SteamWar/BauSystem2.0
Archiviert
12
0

1.18 #77

Zusammengeführt
YoyoNow hat 18 Commits von 1.18 nach master 2022-03-30 11:21:07 +02:00 zusammengeführt
3 geänderte Dateien mit 33 neuen und 27 gelöschten Zeilen
Nur Änderungen aus Commit 9b4fe3c9d6 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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