Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-09 21:10:05 +01:00
Refactored up-with-glass code into a helper function.
Dieser Commit ist enthalten in:
Ursprung
a1fa32153c
Commit
90e1788781
@ -252,8 +252,7 @@ public abstract class LocalPlayer {
|
|||||||
// Found a ceiling!
|
// Found a ceiling!
|
||||||
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
|
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
|
||||||
int platformY = Math.max(initialY, y - 3 - clearance);
|
int platformY = Math.max(initialY, y - 3 - clearance);
|
||||||
world.setBlockType(new Vector(x, platformY, z), BlockID.GLASS);
|
floatAt(x, platformY + 1, z);
|
||||||
setPosition(new Vector(x + 0.5, platformY + 1, z + 0.5));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,8 +283,7 @@ public abstract class LocalPlayer {
|
|||||||
} else if (y > maxY + 1) {
|
} else if (y > maxY + 1) {
|
||||||
break;
|
break;
|
||||||
} else if (y == maxY + 1) {
|
} else if (y == maxY + 1) {
|
||||||
world.setBlockType(new Vector(x, y - 2, z), BlockID.GLASS);
|
floatAt(x, y - 1, z);
|
||||||
setPosition(new Vector(x + 0.5, y - 1, z + 0.5));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,6 +293,18 @@ public abstract class LocalPlayer {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make the player float in the given blocks.
|
||||||
|
*
|
||||||
|
* @param x The X coordinate of the block to float in
|
||||||
|
* @param y The Y coordinate of the block to float in
|
||||||
|
* @param z The Z coordinate of the block to float in
|
||||||
|
*/
|
||||||
|
private void floatAt(int x, int y, int z) {
|
||||||
|
getPosition().getWorld().setBlockType(new Vector(x, y - 1, z), BlockID.GLASS);
|
||||||
|
setPosition(new Vector(x + 0.5, y, z + 0.5));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the point of the block that is being stood in.
|
* Get the point of the block that is being stood in.
|
||||||
*
|
*
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren