diff --git a/README b/README index ba53e5d..4b9b636 100644 --- a/README +++ b/README @@ -155,6 +155,7 @@ toowner - Whether the money from gate-use goes to the owner or nobody maxgates - If non-zero, will define the maximum amount of gates allowed on any network. lang - The language to use (Included languages: en, de) destMemory - Whether to set the first destination as the last used destination for all gates +ignoreEntrance - Set this option to true to not check the entrance of a gate on startup. This is a workaround for snowmen breaking gates. debug - Whether to show massive debug output permdebug - Whether to show massive permission debug output @@ -197,6 +198,8 @@ createConflict=Gate conflicts with existing gate ============= Changes ============= +[Version 0.7.3.3] + - Added "ignoreEntrance" option to not check entrance to gate on integrity check (Workaround for snowmen until event is pulled) [Version 0.7.3.2] - Actually fixed "><" issue with destMemory [Version 0.7.3.1] diff --git a/src/config.yml b/src/config.yml index 558c0f2..28be59d 100644 --- a/src/config.yml +++ b/src/config.yml @@ -15,6 +15,8 @@ maxgates: 0 lang: en # Whether to remember the cursor location between uses destMemory: false +# Ignore the entrance blocks of a gate when checking. Used to work around snowmen +ignoreEntrance: false # Stargate economy options diff --git a/src/net/TheDgtl/Stargate/Gate.java b/src/net/TheDgtl/Stargate/Gate.java index f23570b..9a60d8a 100644 --- a/src/net/TheDgtl/Stargate/Gate.java +++ b/src/net/TheDgtl/Stargate/Gate.java @@ -227,6 +227,9 @@ public class Gate { int id = types.get(layout[y][x]); if (id == ENTRANCE || id == EXIT) { + // TODO: Remove once snowmanTrailEvent is added + if (Stargate.ignoreEntrance) continue; + int type = topleft.modRelative(x, y, 0, modX, 1, modZ).getType(); if (type != portalBlockClosed && type != portalBlockOpen) { // Special case for water gates diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 0c6e028..8d50449 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -84,6 +84,9 @@ public class Stargate extends JavaPlugin { private static int openTime = 10; public static boolean destMemory = false; + // Temp workaround for snowmen, don't check gate entrance + public static boolean ignoreEntrance = false; + // Used for debug public static boolean debug = false; public static boolean permDebug = false; @@ -134,11 +137,14 @@ public class Stargate extends JavaPlugin { pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Normal, this); pm.registerEvent(Event.Type.SIGN_CHANGE, blockListener, Priority.Normal, this); + pm.registerEvent(Event.Type.VEHICLE_MOVE, vehicleListener, Priority.Normal, this); pm.registerEvent(Event.Type.WORLD_LOAD, worldListener, Priority.Normal, this); pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Priority.Normal, this); + // TODO: Add when snowmanTrailEvent is pulled + //pm.registerEvent(Event.Type.SNOWMAN_TRAIL, entityListener, Priority.Normal, this); //pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Normal, this); //pm.registerEvent(Event.Type.ENTITY_COMBUST, entityListener, Priority.Normal, this); @@ -166,6 +172,7 @@ public class Stargate extends JavaPlugin { maxGates = newConfig.getInt("maxgates"); langName = newConfig.getString("lang"); destMemory = newConfig.getBoolean("destMemory"); + ignoreEntrance = newConfig.getBoolean("ignoreEntrance"); // Debug debug = newConfig.getBoolean("debug"); permDebug = newConfig.getBoolean("permdebug"); @@ -882,9 +889,8 @@ public class Stargate extends JavaPlugin { @Override public void onBlockPhysics(BlockPhysicsEvent event) { Block block = event.getBlock(); - if (block.getType() == Material.PORTAL) { - event.setCancelled((Portal.getByEntrance(block) != null)); - } + Portal portal = Portal.getByEntrance(block); + if (portal != null) event.setCancelled(true); } @Override @@ -924,6 +930,15 @@ public class Stargate extends JavaPlugin { } } } + // TODO: Uncomment when Bukkit pulls SnowmanTrailEvent + /* + @Override + public void onSnowmanTrail(SnowmanTrailEvent event) { + Portal p = Portal.getByEntrance(event.getBlock()); + if (p != null) event.setCancelled(true); + } + */ + // Going to leave this commented out until they fix EntityDamagebyBlock /* @Override diff --git a/src/plugin.yml b/src/plugin.yml index 397fce2..3c20aa5 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.7.3.2 +version: 0.7.3.3 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net