Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ public class WorldReloader{
|
||||
|
||||
Call.worldDataBegin();
|
||||
}else{
|
||||
net.reset();
|
||||
if(net.client()){
|
||||
net.reset();
|
||||
}
|
||||
logic.reset();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PowerDiode extends Block{
|
||||
public void updateTile(){
|
||||
super.updateTile();
|
||||
|
||||
if(tile == null || front() == null || back() == null || !back().block.hasPower || !front().block.hasPower || back().team != front().team) return;
|
||||
if(tile == null || front() == null || back() == null || !back().block.hasPower || !front().block.hasPower || back().team != team || front().team != team) return;
|
||||
|
||||
PowerGraph backGraph = back().power.graph;
|
||||
PowerGraph frontGraph = front().power.graph;
|
||||
|
||||
@@ -50,6 +50,8 @@ public class Drill extends Block{
|
||||
public Effect drillEffect = Fx.mine;
|
||||
/** Drill effect randomness. Block size by default. */
|
||||
public float drillEffectRnd = -1f;
|
||||
/** Chance of displaying the effect. Useful for extremely fast drills. */
|
||||
public float drillEffectChance = 1f;
|
||||
/** Speed the drill bit rotates at. */
|
||||
public float rotateSpeed = 2f;
|
||||
/** Effect randomly played while drilling. */
|
||||
@@ -306,7 +308,7 @@ public class Drill extends Block{
|
||||
|
||||
progress %= delay;
|
||||
|
||||
if(wasVisible) drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
|
||||
if(wasVisible && Mathf.chanceDelta(updateEffectChance * warmup)) drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user