mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-12-01 06:53:26 +01:00
#124 Portal rotation code fixed and end portal block
This commit is contained in:
parent
ae677607a1
commit
6a97eb46c8
@ -1,6 +1,6 @@
|
|||||||
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
||||||
name: AdvancedPortals
|
name: AdvancedPortals
|
||||||
version: 0.0.42
|
version: 0.0.45
|
||||||
author: sekwah41
|
author: sekwah41
|
||||||
description: An advanced portals plugin for bukkit.
|
description: An advanced portals plugin for bukkit.
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
|
@ -258,13 +258,17 @@ public class Listeners implements Listener {
|
|||||||
} else if (checkItemForName(event.getItem()) && event.getItem().getItemMeta().getDisplayName().equals("\u00A75Portal Block Placer") &&
|
} 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) {
|
event.getAction() == Action.LEFT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.NETHER_PORTAL) {
|
||||||
BlockData block = event.getClickedBlock().getBlockData();
|
BlockData block = event.getClickedBlock().getBlockData();
|
||||||
|
|
||||||
|
|
||||||
if(block instanceof Orientable) {
|
if(block instanceof Orientable) {
|
||||||
Orientable rotatable = (Orientable) block;
|
Orientable rotatable = (Orientable) block;
|
||||||
|
System.out.println(rotatable.getAxis());
|
||||||
if (rotatable.getAxis() == Axis.X) {
|
if (rotatable.getAxis() == Axis.X) {
|
||||||
rotatable.setAxis(Axis.Z);
|
rotatable.setAxis(Axis.Z);
|
||||||
} else {
|
} else {
|
||||||
rotatable.setAxis(Axis.X);
|
rotatable.setAxis(Axis.X);
|
||||||
}
|
}
|
||||||
|
event.getClickedBlock().setBlockData(rotatable);
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user