Update some stuff
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-02-10 17:35:12 +01:00
Ursprung 4bb25a4ca7
Commit 9b4fe3c9d6
3 geänderte Dateien mit 33 neuen und 27 gelöschten Zeilen

Datei anzeigen

@ -19,7 +19,6 @@
package de.steamwar.bausystem.entities;
import com.sk89q.worldedit.blocks.Blocks;
import com.sk89q.worldedit.world.entity.EntityTypes;
import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
@ -27,6 +26,8 @@ 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.item.EntityFallingBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.phys.Vec3D;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
@ -41,12 +42,17 @@ public class DetonatorEntity18 extends EntityFallingBlock implements AbstractDet
private int references = 0;
public DetonatorEntity18(World world, Vector position) {
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.RED_STAINED_GLASS.getBlockData());
super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.du.n());
this.position = position;
this.h(true);
this.setNoGravity(true);
this.ticksLived = -12000;
this.e(true);
this.S = -12000;
}
@Override
public int getId() {
return ae();
}
@Override
@ -54,12 +60,12 @@ public class DetonatorEntity18 extends EntityFallingBlock implements AbstractDet
if (references++ > 0)
return;
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.FALLING_BLOCK, Block.getCombinedId(Blocks.RED_STAINED_GLASS.getBlockData()), ZERO);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
playerConnection.sendPacket(packetPlayOutSpawnEntity);
PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.FALLING_BLOCK, Block.i(Blocks.du.n()), ZERO);
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
playerConnection.a(packetPlayOutSpawnEntity);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
playerConnection.sendPacket(packetPlayOutEntityMetadata);
PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), Z, true);
playerConnection.a(packetPlayOutEntityMetadata);
}
@Override
@ -68,13 +74,13 @@ public class DetonatorEntity18 extends EntityFallingBlock implements AbstractDet
return false;
sendDestroy(player);
die();
ag();
return true;
}
private void sendDestroy(Player player) {
PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
}
@Override

Datei anzeigen

@ -22,7 +22,7 @@ package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.shared.BaseEntity18;
import de.steamwar.bausystem.shared.ReferenceCounter;
import net.minecraft.server.v1_15_R1.ChatComponentText;
import net.minecraft.network.chat.ChatComponentText;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -36,19 +36,19 @@ public class TraceEntity18 extends BaseEntity18 implements AbstractTraceEntity {
public TraceEntity18(World world, Vector position, boolean tnt) {
super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
this.setNoGravity(true);
this.ticksLived = -12000;
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player, boolean exploded, int ticks) {
if (ticks != -1) {
this.setCustomNameVisible(true);
this.setCustomName(new ChatComponentText(ticks + ""));
this.n(true);
this.a(new ChatComponentText(ticks + ""));
}
if (!this.exploded && exploded) {
this.setCustomNameVisible(true);
this.setCustomName(new ChatComponentText("Bumm"));
this.n(true);
this.a(new ChatComponentText("Bumm"));
this.exploded = true;
if (referenceCounter.increment() > 0) {
sendEntityDestroy(player);
@ -67,7 +67,7 @@ public class TraceEntity18 extends BaseEntity18 implements AbstractTraceEntity {
}
sendEntityDestroy(player);
die();
ag();
return true;
}
}

Datei anzeigen

@ -21,7 +21,7 @@ package de.steamwar.bausystem.entities;
import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import de.steamwar.bausystem.shared.BaseArmorStand18;
import net.minecraft.server.v1_15_R1.ChatComponentText;
import net.minecraft.network.chat.ChatComponentText;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
@ -32,17 +32,17 @@ public class WarpEntity18 extends BaseArmorStand18 implements AbstractWarpEntity
public WarpEntity18(World world, Vector position, String name) {
super(world, position);
setInvisible(true);
setSmall(true);
j(true);
a(true);
this.name = name;
this.setNoGravity(true);
this.ticksLived = -12000;
this.e(true);
this.S = -12000;
}
@Override
public void display(Player player) {
this.setCustomNameVisible(true);
this.setCustomName(new ChatComponentText(name));
this.n(true);
this.a(new ChatComponentText(name));
sendEntity(player);
}
@ -54,7 +54,7 @@ public class WarpEntity18 extends BaseArmorStand18 implements AbstractWarpEntity
@Override
public boolean hide(Player player) {
sendEntityDestroy(player);
die();
ag();
return true;
}
}