From 6a97eb46c837e6de4e0653a1e79605c1f5c71719 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Mon, 27 Aug 2018 00:36:51 +0100 Subject: [PATCH] #124 Portal rotation code fixed and end portal block --- out/production/resources/plugin.yml | 2 +- .../java/com/sekwah/advancedportals/listeners/Listeners.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/out/production/resources/plugin.yml b/out/production/resources/plugin.yml index 1b4decf2..4ba3c9aa 100644 --- a/out/production/resources/plugin.yml +++ b/out/production/resources/plugin.yml @@ -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 diff --git a/src/main/java/com/sekwah/advancedportals/listeners/Listeners.java b/src/main/java/com/sekwah/advancedportals/listeners/Listeners.java index 0cae7b0b..208d163e 100644 --- a/src/main/java/com/sekwah/advancedportals/listeners/Listeners.java +++ b/src/main/java/com/sekwah/advancedportals/listeners/Listeners.java @@ -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); }