From 9d89ebec57dab56ccea2db1032e1f770d98e3116 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 21:33:39 +0200 Subject: [PATCH] Fix DetonatorEntity19 Signed-off-by: yoyosource --- .../bausystem/entities/DetonatorEntity19.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java index b7998786..5c4ab9e7 100644 --- a/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java +++ b/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java @@ -27,10 +27,12 @@ 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.Blocks; +import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.phys.Vec3D; +import org.bukkit.Material; import org.bukkit.World; import org.bukkit.craftbukkit.v1_19_R1.CraftWorld; +import org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData; import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -53,11 +55,12 @@ public class DetonatorEntity19 extends EntityFallingBlock implements AbstractDet private static final Vec3D ZERO = new Vec3D(0, 0, 0); private final Vector position; private int references = 0; + private IBlockData iBlockData; public DetonatorEntity19(World world, Vector position) { super(EntityTypes.E, ((CraftWorld) world).getHandle()); try { - ao.set(this, Blocks.dG.m()); + ao.set(this, ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState()); } catch (IllegalAccessException e) { throw new RuntimeException(e); } @@ -69,9 +72,9 @@ public class DetonatorEntity19 extends EntityFallingBlock implements AbstractDet v = position.getZ(); a(this.db()); + this.iBlockData = ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState(); this.position = position; - this.h(true); this.e(true); this.S = -12000; } @@ -86,7 +89,7 @@ public class DetonatorEntity19 extends EntityFallingBlock implements AbstractDet if (references++ > 0) return; - PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), cp(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(Blocks.du.m()), ZERO, 0.0); + PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cp(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.E, Block.i(iBlockData), ZERO, 0.0); PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b; playerConnection.a(packetPlayOutSpawnEntity);