Tracer-entity #147
@ -50,21 +50,10 @@ class TraceEntity_12 extends EntityFallingBlock implements AbstractTraceEntity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AbstractTraceEntity display(Player player) {
|
public AbstractTraceEntity display(Player player) {
|
||||||
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(this, 0);
|
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(this, 0, 0);
|
||||||
// Todo:
|
|
||||||
// Reflection needed?
|
|
||||||
setValue("c", packetPlayOutSpawnEntity, position.getX());
|
|
||||||
setValue("d", packetPlayOutSpawnEntity, position.getY());
|
|
||||||
setValue("e", packetPlayOutSpawnEntity, position.getZ());
|
|
||||||
setValue("f", packetPlayOutSpawnEntity, 0);
|
|
||||||
setValue("g", packetPlayOutSpawnEntity, 0);
|
|
||||||
setValue("h", packetPlayOutSpawnEntity, 0);
|
|
||||||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||||
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
playerConnection.sendPacket(packetPlayOutSpawnEntity);
|
||||||
|
|
||||||
PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
|
|
||||||
playerConnection.sendPacket(packetPlayOutEntityTeleport);
|
|
||||||
|
|
||||||
if (tnt) {
|
if (tnt) {
|
||||||
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
|
||||||
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
playerConnection.sendPacket(packetPlayOutEntityMetadata);
|
||||||
@ -81,14 +70,4 @@ class TraceEntity_12 extends EntityFallingBlock implements AbstractTraceEntity {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setValue(String field, Object object, Object value) {
|
|
||||||
try {
|
|
||||||
Field f = object.getClass().getDeclaredField(field);
|
|
||||||
f.setAccessible(true);
|
|
||||||
f.set(object, value);
|
|
||||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
|
||||||
throw new SecurityException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren