From 200d47ab093e6c7a345bf86ff348e2eee95d5a76 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 5 Nov 2012 11:32:40 -0800 Subject: [PATCH] Added physics.vine-like-rope-ladders to make ladders work like vines. --- .../com/sk89q/worldguard/bukkit/WorldConfiguration.java | 2 ++ .../sk89q/worldguard/bukkit/WorldGuardBlockListener.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java index de3b4ad4..64b0bd32 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldConfiguration.java @@ -81,6 +81,7 @@ public class WorldConfiguration { public boolean redstoneSponges; public boolean noPhysicsGravel; public boolean noPhysicsSand; + public boolean ropeLadders; public boolean allowPortalAnywhere; public Set preventWaterDamage; public boolean blockLighter; @@ -312,6 +313,7 @@ private void loadConfiguration() { noPhysicsGravel = getBoolean("physics.no-physics-gravel", false); noPhysicsSand = getBoolean("physics.no-physics-sand", false); + ropeLadders = getBoolean("physics.vine-like-rope-ladders", false); allowPortalAnywhere = getBoolean("physics.allow-portal-anywhere", false); preventWaterDamage = new HashSet(getIntList("physics.disable-water-damage-blocks", null)); diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java index 85b25b8d..ba5de764 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardBlockListener.java @@ -472,6 +472,13 @@ public void onBlockPhysics(BlockPhysicsEvent event) { event.setCancelled(true); return; } + + if (id == BlockID.LADDER && wcfg.ropeLadders) { + if (event.getBlock().getRelative(0, 1, 0).getType() == Material.LADDER) { + event.setCancelled(true); + return; + } + } } /*