/[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

miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java revision 1581 by torben, Sun Jul 24 17:23:48 2011 UTC miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/secretdoor/Door.java revision 1708 by torben, Sun Mar 4 20:21:03 2012 UTC
# Line 2  package dk.thoerup.bukkit.hoeruputils.se Line 2  package dk.thoerup.bukkit.hoeruputils.se
2    
3  import java.util.Map;  import java.util.Map;
4    
5    import org.bukkit.Material;
6  import org.bukkit.Location;  import org.bukkit.Location;
7  import org.bukkit.Server;  import org.bukkit.Server;
8  import org.bukkit.World;  import org.bukkit.World;
# Line 27  class Door { Line 28  class Door {
28          private int height;          private int height;
29    
30          private String owner;          private String owner;
31    
32            private boolean isPrivate;
33                    
34    
35          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, boolean isPrivate) throws ConflictingDoorException{
36                  leftUpper = sign.getLocation().clone();                  leftUpper = sign.getLocation().clone();
37                                    
38                  this.width = width;                  this.width = width;
39                  this.height = height;                  this.height = height;
40    
41                  this.owner = owner;                  this.owner = owner;
42    
43                    this.isPrivate = isPrivate;
44                                    
45    
46                  direction = sign.getData() - 2;                  direction = sign.getData() - 2;
# Line 73  class Door { Line 78  class Door {
78    
79          }          }
80    
81    /*
82            @Deprecated
83          public Door(String input, Server server) {          public Door(String input, Server server) {
84                  String parts[] = input.split(":");                  String parts[] = input.split(":");
85    
# Line 88  class Door { Line 95  class Door {
95    
96                                    
97                  loadBlocks();                  loadBlocks();
98            }*/
99    
100            public Door(Location loc, int direction, int width, int height, String owner, boolean isPrivate) {
101                    leftUpper = loc;
102                    this.direction = direction;
103                    this.width = width;
104                    this.height = height;
105                    this.owner = owner;
106                    this.isPrivate = isPrivate;
107    
108                    loadBlocks();
109          }          }
110    
111            
112    
113          public void powerChange(World world, int oldCurrent, int newCurrent ) {          public void powerChange(World world, int oldCurrent, int newCurrent ) {
114                  if (isPowered() == true) {                  if (isPowered() == true) {
115                          open();                          open();
# Line 151  class Door { Line 171  class Door {
171                                    
172          }          }
173    
174          public String toCsv() {  /*      public String toCsv() {
175                  StringBuilder sb = new StringBuilder();                  StringBuilder sb = new StringBuilder();
176                  sb.append( leftUpper.getWorld().getName() );                  sb.append( leftUpper.getWorld().getName() );
177    
# Line 168  class Door { Line 188  class Door {
188                  sb.append( ":" + owner);                  sb.append( ":" + owner);
189    
190                  return sb.toString();                  return sb.toString();
191          }          }*/
192    
193    
194          public void registerMap(Map<Location,Door> map) {          public void registerMap(Map<Location,Door> map) {
# Line 191  class Door { Line 211  class Door {
211          public void open() {          public void open() {
212                  for (int w=0; w<width; w++) {                  for (int w=0; w<width; w++) {
213                          for (int h=0; h<height; h++) {                                                    for (int h=0; h<height; h++) {                          
214                                  blocks[w][h].getBlock().setTypeId(0, false);                                  //blocks[w][h].getBlock().setTypeId( 0, false);
215                                    blocks[w][h].getBlock().setType( Material.AIR );
216                          }                          }
217                  }                  }
218    
# Line 211  class Door { Line 232  class Door {
232                  return owner;                  return owner;
233          }          }
234    
235            public Location getLeftUpper() {
236                    return leftUpper;
237            }
238    
239            public int getWidth() {
240                    return width;
241            }
242    
243            public int getHeight() {
244                    return height;
245            }
246    
247            public int getDirection() {
248                    return direction;
249            }
250    
251            public boolean isPrivate() {
252                    return isPrivate;
253            }
254    
255  }  }

Legend:
Removed from v.1581  
changed lines
  Added in v.1708

  ViewVC Help
Powered by ViewVC 1.1.20