/[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 1912 by torben, Sun Jan 13 13:05:16 2013 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            private String password;
35                    
36    
37          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, String password) throws ConflictingDoorException{
38                  leftUpper = sign.getLocation().clone();                  leftUpper = sign.getLocation().clone();
39                                    
40                  this.width = width;                  this.width = width;
41                  this.height = height;                  this.height = height;
42    
43                  this.owner = owner;                  this.owner = owner;
44    
45                    this.isPrivate = isPrivate;
46                    this.password = password;
47                                    
48    
49                  direction = sign.getData() - 2;                  direction = sign.getData() - 2;
# Line 73  class Door { Line 81  class Door {
81    
82          }          }
83    
84    /*
85            @Deprecated
86          public Door(String input, Server server) {          public Door(String input, Server server) {
87                  String parts[] = input.split(":");                  String parts[] = input.split(":");
88    
# Line 88  class Door { Line 98  class Door {
98    
99                                    
100                  loadBlocks();                  loadBlocks();
101            }*/
102    
103            public Door(Location loc, int direction, int width, int height, String owner, boolean isPrivate, String password) {
104                    leftUpper = loc;
105                    this.direction = direction;
106                    this.width = width;
107                    this.height = height;
108                    this.owner = owner;
109                    this.isPrivate = isPrivate;
110                    this.password = password;
111    
112                    loadBlocks();
113          }          }
114    
115            
116    
117          public void powerChange(World world, int oldCurrent, int newCurrent ) {          public void powerChange(World world, int oldCurrent, int newCurrent ) {
118                  if (isPowered() == true) {                  if (isPowered() == true) {
119                          open();                          open();
# Line 151  class Door { Line 175  class Door {
175                                    
176          }          }
177    
178          public String toCsv() {  /*      public String toCsv() {
179                  StringBuilder sb = new StringBuilder();                  StringBuilder sb = new StringBuilder();
180                  sb.append( leftUpper.getWorld().getName() );                  sb.append( leftUpper.getWorld().getName() );
181    
# Line 168  class Door { Line 192  class Door {
192                  sb.append( ":" + owner);                  sb.append( ":" + owner);
193    
194                  return sb.toString();                  return sb.toString();
195          }          }*/
196    
197    
198          public void registerMap(Map<Location,Door> map) {          public void registerMap(Map<Location,Door> map) {
# Line 191  class Door { Line 215  class Door {
215          public void open() {          public void open() {
216                  for (int w=0; w<width; w++) {                  for (int w=0; w<width; w++) {
217                          for (int h=0; h<height; h++) {                                                    for (int h=0; h<height; h++) {                          
218                                  blocks[w][h].getBlock().setTypeId(0, false);                                  //blocks[w][h].getBlock().setTypeId( 0, false);
219                                    blocks[w][h].getBlock().setType( Material.AIR );
220                          }                          }
221                  }                  }
222    
# Line 211  class Door { Line 236  class Door {
236                  return owner;                  return owner;
237          }          }
238    
239            public Location getLeftUpper() {
240                    return leftUpper;
241            }
242    
243            public int getWidth() {
244                    return width;
245            }
246    
247            public int getHeight() {
248                    return height;
249            }
250    
251            public int getDirection() {
252                    return direction;
253            }
254    
255            public boolean isPrivate() {
256                    return isPrivate;
257            }
258            
259            public String getPassword() {
260                    return password;
261            }
262    
263  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.20