SteamWar/BauSystem2.0
Archiviert
12
0

Add AbstractEntity.sendEntity

Add AbstractEntity.sendEntityDestroy
Dieser Commit ist enthalten in:
yoyosource 2021-04-18 12:47:32 +02:00
Ursprung da80a00c2a
Commit d473245d9b
4 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -52,7 +52,7 @@ class SimulatorEntity_15 extends BaseEntity_15 implements AbstractSimulatorEntit
return false;
}
sendDestroy(player);
sendEntityDestroy(player);
die();
return true;
}

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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);
}

Datei anzeigen

@ -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);
}