From b8adf7fb0877671bb528e4c38d21ee9ea363b66f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 28 Sep 2022 18:57:52 +0200 Subject: [PATCH] Update BlockBoundingBox impls Signed-off-by: yoyosource --- .../slaves/laufbau/BlockBoundingBox.java | 3 +- .../slaves/laufbau/LaufbauLazyInit.java | 35 ------------------- .../boundingboxes/AmethystBoundingBox.java | 10 ++++-- .../boundingboxes/AzaleaBoundingBox.java | 10 ++++-- .../boundingboxes/BellBoundingBox.java | 8 +++-- .../BrewingStandBoundingBox.java | 8 +++-- .../boundingboxes/CandleBoundingBox.java | 10 ++++-- .../boundingboxes/ChainBoundingBox.java | 10 ++++-- .../boundingboxes/ChorusPlantBoundingBox.java | 8 +++-- .../boundingboxes/DragonEggBoundingBox.java | 10 ++++-- .../boundingboxes/DripLeafBoundingBox.java | 10 ++++-- .../boundingboxes/FencesBoundingBox.java | 8 +++-- .../boundingboxes/GrindstoneBoundingBox.java | 8 +++-- .../boundingboxes/HopperBoundingBox.java | 8 +++-- .../boundingboxes/IronBarBoundingBox.java | 8 +++-- .../boundingboxes/LanternBoundingBox.java | 8 +++-- .../boundingboxes/LecternBoundingBox.java | 8 +++-- .../boundingboxes/StairBoundingBox.java | 8 +++-- .../boundingboxes/WallBoundingBox.java | 8 +++-- 19 files changed, 99 insertions(+), 87 deletions(-) delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauLazyInit.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java index 8201d369..deeb0196 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/BlockBoundingBox.java @@ -19,6 +19,7 @@ package de.steamwar.bausystem.features.slaves.laufbau; +import de.steamwar.bausystem.linkage.LinkageUtils; import de.steamwar.bausystem.utils.NMSWrapper; import de.steamwar.core.Core; import de.steamwar.inventory.SWItem; @@ -264,7 +265,7 @@ public class BlockBoundingBox { eastTrapDoor.setOpen(true); addPixel(eastTrapDoor, 0, 0, 0, 3, 16, 16, createItem("LAUFBAU_BLOCK_IRON_TRAPDOOR", Material.IRON_TRAPDOOR, "LAUFBAU_FACING_EAST", "LAUFBAU_OPEN")); - LaufbauLazyInit.init(); + LinkageUtils.linkBoundingBox(); } private static void addPixel(BlockData blockData, double xPixel, double yPixel, double zPixel, double dxPixel, double dyPixel, double dzPixel, SWItem swItem) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauLazyInit.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauLazyInit.java deleted file mode 100644 index d81655a1..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/LaufbauLazyInit.java +++ /dev/null @@ -1,35 +0,0 @@ -package de.steamwar.bausystem.features.slaves.laufbau; - -import de.steamwar.bausystem.features.slaves.laufbau.boundingboxes.*; -import de.steamwar.core.Core; -import lombok.experimental.UtilityClass; - -@UtilityClass -public class LaufbauLazyInit { - - public static void init() { - } - - static { - new BellBoundingBox().enable(); - new BrewingStandBoundingBox().enable(); - new ChorusPlantBoundingBox().enable(); - new FencesBoundingBox().enable(); - new GrindstoneBoundingBox().enable(); - new HopperBoundingBox().enable(); - new IronBarBoundingBox().enable(); - new LanternBoundingBox().enable(); - new StairBoundingBox().enable(); - new WallBoundingBox().enable(); - new LecternBoundingBox().enable(); - - if (Core.getVersion() >= 19) { - new AmethystBoundingBox().enable(); - new ChainBoundingBox().enable(); - new DripLeafBoundingBox().enable(); - new DragonEggBoundingBox().enable(); - new AzaleaBoundingBox().enable(); - new CandleBoundingBox().enable(); - } - } -} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AmethystBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AmethystBoundingBox.java index 824c103f..5eec07ca 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AmethystBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AmethystBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.AmethystCluster; @@ -32,10 +34,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class AmethystBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class AmethystBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { floorSmallAmethystBud(); ceilingSmallAmethystBud(); northSmallAmethystBud(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AzaleaBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AzaleaBoundingBox.java index f9ceda2d..8c0409da 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AzaleaBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/AzaleaBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Material; import org.bukkit.block.data.BlockData; @@ -31,10 +33,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class AzaleaBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class AzaleaBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { BlockData blockData = Material.FLOWERING_AZALEA.createBlockData(); List cuboidList = new ArrayList<>(); cuboidList.add(pixelCuboid(0, 8, 0, 16, 8, 16)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BellBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BellBoundingBox.java index 4b247104..b5fcbb41 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BellBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BellBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Bell; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class BellBoundingBox implements Enable { +@Linked +public class BellBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { ceilingBell(); floorNorthBell(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BrewingStandBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BrewingStandBoundingBox.java index 8e729de5..765bea3d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BrewingStandBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/BrewingStandBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.data.type.BrewingStand; @@ -31,10 +32,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class BrewingStandBoundingBox implements Enable { +@Linked +public class BrewingStandBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { BrewingStand brewingStand = (BrewingStand) Material.BREWING_STAND.createBlockData(); List cuboids = new ArrayList<>(); cuboids.add(pixelCuboid(1, 0, 1, 14, 2, 14)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/CandleBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/CandleBoundingBox.java index 9642ab32..4efaee96 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/CandleBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/CandleBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Material; import org.bukkit.block.data.Lightable; import org.bukkit.block.data.type.Candle; @@ -32,10 +34,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class CandleBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class CandleBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { caked(); single(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChainBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChainBoundingBox.java index bcc6032b..6dd79442 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChainBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChainBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Axis; import org.bukkit.Material; import org.bukkit.block.data.Orientable; @@ -32,10 +34,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class ChainBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class ChainBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { bottomTopChain(); northSouthChain(); eastWestChain(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChorusPlantBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChorusPlantBoundingBox.java index e39231ff..b169a455 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChorusPlantBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/ChorusPlantBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.MultipleFacing; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class ChorusPlantBoundingBox implements Enable { +@Linked +public class ChorusPlantBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { for (int nx = 0; nx < 2; nx++) { for (int ny = 0; ny < 2; ny++) { for (int nz = 0; nz < 2; nz++) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DragonEggBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DragonEggBoundingBox.java index ab3668ad..2bd6a6bb 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DragonEggBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DragonEggBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Material; import org.bukkit.block.data.BlockData; @@ -31,10 +33,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class DragonEggBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class DragonEggBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { BlockData blockData = Material.DRAGON_EGG.createBlockData(); List cuboidList = new ArrayList<>(); cuboidList.add(pixelCuboid(1, 0, 1, 14, 16, 14)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DripLeafBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DripLeafBoundingBox.java index 488476bb..30198624 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DripLeafBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/DripLeafBoundingBox.java @@ -20,8 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; +import de.steamwar.linkage.MinVersion; import org.bukkit.Material; import org.bukkit.block.data.type.BigDripleaf; @@ -31,10 +33,12 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class DripLeafBoundingBox implements Enable { +@Linked +@MinVersion(19) +public class DripLeafBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { tiltNone(); tiltPartial(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/FencesBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/FencesBoundingBox.java index 3873f923..213a2345 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/FencesBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/FencesBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Fence; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class FencesBoundingBox implements Enable { +@Linked +public class FencesBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { for (int nx = 0; nx < 2; nx++) { for (int nz = 0; nz < 2; nz++) { for (int px = 0; px < 2; px++) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/GrindstoneBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/GrindstoneBoundingBox.java index 088a97d6..52fa3557 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/GrindstoneBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/GrindstoneBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.FaceAttachable; @@ -33,10 +34,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class GrindstoneBoundingBox implements Enable { +@Linked +public class GrindstoneBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { floorNorthGrindstone(); floorEastGrindstone(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/HopperBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/HopperBoundingBox.java index 324cc016..19a095b3 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/HopperBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/HopperBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Hopper; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class HopperBoundingBox implements Enable { +@Linked +public class HopperBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { downHopper(); northHopper(); southHopper(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/IronBarBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/IronBarBoundingBox.java index f7a5147a..e275b7b1 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/IronBarBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/IronBarBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Fence; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class IronBarBoundingBox implements Enable { +@Linked +public class IronBarBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { for (int nx = 0; nx < 2; nx++) { for (int nz = 0; nz < 2; nz++) { for (int px = 0; px < 2; px++) { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LanternBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LanternBoundingBox.java index ff54c1c1..3bf275b4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LanternBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LanternBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.data.type.Lantern; @@ -31,10 +32,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class LanternBoundingBox implements Enable { +@Linked +public class LanternBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { lantern(); hangingLantern(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LecternBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LecternBoundingBox.java index aa886b36..563b9bc6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LecternBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/LecternBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.data.BlockData; @@ -31,10 +32,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class LecternBoundingBox implements Enable { +@Linked +public class LecternBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { BlockData blockData = Material.LECTERN.createBlockData(); List cuboidList = new ArrayList<>(); cuboidList.add(pixelCuboid(0, 0, 0, 16, 2, 16)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/StairBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/StairBoundingBox.java index d3729a7b..23807176 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/StairBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/StairBoundingBox.java @@ -20,8 +20,9 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Stairs; @@ -32,10 +33,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class StairBoundingBox implements Enable { +@Linked +public class StairBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { straightBottomNorthStair(); straightBottomSouthStair(); straightBottomEastStair(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/WallBoundingBox.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/WallBoundingBox.java index 20d02366..855fe9b8 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/WallBoundingBox.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/boundingboxes/WallBoundingBox.java @@ -20,9 +20,10 @@ package de.steamwar.bausystem.features.slaves.laufbau.boundingboxes; import de.steamwar.bausystem.features.slaves.laufbau.BlockBoundingBox; +import de.steamwar.bausystem.features.slaves.laufbau.BoundingBoxLoader; import de.steamwar.bausystem.features.slaves.laufbau.Cuboid; -import de.steamwar.bausystem.linkage.Enable; import de.steamwar.core.Core; +import de.steamwar.linkage.Linked; import org.bukkit.Material; import org.bukkit.block.BlockFace; import org.bukkit.block.data.type.Fence; @@ -34,10 +35,11 @@ import java.util.List; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.createItem; import static de.steamwar.bausystem.features.slaves.laufbau.LaufbauUtils.pixelCuboid; -public class WallBoundingBox implements Enable { +@Linked +public class WallBoundingBox implements BoundingBoxLoader { @Override - public void enable() { + public void load() { if (Core.getVersion() > 15) { v18(); } else {