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
|
*.iml
|
||||||
.idea
|
.idea
|
||||||
|
dependency-reduced-pom.xml
|
|
@ -2,14 +2,19 @@ package nl.SBDeveloper.V10Lift.API.Objects;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.bukkit.Location;
|
|
||||||
|
|
||||||
@Getter @Setter
|
@Getter @Setter
|
||||||
public class LiftSign {
|
public class LiftSign {
|
||||||
private LiftBlock block;
|
private String world;
|
||||||
|
private int x;
|
||||||
|
private int z;
|
||||||
|
private int y;
|
||||||
private String oldText;
|
private String oldText;
|
||||||
|
|
||||||
public LiftSign(Location loc) {
|
public LiftSign(String world, int x, int y, int z) {
|
||||||
block = new LiftBlock(loc);
|
this.world = world;
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.z = z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,7 +292,7 @@ public class V10LiftAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update sign
|
//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();
|
BlockState bs = block.getState();
|
||||||
if (!(bs instanceof Sign)) {
|
if (!(bs instanceof Sign)) {
|
||||||
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(block.getLocation()));
|
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(block.getLocation()));
|
||||||
|
@ -322,7 +322,7 @@ public class V10LiftAPI {
|
||||||
Sign s;
|
Sign s;
|
||||||
while (liter.hasNext()) {
|
while (liter.hasNext()) {
|
||||||
ls = liter.next();
|
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)) {
|
if (!(bs instanceof Sign)) {
|
||||||
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
||||||
liter.remove();
|
liter.remove();
|
||||||
|
@ -406,7 +406,7 @@ public class V10LiftAPI {
|
||||||
|
|
||||||
while (liter.hasNext()) {
|
while (liter.hasNext()) {
|
||||||
LiftSign ls = liter.next();
|
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)) {
|
if (!(bs instanceof Sign)) {
|
||||||
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
||||||
liter.remove();
|
liter.remove();
|
||||||
|
@ -431,7 +431,7 @@ public class V10LiftAPI {
|
||||||
|
|
||||||
while (liter.hasNext()) {
|
while (liter.hasNext()) {
|
||||||
LiftSign ls = liter.next();
|
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)) {
|
if (!(bs instanceof Sign)) {
|
||||||
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
Bukkit.getLogger().severe("[V10Lift] Wrong sign removed at: " + LocationSerializer.serialize(bs.getBlock().getLocation()));
|
||||||
liter.remove();
|
liter.remove();
|
||||||
|
|
Loading…
Reference in a new issue