diff --git a/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java index 40e60355..b3165142 100644 --- a/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java +++ b/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java @@ -34,8 +34,13 @@ public class SimulatorEntity18 extends BaseEntity18 implements AbstractSimulator public SimulatorEntity18(World world, Vector position, boolean highlight) { super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT); - this.setNoGravity(true); - this.ticksLived = -12000; + this.e(true); + this.S = -12000; + } + + @Override + public int getId() { + return ae(); } @Override @@ -50,7 +55,7 @@ public class SimulatorEntity18 extends BaseEntity18 implements AbstractSimulator @Override public void setPosition(Vector position) { this.position = position; - setPosition(position.getX(), position.getY(), position.getZ()); + e(position.getX(), position.getY(), position.getZ()); } @Override @@ -60,7 +65,7 @@ public class SimulatorEntity18 extends BaseEntity18 implements AbstractSimulator } sendEntityDestroy(player); - die(); + ag(); return true; } } diff --git a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java index 65e2ee52..b0a91d9e 100644 --- a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java +++ b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.shared; -import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy; import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata; import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; import net.minecraft.server.network.PlayerConnection; +import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.entity.decoration.EntityArmorStand; import net.minecraft.world.phys.Vec3D; import org.bukkit.World; @@ -42,21 +42,21 @@ public class BaseArmorStand18 extends EntityArmorStand implements AbstractEntity super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ()); this.position = position; - setNoGravity(true); - ticksLived = -12000; + e(true); + S = -12000; } public void sendEntity(Player player) { - PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.ARMOR_STAND, 0, ZERO); - PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection; - playerConnection.sendPacket(packetPlayOutSpawnEntity); + PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.c, 0, ZERO); + PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b; + playerConnection.a(packetPlayOutSpawnEntity); - PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true); - playerConnection.sendPacket(packetPlayOutEntityMetadata); + PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Z, true); + playerConnection.a(packetPlayOutEntityMetadata); } public void sendEntityDestroy(Player player) { - PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId()); - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy); + PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae()); + ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy); } } diff --git a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java index ea863593..b331f0da 100644 --- a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java +++ b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java @@ -19,12 +19,13 @@ package de.steamwar.bausystem.shared; -import com.sk89q.worldedit.world.entity.EntityTypes; import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy; import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata; import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity; import net.minecraft.server.network.PlayerConnection; +import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.entity.item.EntityFallingBlock; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.phys.Vec3D; import org.bukkit.Material; @@ -47,21 +48,21 @@ public class BaseEntity18 extends EntityFallingBlock implements AbstractEntity { this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState(); this.position = position; - this.setNoGravity(true); - this.ticksLived = -12000; + this.e(true); + this.S = -12000; } public void sendEntity(Player player) { - PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.FALLING_BLOCK, Block.getCombinedId(iBlockData), ZERO); - PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection; - playerConnection.sendPacket(packetPlayOutSpawnEntity); + PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(iBlockData), ZERO); + PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b; + playerConnection.a(packetPlayOutSpawnEntity); - PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true); - playerConnection.sendPacket(packetPlayOutEntityMetadata); + PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Z, true); + playerConnection.a(packetPlayOutEntityMetadata); } public void sendEntityDestroy(Player player) { - PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId()); - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy); + PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae()); + ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy); } }