diff --git a/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorEntity_15.java b/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorEntity_15.java index 87810907..903f3871 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorEntity_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorEntity_15.java @@ -52,7 +52,7 @@ class SimulatorEntity_15 extends BaseEntity_15 implements AbstractSimulatorEntit return false; } - sendDestroy(player); + sendEntityDestroy(player); die(); return true; } diff --git a/BauSystem_15/src/de/steamwar/bausystem/features/tracer/TraceEntity_15.java b/BauSystem_15/src/de/steamwar/bausystem/features/tracer/TraceEntity_15.java index e427ec59..e4447ee5 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/features/tracer/TraceEntity_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/features/tracer/TraceEntity_15.java @@ -46,7 +46,7 @@ class TraceEntity_15 extends BaseEntity_15 implements AbstractTraceEntity { this.setCustomName(new ChatComponentText("Bumm")); this.exploded = true; if (referenceCounter.increment() > 0) { - sendDestroy(player); + sendEntityDestroy(player); } } else if (referenceCounter.increment() > 0) { return; @@ -61,7 +61,7 @@ class TraceEntity_15 extends BaseEntity_15 implements AbstractTraceEntity { return false; } - sendDestroy(player); + sendEntityDestroy(player); die(); return true; } diff --git a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java b/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java index e1e0f02b..84befad9 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity_15.java @@ -28,7 +28,7 @@ import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.util.Vector; -public class BaseEntity_15 extends EntityFallingBlock { +public class BaseEntity_15 extends EntityFallingBlock implements AbstractEntity { private static final Vec3D ZERO = new Vec3D(0, 0, 0); @@ -44,7 +44,7 @@ public class BaseEntity_15 extends EntityFallingBlock { this.ticksLived = -12000; } - protected void sendEntity(Player player) { + 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); @@ -53,7 +53,7 @@ public class BaseEntity_15 extends EntityFallingBlock { playerConnection.sendPacket(packetPlayOutEntityMetadata); } - protected void sendDestroy(Player player) { + public void sendEntityDestroy(Player player) { PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId()); ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy); } diff --git a/BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java b/BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java index 6627cae9..a187531b 100644 --- a/BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java +++ b/BauSystem_API/src/de/steamwar/bausystem/shared/AbstractEntity.java @@ -19,5 +19,9 @@ package de.steamwar.bausystem.shared; +import org.bukkit.entity.Player; + public interface AbstractEntity { + void sendEntity(Player player); + void sendEntityDestroy(Player player); }