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:
FlippingPotatoes
2022-10-13 10:13:17 -04:00
committed by GitHub
parent 2be787f810
commit 0ca33477d8
3 changed files with 15 additions and 6 deletions

View File

@@ -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 -> {

View File

@@ -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;