Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 02:50:06 +01:00
Changed /descend to be a little more accurate, to not drop players from a high distance, and to not drop players into the void.
Dieser Commit ist enthalten in:
Ursprung
ad0bb92c8f
Commit
3a940ba936
@ -204,14 +204,14 @@ public abstract class WorldEditPlayer {
|
|||||||
* @return true if a spot was found
|
* @return true if a spot was found
|
||||||
*/
|
*/
|
||||||
public boolean descendLevel() {
|
public boolean descendLevel() {
|
||||||
Vector pos = getPosition();
|
Vector pos = getBlockIn();
|
||||||
int x = pos.getBlockX();
|
int x = pos.getBlockX();
|
||||||
int y = pos.getBlockY() - 1;
|
int y = pos.getBlockY() - 1;
|
||||||
int z = pos.getBlockZ();
|
int z = pos.getBlockZ();
|
||||||
|
|
||||||
byte free = 0;
|
byte free = 0;
|
||||||
|
|
||||||
while (y >= 0) {
|
while (y >= 1) {
|
||||||
if (server.getBlockType(new Vector(x, y, z)) == 0) {
|
if (server.getBlockType(new Vector(x, y, z)) == 0) {
|
||||||
free++;
|
free++;
|
||||||
} else {
|
} else {
|
||||||
@ -219,7 +219,13 @@ public abstract class WorldEditPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (free == 2) {
|
if (free == 2) {
|
||||||
setPosition(new Vector(x + 0.5, y, z + 0.5));
|
// So we've found a spot, but we have to drop the player
|
||||||
|
// lightly and also check to see if there's something to
|
||||||
|
// stand upon
|
||||||
|
while (y >= 0) {
|
||||||
|
if (server.getBlockType(new Vector(x, y, z)) != 0) {
|
||||||
|
// Found a block!
|
||||||
|
setPosition(new Vector(x + 0.5, y + 1, z + 0.5));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,6 +235,12 @@ public abstract class WorldEditPlayer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
y--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gives the player an item.
|
* Gives the player an item.
|
||||||
*
|
*
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren