From f5049ecdfb9046837948714db3f2e8fd82ee3d5d Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Wed, 16 May 2012 22:45:40 +0200 Subject: [PATCH] initial values for attributes of base gate --- src/org/mcteam/ancientgates/BaseGate.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/org/mcteam/ancientgates/BaseGate.java b/src/org/mcteam/ancientgates/BaseGate.java index ee51f90..b3cf2c2 100644 --- a/src/org/mcteam/ancientgates/BaseGate.java +++ b/src/org/mcteam/ancientgates/BaseGate.java @@ -16,12 +16,12 @@ public abstract class BaseGate * ATTRIBUTES */ protected Location location; /* saving both location and gateBlockLocations is redundant but makes it easy to allow players to reshape gates */ - protected Set gateBlockLocations; /* Locations of the blocks inside the gate */ + protected Set gateBlockLocations = new HashSet(); /* Locations of the blocks inside the gate */ protected Location exit; - protected boolean isHidden; - protected boolean isOpen; + protected boolean isHidden = false; + protected boolean isOpen = false; /* @@ -131,7 +131,7 @@ public abstract class BaseGate protected void emptyGate() { for (Location l : gateBlockLocations) { - if (l != null && l.getBlock().getType() == Material.PORTAL) { + if (l.getBlock().getType() == Material.PORTAL) { l.getBlock().setType(Material.AIR); } } @@ -162,7 +162,7 @@ public abstract class BaseGate /** * Checks if valus attributes do add up; will close gate on wrong values. */ - protected void validate() + public void validate() { if (!isOpen) { return;