mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-21 12:03:29 -08:00
More efficient way of retrieving ConsumePower subclasses
This commit is contained in:
parent
52f78ee4ed
commit
828661e9de
5 changed files with 21 additions and 40 deletions
|
|
@ -174,8 +174,8 @@ public class PowerTests extends PowerTestFixture{
|
|||
powerGraph.update();
|
||||
|
||||
assertEquals(0.0f, consumerTile.entity.power.satisfaction, MathUtils.FLOAT_ROUNDING_ERROR);
|
||||
if(consumerTile.block().consumes.hasSubtypeOf(ConsumePower.class)){
|
||||
ConsumePower consumePower = consumerTile.block().consumes.getSubtypeOf(ConsumePower.class);
|
||||
if(consumerTile.block().consumes.has(ConsumePower.class)){
|
||||
ConsumePower consumePower = consumerTile.block().consumes.get(ConsumePower.class);
|
||||
assertFalse(consumePower.valid(consumerTile.block(), consumerTile.entity()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue