From 70b1af39e83175b08642884d843c667e375d6f5d Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Sun, 16 Feb 2020 09:19:31 +0100 Subject: [PATCH] Possibly fixes #25 --- .../nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java | 2 +- .../nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java | 6 ++++++ src/main/lombok/nl/SBDeveloper/V10Lift/V10LiftPlugin.java | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java index 09abc12..0d87e26 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Objects/LiftBlock.java @@ -19,7 +19,7 @@ public class LiftBlock implements Comparable { @Getter private int z; //Only used for cabine blocks, because those need caching! - @Getter private Material mat; + @Getter @Setter private Material mat; @Getter private byte data; @Getter private BlockFace face; @Getter private String bisected; diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java index 7f6bd81..c9b3d0e 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/API/Runnables/MoveLift.java @@ -197,6 +197,7 @@ public class MoveLift implements Runnable { lib.setY(lib.getY() + 1); block = Objects.requireNonNull(Bukkit.getWorld(lib.getWorld()), "World is null at MoveLift").getBlockAt(lib.getX(), lib.getY(), lib.getZ()); BlockState state = block.getState(); + if (lib.getMat() == null) lib.setMat(Material.AIR); state.setType(lib.getMat()); if (!XMaterial.isNewVersion()) { state.setRawData(lib.getData()); @@ -241,6 +242,7 @@ public class MoveLift implements Runnable { for (LiftBlock lib : tb) { block = Objects.requireNonNull(Bukkit.getWorld(lib.getWorld()), "World is null at MoveLift").getBlockAt(lib.getX(), lib.getY(), lib.getZ()); BlockState state = block.getState(); + if (lib.getMat() == null) lib.setMat(Material.AIR); state.setType(lib.getMat()); if (!XMaterial.isNewVersion()) { state.setRawData(lib.getData()); @@ -330,6 +332,7 @@ public class MoveLift implements Runnable { y = lib.getY(); block = world.getBlockAt(lib.getX(), lib.getY(), lib.getZ()); BlockState state = block.getState(); + if (lib.getMat() == null) lib.setMat(Material.AIR); state.setType(lib.getMat()); if (!XMaterial.isNewVersion()) { state.setRawData(lib.getData()); @@ -354,6 +357,7 @@ public class MoveLift implements Runnable { for (LiftBlock lib : tb) { block = Objects.requireNonNull(Bukkit.getWorld(lib.getWorld()), "World is null at MoveLift").getBlockAt(lib.getX(), lib.getY(), lib.getZ()); BlockState state = block.getState(); + if (lib.getMat() == null) lib.setMat(Material.AIR); state.setType(lib.getMat()); if (!XMaterial.isNewVersion()) { state.setRawData(lib.getData()); @@ -411,6 +415,7 @@ public class MoveLift implements Runnable { quiter.remove(); rope.setCurrently(rope.getCurrently() - 1); block = world.getBlockAt(rope.getX(), rope.getCurrently(), rope.getZ()); + if (rope.getType() == null) rope.setType(Material.AIR); block.setType(rope.getType()); if (XMaterial.isNewVersion()) { DirectionUtil.setDirection(block, rope.getFace()); @@ -426,6 +431,7 @@ public class MoveLift implements Runnable { world = Objects.requireNonNull(Bukkit.getWorld(rope.getWorld()), "World is null at MoveLift"); rope.setCurrently(rope.getCurrently() - 1); block = world.getBlockAt(rope.getX(), rope.getCurrently(), rope.getZ()); + if (rope.getType() == null) rope.setType(Material.AIR); block.setType(rope.getType()); if (XMaterial.isNewVersion()) { DirectionUtil.setDirection(block, rope.getFace()); diff --git a/src/main/lombok/nl/SBDeveloper/V10Lift/V10LiftPlugin.java b/src/main/lombok/nl/SBDeveloper/V10Lift/V10LiftPlugin.java index fc31318..4db5f9d 100644 --- a/src/main/lombok/nl/SBDeveloper/V10Lift/V10LiftPlugin.java +++ b/src/main/lombok/nl/SBDeveloper/V10Lift/V10LiftPlugin.java @@ -37,9 +37,6 @@ public class V10LiftPlugin extends JavaPlugin { config = new YamlFile("config"); config.loadDefaults(); - //Disable the start/stop logging op HikariCP - Logger.getLogger("com.zaxxer.hikari.HikariDataSource").setLevel(Level.OFF); - //Load the database dbManager = new DBManager("data"); try {