Merge branch 'clans-beta' of ssh://184.154.0.242:7999/min/mineplex into clans-beta
Conflicts: Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/boss/snake/SnakeCreature.java
This commit is contained in:
commit
a76610e21e
@ -1,6 +1,7 @@
|
||||
package mineplex.minecraft.game.core.boss.snake;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -152,8 +153,7 @@ public class SnakeCreature extends EventCreature<Silverfish>
|
||||
return;
|
||||
}
|
||||
|
||||
Packet[] packets = new Packet[_segments.size()];
|
||||
|
||||
ArrayList<Packet> packets = new ArrayList<Packet>();
|
||||
|
||||
for (int i = _segments.size() - 1; i >= 0; i--)
|
||||
{
|
||||
@ -196,12 +196,14 @@ public class SnakeCreature extends EventCreature<Silverfish>
|
||||
vec = _segments.get(i - 1).getLocation();
|
||||
}
|
||||
|
||||
packets[i] = seg.moveEntity(vec);
|
||||
packets.addAll(Arrays.asList(seg.moveEntity(vec)));
|
||||
}
|
||||
|
||||
Packet[] packetArray = packets.toArray(new Packet[0]);
|
||||
|
||||
for (Player player : _canSee)
|
||||
{
|
||||
UtilPlayer.sendPacket(player, packets);
|
||||
UtilPlayer.sendPacket(player, packetArray);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@ import mineplex.core.common.util.UtilEnt;
|
||||
import net.minecraft.server.v1_7_R4.DataWatcher;
|
||||
import net.minecraft.server.v1_7_R4.Packet;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook;
|
||||
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
|
||||
@ -19,6 +20,7 @@ public class SnakeSegment
|
||||
private int _entityId = UtilEnt.getNewEntityId();
|
||||
private Vector _entityLocation;
|
||||
private ItemStack _item;
|
||||
private Vector _prevDir = new Vector();
|
||||
|
||||
public SnakeSegment(Vector location, ItemStack item)
|
||||
{
|
||||
@ -31,9 +33,10 @@ public class SnakeSegment
|
||||
return _entityId;
|
||||
}
|
||||
|
||||
public Packet moveEntity(Vector newLocation)
|
||||
public Packet[] moveEntity(Vector newLocation)
|
||||
{
|
||||
Vector toMove = newLocation.clone().subtract(_entityLocation);
|
||||
Packet packet1;
|
||||
|
||||
int x = (int) Math.floor(32 * toMove.getX());
|
||||
int y = (int) Math.floor(32 * toMove.getY());
|
||||
@ -49,10 +52,10 @@ public class SnakeSegment
|
||||
relMove.b = (byte) x;
|
||||
relMove.c = (byte) y;
|
||||
relMove.d = (byte) z;
|
||||
relMove.e = (byte) (int) (UtilAlg.GetYaw(toMove) * 256.0F / 360.0F);
|
||||
relMove.f = (byte) (int) (UtilAlg.GetPitch(toMove) * 256.0F / 360.0F);
|
||||
//relMove.e = (byte) (int) (UtilAlg.GetYaw(toMove) * 256.0F / 360.0F);
|
||||
//relMove.f = (byte) (int) (UtilAlg.GetPitch(toMove) * 256.0F / 360.0F);
|
||||
|
||||
return relMove;
|
||||
packet1 = relMove;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -67,11 +70,45 @@ public class SnakeSegment
|
||||
teleportPacket.b = x;
|
||||
teleportPacket.c = y;
|
||||
teleportPacket.d = z;
|
||||
teleportPacket.e = (byte) (int) (UtilAlg.GetYaw(toMove) * 256.0F / 360.0F);
|
||||
teleportPacket.f = (byte) (int) (UtilAlg.GetPitch(toMove) * 256.0F / 360.0F);
|
||||
//teleportPacket.e = (byte) (int) (UtilAlg.GetYaw(toMove) * 256.0F / 360.0F);
|
||||
//teleportPacket.f = (byte) (int) (UtilAlg.GetPitch(toMove) * 256.0F / 360.0F);
|
||||
|
||||
return teleportPacket;
|
||||
packet1 = teleportPacket;
|
||||
}
|
||||
|
||||
toMove.normalize();
|
||||
|
||||
if (toMove.equals(_prevDir))
|
||||
{
|
||||
return new Packet[]
|
||||
{
|
||||
packet1
|
||||
};
|
||||
}
|
||||
|
||||
_prevDir = toMove;
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(10, (byte) 0);
|
||||
|
||||
watcher.watch(11, toMove);
|
||||
|
||||
for (int i = 12; i < 17; i++)
|
||||
{
|
||||
watcher.a(i, new Vector(0, 0, 0));
|
||||
}
|
||||
|
||||
PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata();
|
||||
|
||||
meta.a = getId();
|
||||
meta.b = watcher.c();
|
||||
|
||||
return new Packet[]
|
||||
{
|
||||
packet1, meta
|
||||
};
|
||||
}
|
||||
|
||||
public Vector getLocation()
|
||||
|
@ -26,12 +26,7 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.minecraft.game.core.boss.BossAbility;
|
||||
import mineplex.minecraft.game.core.boss.EventCreature;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.GolemBoss;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.GolemCreature;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.abilities.GolemBlockHail;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.abilities.GolemCaveIn;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.abilities.GolemEarthquake;
|
||||
import mineplex.minecraft.game.core.boss.ironwizard.abilities.GolemSlam;
|
||||
import mineplex.minecraft.game.core.boss.spider.attacks.SpiderEggplosm;
|
||||
|
||||
public class SpiderCreature extends EventCreature<Spider>
|
||||
|
Loading…
Reference in New Issue
Block a user