This commit is contained in:
Sollace 2019-02-06 22:25:18 +02:00
parent e8dd55ee20
commit 0cebad1277
2 changed files with 9 additions and 11 deletions

View file

@ -74,9 +74,9 @@ public abstract class UFarmland extends BlockFarmland {
}
public boolean hasWater(World world, BlockPos pos) {
return PosHelper.inRegion(pos.add(-4, 0, -4), pos.add(4, 1, 4)).anyMatch(p -> {
return world.getBlockState(p).getMaterial() == Material.WATER;
});
return PosHelper.inRegion(pos.add(-4, 0, -4), pos.add(4, 1, 4)).anyMatch(p ->
world.getBlockState(p).getMaterial() == Material.WATER
);
}
@Override

View file

@ -103,21 +103,19 @@ public class OreReplacer {
public void done() {
log.info("Searching for ore replacements...");
Streams.stream(ForgeRegistries.RECIPES).forEach(recipe -> {
Streams.stream(ForgeRegistries.RECIPES).forEach(recipe ->
remappers.stream()
.filter(remapper -> remapper.canRemap(recipe))
.findFirst()
.ifPresent(remapper -> remapper.replaceIngredients(this, recipe));
});
.ifPresent(remapper -> remapper.replaceIngredients(this, recipe))
);
log.info("Replaced {} ingredients.", replacements);
}
public boolean replaceOre(ItemStack stack, NonNullList<ItemStack> newStacks) {
return ores.stream().filter(ore -> ore.matches(stack)).map(ore -> {
ore.getSubItems(stack, newStacks);
return ore;
}).findFirst().isPresent();
return ores.stream().filter(ore -> ore.matches(stack)).peek(ore ->
ore.getSubItems(stack, newStacks)
).findFirst().isPresent();
}
public interface IIngredientRemapper {