Minor tweaks

This commit is contained in:
Anuken
2019-02-16 11:15:10 -05:00
parent 4677de80c1
commit 86dddd0253
2 changed files with 1 additions and 20 deletions

View File

@@ -76,25 +76,6 @@ public class ImpactReactor extends PowerGenerator{
super.update(tile);
}
@Override
public float handleDamage(Tile tile, float amount){
FusionReactorEntity entity = tile.entity();
if(entity.warmup < 0.4f) return amount;
float healthFract = tile.entity.health / health;
//5% chance to explode when hit at <50% HP with a normal bullet
if(amount > 5f && healthFract <= 0.5f && Mathf.chance(0.05)){
return health;
//10% chance to explode when hit at <25% HP with a powerful bullet
}else if(amount > 8f && healthFract <= 0.2f && Mathf.chance(0.1)){
return health;
}
return amount;
}
@Override
public void draw(Tile tile){
FusionReactorEntity entity = tile.entity();

View File

@@ -56,7 +56,7 @@ public class ConsumeLiquidFilter extends Consume{
@Override
public boolean valid(Block block, TileEntity entity){
return entity.liquids != null && filter.test(entity.liquids.current()) && entity.liquids.currentAmount() >= use(block, entity);
return entity != null && entity.liquids != null && filter.test(entity.liquids.current()) && entity.liquids.currentAmount() >= use(block, entity);
}
@Override