diff --git a/src/main/java/supersymmetry/api/capability/impl/BiomeRecipeLogic.java b/src/main/java/supersymmetry/api/capability/impl/BiomeRecipeLogic.java new file mode 100644 index 000000000..8f260fe54 --- /dev/null +++ b/src/main/java/supersymmetry/api/capability/impl/BiomeRecipeLogic.java @@ -0,0 +1,43 @@ +package supersymmetry.api.capability.impl; + +import gregtech.api.capability.impl.MultiblockRecipeLogic; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.recipes.Recipe; +import org.jetbrains.annotations.NotNull; +import supersymmetry.api.recipes.properties.BiomeProperty; + +/** + * A custom recipeLogic class, for adding our check for biomes + * This can be moved out to a stand-alone class. + * But generally speaking if you do not plan to re-use this, making it an inner class should be fine. + * CEu itself has many such cases. + */ +public class BiomeRecipeLogic extends MultiblockRecipeLogic { + + public BiomeRecipeLogic(RecipeMapMultiblockController tileEntity) { + super(tileEntity, true); + } + + + /** + * Overriding this to add our own custom checks + * Don't forget super calls + */ + @Override + public boolean checkRecipe(@NotNull Recipe recipe) { + return checkHeightRequirement() && checkBiomeRequirement(recipe) && super.checkRecipe(recipe); + } + /** + * This is a method for biome checking + */ + public boolean checkBiomeRequirement(@NotNull Recipe recipe) { + if (!recipe.hasProperty(BiomeProperty.getInstance())) return true; + return recipe.getProperty(BiomeProperty.getInstance(), BiomeProperty.BiomePropertyList.EMPTY_LIST) + .checkBiome(getMetaTileEntity().getWorld().getBiome(getMetaTileEntity().getPos())); + } + + @Override + public int getParallelLimit() { + return 256; + } +} diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLargeFluidPump.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLargeFluidPump.java index cc0cfe8d0..6bd161b3b 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLargeFluidPump.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLargeFluidPump.java @@ -17,12 +17,14 @@ import gregtech.common.blocks.BlockMetalCasing.MetalCasingType; import gregtech.common.blocks.BlockTurbineCasing.TurbineCasingType; import gregtech.common.blocks.MetaBlocks; +import net.minecraft.block.state.BlockWorldState; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.jetbrains.annotations.NotNull; +import supersymmetry.api.capability.impl.BiomeRecipeLogic; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.api.recipes.properties.BiomeProperty; import supersymmetry.client.renderer.textures.SusyTextures; @@ -44,8 +46,19 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { return new MetaTileEntityLargeFluidPump(this.metaTileEntityId); } + @Override + public boolean isMultiblockPartWeatherResistant(@Nonnull IMultiblockPart part) { + return true; + } + + public boolean checkHeightRequirement() { + return this.getPos().getY() == 64; + } + + protected @NotNull BlockPattern createStructurePattern() { return FactoryBlockPattern.start(RIGHT, FRONT, UP) + .aisle(" ", " P", " ") .aisle(" ", " P", " ") .aisle("FCCCC ", "CCCCC P", "FCECC ") .aisle("CCSGC ", "OPPPPPP", "CCECC ") @@ -79,42 +92,14 @@ protected static IBlockState getGearboxState() { public void addInformation(ItemStack stack, @Nullable World player, @NotNull List tooltip, boolean advanced) { super.addInformation(stack, player, tooltip, advanced); + tooltip.add(I18n.format("gregtech.multiblock.large_fluid_pump.tooltip.1")); + tooltip.add(I18n.format("gregtech.multiblock.large_fluid_pump.tooltip.2")); tooltip.add(TooltipHelper.RAINBOW_SLOW + I18n.format("gregtech.machine.perfect_oc", new Object[0])); } - /** - * A custom recipeLogic class, for adding our check for biomes - * This can be moved out to a stand-alone class. - * But generally speaking if you do not plan to re-use this, making it an inner class should be fine. - * CEu itself has many such cases. - */ - public static class BiomeRecipeLogic extends MultiblockRecipeLogic { - - public BiomeRecipeLogic(RecipeMapMultiblockController tileEntity) { - super(tileEntity, true); - } - - /** - * Overriding this to add our own custom checks - * Don't forget super calls - */ - @Override - public boolean checkRecipe(@NotNull Recipe recipe) { - return checkBiomeRequirement(recipe) && super.checkRecipe(recipe); - } - - /** - * This is a method for biome checking - */ - public boolean checkBiomeRequirement(@NotNull Recipe recipe) { - if (!recipe.hasProperty(BiomeProperty.getInstance())) return true; - return recipe.getProperty(BiomeProperty.getInstance(), BiomeProperty.BiomePropertyList.EMPTY_LIST) - .checkBiome(getMetaTileEntity().getWorld().getBiome(getMetaTileEntity().getPos())); - } - @Override - public int getParallelLimit() { - return 256; - } + @Override + public void checkStructurePattern() { + super.checkStructurePattern(); } @Nonnull diff --git a/src/main/resources/assets/susy/lang/en_us.lang b/src/main/resources/assets/susy/lang/en_us.lang index 909a59bd1..70cc78209 100644 --- a/src/main/resources/assets/susy/lang/en_us.lang +++ b/src/main/resources/assets/susy/lang/en_us.lang @@ -256,6 +256,9 @@ gregtech.machine.primitive_mud_pump.name=Primitive Mud Pump gregtech.machine.primitive_mud_pump.tooltip=Works only in River biomes between Y=64 and Y=80 gregtech.machine.basic_steam_turbine.name=Large Steam Turbine gregtech.machine.basic_gas_turbine.name=Large Gas Turbine +gregtech.machine.large_fluid_pump.name=Large Fluid Pump +gregtech.machine.large_fluid_pump.tooltip.1=Only works when the controller is at Y=64 +gregtech.machine.large_fluid_pump.tooltip.1=This would definitely affect the local trout population. gregtech.machine.ocean_pumper.name=Ocean Pumper gregtech.machine.ocean_pumper.tooltip=Works only in Ocean biomes between Y=70 and Y=75 gregtech.machine.advanced_arc_furnace.name=Advanced Arc Furnace