mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-25 03:55:23 +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
|
||||
name: AdvancedPortals
|
||||
version: 0.0.42
|
||||
version: 0.0.45
|
||||
author: sekwah41
|
||||
description: An advanced portals plugin for bukkit.
|
||||
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") &&
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user