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

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

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

revision 1536 by torben, Wed Jun 29 17:19:38 2011 UTC revision 1578 by torben, Sat Jul 16 11:01:02 2011 UTC
# Line 14  class Door { Line 14  class Door {
14          final static int NORTH = 2;          final static int NORTH = 2;
15          final static int SOUTH = 3;          final static int SOUTH = 3;
16                    
17          Location leftUpper;          private Location leftUpper;
18    
19                    
20          Location blocks[][]; // [width][height] - [0][0] == leftUpper          private Location blocks[][]; // [width][height] - [0][0] == leftUpper
21    
22          int material;          private int material;
23                    
24          int direction;          private int direction;
25                    
26          int width;          private int width;
27          int height;          private int height;
28    
29          String owner;          private String owner;
30                    
31    
32          public Door(Block sign, int width, int height, DoorStorage store, String owner) throws ConflictingDoorException{          public Door(Block sign, int width, int height, DoorStorage store, String owner) throws ConflictingDoorException{
# Line 62  class Door { Line 62  class Door {
62                                    
63                  loadBlocks();                  loadBlocks();
64                                    
65                            
66                  for (int w=0; w<width; w++) {                  for (int w=0; w<width; w++) {
67                          for (int h=0; h<height; h++) {                          for (int h=0; h<height; h++) {
68                                  Door d = store.findDoor( blocks[w][h] );                                  Door d = store.findDoor( blocks[w][h] );
# Line 92  class Door { Line 92  class Door {
92                                    
93                  loadBlocks();                  loadBlocks();
94          }          }
95    
96            public void powerChange(World world, int oldCurrent, int newCurrent ) {
97                    if (newCurrent != 0) {
98                            open(world);
99                    } else {
100                            close(world);
101                    }      
102            }
103                    
104          private void loadBlocks() {          private void loadBlocks() {
105                                    
# Line 167  class Door { Line 175  class Door {
175          public void open(World world) {          public void open(World world) {
176                  for (int w=0; w<width; w++) {                  for (int w=0; w<width; w++) {
177                          for (int h=0; h<height; h++) {                                                    for (int h=0; h<height; h++) {                          
178                                  blocks[w][h].getBlock().setTypeId(0);                                  blocks[w][h].getBlock().setTypeId(0, false);
179                          }                          }
180                  }                  }
181    
# Line 181  class Door { Line 189  class Door {
189                  }                  }
190          }          }
191    
192    
193            /////// setters and getters
194            public String getOwner() {
195                    return owner;
196            }
197    
198  }  }

Legend:
Removed from v.1536  
changed lines
  Added in v.1578

  ViewVC Help
Powered by ViewVC 1.1.20