Bugfixes
This commit is contained in:
@@ -133,6 +133,8 @@ public class Block extends UnlockableContent{
|
||||
public int unitCapModifier = 0;
|
||||
/** Whether the block can be tapped and selected to configure. */
|
||||
public boolean configurable;
|
||||
/** If true, this block can be configured by logic. */
|
||||
public boolean logicConfigurable = false;
|
||||
/** Whether this block consumes touchDown events when tapped. */
|
||||
public boolean consumesTap;
|
||||
/** Whether to draw the glow of the liquid for this block, if it has one. */
|
||||
@@ -674,6 +676,14 @@ public class Block extends UnlockableContent{
|
||||
|
||||
consumes.init();
|
||||
|
||||
if(!logicConfigurable){
|
||||
configurations.each((key, val) -> {
|
||||
if(UnlockableContent.class.isAssignableFrom(key)){
|
||||
logicConfigurable = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(!outputsPower && consumes.hasPower() && consumes.getPower().buffered){
|
||||
throw new IllegalArgumentException("Consumer using buffered power: " + name);
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@ public class UnitFactory extends UnitBlock{
|
||||
hasPower = true;
|
||||
hasItems = true;
|
||||
solid = true;
|
||||
//flags = EnumSet.of(BlockFlag.producer, BlockFlag.unitModifier);
|
||||
//unitCapModifier = 2;
|
||||
configurable = true;
|
||||
outputsPayload = true;
|
||||
rotate = true;
|
||||
@@ -44,6 +42,11 @@ public class UnitFactory extends UnitBlock{
|
||||
tile.progress = 0;
|
||||
});
|
||||
|
||||
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
|
||||
tile.currentPlan = plans.indexOf(p -> p.unit == val);
|
||||
tile.progress = 0;
|
||||
});
|
||||
|
||||
consumes.add(new ConsumeItemDynamic((UnitFactoryBuild e) -> e.currentPlan != -1 ? plans.get(e.currentPlan).requirements : ItemStack.empty));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user