Expand getBlock functionality (#7702)
* Update LExecutor.java * Update LUnitControl.java * Update LExecutor.java * Update LExecutor.java * Update LExecutor.java * Update LExecutor.java * Update bundle.properties * Update bundle.properties * Update bundle.properties * Update LExecutor.java
This commit is contained in:
@@ -2321,7 +2321,7 @@ lenum.payenter = Enter/land on the payload block the unit is on.
|
||||
lenum.flag = Numeric unit flag.
|
||||
lenum.mine = Mine at a position.
|
||||
lenum.build = Build a structure.
|
||||
lenum.getblock = Fetch a building and type at coordinates.\nUnit must be in range of position.\nSolid non-buildings will have the type [accent]@solid[].
|
||||
lenum.getblock = Fetch a building, floor and type at coordinates.\nUnit must be in range of position.\nSolid non-buildings will have the type [accent]@solid[].
|
||||
lenum.within = Check if unit is near a position.
|
||||
lenum.boost = Start/stop boosting.
|
||||
|
||||
|
||||
@@ -510,12 +510,21 @@ public class LExecutor{
|
||||
if(!unit.within(x1, y1, range)){
|
||||
exec.setobj(p3, null);
|
||||
exec.setobj(p4, null);
|
||||
exec.setobj(p5, null);
|
||||
}else{
|
||||
Tile tile = world.tileWorld(x1, y1);
|
||||
//any environmental solid block is returned as StoneWall, aka "@solid"
|
||||
Block block = tile == null ? null : !tile.synthetic() ? (tile.solid() ? Blocks.stoneWall : Blocks.air) : tile.block();
|
||||
exec.setobj(p3, block);
|
||||
exec.setobj(p4, tile != null && tile.build != null ? tile.build : null);
|
||||
if(tile == null){
|
||||
exec.setobj(p3, null);
|
||||
exec.setobj(p4, null);
|
||||
exec.setobj(p5, null);
|
||||
}else{
|
||||
//any environmental solid block is returned as StoneWall, aka "@solid"
|
||||
Block block = !tile.synthetic() ? (tile.solid() ? Blocks.stoneWall : Blocks.air) : tile.block();
|
||||
exec.setobj(p3, block);
|
||||
exec.setobj(p4, tile.build != null ? tile.build : null);
|
||||
//Allows reading of ore tiles if they are present (overlay is not air) otherwise returns the floor
|
||||
exec.setobj(p5, tile.overlay() == Blocks.air ? tile.floor() : tile.overlay());
|
||||
}
|
||||
}
|
||||
}
|
||||
case itemDrop -> {
|
||||
|
||||
@@ -16,7 +16,7 @@ public enum LUnitControl{
|
||||
mine("x", "y"),
|
||||
flag("value"),
|
||||
build("x", "y", "block", "rotation", "config"),
|
||||
getBlock("x", "y", "type", "building"),
|
||||
getBlock("x", "y", "type", "building", "floor"),
|
||||
within("x", "y", "radius", "result"),
|
||||
unbind;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user