From d9679539defb188380472d62da73e72ecde10744 Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Thu, 30 Jan 2020 12:57:42 +0100 Subject: [PATCH] Fixed old LiftSign class --- .gitignore | 1 + .../SBDeveloper/V10Lift/API/Objects/LiftSign.java | 13 +++++++++---- .../java/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java | 8 ++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 4a60582..1fe2c2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.iml .idea +dependency-reduced-pom.xml \ No newline at end of file diff --git a/src/main/java/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java b/src/main/java/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java index fcb2091..232321a 100644 --- a/src/main/java/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java +++ b/src/main/java/nl/SBDeveloper/V10Lift/API/Objects/LiftSign.java @@ -2,14 +2,19 @@ package nl.SBDeveloper.V10Lift.API.Objects; import lombok.Getter; import lombok.Setter; -import org.bukkit.Location; @Getter @Setter public class LiftSign { - private LiftBlock block; + private String world; + private int x; + private int z; + private int y; private String oldText; - public LiftSign(Location loc) { - block = new LiftBlock(loc); + public LiftSign(String world, int x, int y, int z) { + this.world = world; + this.x = x; + this.y = y; + this.z = z; } } diff --git a/src/main/java/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java b/src/main/java/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java index 1a9e769..be227d1 100644 --- a/src/main/java/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java +++ b/src/main/java/nl/SBDeveloper/V10Lift/API/V10LiftAPI.java @@ -292,7 +292,7 @@ public class V10LiftAPI { } //Update sign - Block block = Objects.requireNonNull(Bukkit.getWorld(ls.getBlock().getWorld()), "World is null at setDefective").getBlockAt(ls.getBlock().getX(), ls.getBlock().getY(), ls.getBlock().getZ()); + Block block = Objects.requireNonNull(Bukkit.getWorld(ls.getWorld()), "World is null at setDefective").getBlockAt(ls.getX(), ls.getY(), ls.getZ()); BlockState bs = block.getState(); if (!(bs instanceof Sign)) { Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(block.getLocation())); @@ -322,7 +322,7 @@ public class V10LiftAPI { Sign s; while (liter.hasNext()) { ls = liter.next(); - bs = Objects.requireNonNull(Bukkit.getWorld(ls.getBlock().getWorld()), "World is null at setDefective").getBlockAt(ls.getBlock().getX(), ls.getBlock().getY(), ls.getBlock().getZ()).getState(); + bs = Objects.requireNonNull(Bukkit.getWorld(ls.getWorld()), "World is null at setDefective").getBlockAt(ls.getX(), ls.getY(), ls.getZ()).getState(); if (!(bs instanceof Sign)) { Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation())); liter.remove(); @@ -406,7 +406,7 @@ public class V10LiftAPI { while (liter.hasNext()) { LiftSign ls = liter.next(); - bs = Objects.requireNonNull(Bukkit.getWorld(ls.getBlock().getWorld()), "World is null at setOffline").getBlockAt(ls.getBlock().getX(), ls.getBlock().getY(), ls.getBlock().getZ()).getState(); + bs = Objects.requireNonNull(Bukkit.getWorld(ls.getWorld()), "World is null at setOffline").getBlockAt(ls.getX(), ls.getY(), ls.getZ()).getState(); if (!(bs instanceof Sign)) { Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation())); liter.remove(); @@ -431,7 +431,7 @@ public class V10LiftAPI { while (liter.hasNext()) { LiftSign ls = liter.next(); - bs = Objects.requireNonNull(Bukkit.getWorld(ls.getBlock().getWorld()), "World is null at setOffline").getBlockAt(ls.getBlock().getX(), ls.getBlock().getY(), ls.getBlock().getZ()).getState(); + bs = Objects.requireNonNull(Bukkit.getWorld(ls.getWorld()), "World is null at setOffline").getBlockAt(ls.getX(), ls.getY(), ls.getZ()).getState(); if (!(bs instanceof Sign)) { Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation())); liter.remove();