Implemented Stargate spawning correctly
Or at least attemted to
This commit is contained in:
parent
90a2b58c37
commit
f6bef6fdde
@ -29,6 +29,12 @@ public class Stargate {
|
||||
|
||||
public void setCurrentWall(Wall wall) {
|
||||
currentWall = wall;
|
||||
if(wall != null) {
|
||||
isSpawned = true;
|
||||
}
|
||||
else {
|
||||
isSpawned = false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOpen() {
|
||||
|
@ -8,15 +8,22 @@ public class Wall extends Tile {
|
||||
}
|
||||
|
||||
public void spawnStargate(Stargate stargate, Direction direction) {
|
||||
if (sg == null)
|
||||
clearStargate();
|
||||
if (sg == null) {
|
||||
sg = stargate;
|
||||
sg.setCurrentWall(this);
|
||||
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
public void clearStargate() {
|
||||
if(sg != null) {
|
||||
sg.setCurrentWall(null);
|
||||
sg = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
if (sg == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user