diff --git a/FightSystem_8/src/de/steamwar/fightsystem/utils/BountifulWrapper8.java b/FightSystem_8/src/de/steamwar/fightsystem/utils/BountifulWrapper8.java index 2a838a6..9ca288c 100644 --- a/FightSystem_8/src/de/steamwar/fightsystem/utils/BountifulWrapper8.java +++ b/FightSystem_8/src/de/steamwar/fightsystem/utils/BountifulWrapper8.java @@ -128,6 +128,11 @@ public class BountifulWrapper8 implements BountifulWrapper.IBountifulWrapper { // field not present } + @Override + public void setNamedSpawnPosition(Object packet, double x, double y, double z) { + //no implementation for 1.8 + } + private final Set seesDragon = new HashSet<>(); private final PacketPlayOutSpawnEntityLiving spawnDragon; private final int spawnDragonId; diff --git a/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java b/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java index e625d1e..cbf3207 100644 --- a/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java +++ b/FightSystem_9/src/de/steamwar/fightsystem/utils/BountifulWrapper9.java @@ -162,6 +162,15 @@ public class BountifulWrapper9 implements BountifulWrapper.IBountifulWrapper { spawnUUID.set(packet, uuid); } + private static final Reflection.FieldAccessor namedSpawnX = Reflection.getField(REntity.namedSpawnPacket, double.class, 0); + private static final Reflection.FieldAccessor namedSpawnY = Reflection.getField(REntity.namedSpawnPacket, double.class, 1); + private static final Reflection.FieldAccessor namedSpawnZ = Reflection.getField(REntity.namedSpawnPacket, double.class, 2); + @Override + public void setNamedSpawnPosition(Object packet, double x, double y, double z) { + namedSpawnX.set(packet, x); + namedSpawnY.set(packet, y); + namedSpawnZ.set(packet, z); + } private final Map barMap = new HashMap<>(); @Override diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/record/REntity.java b/FightSystem_Core/src/de/steamwar/fightsystem/record/REntity.java index 52e1021..fe05d36 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/record/REntity.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/record/REntity.java @@ -337,16 +337,11 @@ public class REntity { public static final Class namedSpawnPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutNamedEntitySpawn"); private static final Reflection.FieldAccessor namedSpawnEntity = Reflection.getField(namedSpawnPacket, int.class, 0); private static final Reflection.FieldAccessor namedSpawnUUID = Reflection.getField(namedSpawnPacket, UUID.class, 0); - private static final Reflection.FieldAccessor namedSpawnX = Reflection.getField(namedSpawnPacket, double.class, 0); - private static final Reflection.FieldAccessor namedSpawnY = Reflection.getField(namedSpawnPacket, double.class, 1); - private static final Reflection.FieldAccessor namedSpawnZ = Reflection.getField(namedSpawnPacket, double.class, 2); private Object getNamedSpawnPacket(){ Object packet = Reflection.newInstance(namedSpawnPacket); namedSpawnEntity.set(packet, entityId); namedSpawnUUID.set(packet, uuid); - namedSpawnX.set(packet, locX); - namedSpawnY.set(packet, locY); - namedSpawnZ.set(packet, locZ); + BountifulWrapper.impl.setNamedSpawnPosition(packet, locX, locY, locZ); FlatteningWrapper.impl.setNamedSpawnPacketDataWatcher(packet); return packet; } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/BountifulWrapper.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/BountifulWrapper.java index ffc6217..5149f87 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/BountifulWrapper.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/BountifulWrapper.java @@ -54,6 +54,7 @@ public class BountifulWrapper { Object getDataWatcherItem(Object dataWatcherObject, Object value); void setTeleportPacketPosition(Object packet, double x, double y, double z); void setSpawnPacketUUID(Object packet, UUID uuid); + void setNamedSpawnPosition(Object packet, double x, double y, double z); void sendBar(Player player, FightTeam team, double progress, String text); }