Portal rotation code fixed and end portal block

This commit is contained in:
Sekwah 2018-08-27 00:36:51 +01:00
parent ae677607a1
commit e37de65fd3
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.42
version: 0.0.45
author: sekwah41
description: An advanced portals plugin for bukkit.
api-version: 1.13

View File

@ -258,13 +258,17 @@ public class Listeners implements Listener {
} else if (checkItemForName(event.getItem()) && event.getItem().getItemMeta().getDisplayName().equals("\u00A75Portal Block Placer") &&
event.getAction() == Action.LEFT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.NETHER_PORTAL) {
BlockData block = event.getClickedBlock().getBlockData();
if(block instanceof Orientable) {
Orientable rotatable = (Orientable) block;
System.out.println(rotatable.getAxis());
if (rotatable.getAxis() == Axis.X) {
rotatable.setAxis(Axis.Z);
} else {
rotatable.setAxis(Axis.X);
}
event.getClickedBlock().setBlockData(rotatable);
}
event.setCancelled(true);
}