[Version 0.7.3.3]

- Added "ignoreEntrance" option to not check entrance to gate on
integrity check (Workaround for snowmen until event is pulled)
This commit is contained in:
Steven Scott 2011-12-12 22:01:52 -08:00
parent 48cb69447d
commit 89491a5c26
5 changed files with 27 additions and 4 deletions

3
README
View File

@ -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. maxgates - If non-zero, will define the maximum amount of gates allowed on any network.
lang - The language to use (Included languages: en, de) lang - The language to use (Included languages: en, de)
destMemory - Whether to set the first destination as the last used destination for all gates 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 debug - Whether to show massive debug output
permdebug - Whether to show massive permission debug output permdebug - Whether to show massive permission debug output
@ -197,6 +198,8 @@ createConflict=Gate conflicts with existing gate
============= =============
Changes 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] [Version 0.7.3.2]
- Actually fixed "><" issue with destMemory - Actually fixed "><" issue with destMemory
[Version 0.7.3.1] [Version 0.7.3.1]

View File

@ -15,6 +15,8 @@ maxgates: 0
lang: en lang: en
# Whether to remember the cursor location between uses # Whether to remember the cursor location between uses
destMemory: false destMemory: false
# Ignore the entrance blocks of a gate when checking. Used to work around snowmen
ignoreEntrance: false
# Stargate economy options # Stargate economy options

View File

@ -227,6 +227,9 @@ public class Gate {
int id = types.get(layout[y][x]); int id = types.get(layout[y][x]);
if (id == ENTRANCE || id == EXIT) { 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(); int type = topleft.modRelative(x, y, 0, modX, 1, modZ).getType();
if (type != portalBlockClosed && type != portalBlockOpen) { if (type != portalBlockClosed && type != portalBlockOpen) {
// Special case for water gates // Special case for water gates

View File

@ -84,6 +84,9 @@ public class Stargate extends JavaPlugin {
private static int openTime = 10; private static int openTime = 10;
public static boolean destMemory = false; public static boolean destMemory = false;
// Temp workaround for snowmen, don't check gate entrance
public static boolean ignoreEntrance = false;
// Used for debug // Used for debug
public static boolean debug = false; public static boolean debug = false;
public static boolean permDebug = 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.BLOCK_BREAK, blockListener, Priority.Normal, this);
pm.registerEvent(Event.Type.SIGN_CHANGE, 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.VEHICLE_MOVE, vehicleListener, Priority.Normal, this);
pm.registerEvent(Event.Type.WORLD_LOAD, worldListener, Priority.Normal, this); pm.registerEvent(Event.Type.WORLD_LOAD, worldListener, Priority.Normal, this);
pm.registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, 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_DAMAGE, entityListener, Priority.Normal, this);
//pm.registerEvent(Event.Type.ENTITY_COMBUST, 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"); maxGates = newConfig.getInt("maxgates");
langName = newConfig.getString("lang"); langName = newConfig.getString("lang");
destMemory = newConfig.getBoolean("destMemory"); destMemory = newConfig.getBoolean("destMemory");
ignoreEntrance = newConfig.getBoolean("ignoreEntrance");
// Debug // Debug
debug = newConfig.getBoolean("debug"); debug = newConfig.getBoolean("debug");
permDebug = newConfig.getBoolean("permdebug"); permDebug = newConfig.getBoolean("permdebug");
@ -882,9 +889,8 @@ public class Stargate extends JavaPlugin {
@Override @Override
public void onBlockPhysics(BlockPhysicsEvent event) { public void onBlockPhysics(BlockPhysicsEvent event) {
Block block = event.getBlock(); Block block = event.getBlock();
if (block.getType() == Material.PORTAL) { Portal portal = Portal.getByEntrance(block);
event.setCancelled((Portal.getByEntrance(block) != null)); if (portal != null) event.setCancelled(true);
}
} }
@Override @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 // Going to leave this commented out until they fix EntityDamagebyBlock
/* /*
@Override @Override

View File

@ -1,6 +1,6 @@
name: Stargate name: Stargate
main: net.TheDgtl.Stargate.Stargate main: net.TheDgtl.Stargate.Stargate
version: 0.7.3.2 version: 0.7.3.3
description: Stargate mod for Bukkit description: Stargate mod for Bukkit
author: Drakia author: Drakia
website: http://www.thedgtl.net website: http://www.thedgtl.net