Add AbstractEntity.sendEntity
Add AbstractEntity.sendEntityDestroy
Dieser Commit ist enthalten in:
Ursprung
da80a00c2a
Commit
d473245d9b
@ -52,7 +52,7 @@ class SimulatorEntity_15 extends BaseEntity_15 implements AbstractSimulatorEntit
|
||||
return false;
|
||||
}
|
||||
|
||||
sendDestroy(player);
|
||||
sendEntityDestroy(player);
|
||||
die();
|
||||
return true;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren