--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java 2011/07/16 11:16:09 1579 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java 2011/09/27 18:27:54 1604 @@ -18,8 +18,8 @@ private Location blocks[][]; // [width][height] - [0][0] == leftUpper - - private int material; + private int material[][]; + private byte data[][]; private int direction; @@ -37,7 +37,6 @@ this.owner = owner; - blocks = new Location[width][height]; direction = sign.getData() - 2; @@ -58,7 +57,7 @@ - material = leftUpper.getBlock().getTypeId(); + //material = leftUpper.getBlock().getTypeId(); loadBlocks(); @@ -74,6 +73,8 @@ } +/* + @Deprecated public Door(String input, Server server) { String parts[] = input.split(":"); @@ -81,20 +82,30 @@ leftUpper = new Location(w, Integer.parseInt(parts[1]), Integer.parseInt(parts[2]), Integer.parseInt(parts[3]) ); direction = Integer.parseInt( parts[4] ); - material = Integer.parseInt( parts[5] ); + //material = Integer.parseInt( parts[5] ); width = Integer.parseInt( parts[6] ); height = Integer.parseInt( parts[7] ); owner = parts[8]; - - blocks = new Location[width][height]; loadBlocks(); + }*/ + + public Door(Location loc, int direction, int width, int height, String owner) { + leftUpper = loc; + this.direction = direction; + this.width = width; + this.height = height; + this.owner = owner; + + loadBlocks(); } + + public void powerChange(World world, int oldCurrent, int newCurrent ) { - if (newCurrent != 0 && isPowered() == true) { + if (isPowered() == true) { open(); } else { close(); @@ -104,7 +115,9 @@ public boolean isPowered() { for (int w=0; w map) { @@ -195,7 +214,7 @@ public void close() { for (int w=0; w