diff --git a/BauSystem_15/src/de/steamwar/bausystem/entities/DetonatorEntity15.java b/BauSystem_15/src/de/steamwar/bausystem/entities/DetonatorEntity15.java
deleted file mode 100644
index efbd29d8..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/entities/DetonatorEntity15.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
-import net.minecraft.server.v1_15_R1.*;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class DetonatorEntity15 extends EntityFallingBlock implements AbstractDetonatorEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
- private final Vector position;
- private int references = 0;
-
- public DetonatorEntity15(World world, Vector position) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.RED_STAINED_GLASS.getBlockData());
- this.position = position;
-
- this.h(true);
- this.setNoGravity(true);
- this.ticksLived = -12000;
- }
-
- @Override
- public void display(Player player) {
- 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);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
- playerConnection.sendPacket(packetPlayOutEntityMetadata);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && --references > 0)
- return false;
-
- sendDestroy(player);
- die();
- return true;
- }
-
- private void sendDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
- }
-
- @Override
- public void sendEntity(Player player) {
- display(player);
- }
-
- @Override
- public void sendEntityDestroy(Player player) {
- hide(player, false);
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/entities/SimulatorEntity15.java b/BauSystem_15/src/de/steamwar/bausystem/entities/SimulatorEntity15.java
deleted file mode 100644
index 5f828a33..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/entities/SimulatorEntity15.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.shared.BaseEntity15;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class SimulatorEntity15 extends BaseEntity15 implements AbstractSimulatorEntity {
-
- private boolean printed = false;
-
- public SimulatorEntity15(World world, Vector position, boolean highlight) {
- super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
-
- this.setNoGravity(true);
- this.ticksLived = -12000;
- }
-
- @Override
- public void display(Player player) {
- if (printed) return;
- printed = true;
-
- sendEntity(player);
- }
-
- @Override
- public void setPosition(Vector position) {
- this.position = position;
- setPosition(position.getX(), position.getY(), position.getZ());
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!printed) return false;
- printed = false;
-
-
- sendEntityDestroy(player);
- die();
- return true;
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/entities/TraceEntity15.java b/BauSystem_15/src/de/steamwar/bausystem/entities/TraceEntity15.java
deleted file mode 100644
index 99873513..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/entities/TraceEntity15.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
-import de.steamwar.bausystem.shared.BaseEntity15;
-import de.steamwar.bausystem.shared.ReferenceCounter;
-import net.minecraft.server.v1_15_R1.ChatComponentText;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class TraceEntity15 extends BaseEntity15 implements AbstractTraceEntity {
-
- private boolean exploded = false;
- private ReferenceCounter referenceCounter = new ReferenceCounter();
-
- public TraceEntity15(World world, Vector position, boolean tnt) {
- super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
-
- this.setNoGravity(true);
- this.ticksLived = -12000;
- }
-
- @Override
- public void display(Player player, boolean exploded, int ticks) {
- if (ticks != -1) {
- this.setCustomNameVisible(true);
- this.setCustomName(new ChatComponentText(ticks + ""));
- }
- if (!this.exploded && exploded) {
- this.setCustomNameVisible(true);
- this.setCustomName(new ChatComponentText("Bumm"));
- this.exploded = true;
- if (referenceCounter.increment() > 0) {
- sendEntityDestroy(player);
- }
- } else if (referenceCounter.increment() > 0) {
- return;
- }
-
- sendEntity(player);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && referenceCounter.decrement() > 0) {
- return false;
- }
-
- sendEntityDestroy(player);
- die();
- return true;
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/entities/WarpEntity15.java b/BauSystem_15/src/de/steamwar/bausystem/entities/WarpEntity15.java
deleted file mode 100644
index 03929086..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/entities/WarpEntity15.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
-import de.steamwar.bausystem.shared.BaseArmorStand15;
-import net.minecraft.server.v1_15_R1.ChatComponentText;
-import net.minecraft.server.v1_15_R1.PacketPlayOutEntityMetadata;
-import net.minecraft.server.v1_15_R1.PacketPlayOutEntityTeleport;
-import net.minecraft.server.v1_15_R1.PlayerConnection;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class WarpEntity15 extends BaseArmorStand15 implements AbstractWarpEntity {
-
- public WarpEntity15(World world, Vector position, String name) {
- super(world, position);
- setInvisible(true);
- setSmall(true);
- setName(name);
- this.setNoGravity(true);
- this.ticksLived = -12000;
- }
-
- @Override
- public void display(Player player) {
- sendEntity(player);
- }
-
- @Override
- public void setName(String name) {
- this.setCustomNameVisible(true);
- this.setCustomName(new ChatComponentText(name));
- }
-
- @Override
- public boolean hide(Player player) {
- sendEntityDestroy(player);
- die();
- return true;
- }
-
- @Override
- public void sendMetaData(Player player) {
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
- playerConnection.sendPacket(packetPlayOutEntityMetadata);
- }
-
- @Override
- public void teleport(Player player, Vector position) {
- setPositionRaw(position.getX(), position.getY(), position.getZ());
- PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityTeleport);
- }
-
- @Override
- public Vector getPosition() {
- return new Vector(locX(), locY(), locZ());
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorPreview15.java b/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorPreview15.java
deleted file mode 100644
index f3e38be3..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/features/simulator/SimulatorPreview15.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.simulator;
-
-import de.steamwar.bausystem.features.tracer.show.Record;
-
-public class SimulatorPreview15 implements SimulatorPreview {
-
- @Override
- public Record simulate(TNTSimulator tntSimulator) {
- return new Record(null);
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseArmorStand15.java b/BauSystem_15/src/de/steamwar/bausystem/shared/BaseArmorStand15.java
deleted file mode 100644
index 2e604c77..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseArmorStand15.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.server.v1_15_R1.*;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class BaseArmorStand15 extends EntityArmorStand implements AbstractEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- protected Vector position;
-
- public BaseArmorStand15(World world, Vector position) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
-
- this.position = position;
- setNoGravity(true);
- ticksLived = -12000;
- }
-
- public void sendEntity(Player player) {
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), getUniqueID(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.ARMOR_STAND, 0, ZERO);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
- playerConnection.sendPacket(packetPlayOutSpawnEntity);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
- playerConnection.sendPacket(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity15.java b/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity15.java
deleted file mode 100644
index 66480122..00000000
--- a/BauSystem_15/src/de/steamwar/bausystem/shared/BaseEntity15.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.server.v1_15_R1.*;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_15_R1.block.data.CraftBlockData;
-import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class BaseEntity15 extends EntityFallingBlock implements AbstractEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- private final IBlockData iBlockData;
- protected Vector position;
-
- public BaseEntity15(World world, Vector position, Material blockType) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), ((CraftBlockData) blockType.createBlockData()).getState());
- this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState();
- this.position = position;
-
- this.setNoGravity(true);
- this.ticksLived = -12000;
- }
-
- 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);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), datawatcher, true);
- playerConnection.sendPacket(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java b/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java
index 15756166..b6cd9609 100644
--- a/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java
+++ b/BauSystem_15/src/de/steamwar/bausystem/utils/NMSWrapper15.java
@@ -20,20 +20,11 @@
package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection;
-import de.steamwar.bausystem.entities.DetonatorEntity15;
-import de.steamwar.bausystem.entities.SimulatorEntity15;
-import de.steamwar.bausystem.entities.TraceEntity15;
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
import de.steamwar.bausystem.features.util.NoClipCommand;
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
-import de.steamwar.bausystem.entities.WarpEntity15;
import net.minecraft.server.v1_15_R1.*;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Material;
-import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer;
@@ -41,7 +32,6 @@ import org.bukkit.craftbukkit.v1_15_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack;
-import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.List;
@@ -162,26 +152,6 @@ public class NMSWrapper15 implements NMSWrapper {
return invalid;
}
- @Override
- public AbstractWarpEntity createWarp(World world, Vector position, String name) {
- return new WarpEntity15(world, position, name);
- }
-
- @Override
- public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
- return new SimulatorEntity15(world, tntPosition, highlight);
- }
-
- @Override
- public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
- return new DetonatorEntity15(world, position);
- }
-
- @Override
- public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
- return new TraceEntity15(world, tntPosition, tnt);
- }
-
private final Class> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
private final Reflection.FieldAccessor a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor b = Reflection.getField(explosionPacket, double.class, 1);
diff --git a/BauSystem_18/src/de/steamwar/bausystem/entities/DetonatorEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/entities/DetonatorEntity18.java
deleted file mode 100644
index 8b28359e..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/entities/DetonatorEntity18.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.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.phys.Vec3D;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
-import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class DetonatorEntity18 extends EntityFallingBlock implements AbstractDetonatorEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
- private final Vector position;
- private int references = 0;
-
- public DetonatorEntity18(World world, Vector position) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), Blocks.du.n());
- this.position = position;
-
- this.h(true);
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public int getId() {
- return ae();
- }
-
- @Override
- public void display(Player player) {
- if (references++ > 0)
- return;
-
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(getId(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(Blocks.du.n()), ZERO);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutSpawnEntity);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && --references > 0)
- return false;
-
- sendDestroy(player);
- ag();
- return true;
- }
-
- private void sendDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-
- @Override
- public void sendEntity(Player player) {
- display(player);
- }
-
- @Override
- public void sendEntityDestroy(Player player) {
- hide(player, false);
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java
deleted file mode 100644
index 58537b7b..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/entities/SimulatorEntity18.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.shared.BaseEntity18;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class SimulatorEntity18 extends BaseEntity18 implements AbstractSimulatorEntity {
-
- private boolean printed = false;
-
- public SimulatorEntity18(World world, Vector position, boolean highlight) {
- super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
-
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public int getId() {
- return ae();
- }
-
- @Override
- public void display(Player player) {
- if (printed) return;
- printed = true;
-
- sendEntity(player);
- }
-
- @Override
- public void setPosition(Vector position) {
- this.position = position;
- e(position.getX(), position.getY(), position.getZ());
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!printed) return false;
- printed = false;
-
- sendEntityDestroy(player);
- ag();
- return true;
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/entities/TraceEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/entities/TraceEntity18.java
deleted file mode 100644
index 437c2620..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/entities/TraceEntity18.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-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.network.chat.ChatComponentText;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class TraceEntity18 extends BaseEntity18 implements AbstractTraceEntity {
-
- private boolean exploded = false;
- private ReferenceCounter referenceCounter = new ReferenceCounter();
-
- public TraceEntity18(World world, Vector position, boolean tnt) {
- super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
-
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public void display(Player player, boolean exploded, int ticks) {
- if (ticks != -1) {
- this.n(true);
- this.a(new ChatComponentText(ticks + ""));
- }
- if (!this.exploded && exploded) {
- this.n(true);
- this.a(new ChatComponentText("Bumm"));
- this.exploded = true;
- if (referenceCounter.increment() > 0) {
- sendEntityDestroy(player);
- }
- } else if (referenceCounter.increment() > 0) {
- return;
- }
-
- sendEntity(player);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && referenceCounter.decrement() > 0) {
- return false;
- }
-
- sendEntityDestroy(player);
- ag();
- return true;
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/entities/WarpEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/entities/WarpEntity18.java
deleted file mode 100644
index 35f8287a..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/entities/WarpEntity18.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
-import de.steamwar.bausystem.shared.BaseArmorStand18;
-import net.minecraft.network.chat.ChatComponentText;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
-import net.minecraft.server.network.PlayerConnection;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class WarpEntity18 extends BaseArmorStand18 implements AbstractWarpEntity {
-
- public WarpEntity18(World world, Vector position, String name) {
- super(world, position);
- this.j(true);
- this.a(true);
- setName(name);
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public void display(Player player) {
- sendEntity(player);
- }
-
- @Override
- public void setName(String name) {
- this.n(true);
- this.a(new ChatComponentText(name));
- }
-
- @Override
- public boolean hide(Player player) {
- sendEntityDestroy(player);
- ag();
- return true;
- }
-
- @Override
- public void sendMetaData(Player player) {
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- @Override
- public void teleport(Player player, Vector position) {
- setPosRaw(position.getX(), position.getY(), position.getZ(), false);
- PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityTeleport);
- }
-
- @Override
- public Vector getPosition() {
- return new Vector(dc(), de(), di());
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java
deleted file mode 100644
index cc0d278c..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseArmorStand18.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.EntityTypes;
-import net.minecraft.world.entity.decoration.EntityArmorStand;
-import net.minecraft.world.phys.Vec3D;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
-import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class BaseArmorStand18 extends EntityArmorStand implements AbstractEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- protected Vector position;
-
- public BaseArmorStand18(World world, Vector position) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
-
- this.position = position;
- e(true);
- S = -12000;
- }
-
- public void sendEntity(Player player) {
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.c, 0, ZERO);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutSpawnEntity);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java b/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java
deleted file mode 100644
index ef776851..00000000
--- a/BauSystem_18/src/de/steamwar/bausystem/shared/BaseEntity18.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.EntityTypes;
-import net.minecraft.world.entity.item.EntityFallingBlock;
-import net.minecraft.world.level.block.Block;
-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_18_R2.CraftWorld;
-import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData;
-import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class BaseEntity18 extends EntityFallingBlock implements AbstractEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- private final IBlockData iBlockData;
- protected Vector position;
-
- public BaseEntity18(World world, Vector position, Material blockType) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ(), ((CraftBlockData) blockType.createBlockData()).getState());
- this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState();
- this.position = position;
-
- this.e(true);
- this.S = -12000;
- }
-
- public void sendEntity(Player player) {
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), cm(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.C, Block.i(iBlockData), ZERO);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutSpawnEntity);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java b/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java
index 4d14fc01..3e9ed190 100644
--- a/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java
+++ b/BauSystem_18/src/de/steamwar/bausystem/utils/NMSWrapper18.java
@@ -21,15 +21,7 @@ package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol;
-import de.steamwar.bausystem.entities.DetonatorEntity18;
-import de.steamwar.bausystem.entities.SimulatorEntity18;
-import de.steamwar.bausystem.entities.TraceEntity18;
-import de.steamwar.bausystem.entities.WarpEntity18;
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.features.util.NoClipCommand;
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import net.minecraft.SystemUtils;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
@@ -39,14 +31,16 @@ import net.minecraft.network.protocol.game.*;
import net.minecraft.server.level.PlayerInteractManager;
import net.minecraft.world.level.EnumGamemode;
import net.minecraft.world.phys.Vec3D;
-import org.bukkit.*;
+import org.bukkit.Bukkit;
+import org.bukkit.GameMode;
+import org.bukkit.Material;
+import org.bukkit.World;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack;
-import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.List;
@@ -167,26 +161,6 @@ public class NMSWrapper18 implements NMSWrapper {
return invalid;
}
- @Override
- public AbstractWarpEntity createWarp(World world, Vector position, String name) {
- return new WarpEntity18(world, position, name);
- }
-
- @Override
- public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
- return new SimulatorEntity18(world, tntPosition, highlight);
- }
-
- @Override
- public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
- return new DetonatorEntity18(world, position);
- }
-
- @Override
- public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
- return new TraceEntity18(world, tntPosition, tnt);
- }
-
private final Class> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
private final Reflection.FieldAccessor a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor b = Reflection.getField(explosionPacket, double.class, 1);
diff --git a/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java
deleted file mode 100644
index 15b622ac..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/entities/DetonatorEntity19.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.EntityTypes;
-import net.minecraft.world.entity.item.EntityFallingBlock;
-import net.minecraft.world.level.block.Block;
-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;
-
-import java.lang.reflect.Field;
-
-public class DetonatorEntity19 extends EntityFallingBlock implements AbstractDetonatorEntity {
-
- private static final Field ao;
-
- static {
- try {
- ao = EntityFallingBlock.class.getDeclaredField("ao");
- ao.setAccessible(true);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException(e);
- }
- }
-
- 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, ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState());
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- this.q = true;
- e(position.getX(), position.getY(), position.getZ());
- f(Vec3D.b);
- t = position.getX();
- u = position.getY();
- v = position.getZ();
- a(this.db());
-
- this.iBlockData = ((CraftBlockData) Material.RED_STAINED_GLASS.createBlockData()).getState();
- this.position = position;
-
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public int getId() {
- return ae();
- }
-
- @Override
- public void display(Player player) {
- if (references++ > 0)
- return;
-
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), 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);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(getId(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && --references > 0)
- return false;
-
- sendDestroy(player);
- ag();
- return true;
- }
-
- private void sendDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(getId());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-
- @Override
- public void sendEntity(Player player) {
- display(player);
- }
-
- @Override
- public void sendEntityDestroy(Player player) {
- hide(player, false);
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/entities/SimulatorEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/entities/SimulatorEntity19.java
deleted file mode 100644
index 51d3e6eb..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/entities/SimulatorEntity19.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.shared.BaseEntity19;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class SimulatorEntity19 extends BaseEntity19 implements AbstractSimulatorEntity {
-
- private boolean printed = false;
-
- public SimulatorEntity19(World world, Vector position, boolean highlight) {
- super(world, position, highlight ? Material.WHITE_STAINED_GLASS : Material.TNT);
-
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public int getId() {
- return ae();
- }
-
- @Override
- public void display(Player player) {
- if (printed) return;
- printed = true;
-
- sendEntity(player);
- }
-
- @Override
- public void setPosition(Vector position) {
- this.position = position;
- e(position.getX(), position.getY(), position.getZ());
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!printed) return false;
- printed = false;
-
- sendEntityDestroy(player);
- ag();
- return true;
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/entities/TraceEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/entities/TraceEntity19.java
deleted file mode 100644
index e70dba55..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/entities/TraceEntity19.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- This file is a part of the SteamWar software.
-
- Copyright (C) 2020 SteamWar.de-Serverteam
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-*/
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
-import de.steamwar.bausystem.shared.BaseEntity19;
-import de.steamwar.bausystem.shared.ReferenceCounter;
-import net.minecraft.network.chat.IChatMutableComponent;
-import net.minecraft.network.chat.contents.LiteralContents;
-import org.bukkit.Material;
-import org.bukkit.World;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class TraceEntity19 extends BaseEntity19 implements AbstractTraceEntity {
-
- private boolean exploded = false;
- private ReferenceCounter referenceCounter = new ReferenceCounter();
-
- public TraceEntity19(World world, Vector position, boolean tnt) {
- super(world, position, tnt ? Material.TNT : Material.WHITE_STAINED_GLASS);
-
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public void display(Player player, boolean exploded, int ticks) {
- if (ticks != -1) {
- this.n(true);
- this.b(IChatMutableComponent.a(new LiteralContents(ticks + "")));
- }
- if (!this.exploded && exploded) {
- this.n(true);
- this.b(IChatMutableComponent.a(new LiteralContents("Bumm")));
- this.exploded = true;
- if (referenceCounter.increment() > 0) {
- sendEntityDestroy(player);
- }
- } else if (referenceCounter.increment() > 0) {
- return;
- }
-
- sendEntity(player);
- }
-
- @Override
- public boolean hide(Player player, boolean force) {
- if (!force && referenceCounter.decrement() > 0) {
- return false;
- }
-
- sendEntityDestroy(player);
- ag();
- return true;
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/entities/WarpEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/entities/WarpEntity19.java
deleted file mode 100644
index a86a653e..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/entities/WarpEntity19.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.entities;
-
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
-import de.steamwar.bausystem.shared.BaseArmorStand19;
-import net.minecraft.network.chat.IChatMutableComponent;
-import net.minecraft.network.chat.contents.LiteralContents;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityMetadata;
-import net.minecraft.network.protocol.game.PacketPlayOutEntityTeleport;
-import net.minecraft.server.network.PlayerConnection;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class WarpEntity19 extends BaseArmorStand19 implements AbstractWarpEntity {
-
- public WarpEntity19(World world, Vector position, String name) {
- super(world, position);
- this.j(true);
- this.a(true);
- setName(name);
- this.e(true);
- this.S = -12000;
- }
-
- @Override
- public void display(Player player) {
- sendEntity(player);
- }
-
- @Override
- public void setName(String name) {
- this.n(true);
- this.b(IChatMutableComponent.a(new LiteralContents(name)));
- }
-
- @Override
- public boolean hide(Player player) {
- sendEntityDestroy(player);
- ag();
- return true;
- }
-
- @Override
- public void sendMetaData(Player player) {
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- @Override
- public void teleport(Player player, Vector position) {
- setPosRaw(position.getX(), position.getY(), position.getZ(), false);
- PacketPlayOutEntityTeleport packetPlayOutEntityTeleport = new PacketPlayOutEntityTeleport(this);
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityTeleport);
- }
-
- @Override
- public Vector getPosition() {
- return new Vector(df(), dh(), dj());
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeExplosion19.java b/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeExplosion19.java
deleted file mode 100644
index eaa19495..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeExplosion19.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.simulator;
-
-import com.google.common.collect.Maps;
-import it.unimi.dsi.fastutil.objects.ObjectArrayList;
-import net.minecraft.core.BlockPosition;
-import net.minecraft.util.RandomSource;
-import net.minecraft.world.damagesource.DamageSource;
-import net.minecraft.world.entity.Entity;
-import net.minecraft.world.entity.player.EntityHuman;
-import net.minecraft.world.level.Explosion;
-import net.minecraft.world.level.ExplosionDamageCalculator;
-import net.minecraft.world.level.World;
-import net.minecraft.world.level.gameevent.GameEvent;
-import net.minecraft.world.phys.Vec3D;
-import org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory;
-
-import javax.annotation.Nullable;
-import java.util.List;
-import java.util.Map;
-
-public class FakeExplosion19 extends Explosion {
-
- private List fakeTNT19s;
- private boolean c;
- private Explosion.Effect d;
- private RandomSource e;
- private World f;
- private double g;
- private double h;
- private double i;
- @Nullable
- public Entity j;
- private float k;
- private DamageSource l;
- private ExplosionDamageCalculator m;
- private ObjectArrayList n;
- private Map o;
- public boolean wasCanceled;
-
- public FakeExplosion19(List fakeTNT19s, World world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
- super(world, entity, damageSource, behavior, x, y, z, power, createFire, destructionType);
- this.fakeTNT19s = fakeTNT19s;
- this.wasCanceled = false;
- this.e = RandomSource.a();
- this.n = new ObjectArrayList();
- this.o = Maps.newHashMap();
- this.f = world;
- this.j = entity;
- this.k = (float) Math.max((double) power, 0.0D);
- this.g = x;
- this.h = y;
- this.i = z;
- this.c = createFire;
- this.d = destructionType;
- this.l = damageSource == null ? DamageSource.a(this) : damageSource;
- this.m = new ExplosionDamageCalculator();
-
- }
-
- private float getBlockDensity(Vec3D vec3d, Entity entity) {
- return a(vec3d, entity);
- }
-
-
- @Override
- public void a() {
- if ((this.k) >= 0.1F) {
- this.f.a(this.j, GameEvent.w, new Vec3D(this.g, this.h, this.i));
- /*
- Set set = Sets.newHashSet();
-
- int i;
- int j;
- for (int k = 0; k < 16; ++k) {
- for (i = 0; i < 16; ++i) {
- for (j = 0; j < 16; ++j) {
- if (k == 0 || k == 15 || i == 0 || i == 15 || j == 0 || j == 15) {
- double d0 = (double) ((float) k / 15.0F * 2.0F - 1.0F);
- double d1 = (double) ((float) i / 15.0F * 2.0F - 1.0F);
- double d2 = (double) ((float) j / 15.0F * 2.0F - 1.0F);
- double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
- d0 /= d3;
- d1 /= d3;
- d2 /= d3;
- float f = this.k * (0.7F + this.f.w.i() * 0.6F);
- double d4 = this.g;
- double d5 = this.h;
- double d6 = this.i;
-
- for (float var21 = 0.3F; f > 0.0F; f -= 0.22500001F) {
- BlockPosition blockposition = new BlockPosition(d4, d5, d6);
- IBlockData iblockdata = this.f.a_(blockposition);
- Fluid fluid = iblockdata.p();
- if (!this.f.j(blockposition)) {
- break;
- }
-
- Optional optional = this.m.a(this, this.f, blockposition, iblockdata, fluid);
- if (optional.isPresent()) {
- f -= ((Float) optional.get() + 0.3F) * 0.3F;
- }
-
- if (f > 0.0F && this.m.a(this, this.f, blockposition, iblockdata, f)) {
- set.add(blockposition);
- }
-
- d4 += d0 * 0.30000001192092896D;
- d5 += d1 * 0.30000001192092896D;
- d6 += d2 * 0.30000001192092896D;
- }
- }
- }
- }
- }
-
- this.n.addAll(set);
- */
-
- float f2 = this.k * 2.0F;
- Vec3D vec3d = new Vec3D(this.g, this.h, this.i);
- for (int l1 = 0; l1 < fakeTNT19s.size(); ++l1) {
- Entity entity = (Entity) fakeTNT19s.get(l1);
- if (!entity.cF()) {
- double d7 = Math.sqrt(entity.e(vec3d)) / (double) f2;
- if (d7 <= 1.0D) {
- double d8 = entity.df() - this.g;
- double d9 = entity.dh() - this.h;
- double d10 = entity.dl() - this.i;
- double d11 = Math.sqrt(d8 * d8 + d9 * d9 + d10 * d10);
- if (d11 != 0.0D) {
- d8 /= d11;
- d9 /= d11;
- d10 /= d11;
- double d12 = (double) this.getBlockDensity(vec3d, entity);
-
- double d13 = (1.0D - d7) * d12;
- entity.lastDamageCancelled = false;
- CraftEventFactory.entityDamage = null;
- entity.f(entity.dd().b(d8 * d13, d9 * d13, d10 * d13));
- }
- }
- }
- }
- }
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeTNT19.java b/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeTNT19.java
deleted file mode 100644
index abf89c09..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/FakeTNT19.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.simulator;
-
-import net.minecraft.core.BlockPosition;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.protocol.Packet;
-import net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity;
-import net.minecraft.network.syncher.DataWatcher;
-import net.minecraft.network.syncher.DataWatcherObject;
-import net.minecraft.network.syncher.DataWatcherRegistry;
-import net.minecraft.util.MathHelper;
-import net.minecraft.world.damagesource.DamageSource;
-import net.minecraft.world.entity.*;
-import net.minecraft.world.entity.item.EntityTNTPrimed;
-import net.minecraft.world.level.Explosion;
-import net.minecraft.world.level.ExplosionDamageCalculator;
-import net.minecraft.world.level.World;
-import net.minecraft.world.level.block.state.IBlockData;
-import net.minecraft.world.phys.AxisAlignedBB;
-import net.minecraft.world.phys.Vec3D;
-import net.minecraft.world.phys.shapes.VoxelShape;
-import org.bukkit.entity.Explosive;
-import org.bukkit.event.entity.ExplosionPrimeEvent;
-
-import javax.annotation.Nullable;
-import java.util.ArrayList;
-import java.util.List;
-
-public class FakeTNT19 extends EntityTNTPrimed {
- private static final DataWatcherObject b;
- private static final int c = 80;
- private List fakeTNT19s;
- private List spawnList = new ArrayList<>();
- private int count;
- @Nullable
- public EntityLiving d;
- public float yield;
- public boolean isIncendiary;
-
- public FakeTNT19(List fakeTNT19s, EntityTypes extends EntityTNTPrimed> type, World world) {
- super(type, world);
- this.fakeTNT19s = fakeTNT19s;
- this.yield = 4.0F;
- this.isIncendiary = false;
- super.q = true;
- }
-
- public FakeTNT19(List fakeTNT19s, World world, double x, double y, double z, int fuse, int count) {
- this(fakeTNT19s, EntityTypes.av, world);
- this.e(x, y, z);
- double d3 = world.w.j() * 6.2831854820251465D;
- this.n(-Math.sin(d3) * 0.02D, 0.20000000298023224D, -Math.cos(d3) * 0.02D);
- this.a(fuse);
- super.t = x;
- super.u = y;
- super.v = z;
- this.d = null;
- this.count = count;
- }
-
- protected void a_() {
- super.Y.a(b, 80);
- }
-
- protected MovementEmission aO() {
- return MovementEmission.a;
- }
-
- public boolean bl() {
- return !this.dt();
- }
-
- private Vec3D g(Vec3D vec3d) {
- AxisAlignedBB axisalignedbb = this.cz();
- List list = this.s.b(this, axisalignedbb.b(vec3d));
- Vec3D vec3d1 = vec3d.g() == 0.0 ? vec3d : a(this, vec3d, axisalignedbb, this.s, list);
- boolean flag = vec3d.c != vec3d1.c;
- boolean flag1 = vec3d.d != vec3d1.d;
- boolean flag2 = vec3d.e != vec3d1.e;
- boolean flag3 = this.y || flag1 && vec3d.d < 0.0;
- if (this.P > 0.0F && flag3 && (flag || flag2)) {
- Vec3D vec3d2 = a(this, new Vec3D(vec3d.c, (double)this.P, vec3d.e), axisalignedbb, this.s, list);
- Vec3D vec3d3 = a(this, new Vec3D(0.0, (double)this.P, 0.0), axisalignedbb.b(vec3d.c, 0.0, vec3d.e), this.s, list);
- if (vec3d3.d < (double)this.P) {
- Vec3D vec3d4 = a(this, new Vec3D(vec3d.c, 0.0, vec3d.e), axisalignedbb.c(vec3d3), this.s, list).e(vec3d3);
- if (vec3d4.i() > vec3d2.i()) {
- vec3d2 = vec3d4;
- }
- }
-
- if (vec3d2.i() > vec3d1.i()) {
- return vec3d2.e(a(this, new Vec3D(0.0, -vec3d2.d + vec3d.d, 0.0), axisalignedbb.c(vec3d2), this.s, list));
- }
- }
-
- return vec3d1;
- }
-
- @Override
- public void a(EnumMoveType enummovetype, Vec3D vec3d) {
- if (this.E.g() > 1.0E-7) {
- vec3d = vec3d.h(this.E);
- this.E = Vec3D.b;
- this.f(Vec3D.b);
- }
-
- Vec3D vec3d1 = this.g(vec3d);
- double d0 = vec3d1.g();
- if (d0 > 1.0E-7) {
- this.e(this.df() + vec3d1.c, this.dg() + vec3d1.d, this.dl() + vec3d1.e);
- }
-
- boolean flag = !MathHelper.b(vec3d.c, vec3d1.c);
- boolean flag1 = !MathHelper.b(vec3d.e, vec3d1.e);
- this.z = flag || flag1;
- this.A = vec3d.d != vec3d1.d;
- this.B = this.A && vec3d.d < 0.0;
- if (this.z) {
- this.C = this.b(vec3d1);
- } else {
- this.C = false;
- }
-
- this.y = this.A && vec3d.d < 0.0;
- BlockPosition blockposition = this.aA();
- IBlockData iblockdata = this.s.a_(blockposition);
- // this.a(vec3d1.d, this.y, iblockdata, blockposition);
- if (!this.dt()) {
- if (this.z) {
- Vec3D vec3d2 = this.dd();
- this.n(flag ? 0.0 : vec3d2.c, vec3d2.d, flag1 ? 0.0 : vec3d2.e);
- }
-
- net.minecraft.world.level.block.Block block = iblockdata.b();
- if (vec3d.d != vec3d1.d) {
- block.a(this.s, this);
- }
-
- if (this.y) {
- block.a(this.s, blockposition, iblockdata, this);
- }
-
- this.ax();
- float f2 = this.aD();
- this.f(this.dd().d((double)f2, 1.0, (double)f2));
- }
- }
-
- public void k(List spawnList) {
- if (!this.aN()) {
- this.f(this.dd().b(0.0D, -0.04D, 0.0D));
- }
-
- this.a(EnumMoveType.a, this.dd());
- this.f(this.dd().a(0.98D));
- if (super.y) {
- this.f(this.dd().d(0.7D, -0.5D, 0.7D));
- }
-
- int i = this.i() - 1;
- this.a(i);
- if (i <= 0) {
- if (!super.s.y) {
- this.j1();
- }
-
- this.ah();
- } else {
- this.aY();
- }
-
- if (i == 1 && count > 1) {
- for (int c = 0; c < count - 1; c++) {
- FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, this.s, this.df(), this.dh(), this.dl(), i, 1);
- fakeTNT19.y = this.y;
- fakeTNT19.f(new Vec3D(this.dd().c, this.dd().d, this.dd().e));
- spawnList.add(fakeTNT19);
- }
- count = 1;
- }
- }
-
- private void j1() {
- ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) this.getBukkitEntity());
- super.s.getCraftServer().getPluginManager().callEvent(event);
- if (!event.isCancelled()) {
- this.a(this, this.df(), this.e(0.0625D), this.dl(), event.getRadius(), event.getFire(), Explosion.Effect.b);
- }
- }
-
- public FakeExplosion19 a(@Nullable Entity entity, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
- return this.a(entity, (DamageSource) null, (ExplosionDamageCalculator) null, x, y, z, power, createFire, destructionType);
- }
-
- public FakeExplosion19 a(@Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.Effect destructionType) {
- FakeExplosion19 explosion = new FakeExplosion19(fakeTNT19s, SimulatorPreview19.WORLD, entity, damageSource, behavior, x, y, z, power, createFire, destructionType);
- explosion.a();
- // explosion.a(true);
- return explosion;
- }
-
-
- protected void b(NBTTagCompound nbt) {
- nbt.a("Fuse", (short) this.i());
- }
-
- protected void a(NBTTagCompound nbt) {
- this.a(nbt.g("Fuse"));
- }
-
- @Nullable
- public EntityLiving h() {
- return this.d;
- }
-
- protected float a(EntityPose pose, EntitySize dimensions) {
- return 0.15F;
- }
-
- public void a(int fuse) {
- super.Y.b(b, fuse);
- }
-
- public int i() {
- return (Integer) super.Y.a(b);
- }
-
- public Packet> S() {
- return new PacketPlayOutSpawnEntity(this);
- }
-
- public boolean cr() {
- return super.cr();
- }
-
- static {
- b = DataWatcher.a(EntityTNTPrimed.class, DataWatcherRegistry.b);
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/SimulatorPreview19.java b/BauSystem_19/src/de/steamwar/bausystem/features/simulator/SimulatorPreview19.java
deleted file mode 100644
index 5a06c342..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/features/simulator/SimulatorPreview19.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.simulator;
-
-import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
-import de.steamwar.bausystem.features.tracer.show.Record;
-import de.steamwar.bausystem.shared.Pair;
-import net.minecraft.world.level.World;
-import org.bukkit.Bukkit;
-import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
-import org.bukkit.entity.TNTPrimed;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
-
-public class SimulatorPreview19 implements SimulatorPreview {
-
- public static final World WORLD = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle();
-
- @Override
- public Record simulate(TNTSimulator tntSimulator) {
- if (true) {
- return new Record(null);
- }
-
- Map>>> result = new HashMap<>();
- for (SimulatorElement element : tntSimulator.getTntElementList()) {
- element.locations(result);
- }
-
- AtomicInteger maxTick = new AtomicInteger(0);
- Map>>> toSpawn = new HashMap<>();
- AtomicInteger tntCount = new AtomicInteger(0);
- result.forEach((integer, integerSetMap) -> {
- List>>> internal = new ArrayList<>();
- integerSetMap.forEach((integer1, pairs) -> {
- internal.add(new Pair<>(integer1, pairs));
- });
- internal.sort(Comparator.comparingInt(Pair::getKey));
-
- toSpawn.put(integer, internal.stream().map(Pair::getValue).peek(pairs -> {
- tntCount.addAndGet(pairs.stream().mapToInt(Pair::getValue).sum());
- }).map(ArrayList::new).peek(Collections::shuffle).collect(Collectors.toList()));
-
- if (maxTick.get() < integer) {
- maxTick.set(integer);
- }
- });
- if (tntCount.get() > 500) {
- return new Record(null);
- }
-
- List fakeTNT19s = new ArrayList<>();
- Record record = new Record(null);
- Map tntRecords = new HashMap<>();
-
- int maxTickToCalc = maxTick.get() + 160;
- for (int tick = 0; tick < maxTickToCalc; tick++) {
- List>> toSpawnInTick = toSpawn.get(tick);
- try {
- if (toSpawnInTick == null) continue;
- toSpawnInTick.forEach(pairs -> {
- AtomicBoolean hasSomeLeft = new AtomicBoolean(true);
- while(hasSomeLeft.get()) {
- hasSomeLeft.set(false);
- pairs.forEach(pair -> {
- SimulatorPreview.SimulatorPreviewTNTData previewTNTData = pair.getKey();
- if (!previewTNTData.isXVelocity() && !previewTNTData.isZVelocity()) {
- FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, WORLD, previewTNTData.getX(), previewTNTData.getY(), previewTNTData.getZ(), previewTNTData.getFuseTicks(), pair.getValue());
- TNTPrimed tntPrimed = (TNTPrimed) fakeTNT19.getBukkitEntity();
- if (!previewTNTData.isXVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setX(0));
- if (!previewTNTData.isYVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setY(0));
- if (!previewTNTData.isZVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setZ(0));
- fakeTNT19s.add(fakeTNT19);
- pair.setValue(0);
- } else if (pair.getValue() > 0) {
- hasSomeLeft.set(true);
- FakeTNT19 fakeTNT19 = new FakeTNT19(fakeTNT19s, WORLD, previewTNTData.getX(), previewTNTData.getY(), previewTNTData.getZ(), previewTNTData.getFuseTicks(), 1);
- TNTPrimed tntPrimed = (TNTPrimed) fakeTNT19.getBukkitEntity();
- if (!previewTNTData.isXVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setX(0));
- if (!previewTNTData.isYVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setY(0));
- if (!previewTNTData.isZVelocity()) tntPrimed.setVelocity(tntPrimed.getVelocity().setZ(0));
- fakeTNT19s.add(fakeTNT19);
- pair.setValue(pair.getValue() - 1);
- }
- });
- }
- });
- } finally {
- calculateTick(fakeTNT19s, record, tntRecords);
- }
- }
- return record;
- }
-
- private void calculateTick(List fakeTNT19s, Record record, Map tntRecords) {
- int i = 0;
- while (i < fakeTNT19s.size()) {
- List spawnList = new ArrayList<>();
- FakeTNT19 fakeTNT19 = fakeTNT19s.get(i);
- fakeTNT19.k(spawnList);
- TNTPrimed tntPrimed = ((TNTPrimed) (fakeTNT19.getBukkitEntity()));
- if (tntPrimed.getFuseTicks() <= 0) {
- tntRecords.computeIfAbsent(fakeTNT19, ignore -> record.spawn(0)).explode(tntPrimed);
- fakeTNT19s.remove(i);
- i--;
- } else {
- tntRecords.computeIfAbsent(fakeTNT19, ignore -> record.spawn(0)).explode(tntPrimed);
- }
- if (!spawnList.isEmpty()) {
- fakeTNT19s.addAll(i, spawnList);
- i += spawnList.size();
- }
- i++;
- }
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/shared/BaseArmorStand19.java b/BauSystem_19/src/de/steamwar/bausystem/shared/BaseArmorStand19.java
deleted file mode 100644
index fcc0ef9f..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/shared/BaseArmorStand19.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.EntityTypes;
-import net.minecraft.world.entity.decoration.EntityArmorStand;
-import net.minecraft.world.phys.Vec3D;
-import org.bukkit.World;
-import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
-import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public class BaseArmorStand19 extends EntityArmorStand implements AbstractEntity {
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- protected Vector position;
-
- public BaseArmorStand19(World world, Vector position) {
- super(((CraftWorld) world).getHandle(), position.getX(), position.getY(), position.getZ());
-
- this.position = position;
- e(true);
- S = -12000;
- }
-
- public void sendEntity(Player player) {
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), position.getX(), position.getY(), position.getZ(), 0, 0, EntityTypes.d, 0, ZERO, 0.0);
- PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
- playerConnection.a(packetPlayOutSpawnEntity);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/shared/BaseEntity19.java b/BauSystem_19/src/de/steamwar/bausystem/shared/BaseEntity19.java
deleted file mode 100644
index df65d56a..00000000
--- a/BauSystem_19/src/de/steamwar/bausystem/shared/BaseEntity19.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.shared;
-
-import net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy;
-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.EntityTypes;
-import net.minecraft.world.entity.item.EntityFallingBlock;
-import net.minecraft.world.level.block.Block;
-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;
-
-import java.lang.reflect.Field;
-
-public class BaseEntity19 extends EntityFallingBlock implements AbstractEntity {
-
- private static final Field ao;
-
- static {
- try {
- ao = EntityFallingBlock.class.getDeclaredField("ao");
- ao.setAccessible(true);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException(e);
- }
- }
-
- private static final Vec3D ZERO = new Vec3D(0, 0, 0);
-
- private final IBlockData iBlockData;
- protected Vector position;
-
- public BaseEntity19(World world, Vector position, Material blockType) {
- super(EntityTypes.E, ((CraftWorld) world).getHandle());
- try {
- ao.set(this, ((CraftBlockData) blockType.createBlockData()).getState());
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- }
- this.q = true;
- e(position.getX(), position.getY(), position.getZ());
- f(Vec3D.b);
- t = position.getX();
- u = position.getY();
- v = position.getZ();
- a(this.db());
-
- this.iBlockData = ((CraftBlockData) blockType.createBlockData()).getState();
- this.position = position;
-
- this.e(true);
- this.S = -12000;
- }
-
- public void sendEntity(Player player) {
- PacketPlayOutSpawnEntity packetPlayOutSpawnEntity = new PacketPlayOutSpawnEntity(ae(), co(), 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);
-
- PacketPlayOutEntityMetadata packetPlayOutEntityMetadata = new PacketPlayOutEntityMetadata(ae(), Y, true);
- playerConnection.a(packetPlayOutEntityMetadata);
- }
-
- public void sendEntityDestroy(Player player) {
- PacketPlayOutEntityDestroy packetPlayOutEntityDestroy = new PacketPlayOutEntityDestroy(ae());
- ((CraftPlayer) player).getHandle().b.a(packetPlayOutEntityDestroy);
- }
-}
diff --git a/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java b/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java
index 4d184f6f..f0d11ff1 100644
--- a/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java
+++ b/BauSystem_19/src/de/steamwar/bausystem/utils/NMSWrapper19.java
@@ -21,15 +21,7 @@ package de.steamwar.bausystem.utils;
import com.comphenix.tinyprotocol.Reflection;
import com.comphenix.tinyprotocol.TinyProtocol;
-import de.steamwar.bausystem.entities.DetonatorEntity19;
-import de.steamwar.bausystem.entities.SimulatorEntity19;
-import de.steamwar.bausystem.entities.TraceEntity19;
-import de.steamwar.bausystem.entities.WarpEntity19;
-import de.steamwar.bausystem.features.detonator.AbstractDetonatorEntity;
-import de.steamwar.bausystem.features.simulator.AbstractSimulatorEntity;
-import de.steamwar.bausystem.features.tracer.AbstractTraceEntity;
import de.steamwar.bausystem.features.util.NoClipCommand;
-import de.steamwar.bausystem.features.warp.AbstractWarpEntity;
import net.minecraft.SystemUtils;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
@@ -39,14 +31,16 @@ import net.minecraft.network.protocol.game.*;
import net.minecraft.server.level.PlayerInteractManager;
import net.minecraft.world.level.EnumGamemode;
import net.minecraft.world.phys.Vec3D;
-import org.bukkit.*;
+import org.bukkit.Bukkit;
+import org.bukkit.GameMode;
+import org.bukkit.Material;
+import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.inventory.ItemStack;
-import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.List;
@@ -167,26 +161,6 @@ public class NMSWrapper19 implements NMSWrapper {
return invalid;
}
- @Override
- public AbstractWarpEntity createWarp(World world, Vector position, String name) {
- return new WarpEntity19(world, position, name);
- }
-
- @Override
- public AbstractSimulatorEntity createSimulator(World world, Vector tntPosition, boolean highlight) {
- return new SimulatorEntity19(world, tntPosition, highlight);
- }
-
- @Override
- public AbstractDetonatorEntity constructDetonator(World world, Vector position) {
- return new DetonatorEntity19(world, position);
- }
-
- @Override
- public AbstractTraceEntity createTrace(World world, Vector tntPosition, boolean tnt) {
- return new TraceEntity19(world, tntPosition, tnt);
- }
-
private final Class> explosionPacket = Reflection.getClass("{nms.network.protocol.game}.PacketPlayOutExplosion");
private final Reflection.FieldAccessor a = Reflection.getField(explosionPacket, double.class, 0);
private final Reflection.FieldAccessor b = Reflection.getField(explosionPacket, double.class, 1);
diff --git a/BauSystem_Linkage/src/de/steamwar/linkage/types/BlockAttribute_GENERIC.java b/BauSystem_Linkage/src/de/steamwar/linkage/types/BlockAttribute_GENERIC.java
deleted file mode 100644
index b898485b..00000000
--- a/BauSystem_Linkage/src/de/steamwar/linkage/types/BlockAttribute_GENERIC.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.linkage.types;
-
-import de.steamwar.linkage.LinkageType;
-import de.steamwar.linkage.plan.BuildPlan;
-import de.steamwar.linkage.plan.MethodBuilder;
-
-import javax.lang.model.element.TypeElement;
-
-public class BlockAttribute_GENERIC implements LinkageType {
-
- @Override
- public String method() {
- return "linkBlockAttributes";
- }
-
- @Override
- public void generateCode(BuildPlan buildPlan, MethodBuilder methodBuilder, String s, TypeElement typeElement) {
- buildPlan.addImport("de.steamwar.bausystem.features.attributescopy.*");
- methodBuilder.addLine("AttributesCopyCommand.add(" + s + ");");
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java
index 565f368f..1d1e6362 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java
@@ -121,19 +121,4 @@ public class BauSystem extends JavaPlugin implements Listener {
}
}));
}
-
- private void createLink(String source, String destination) {
- try {
- Bukkit.getLogger().log(Level.INFO, "Executing: ln -s /home/minecraft/server/Bau15/{0} {1}", new String[]{source, destination});
- ProcessBuilder processBuilder = new ProcessBuilder("ln", "-s", "/home/minecraft/server/Bau15/" + source, destination);
- processBuilder.directory(world.getWorldFolder());
- processBuilder.inheritIO();
-
- Process process = processBuilder.start();
- process.waitFor();
- } catch (IOException | InterruptedException e) {
- Thread.currentThread().interrupt();
- Bukkit.shutdown();
- }
- }
}
\ No newline at end of file
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java
index f9217497..902d7c59 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeRemoveCommand.java
@@ -36,7 +36,6 @@ import java.util.List;
import java.util.stream.Collectors;
@Linked
-@MinVersion(18)
public class AttributeRemoveCommand extends SWCommand {
public AttributeRemoveCommand() {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeUtils.java
new file mode 100644
index 00000000..246e4ab9
--- /dev/null
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributeUtils.java
@@ -0,0 +1,128 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2023 SteamWar.de-Serverteam
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+package de.steamwar.bausystem.features.attributescopy;
+
+import lombok.experimental.UtilityClass;
+import org.bukkit.block.data.BlockData;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@UtilityClass
+public class AttributeUtils {
+
+ private Map names = new HashMap<>();
+ private Map, List> getters = new HashMap<>();
+ private Map, Map> setters = new HashMap<>();
+
+ private void generate(BlockData blockData) {
+ Class extends BlockData> clazz = blockData.getClass();
+ if (getters.containsKey(clazz) && setters.containsKey(clazz)) return;
+
+ Map> methods = new HashMap<>();
+ for (Method declaredMethod : clazz.getMethods()) {
+ String s = declaredMethod.getName();
+ if (s.startsWith("get") && declaredMethod.getParameterCount() == 0) {
+ methods.computeIfAbsent(s.substring(3), aClass -> new ArrayList<>()).add(declaredMethod);
+ } else if (s.startsWith("is") && declaredMethod.getParameterCount() == 0) {
+ methods.computeIfAbsent(s.substring(2), aClass -> new ArrayList<>()).add(declaredMethod);
+ } else if (s.startsWith("set") && declaredMethod.getParameterCount() == 1) {
+ methods.computeIfAbsent(s.substring(3), aClass -> new ArrayList<>()).add(declaredMethod);
+ }
+ }
+ for (Map.Entry> entry : methods.entrySet()) {
+ if (entry.getValue().size() != 2) continue;
+ for (Method method : entry.getValue()) {
+ names.put(method, entry.getKey());
+ if (method.getName().startsWith("is") || method.getName().startsWith("get")) {
+ getters.computeIfAbsent(clazz, aClass -> new ArrayList<>()).add(method);
+ } else {
+ setters.computeIfAbsent(clazz, aClass -> new HashMap<>()).put(entry.getKey(), method);
+ }
+ }
+ }
+ }
+
+ public void copy(BlockData blockData, List attributes) {
+ generate(blockData);
+
+ getters.getOrDefault(blockData.getClass(), new ArrayList<>()).forEach(method -> {
+ try {
+ Object invoke = method.invoke(blockData);
+ if (invoke != null) {
+ attributes.add("§8-§7 " + names.get(method) + "§8:§7 " + convert(invoke));
+ }
+ } catch (Exception e) {
+ // ignore
+ }
+ });
+ }
+
+ public void paste(BlockData blockData, List attributes) {
+ generate(blockData);
+
+ for (String attribute : attributes) {
+ String[] split = attribute.split("§8:§7 ");
+ if (split.length != 2) continue;
+ String name = split[0].substring(6);
+ String value = split[1];
+ Method method = setters.getOrDefault(blockData.getClass(), new HashMap<>()).get(name);
+ if (method == null) continue;
+ try {
+ method.invoke(blockData, convert(value, method.getParameterTypes()[0]));
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+
+ private String convert(Object o) {
+ if (o.getClass().isEnum()) {
+ return ((Enum>) o).name();
+ } else {
+ return o.toString();
+ }
+ }
+
+ private Object convert(String s, Class> type) {
+ if (type.isEnum()) {
+ return Enum.valueOf((Class extends Enum>) type, s);
+ } else if (type == int.class || type == Integer.class) {
+ return Integer.parseInt(s);
+ } else if (type == double.class || type == Double.class) {
+ return Double.parseDouble(s);
+ } else if (type == float.class || type == Float.class) {
+ return Float.parseFloat(s);
+ } else if (type == long.class || type == Long.class) {
+ return Long.parseLong(s);
+ } else if (type == short.class || type == Short.class) {
+ return Short.parseShort(s);
+ } else if (type == byte.class || type == Byte.class) {
+ return Byte.parseByte(s);
+ } else if (type == boolean.class || type == Boolean.class) {
+ return Boolean.parseBoolean(s);
+ } else {
+ return s;
+ }
+ }
+}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java
index d63204f3..01d652b4 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesCopyCommand.java
@@ -20,10 +20,8 @@
package de.steamwar.bausystem.features.attributescopy;
import de.steamwar.bausystem.BauSystem;
-import de.steamwar.bausystem.linkage.LinkageUtils;
import de.steamwar.command.SWCommand;
import de.steamwar.linkage.Linked;
-import de.steamwar.linkage.MinVersion;
import org.bukkit.FluidCollisionMode;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -36,40 +34,29 @@ import java.util.ArrayList;
import java.util.List;
@Linked
-@MinVersion(18)
public class AttributesCopyCommand extends SWCommand {
- static List> blockAttributeList = new ArrayList<>();
-
- public static void add(BlockAttribute> blockAttribute) {
- blockAttributeList.add(blockAttribute);
- }
-
public AttributesCopyCommand() {
super("copyattributes", "attributescopy", "ac");
}
@Register
public void genericCommand(Player player) {
- linkIfNeeded();
-
Block block = player.getTargetBlockExact(8, FluidCollisionMode.ALWAYS);
if (block == null) return;
ItemStack mainHand = player.getInventory().getItemInMainHand();
- if (!isSame(block, mainHand)) {
+
+ if (!(block.getType().isItem() && block.getType() == mainHand.getType() || isSame(block, mainHand))) {
BauSystem.MESSAGE.send("ATTRIBUTES_CANT_COPY", player);
return;
}
+
BlockData blockData = block.getBlockData();
List attributesToCopy = new ArrayList<>();
- if (needsType(block)) {
- attributesToCopy.add("§8-§7 material " + block.getType().name().toLowerCase());
- }
- for (BlockAttribute blockAttribute : blockAttributeList) {
- if (blockAttribute.type().isInstance(blockData)) {
- blockAttribute.copy(attributesToCopy, blockData);
- }
+ if (block.getType() != mainHand.getType()) {
+ attributesToCopy.add("§8-§7 Material§8:§7 " + block.getType().name());
}
+ AttributeUtils.copy(blockData, attributesToCopy);
if (attributesToCopy.isEmpty()) {
BauSystem.MESSAGE.send("ATTRIBUTES_NO_COPY", player);
return;
@@ -83,15 +70,7 @@ public class AttributesCopyCommand extends SWCommand {
BauSystem.MESSAGE.send("ATTRIBUTES_COPIED", player);
}
- private static boolean isLinked = false;
- static void linkIfNeeded() {
- if (isLinked) return;
- LinkageUtils.linkBlockAttributes();
- isLinked = true;
- }
-
private boolean isSame(Block block, ItemStack itemStack) {
- if (block.getType() == itemStack.getType()) return true;
if (itemStack.getType() == Material.REDSTONE && block.getType() == Material.REDSTONE_WIRE) return true;
if (itemStack.getType() == Material.PLAYER_HEAD && block.getType() == Material.PLAYER_WALL_HEAD) return true;
if (itemStack.getType() == Material.ZOMBIE_HEAD && block.getType() == Material.ZOMBIE_WALL_HEAD) return true;
@@ -102,22 +81,8 @@ public class AttributesCopyCommand extends SWCommand {
if (itemStack.getType() == Material.TORCH && block.getType() == Material.WALL_TORCH) return true;
if (itemStack.getType() == Material.SOUL_TORCH && block.getType() == Material.SOUL_WALL_TORCH) return true;
if (itemStack.getType() == Material.REDSTONE_TORCH && block.getType() == Material.REDSTONE_WALL_TORCH) return true;
+ if (itemStack.getType() == Material.WHEAT_SEEDS && block.getType() == Material.WHEAT) return true;
if (itemStack.getType().name().contains("_BANNER") && block.getType().name().contains("_WALL_BANNER")) return true;
return false;
}
-
- private boolean needsType(Block block) {
- if (block.getType().name().contains("WALL")) return true;
- if (block.getType() == Material.PLAYER_HEAD) return true;
- if (block.getType() == Material.ZOMBIE_HEAD) return true;
- if (block.getType() == Material.CREEPER_HEAD) return true;
- if (block.getType() == Material.DRAGON_HEAD) return true;
- if (block.getType() == Material.SKELETON_SKULL) return true;
- if (block.getType() == Material.WITHER_SKELETON_SKULL) return true;
- if (block.getType() == Material.TORCH) return true;
- if (block.getType() == Material.SOUL_TORCH) return true;
- if (block.getType() == Material.REDSTONE_TORCH) return true;
- if (block.getType().name().contains("_BANNER")) return true;
- return false;
- }
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java
index 0daed5af..de4b192a 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/AttributesPlaceListener.java
@@ -21,7 +21,6 @@ package de.steamwar.bausystem.features.attributescopy;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.linkage.Linked;
-import de.steamwar.linkage.MinVersion;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
@@ -33,21 +32,14 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
-import org.bukkit.profile.PlayerProfile;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
-
-import static de.steamwar.bausystem.features.attributescopy.AttributesCopyCommand.blockAttributeList;
@Linked
-@MinVersion(18)
public class AttributesPlaceListener implements Listener {
@EventHandler
public void onBlockPlace(BlockPlaceEvent event) {
- AttributesCopyCommand.linkIfNeeded();
ItemStack itemStack = event.getItemInHand();
ItemMeta itemMeta = itemStack.getItemMeta();
if (itemMeta == null) return;
@@ -65,12 +57,12 @@ public class AttributesPlaceListener implements Listener {
event.setCancelled(true);
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
Material material = strings.stream()
- .filter(s -> s.startsWith("§8-§7 material "))
- .map(s -> s.replace("§8-§7 material ", ""))
+ .filter(s -> s.startsWith("§8-§7 Material§8:§7 "))
+ .map(s -> s.replace("§8-§7 Material§8:§7 ", ""))
.map(String::toUpperCase)
.map(s -> {
try {
- return Material.valueOf(s.toUpperCase());
+ return Material.valueOf(s);
} catch (Exception e) {
return null;
}
@@ -78,7 +70,6 @@ public class AttributesPlaceListener implements Listener {
.findFirst()
.orElse(type);
event.getBlock().setType(material, false);
- Set attributesToPaste = new HashSet<>(strings);
Block block = event.getBlock();
BlockData blockData = block.getBlockData();
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
@@ -88,11 +79,7 @@ public class AttributesPlaceListener implements Listener {
skull.update(true, false);
}
}, 1);
- for (BlockAttribute blockAttribute : blockAttributeList) {
- if (blockAttribute.type().isInstance(blockData)) {
- blockAttribute.paste(attributesToPaste, blockData);
- }
- }
+ AttributeUtils.paste(blockData, strings);
block.setBlockData(blockData, false);
}, 1);
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/BlockAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/BlockAttribute.java
deleted file mode 100644
index 13fbf86c..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/BlockAttribute.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy;
-
-import org.bukkit.block.data.BlockData;
-
-import java.util.List;
-import java.util.Set;
-
-public interface BlockAttribute {
- Class type();
- void copy(List attributes, T blockData);
- void paste(Set attributes, T blockData);
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AgeableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AgeableAttribute.java
deleted file mode 100644
index a52d6819..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AgeableAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Ageable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class AgeableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 age ";
-
- @Override
- public Class type() {
- return Ageable.class;
- }
-
- @Override
- public void copy(List attributes, Ageable blockData) {
- attributes.add(attribute + blockData.getAge());
- }
-
- @Override
- public void paste(Set attributes, Ageable blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setAge);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AnaloguePowerableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AnaloguePowerableAttribute.java
deleted file mode 100644
index 6d9c7df0..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AnaloguePowerableAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.AnaloguePowerable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class AnaloguePowerableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 power ";
-
- @Override
- public Class type() {
- return AnaloguePowerable.class;
- }
-
- @Override
- public void copy(List attributes, AnaloguePowerable blockData) {
- attributes.add(attribute + blockData.getPower());
- }
-
- @Override
- public void paste(Set attributes, AnaloguePowerable blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setPower);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AttachableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AttachableAttribute.java
deleted file mode 100644
index 05a716e9..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/AttachableAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Attachable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class AttachableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 attached";
-
- @Override
- public Class type() {
- return Attachable.class;
- }
-
- @Override
- public void copy(List attributes, Attachable blockData) {
- if (blockData.isAttached()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Attachable blockData) {
- blockData.setAttached(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/BisectedAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/BisectedAttribute.java
deleted file mode 100644
index 31849b40..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/BisectedAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Bisected;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class BisectedAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 half ";
-
- @Override
- public Class type() {
- return Bisected.class;
- }
-
- @Override
- public void copy(List attributes, Bisected blockData) {
- attributes.add(attribute + blockData.getHalf().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Bisected blockData) {
- for (Bisected.Half half : Bisected.Half.values()) {
- if (attributes.contains(attribute + half.name().toLowerCase())) {
- blockData.setHalf(half);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/DirectionalAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/DirectionalAttribute.java
deleted file mode 100644
index c0e11fc8..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/DirectionalAttribute.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.Directional;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class DirectionalAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 facing ";
-
- @Override
- public Class type() {
- return Directional.class;
- }
-
- @Override
- public void copy(List attributes, Directional blockData) {
- attributes.add(attribute + blockData.getFacing().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Directional blockData) {
- for (BlockFace blockFace : blockData.getFaces()) {
- if (attributes.contains(attribute + blockFace.name().toLowerCase())) {
- blockData.setFacing(blockFace);
- break;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/FaceAttachableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/FaceAttachableAttribute.java
deleted file mode 100644
index 59f79a19..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/FaceAttachableAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.FaceAttachable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class FaceAttachableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 attached ";
-
- @Override
- public Class type() {
- return FaceAttachable.class;
- }
-
- @Override
- public void copy(List attributes, FaceAttachable blockData) {
- attributes.add(attribute + blockData.getAttachedFace().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, FaceAttachable blockData) {
- for (FaceAttachable.AttachedFace attachedFace : FaceAttachable.AttachedFace.values()) {
- if (attributes.contains(attribute + attachedFace.name().toLowerCase())) {
- blockData.setAttachedFace(attachedFace);
- break;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/HangableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/HangableAttribute.java
deleted file mode 100644
index 8e26bb31..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/HangableAttribute.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import de.steamwar.linkage.MinVersion;
-import org.bukkit.block.data.Hangable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-@MinVersion(19)
-public class HangableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 hanging";
-
- @Override
- public Class type() {
- return Hangable.class;
- }
-
- @Override
- public void copy(List attributes, Hangable blockData) {
- if (!blockData.isHanging()) return;
- attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Hangable blockData) {
- blockData.setHanging(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LevelledAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LevelledAttribute.java
deleted file mode 100644
index 6e60b601..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LevelledAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Levelled;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class LevelledAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 level ";
-
- @Override
- public Class type() {
- return Levelled.class;
- }
-
- @Override
- public void copy(List attributes, Levelled blockData) {
- attributes.add(attribute + blockData.getLevel());
- }
-
- @Override
- public void paste(Set attributes, Levelled blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setLevel);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LightableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LightableAttribute.java
deleted file mode 100644
index aa55a054..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/LightableAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Lightable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class LightableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 lit";
-
- @Override
- public Class type() {
- return Lightable.class;
- }
-
- @Override
- public void copy(List attributes, Lightable blockData) {
- if (blockData.isLit()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Lightable blockData) {
- blockData.setLit(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/MultipleFacingAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/MultipleFacingAttribute.java
deleted file mode 100644
index 262de53c..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/MultipleFacingAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.MultipleFacing;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class MultipleFacingAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 connected ";
-
- @Override
- public Class type() {
- return MultipleFacing.class;
- }
-
- @Override
- public void copy(List attributes, MultipleFacing blockData) {
- blockData.getFaces().forEach(blockFace -> {
- attributes.add(attribute + blockFace.name().toLowerCase());
- });
- }
-
- @Override
- public void paste(Set attributes, MultipleFacing blockData) {
- for (BlockFace blockFace : BlockFace.values()) {
- blockData.setFace(blockFace, attributes.contains(attribute + blockFace.name().toLowerCase()));
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OpenableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OpenableAttribute.java
deleted file mode 100644
index 2e440e67..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OpenableAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Openable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class OpenableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 open";
-
- @Override
- public Class type() {
- return Openable.class;
- }
-
- @Override
- public void copy(List attributes, Openable blockData) {
- if (blockData.isOpen()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Openable blockData) {
- blockData.setOpen(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OrientableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OrientableAttribute.java
deleted file mode 100644
index e70d8ab3..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/OrientableAttribute.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.Axis;
-import org.bukkit.block.data.Orientable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class OrientableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 orientation ";
-
- @Override
- public Class type() {
- return Orientable.class;
- }
-
- @Override
- public void copy(List attributes, Orientable blockData) {
- attributes.add(attribute + blockData.getAxis().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Orientable blockData) {
- for (Axis axis : Axis.values()) {
- if (attributes.contains(attribute + axis.name().toLowerCase())) {
- blockData.setAxis(axis);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/PowerableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/PowerableAttribute.java
deleted file mode 100644
index 3aabee78..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/PowerableAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Powerable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class PowerableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 powered";
-
- @Override
- public Class type() {
- return Powerable.class;
- }
-
- @Override
- public void copy(List attributes, Powerable blockData) {
- if (blockData.isPowered()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Powerable blockData) {
- blockData.setPowered(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RailAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RailAttribute.java
deleted file mode 100644
index e7ab4e76..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RailAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Rail;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class RailAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 rail shape ";
-
- @Override
- public Class type() {
- return Rail.class;
- }
-
- @Override
- public void copy(List attributes, Rail blockData) {
- attributes.add(attribute + blockData.getShape().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Rail blockData) {
- for (Rail.Shape shape : Rail.Shape.values()) {
- if (attributes.contains(attribute + shape)) {
- blockData.setShape(shape);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RotatableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RotatableAttribute.java
deleted file mode 100644
index 94a1fa8d..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/RotatableAttribute.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.Rotatable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class RotatableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 rotation ";
-
- @Override
- public Class type() {
- return Rotatable.class;
- }
-
- @Override
- public void copy(List attributes, Rotatable blockData) {
- attributes.add(attribute + blockData.getRotation().name());
- }
-
- @Override
- public void paste(Set attributes, Rotatable blockData) {
- for (BlockFace face : BlockFace.values()) {
- if (attributes.contains(attribute + face.name())) {
- blockData.setRotation(face);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/SnowableAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/SnowableAttribute.java
deleted file mode 100644
index 71358651..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/SnowableAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Snowable;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SnowableAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 snowy";
-
- @Override
- public Class type() {
- return Snowable.class;
- }
-
- @Override
- public void copy(List attributes, Snowable blockData) {
- if (blockData.isSnowy()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Snowable blockData) {
- blockData.setSnowy(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/WaterloggedAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/WaterloggedAttribute.java
deleted file mode 100644
index bd010c01..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/WaterloggedAttribute.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.Waterlogged;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class WaterloggedAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 waterlogged";
-
- @Override
- public Class type() {
- return Waterlogged.class;
- }
-
- @Override
- public void copy(List attributes, Waterlogged waterlogged) {
- if (!waterlogged.isWaterlogged()) return;
- attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Waterlogged waterlogged) {
- waterlogged.setWaterlogged(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BambooAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BambooAttribute.java
deleted file mode 100644
index c2182b03..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BambooAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Bamboo;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class BambooAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 leaves ";
-
- @Override
- public Class type() {
- return Bamboo.class;
- }
-
- @Override
- public void copy(List attributes, Bamboo blockData) {
- attributes.add(attribute + blockData.getLeaves());
- }
-
- @Override
- public void paste(Set attributes, Bamboo blockData) {
- for (Bamboo.Leaves leaves : Bamboo.Leaves.values()) {
- if (attributes.contains(attribute + leaves)) {
- blockData.setLeaves(leaves);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BellAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BellAttribute.java
deleted file mode 100644
index b5fcb280..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BellAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Bell;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class BellAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 attachament ";
-
- @Override
- public Class type() {
- return Bell.class;
- }
-
- @Override
- public void copy(List attributes, Bell blockData) {
- attributes.add(attribute + blockData.getAttachment());
- }
-
- @Override
- public void paste(Set attributes, Bell blockData) {
- for (Bell.Attachment attachment : Bell.Attachment.values()) {
- if (attributes.contains(attribute + attachment)) {
- blockData.setAttachment(attachment);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BigDripleafAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BigDripleafAttribute.java
deleted file mode 100644
index a1ebef35..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/BigDripleafAttribute.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import de.steamwar.linkage.MinVersion;
-import org.bukkit.block.data.type.BigDripleaf;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-@MinVersion(18)
-public class BigDripleafAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 tilt ";
-
- @Override
- public Class type() {
- return BigDripleaf.class;
- }
-
- @Override
- public void copy(List attributes, BigDripleaf blockData) {
- attributes.add(attribute + blockData.getTilt());
- }
-
- @Override
- public void paste(Set attributes, BigDripleaf blockData) {
- for (BigDripleaf.Tilt tilt : BigDripleaf.Tilt.values()) {
- if (attributes.contains(attribute + tilt)) {
- blockData.setTilt(tilt);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CakeAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CakeAttribute.java
deleted file mode 100644
index 0e44b938..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CakeAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Cake;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class CakeAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 bites ";
-
- @Override
- public Class type() {
- return Cake.class;
- }
-
- @Override
- public void copy(List attributes, Cake blockData) {
- attributes.add(attribute + blockData.getBites());
- }
-
- @Override
- public void paste(Set attributes, Cake blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setBites);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CampfireAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CampfireAttribute.java
deleted file mode 100644
index 9d5d9e3e..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CampfireAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Campfire;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class CampfireAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 signal fire";
-
- @Override
- public Class type() {
- return Campfire.class;
- }
-
- @Override
- public void copy(List attributes, Campfire blockData) {
- if (blockData.isSignalFire()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Campfire blockData) {
- blockData.setSignalFire(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CandleAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CandleAttribute.java
deleted file mode 100644
index a8e054d8..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CandleAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Candle;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class CandleAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 candles ";
-
- @Override
- public Class type() {
- return Candle.class;
- }
-
- @Override
- public void copy(List attributes, Candle blockData) {
- if (blockData.getCandles() > 0) attributes.add(attribute + blockData.getCandles());
- }
-
- @Override
- public void paste(Set attributes, Candle blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setCandles);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CaveVinesPlantAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CaveVinesPlantAttribute.java
deleted file mode 100644
index ecbaf271..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/CaveVinesPlantAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.CaveVinesPlant;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class CaveVinesPlantAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 berries";
-
- @Override
- public Class type() {
- return CaveVinesPlant.class;
- }
-
- @Override
- public void copy(List attributes, CaveVinesPlant blockData) {
- if (blockData.isBerries()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, CaveVinesPlant blockData) {
- blockData.setBerries(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ComparatorAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ComparatorAttribute.java
deleted file mode 100644
index 4342008e..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ComparatorAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Comparator;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class ComparatorAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 mode ";
-
- @Override
- public Class type() {
- return Comparator.class;
- }
-
- @Override
- public void copy(List attributes, Comparator blockData) {
- attributes.add(attribute + blockData.getMode().name());
- }
-
- @Override
- public void paste(Set attributes, Comparator blockData) {
- for (Comparator.Mode mode : Comparator.Mode.values()) {
- if (attributes.contains(attribute + mode.name())) {
- blockData.setMode(mode);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DaylightDetectorAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DaylightDetectorAttribute.java
deleted file mode 100644
index 3c319987..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DaylightDetectorAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.DaylightDetector;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class DaylightDetectorAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 inverted";
-
- @Override
- public Class type() {
- return DaylightDetector.class;
- }
-
- @Override
- public void copy(List attributes, DaylightDetector blockData) {
- if (blockData.isInverted()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, DaylightDetector blockData) {
- blockData.setInverted(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DoorAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DoorAttribute.java
deleted file mode 100644
index 1c7885af..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/DoorAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Door;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class DoorAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 hinge ";
-
- @Override
- public Class type() {
- return Door.class;
- }
-
- @Override
- public void copy(List attributes, Door blockData) {
- attributes.add(attribute + blockData.getHinge().toString().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Door blockData) {
- for (Door.Hinge hinge : Door.Hinge.values()) {
- if (attributes.contains(attribute + hinge.toString().toLowerCase())) {
- blockData.setHinge(hinge);
- break;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/EndPortalFrameAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/EndPortalFrameAttribute.java
deleted file mode 100644
index 25f790a6..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/EndPortalFrameAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.EndPortalFrame;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class EndPortalFrameAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 eye";
-
- @Override
- public Class type() {
- return EndPortalFrame.class;
- }
-
- @Override
- public void copy(List attributes, EndPortalFrame blockData) {
- if (blockData.hasEye()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, EndPortalFrame blockData) {
- blockData.setEye(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/FarmlandAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/FarmlandAttribute.java
deleted file mode 100644
index b55971d4..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/FarmlandAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Farmland;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class FarmlandAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 moisture ";
-
- @Override
- public Class type() {
- return Farmland.class;
- }
-
- @Override
- public void copy(List attributes, Farmland blockData) {
- attributes.add(attribute + blockData.getMoisture());
- }
-
- @Override
- public void paste(Set attributes, Farmland blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setMoisture);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/GateAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/GateAttribute.java
deleted file mode 100644
index 3f853135..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/GateAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Gate;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class GateAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 inWall";
-
- @Override
- public Class type() {
- return Gate.class;
- }
-
- @Override
- public void copy(List attributes, Gate blockData) {
- if (blockData.isInWall()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Gate blockData) {
- blockData.setInWall(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/HopperAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/HopperAttribute.java
deleted file mode 100644
index b64266a8..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/HopperAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Hopper;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class HopperAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 enabled";
-
- @Override
- public Class type() {
- return Hopper.class;
- }
-
- @Override
- public void copy(List attributes, Hopper blockData) {
- if (blockData.isEnabled()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Hopper blockData) {
- blockData.setEnabled(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/JigsawAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/JigsawAttribute.java
deleted file mode 100644
index 492e2543..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/JigsawAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Jigsaw;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class JigsawAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 orientation ";
-
- @Override
- public Class type() {
- return Jigsaw.class;
- }
-
- @Override
- public void copy(List attributes, Jigsaw blockData) {
- attributes.add(attribute + blockData.getOrientation());
- }
-
- @Override
- public void paste(Set attributes, Jigsaw blockData) {
- for (Jigsaw.Orientation orientation : Jigsaw.Orientation.values()) {
- if (attributes.contains(attribute + orientation)) {
- blockData.setOrientation(orientation);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LanternAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LanternAttribute.java
deleted file mode 100644
index 3ea0d701..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LanternAttribute.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Lantern;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class LanternAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 lantern";
-
- @Override
- public Class type() {
- return Lantern.class;
- }
-
- @Override
- public void copy(List attributes, Lantern lantern) {
- if (!lantern.isHanging()) return;
- attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Lantern lantern) {
- lantern.setHanging(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LeavesAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LeavesAttribute.java
deleted file mode 100644
index 74f445f6..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/LeavesAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Leaves;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class LeavesAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 persistent";
-
- @Override
- public Class type() {
- return Leaves.class;
- }
-
- @Override
- public void copy(List attributes, Leaves blockData) {
- if (blockData.isPersistent()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Leaves blockData) {
- blockData.setPersistent(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/PointedDripstoneAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/PointedDripstoneAttribute.java
deleted file mode 100644
index 5b25834a..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/PointedDripstoneAttribute.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.type.PointedDripstone;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class PointedDripstoneAttribute implements BlockAttribute {
-
- private String attribute1 = "§8-§7 vertialDirection ";
- private String attribute2 = "§8-§7 thickness ";
-
- @Override
- public Class type() {
- return PointedDripstone.class;
- }
-
- @Override
- public void copy(List attributes, PointedDripstone blockData) {
- attributes.add(attribute1 + " " + blockData.getVerticalDirection().name().toLowerCase());
- attributes.add(attribute2 + " " + blockData.getThickness().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, PointedDripstone blockData) {
- for (BlockFace blockFace : blockData.getVerticalDirections()) {
- if (attributes.contains(attribute1 + " " + blockFace.name().toLowerCase())) {
- blockData.setVerticalDirection(blockFace);
- break;
- }
- }
- for (PointedDripstone.Thickness thickness : PointedDripstone.Thickness.values()) {
- if (attributes.contains(attribute2 + " " + thickness.name().toLowerCase())) {
- blockData.setThickness(thickness);
- break;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RedstoneWireAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RedstoneWireAttribute.java
deleted file mode 100644
index a3049f2b..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RedstoneWireAttribute.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.type.RedstoneWire;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class RedstoneWireAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 connection ";
-
- @Override
- public Class type() {
- return RedstoneWire.class;
- }
-
- @Override
- public void copy(List attributes, RedstoneWire blockData) {
- for (BlockFace blockFace : blockData.getAllowedFaces()) {
- attributes.add(attribute + blockFace.name().toLowerCase() + " " + blockData.getFace(blockFace).name().toLowerCase());
- }
- }
-
- @Override
- public void paste(Set attributes, RedstoneWire blockData) {
- for (BlockFace blockFace : blockData.getAllowedFaces()) {
- for (RedstoneWire.Connection connection : RedstoneWire.Connection.values()) {
- if (attributes.contains(attribute + blockFace.name().toLowerCase() + " " + connection.name().toLowerCase())) {
- blockData.setFace(blockFace, connection);
- }
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RepeaterAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RepeaterAttribute.java
deleted file mode 100644
index 1f25d655..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RepeaterAttribute.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Repeater;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class RepeaterAttribute implements BlockAttribute {
-
- private String attribute1 = "§8-§7 delay ";
- private String attribute2 = "§8-§7 locked";
-
- @Override
- public Class type() {
- return Repeater.class;
- }
-
- @Override
- public void copy(List attributes, Repeater blockData) {
- attributes.add(attribute1 + blockData.getDelay());
- if (blockData.isLocked()) attributes.add(attribute2);
- }
-
- @Override
- public void paste(Set attributes, Repeater blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute1))
- .map(s -> s.replace(attribute1, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setDelay);
- blockData.setLocked(attributes.contains(attribute2));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RespawnAnchorAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RespawnAnchorAttribute.java
deleted file mode 100644
index 646a14d8..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/RespawnAnchorAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.RespawnAnchor;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class RespawnAnchorAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 charges ";
-
- @Override
- public Class type() {
- return RespawnAnchor.class;
- }
-
- @Override
- public void copy(List attributes, RespawnAnchor blockData) {
- attributes.add(attribute + blockData.getCharges());
- }
-
- @Override
- public void paste(Set attributes, RespawnAnchor blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setCharges);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SaplingAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SaplingAttribute.java
deleted file mode 100644
index 3a15fc35..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SaplingAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Sapling;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SaplingAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 stage ";
-
- @Override
- public Class type() {
- return Sapling.class;
- }
-
- @Override
- public void copy(List attributes, Sapling blockData) {
- attributes.add(attribute + blockData.getStage());
- }
-
- @Override
- public void paste(Set attributes, Sapling blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setStage);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ScaffoldingAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ScaffoldingAttribute.java
deleted file mode 100644
index 8da631d8..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/ScaffoldingAttribute.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Scaffolding;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class ScaffoldingAttribute implements BlockAttribute {
-
- private String attribute1 = "§8-§7 bottom";
- private String attribute2 = "§8-§7 distance ";
-
- @Override
- public Class type() {
- return Scaffolding.class;
- }
-
- @Override
- public void copy(List attributes, Scaffolding blockData) {
- if (blockData.isBottom()) attributes.add(attribute1);
- attributes.add(attribute2 + blockData.getDistance());
- }
-
- @Override
- public void paste(Set attributes, Scaffolding blockData) {
- blockData.setBottom(attributes.contains(attribute1));
- attributes.stream()
- .filter(s -> s.startsWith(attribute2))
- .map(s -> s.replace(attribute2, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setDistance);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SculkSensorAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SculkSensorAttribute.java
deleted file mode 100644
index 8f974f40..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SculkSensorAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.SculkSensor;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SculkSensorAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 phase ";
-
- @Override
- public Class type() {
- return SculkSensor.class;
- }
-
- @Override
- public void copy(List attributes, SculkSensor blockData) {
- attributes.add(attribute + blockData.getPhase());
- }
-
- @Override
- public void paste(Set attributes, SculkSensor blockData) {
- for (SculkSensor.Phase phase : SculkSensor.Phase.values()) {
- if (attributes.contains(attribute + phase)) {
- blockData.setPhase(phase);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SeaPickleAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SeaPickleAttribute.java
deleted file mode 100644
index 7b3ddf57..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SeaPickleAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.SeaPickle;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SeaPickleAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 pickles ";
-
- @Override
- public Class type() {
- return SeaPickle.class;
- }
-
- @Override
- public void copy(List attributes, SeaPickle blockData) {
- attributes.add(attribute + blockData.getPickles());
- }
-
- @Override
- public void paste(Set attributes, SeaPickle blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setPickles);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SlabAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SlabAttribute.java
deleted file mode 100644
index eca81bf4..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SlabAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Slab;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SlabAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 type ";
-
- @Override
- public Class type() {
- return Slab.class;
- }
-
- @Override
- public void copy(List attributes, Slab blockData) {
- attributes.add(attribute + blockData.getType());
- }
-
- @Override
- public void paste(Set attributes, Slab blockData) {
- for (Slab.Type type : Slab.Type.values()) {
- if (attributes.contains(attribute + type)) {
- blockData.setType(type);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SnowAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SnowAttribute.java
deleted file mode 100644
index 935e975d..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/SnowAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Snow;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class SnowAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 layers ";
-
- @Override
- public Class type() {
- return Snow.class;
- }
-
- @Override
- public void copy(List attributes, Snow blockData) {
- attributes.add(attribute + blockData.getLayers());
- }
-
- @Override
- public void paste(Set attributes, Snow blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute))
- .map(s -> s.replace(attribute, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setLayers);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StairsAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StairsAttribute.java
deleted file mode 100644
index 3686b506..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StairsAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Stairs;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class StairsAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 shape ";
-
- @Override
- public Class type() {
- return Stairs.class;
- }
-
- @Override
- public void copy(List attributes, Stairs blockData) {
- attributes.add(attribute + blockData.getShape().name().toLowerCase());
- }
-
- @Override
- public void paste(Set attributes, Stairs blockData) {
- for (Stairs.Shape shape : Stairs.Shape.values()) {
- if (attributes.contains(attribute + shape.name().toLowerCase())) {
- blockData.setShape(shape);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StructureBlockAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StructureBlockAttribute.java
deleted file mode 100644
index 34055ce9..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/StructureBlockAttribute.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.StructureBlock;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class StructureBlockAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 mode ";
-
- @Override
- public Class type() {
- return StructureBlock.class;
- }
-
- @Override
- public void copy(List attributes, StructureBlock blockData) {
- attributes.add(attribute + blockData.getMode().name());
- }
-
- @Override
- public void paste(Set attributes, StructureBlock blockData) {
- for (StructureBlock.Mode mode : StructureBlock.Mode.values()) {
- if (attributes.contains(attribute + mode.name())) {
- blockData.setMode(mode);
- return;
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TNTAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TNTAttribute.java
deleted file mode 100644
index 14192eac..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TNTAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.TNT;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class TNTAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 unstable";
-
- @Override
- public Class type() {
- return TNT.class;
- }
-
- @Override
- public void copy(List attributes, TNT blockData) {
- if (blockData.isUnstable()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, TNT blockData) {
- blockData.setUnstable(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TripwireAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TripwireAttribute.java
deleted file mode 100644
index 27257568..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TripwireAttribute.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.Tripwire;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class TripwireAttribute implements BlockAttribute {
-
- private String attribute = "§8-§7 disarmed";
-
- @Override
- public Class type() {
- return Tripwire.class;
- }
-
- @Override
- public void copy(List attributes, Tripwire blockData) {
- if (blockData.isDisarmed()) attributes.add(attribute);
- }
-
- @Override
- public void paste(Set attributes, Tripwire blockData) {
- blockData.setDisarmed(attributes.contains(attribute));
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TurtleEggAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TurtleEggAttribute.java
deleted file mode 100644
index 478d1f75..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/TurtleEggAttribute.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.data.type.TurtleEgg;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class TurtleEggAttribute implements BlockAttribute {
-
- private String attribute1 = "§8-§7 eggs ";
- private String attribute2 = "§8-§7 hatch ";
-
- @Override
- public Class type() {
- return TurtleEgg.class;
- }
-
- @Override
- public void copy(List attributes, TurtleEgg blockData) {
- attributes.add(attribute1 + blockData.getEggs());
- attributes.add(attribute2 + blockData.getHatch());
- }
-
- @Override
- public void paste(Set attributes, TurtleEgg blockData) {
- attributes.stream()
- .filter(s -> s.startsWith(attribute1))
- .map(s -> s.replace(attribute1, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setEggs);
- attributes.stream()
- .filter(s -> s.startsWith(attribute2))
- .map(s -> s.replace(attribute2, ""))
- .map(Integer::parseInt)
- .findFirst()
- .ifPresent(blockData::setHatch);
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/WallAttribute.java b/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/WallAttribute.java
deleted file mode 100644
index a72ed734..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/attributescopy/impl/type/WallAttribute.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.attributescopy.impl.type;
-
-import de.steamwar.bausystem.features.attributescopy.BlockAttribute;
-import de.steamwar.linkage.Linked;
-import org.bukkit.block.BlockFace;
-import org.bukkit.block.data.type.Wall;
-
-import java.util.List;
-import java.util.Set;
-
-@Linked
-public class WallAttribute implements BlockAttribute {
-
- private BlockFace[] faces = new BlockFace[] {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST};
-
- private String attribute1 = "§8-§7 up";
- private String attribute2 = "§8-§7 connected ";
-
- @Override
- public Class type() {
- return Wall.class;
- }
-
- @Override
- public void copy(List attributes, Wall blockData) {
- if (blockData.isUp()) attributes.add(attribute1);
- for (BlockFace face : faces) {
- if (blockData.getHeight(face) == Wall.Height.NONE) continue;
- attributes.add(attribute2 + face.name().toLowerCase() + " " + blockData.getHeight(face).name().toLowerCase());
- }
- }
-
- @Override
- public void paste(Set attributes, Wall blockData) {
- blockData.setUp(attributes.contains(attribute1));
- for (BlockFace face : faces) {
- for (Wall.Height height : Wall.Height.values()) {
- if (attributes.contains(attribute2 + face.name().toLowerCase() + " " + height.name().toLowerCase())) {
- blockData.setHeight(face, height);
- break;
- }
- }
- }
- }
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/AbstractDetonatorEntity.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/AbstractDetonatorEntity.java
deleted file mode 100644
index 1f1a5b8b..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/AbstractDetonatorEntity.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2021 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.detonator;
-
-import de.steamwar.bausystem.shared.AbstractEntity;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Player;
-
-public interface AbstractDetonatorEntity extends AbstractEntity {
-
- void display(Player player);
-
- boolean hide(Player player, boolean always);
-
- int getId();
-
- Entity getBukkitEntity();
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java
index c1ffd756..80d5b33b 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/Detonator.java
@@ -25,7 +25,8 @@ import de.steamwar.bausystem.configplayer.Config;
import de.steamwar.bausystem.features.autostart.AutostartListener;
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
import de.steamwar.bausystem.features.detonator.storage.ItemStorage;
-import de.steamwar.bausystem.utils.NMSWrapper;
+import de.steamwar.entity.REntityServer;
+import de.steamwar.entity.RFallingBlockEntity;
import lombok.experimental.UtilityClass;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@@ -44,7 +45,7 @@ import java.util.*;
@UtilityClass
public class Detonator {
- private static final Map> ENTITIES_MAP = new HashMap<>();
+ private static final Map ENTITIES_MAP = new HashMap<>();
private static final Vector HALF = new Vector(0.5, 0, 0.5);
public static boolean isDetonator(ItemStack itemStack) {
@@ -52,18 +53,24 @@ public class Detonator {
}
public static void showDetonator(Player p, List locs) {
- List entities = new LinkedList<>();
- locs.stream().map(Location::toVector).forEach(vector -> entities.add(NMSWrapper.impl.constructDetonator(p.getWorld(), vector.add(HALF))));
- entities.forEach(abstractDetonatorEntity -> abstractDetonatorEntity.display(p));
- ENTITIES_MAP.putIfAbsent(p, entities);
+ if (ENTITIES_MAP.containsKey(p)) return;
+ REntityServer entities = new REntityServer();
+ entities.setCallback((player, rEntity, entityAction) -> {
+ Vector vector = new Vector(rEntity.getX(), rEntity.getY(), rEntity.getZ());
+ DetonatorListener.addLocationToDetonator(vector.toLocation(player.getWorld()).getBlock().getLocation(), player);
+ DetonatorListener.HAS_UPDATED.add(player);
+ });
+ entities.addPlayer(p);
+ ENTITIES_MAP.put(p, entities);
+
+ locs.forEach(location -> {
+ RFallingBlockEntity entity = new RFallingBlockEntity(entities, location.clone().add(HALF), Material.RED_STAINED_GLASS);
+ entity.setNoGravity(true);
+ });
}
public static void hideDetonator(Player p) {
- ENTITIES_MAP.remove(p).forEach(abstractDetonatorEntity -> abstractDetonatorEntity.hide(p, true));
- }
-
- public static List getDetoEntities(Player p) {
- return ENTITIES_MAP.getOrDefault(p, new ArrayList<>());
+ ENTITIES_MAP.remove(p).close();
}
public static boolean hasActiveDetonatorShow(Player p) {
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java
index 2e0cbf38..be8e8ce9 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/detonator/DetonatorListener.java
@@ -19,8 +19,6 @@
package de.steamwar.bausystem.features.detonator;
-import com.comphenix.tinyprotocol.Reflection;
-import com.comphenix.tinyprotocol.TinyProtocol;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.features.detonator.storage.DetonatorStorage;
@@ -38,39 +36,14 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
@Linked
public class DetonatorListener implements Listener {
- public static final Class> useEntity = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseEntity");
- private static final Reflection.FieldAccessor entityIdFieldAccessor = Reflection.getField(useEntity, int.class, 0);
+ static final Set HAS_UPDATED = new HashSet<>();
- private static final Set HAS_UPDATED = new HashSet<>();
-
- public DetonatorListener() {
- TinyProtocol.instance.addFilter(useEntity, (player, o) -> {
- List entities = Detonator.getDetoEntities(player);
- if (entities.isEmpty()) {
- return o;
- }
-
- int entityId = entityIdFieldAccessor.get(o);
- AbstractDetonatorEntity entity = entities.stream().filter(abstractDetonatorEntity -> abstractDetonatorEntity.getId() == entityId).findFirst().orElse(null);
-
- if (entity == null) {
- return o;
- }
-
- Location location = entity.getBukkitEntity().getLocation().getBlock().getLocation();
- addLocationToDetonator(location, player);
- HAS_UPDATED.add(player);
- return null;
- });
- }
-
- private static void addLocationToDetonator(Location location, Player p) {
+ static void addLocationToDetonator(Location location, Player p) {
Detoblock detoblock = Detonator.getBlock(location.getBlock());
if (detoblock == Detoblock.INVALID) {
SWUtils.sendToActionbar(p, BauSystem.MESSAGE.parse("DETONATOR_INVALID_BLOCK", p));
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java
index 168b1893..e97f4a30 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/killchecker/KillcheckerVisualizer.java
@@ -33,7 +33,10 @@ import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
public class KillcheckerVisualizer {
@@ -207,7 +210,7 @@ public class KillcheckerVisualizer {
public boolean hide(Player player) {
rEntityServer.removePlayer(player);
players.remove(player);
- if (player.isEmpty()) {
+ if (players.isEmpty()) {
rEntityServer.close();
return true;
}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/AbstractSimulatorEntity.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/AbstractSimulatorEntity.java
deleted file mode 100644
index faf81588..00000000
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/AbstractSimulatorEntity.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This file is a part of the SteamWar software.
- *
- * Copyright (C) 2022 SteamWar.de-Serverteam
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-package de.steamwar.bausystem.features.simulator;
-
-import de.steamwar.bausystem.shared.AbstractEntity;
-import org.bukkit.entity.Entity;
-import org.bukkit.entity.Player;
-import org.bukkit.util.Vector;
-
-public interface AbstractSimulatorEntity extends AbstractEntity {
-
- void display(Player player);
-
- void setPosition(Vector position);
-
- boolean hide(Player player, boolean always);
-
- int getId();
-
- Entity getBukkitEntity();
-}
diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java
index fcc11942..caa3af54 100644
--- a/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java
+++ b/BauSystem_Main/src/de/steamwar/bausystem/features/simulator/SimulatorCursor.java
@@ -20,13 +20,17 @@
package de.steamwar.bausystem.features.simulator;
import de.steamwar.bausystem.BauSystem;
-import de.steamwar.bausystem.features.simulator.show.SimulatorEntityShowMode;
import de.steamwar.bausystem.features.simulator.tnt.SimulatorElement;
+import de.steamwar.bausystem.utils.RayTraceUtils;
+import de.steamwar.entity.REntityServer;
+import de.steamwar.entity.RFallingBlockEntity;
import lombok.experimental.UtilityClass;
import net.md_5.bungee.api.ChatMessageType;
+import org.bukkit.Bukkit;
+import org.bukkit.Material;
+import org.bukkit.World;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
-import org.bukkit.util.RayTraceResult;
import org.bukkit.util.Vector;
import java.util.HashMap;
@@ -36,13 +40,14 @@ import java.util.Map;
@UtilityClass
public class SimulatorCursor {
- private Map cursors = new HashMap<>();
+ private static final World WORLD = Bukkit.getWorlds().get(0);
+ private Map