Fixed old LiftSign class
This commit is contained in:
parent
29eee7bf9d
commit
d9679539de
3 changed files with 14 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
*.iml
|
||||
.idea
|
||||
dependency-reduced-pom.xml
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue