27 |
private int height; |
private int height; |
28 |
|
|
29 |
private String owner; |
private String owner; |
30 |
|
|
31 |
|
private boolean isPrivate; |
32 |
|
|
33 |
|
|
34 |
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{ |
35 |
leftUpper = sign.getLocation().clone(); |
leftUpper = sign.getLocation().clone(); |
36 |
|
|
37 |
this.width = width; |
this.width = width; |
38 |
this.height = height; |
this.height = height; |
39 |
|
|
40 |
this.owner = owner; |
this.owner = owner; |
41 |
|
|
42 |
|
this.isPrivate = isPrivate; |
43 |
|
|
44 |
|
|
45 |
direction = sign.getData() - 2; |
direction = sign.getData() - 2; |
77 |
|
|
78 |
} |
} |
79 |
|
|
80 |
|
/* |
81 |
|
@Deprecated |
82 |
public Door(String input, Server server) { |
public Door(String input, Server server) { |
83 |
String parts[] = input.split(":"); |
String parts[] = input.split(":"); |
84 |
|
|
94 |
|
|
95 |
|
|
96 |
loadBlocks(); |
loadBlocks(); |
97 |
|
}*/ |
98 |
|
|
99 |
|
public Door(Location loc, int direction, int width, int height, String owner, boolean isPrivate) { |
100 |
|
leftUpper = loc; |
101 |
|
this.direction = direction; |
102 |
|
this.width = width; |
103 |
|
this.height = height; |
104 |
|
this.owner = owner; |
105 |
|
this.isPrivate = isPrivate; |
106 |
|
|
107 |
|
loadBlocks(); |
108 |
} |
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
public void powerChange(World world, int oldCurrent, int newCurrent ) { |
public void powerChange(World world, int oldCurrent, int newCurrent ) { |
113 |
if (isPowered() == true) { |
if (isPowered() == true) { |
114 |
open(); |
open(); |
170 |
|
|
171 |
} |
} |
172 |
|
|
173 |
public String toCsv() { |
/* public String toCsv() { |
174 |
StringBuilder sb = new StringBuilder(); |
StringBuilder sb = new StringBuilder(); |
175 |
sb.append( leftUpper.getWorld().getName() ); |
sb.append( leftUpper.getWorld().getName() ); |
176 |
|
|
187 |
sb.append( ":" + owner); |
sb.append( ":" + owner); |
188 |
|
|
189 |
return sb.toString(); |
return sb.toString(); |
190 |
} |
}*/ |
191 |
|
|
192 |
|
|
193 |
public void registerMap(Map<Location,Door> map) { |
public void registerMap(Map<Location,Door> map) { |
230 |
return owner; |
return owner; |
231 |
} |
} |
232 |
|
|
233 |
|
public Location getLeftUpper() { |
234 |
|
return leftUpper; |
235 |
|
} |
236 |
|
|
237 |
|
public int getWidth() { |
238 |
|
return width; |
239 |
|
} |
240 |
|
|
241 |
|
public int getHeight() { |
242 |
|
return height; |
243 |
|
} |
244 |
|
|
245 |
|
public int getDirection() { |
246 |
|
return direction; |
247 |
|
} |
248 |
|
|
249 |
|
public boolean isPrivate() { |
250 |
|
return isPrivate; |
251 |
|
} |
252 |
|
|
253 |
} |
} |