use of mods.railcraft.common.plugins.forge.PowerPlugin.FULL_POWER in project Railcraft by Railcraft.
the class DetectorLocomotive method testCarts.
@Override
public int testCarts(List<EntityMinecart> carts) {
for (EntityMinecart cart : carts) {
if (cart instanceof EntityLocomotive) {
EntityLocomotive loco = (EntityLocomotive) cart;
ItemStack primary = getFilters().getStackInSlot(0);
boolean matches = EnumColor.fromItemStack(primary).map(c -> c == loco.getPrimaryColor()).orElse(false);
ItemStack secondary = getFilters().getStackInSlot(1);
matches &= EnumColor.fromItemStack(secondary).map(c -> c == loco.getSecondaryColor()).orElse(false);
if (matches)
return FULL_POWER;
}
}
return NO_POWER;
}
Aggregations