/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1579 by torben, Sat Jul 16 11:16:09 2011 UTC revision 1580 by torben, Sun Jul 17 19:28:22 2011 UTC
# Line 94  class Door { Line 94  class Door {
94          }          }
95    
96          public void powerChange(World world, int oldCurrent, int newCurrent ) {          public void powerChange(World world, int oldCurrent, int newCurrent ) {
97                  if (newCurrent != 0 && isPowered() == true) {                  if (isPowered() == true) {
98                          open();                          open();
99                  } else {                  } else {
100                          close();                          close();
# Line 104  class Door { Line 104  class Door {
104          public boolean isPowered() {          public boolean isPowered() {
105                  for (int w=0; w<width; w++) {                  for (int w=0; w<width; w++) {
106                          for (int h=0; h<height; h++) {                          for (int h=0; h<height; h++) {
107                                  if (blocks[w][h].getBlock().isBlockIndirectlyPowered() == true)                                  Block b = blocks[w][h].getBlock();
108    
109                                    if ( b.isBlockPowered() ||  b.isBlockIndirectlyPowered() )
110                                          return true;                                          return true;
111                          }                          }
112                  }                  }

Legend:
Removed from v.1579  
changed lines
  Added in v.1580

  ViewVC Help
Powered by ViewVC 1.1.20