geforkt von Mirrors/FastAsyncWorldEdit
Cleaned up /ascend. Now uses WorldEditPlayer.getBlockIn() for better accuracy.
Dieser Commit ist enthalten in:
Ursprung
263417550b
Commit
ad0bb92c8f
@ -169,27 +169,24 @@ public abstract class WorldEditPlayer {
|
|||||||
* @return true if a spot was found
|
* @return true if a spot was found
|
||||||
*/
|
*/
|
||||||
public boolean ascendLevel() {
|
public boolean ascendLevel() {
|
||||||
Vector pos = getPosition();
|
Vector pos = getBlockIn();
|
||||||
int x = pos.getBlockX();
|
int x = pos.getBlockX();
|
||||||
int y = pos.getBlockY();
|
int y = pos.getBlockY();
|
||||||
int z = pos.getBlockZ();
|
int z = pos.getBlockZ();
|
||||||
|
|
||||||
byte free = 0;
|
byte free = 0;
|
||||||
byte spots = 0;
|
byte spots = 0;
|
||||||
boolean inFree = false;
|
|
||||||
|
|
||||||
while (y <= 129) {
|
while (y <= 129) {
|
||||||
if (server.getBlockType(new Vector(x, y, z)) == 0) {
|
if (server.getBlockType(new Vector(x, y, z)) == 0) {
|
||||||
free++;
|
free++;
|
||||||
} else {
|
} else {
|
||||||
free = 0;
|
free = 0;
|
||||||
inFree = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (free == 2 && inFree == false) {
|
if (free == 2) {
|
||||||
inFree = true;
|
|
||||||
spots++;
|
spots++;
|
||||||
if (y >= 129 || spots == 2) {
|
if (spots == 2) {
|
||||||
setPosition(new Vector(x + 0.5, y - 1, z + 0.5));
|
setPosition(new Vector(x + 0.5, y - 1, z + 0.5));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren