Fixed BlockState issues

This commit is contained in:
stijnb1234 2020-02-02 13:01:58 +01:00
parent f24b35a2df
commit 52758e18a1
2 changed files with 9 additions and 9 deletions

View file

@ -184,9 +184,9 @@ 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();
state.setType(lb.getMat());
state.setType(lib.getMat());
if (!XMaterial.isNewVersion()) {
state.setRawData(lb.getData());
state.setRawData(lib.getData());
}
state.update(true);
lb = lift.getBlocks().first();
@ -224,9 +224,9 @@ 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();
state.setType(lb.getMat());
state.setType(lib.getMat());
if (!XMaterial.isNewVersion()) {
state.setRawData(lb.getData());
state.setRawData(lib.getData());
}
state.update(true);
lift.getBlocks().add(lib);
@ -309,9 +309,9 @@ public class MoveLift implements Runnable {
y = lib.getY();
block = world.getBlockAt(lib.getX(), lib.getY(), lib.getZ());
BlockState state = block.getState();
state.setType(lb.getMat());
state.setType(lib.getMat());
if (!XMaterial.isNewVersion()) {
state.setRawData(lb.getData());
state.setRawData(lib.getData());
}
state.update(true);
}
@ -329,9 +329,9 @@ 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();
state.setType(lb.getMat());
state.setType(lib.getMat());
if (!XMaterial.isNewVersion()) {
state.setRawData(lb.getData());
state.setRawData(lib.getData());
}
state.update(true);
lift.getBlocks().add(lib);

View file

@ -38,7 +38,7 @@ public class PlayerInteractListener implements Listener {
if (action == Action.RIGHT_CLICK_BLOCK
&& e.getHand() != EquipmentSlot.OFF_HAND
&& (button.toString().contains("_BUTTON") || button == XMaterial.LEVER.parseMaterial())) {
&& (button.toString().contains("BUTTON") || button == XMaterial.LEVER.parseMaterial())) {
String world = block.getWorld().getName();
int x = block.getX();
int y = block.getY();