Bugfixes from testing session 1
This commit is contained in:
@@ -134,6 +134,8 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
public boolean useColor = true;
|
||||
/** item that drops from this block, used for drills */
|
||||
public @Nullable Item itemDrop = null;
|
||||
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
|
||||
public boolean playerUnmineable = false;
|
||||
/** Array of affinities to certain things. */
|
||||
public Attributes attributes = new Attributes();
|
||||
/** Health per square tile that this block occupies; essentially, this is multiplied by size * size. Overridden if health is > 0. If <0, the default is 40. */
|
||||
@@ -519,7 +521,7 @@ public class Block extends UnlockableContent implements Senseable{
|
||||
}
|
||||
|
||||
public void addLiquidBar(Liquid liq){
|
||||
addBar("liquid-" + liq.name, entity -> new Bar(
|
||||
addBar("liquid-" + liq.name, entity -> !liq.unlocked() ? null : new Bar(
|
||||
() -> liq.localizedName,
|
||||
liq::barColor,
|
||||
() -> entity.liquids.get(liq) / liquidCapacity
|
||||
|
||||
@@ -55,8 +55,6 @@ public class Floor extends Block{
|
||||
public boolean supportsOverlay = false;
|
||||
/** shallow water flag used for generation */
|
||||
public boolean shallow = false;
|
||||
/** if true, this block cannot be mined by players. useful for annoying things like sand. */
|
||||
public boolean playerUnmineable = false;
|
||||
/** Group of blocks that this block does not draw edges on. */
|
||||
public Block blendGroup = this;
|
||||
/** Whether this ore generates in maps by default. */
|
||||
|
||||
@@ -104,6 +104,13 @@ public class BeamNode extends PowerBlock{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStatus status(){
|
||||
if(Mathf.equal(power.status, 0f, 0.001f)) return BlockStatus.noInput;
|
||||
if(Mathf.equal(power.status, 1f, 0.001f)) return BlockStatus.active;
|
||||
return BlockStatus.noOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
super.draw();
|
||||
|
||||
@@ -145,7 +145,7 @@ public class StatValues{
|
||||
return table -> table.stack(
|
||||
new Image(floor.uiIcon).setScaling(Scaling.fit),
|
||||
new Table(t -> t.top().right().add((multiplier < 0 ? "[scarlet]" : startZero ? "[accent]" : "[accent]+") + (int)((multiplier) * 100) + "%").style(Styles.outlineLabel))
|
||||
);
|
||||
).maxSize(64f);
|
||||
}
|
||||
|
||||
public static StatValue blocks(Attribute attr, boolean floating, float scale, boolean startZero){
|
||||
@@ -204,6 +204,8 @@ public class StatValues{
|
||||
for(int i = 0; i < list.size; i++){
|
||||
var item = list.get(i);
|
||||
|
||||
if(item instanceof Block block && block.itemDrop != null && !block.itemDrop.unlocked()) continue;
|
||||
|
||||
l.image(item.uiIcon).size(iconSmall).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
||||
l.add(item.localizedName).left().padLeft(1).padRight(4);
|
||||
if(i % 5 == 4){
|
||||
|
||||
Reference in New Issue
Block a user