diff options
| author | boubou19 <miisterunknown@gmail.com> | 2023-04-21 20:29:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-21 20:29:38 +0200 |
| commit | de864236f83dc31c53ca77a6939357a0959bca75 (patch) | |
| tree | ef739fd9426e7c2525b1560386faaa5bb893e30d /src/main/java/gregtech/common/blocks | |
| parent | 285a75535d07f2037967b1208a5840fb81719514 (diff) | |
| download | GT5-Unofficial-de864236f83dc31c53ca77a6939357a0959bca75.tar.gz GT5-Unofficial-de864236f83dc31c53ca77a6939357a0959bca75.tar.bz2 GT5-Unofficial-de864236f83dc31c53ca77a6939357a0959bca75.zip | |
Recipes ra2 (#1872)
* Recipes RA2 fixes
* Use \uXXXX for non-ASCII characters
* Misc cleanup (#1888)
* migrate away from addThermalCentrifugeRecipe
* split recipes of GT_Block_Stones_Abstract
* migrate away from addForgeHammerRecipe
* migrate away from addChemicalBathRecipe
* remove "DisableOldChemicalRecipes" and its usage, as it's disabled by default in NH and it increases recipe complexity for nothing
* Remove underground biomes ore classes, as it's not present in NH
* migrate away from addFluidCannerRecipe
* migrate away from addFluidExtractionRecipe
* migrate away from addChemicalRecipe
* migrate away from addMultiblockChemicalRecipe
* deprecate addChemicalRecipeForBasicMachineOnly
* migrate away from addCentrifugeRecipe
* spotlessApply
* fixing wrong merge conflict solving
* Add Tengam materials (#1891)
* Add Tengam materials
* Change new recipes to consume 15/16 Amp
* Remove now redundant `break` statements
* fix comb chances?
* fix centrifuge code not working
---------
Co-authored-by: glowredman <35727266+glowredman@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/common/blocks')
9 files changed, 79 insertions, 239 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java index e0215e77eb..c9a93ecaec 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Machines.java @@ -228,7 +228,6 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo return tTileEntity != null && tTileEntity.receiveClientEvent(aData1, aData2); } - @SuppressWarnings("unchecked") // Old API uses raw List type @Override public void addCollisionBoxesToList(World aWorld, int aX, int aY, int aZ, AxisAlignedBB inputAABB, List<AxisAlignedBB> outputAABB, Entity collider) { @@ -605,7 +604,6 @@ public class GT_Block_Machines extends GT_Generic_Block implements IDebugableBlo @SideOnly(Side.CLIENT) @Override - @SuppressWarnings("unchecked") // Old API uses raw List type public void getSubBlocks(Item item, CreativeTabs aCreativeTab, List<ItemStack> outputSubBlocks) { for (int i = 1; i < GregTech_API.METATILEENTITIES.length; i++) { if (GregTech_API.METATILEENTITIES[i] != null) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 10fb15a77c..2a37aefa64 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -308,7 +308,6 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements public abstract ITexture[] getTextureSet(); // Must have 16 entries. - @SuppressWarnings({ "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item aItem, CreativeTabs aTab, List<ItemStack> aList) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java deleted file mode 100644 index cacf903c81..0000000000 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB1.java +++ /dev/null @@ -1,72 +0,0 @@ -package gregtech.common.blocks; - -import static gregtech.api.enums.Mods.UndergroundBiomes; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.render.TextureFactory; - -public class GT_Block_Ores_UB1 extends GT_Block_Ores_Abstract { - - Block aUBBlock = GameRegistry.findBlock(UndergroundBiomes.ID, "igneousStone"); - - public GT_Block_Ores_UB1() { - super("gt.blockores.ub1", 8, true, Material.rock); - if (aUBBlock == null) aUBBlock = Blocks.stone; - } - - @Override - public String getUnlocalizedName() { - return "gt.blockores.ub1"; - } - - @Override - public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries. - return new OrePrefixes[] { OrePrefixes.oreRedgranite, OrePrefixes.oreBlackgranite, OrePrefixes.ore, - OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreBasalt, OrePrefixes.ore, OrePrefixes.ore }; - } - - @Override - public IIcon getIcon(int side, int meta) { - return aUBBlock.getIcon(side, (meta / 1000) % 8); - } - - @Override - public int getBaseBlockHarvestLevel(int aMeta) { - return aUBBlock.getHarvestLevel(aMeta); - } - - @Override - public Block getDroppedBlock() { - return GregTech_API.sBlockOresUb1; - } - - @Override - public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, - Materials.Stone, Materials.Stone, Materials.Stone }; - } - - @Override - public boolean[] getEnabledMetas() { - return new boolean[] { true, true, true, true, true, true, true, true }; - } - - @Override - public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; - } -} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java deleted file mode 100644 index db8dc4347c..0000000000 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB2.java +++ /dev/null @@ -1,73 +0,0 @@ -package gregtech.common.blocks; - -import static gregtech.api.enums.Mods.UndergroundBiomes; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.render.TextureFactory; - -public class GT_Block_Ores_UB2 extends GT_Block_Ores_Abstract { - - Block aUBBlock = GameRegistry.findBlock(UndergroundBiomes.ID, "metamorphicStone"); - - public GT_Block_Ores_UB2() { - super("gt.blockores.ub2", 8, true, Material.rock); - if (aUBBlock == null) aUBBlock = Blocks.stone; - } - - @Override - public String getUnlocalizedName() { - return "gt.blockores.ub2"; - } - - @Override - public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic - // recipes. - return new OrePrefixes[] { OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.oreMarble, OrePrefixes.ore, - OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore }; - } - - @Override - public IIcon getIcon(int side, int meta) { - return aUBBlock.getIcon(side, (meta / 1000) % 8); - } - - @Override - public int getBaseBlockHarvestLevel(int aMeta) { - return aUBBlock.getHarvestLevel(aMeta); - } - - @Override - public Block getDroppedBlock() { - return GregTech_API.sBlockOresUb2; - } - - @Override - public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, - Materials.Stone, Materials.Stone, Materials.Stone }; - } - - @Override - public boolean[] getEnabledMetas() { - return new boolean[] { true, true, true, true, true, true, true, true }; - } - - @Override - public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; - } -} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java deleted file mode 100644 index 1c8f433adf..0000000000 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_UB3.java +++ /dev/null @@ -1,73 +0,0 @@ -package gregtech.common.blocks; - -import static gregtech.api.enums.Mods.UndergroundBiomes; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.render.TextureFactory; - -public class GT_Block_Ores_UB3 extends GT_Block_Ores_Abstract { - - Block aUBBlock = GameRegistry.findBlock(UndergroundBiomes.ID, "sedimentaryStone"); - - public GT_Block_Ores_UB3() { - super("gt.blockores.ub3", 8, true, Material.rock); - if (aUBBlock == null) aUBBlock = Blocks.stone; - } - - @Override - public String getUnlocalizedName() { - return "gt.blockores.ub3"; - } - - @Override - public OrePrefixes[] getProcessingPrefix() { // Must have 8 entries; an entry can be null to disable automatic - // recipes. - return new OrePrefixes[] { OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore, - OrePrefixes.ore, OrePrefixes.ore, OrePrefixes.ore }; - } - - @Override - public IIcon getIcon(int side, int meta) { - return aUBBlock.getIcon(side, (meta / 1000) % 8); - } - - @Override - public int getBaseBlockHarvestLevel(int aMeta) { - return aUBBlock.getHarvestLevel(aMeta); - } - - @Override - public Block getDroppedBlock() { - return GregTech_API.sBlockOresUb3; - } - - @Override - public Materials[] getDroppedDusts() { // Must have 8 entries; can be null. - return new Materials[] { Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, Materials.Stone, - Materials.Stone, Materials.Stone, Materials.Stone }; - } - - @Override - public boolean[] getEnabledMetas() { - return new boolean[] { true, true, true, true, true, true, true, true }; - } - - @Override - public ITexture[] getTextureSet() { // Must have 16 entries. - return new ITexture[] { TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), - TextureFactory.of(aUBBlock, 2), TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), - TextureFactory.of(aUBBlock, 5), TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7), - TextureFactory.of(aUBBlock, 0), TextureFactory.of(aUBBlock, 1), TextureFactory.of(aUBBlock, 2), - TextureFactory.of(aUBBlock, 3), TextureFactory.of(aUBBlock, 4), TextureFactory.of(aUBBlock, 5), - TextureFactory.of(aUBBlock, 6), TextureFactory.of(aUBBlock, 7) }; - } -} diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java index 23e55839bf..18f17fb336 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java @@ -330,6 +330,7 @@ public class GT_Block_Reinforced extends GT_Generic_Block { } } + @SuppressWarnings("deprecation") @Override public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) { if (!world.isRemote && world.getBlockMetadata(x, y, z) == 5) { diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java index 31b81eb5ff..45c0e38c30 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Stones_Abstract.java @@ -1,5 +1,10 @@ package gregtech.common.blocks; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sHammerRecipes; +import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sLaserEngraverRecipes; +import static gregtech.api.util.GT_RecipeBuilder.SECONDS; +import static gregtech.api.util.GT_RecipeBuilder.TICKS; + import java.util.List; import net.minecraft.block.material.Material; @@ -31,6 +36,15 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe OrePrefixes.crafting.add(this); setStepSound(soundTypeStone); setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); + + this.registerSmeltingRecipes(); + this.registerAssemblerRecipes(); + this.registerCraftingRecipes(); + this.registerForgeHammerRecipes(); + + } + + private void registerSmeltingRecipes() { GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 7)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 1), new ItemStack(this, 1, 0)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 2), new ItemStack(this, 1, 0)); @@ -47,6 +61,10 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 13), new ItemStack(this, 1, 8)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 14), new ItemStack(this, 1, 8)); GT_ModHandler.addSmeltingRecipe(new ItemStack(this, 1, 15), new ItemStack(this, 1, 8)); + + } + + private void registerAssemblerRecipes() { GT_Values.RA.addAssemblerRecipe( new ItemStack(this, 1, 0), ItemList.Circuit_Integrated.getWithDamage(0L, 4L), @@ -59,6 +77,9 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe new ItemStack(this, 1, 11), 50, 4); + } + + private void registerCraftingRecipes() { GT_ModHandler.addCraftingRecipe( new ItemStack(this, 1, 6), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -83,10 +104,6 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe new ItemStack(this, 1, 9), GT_ModHandler.RecipeBits.NOT_REMOVABLE, new Object[] { "h", "X", 'X', new ItemStack(this, 1, 8) }); - GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 3), new ItemStack(this, 1, 4), 16, 10); - GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 11), new ItemStack(this, 1, 12), 16, 10); - GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 0), new ItemStack(this, 1, 1), 16, 10); - GT_Values.RA.addForgeHammerRecipe(new ItemStack(this, 1, 8), new ItemStack(this, 1, 9), 16, 10); GT_ModHandler.addCraftingRecipe( new ItemStack(this, 4, 3), GT_ModHandler.RecipeBits.NOT_REMOVABLE, @@ -105,22 +122,67 @@ public class GT_Block_Stones_Abstract extends GT_Generic_Block implements IOreRe new Object[] { "XX", "XX", 'X', new ItemStack(this, 4, 15) }); } + private void registerForgeHammerRecipes() { + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 3)) + .itemOutputs(new ItemStack(this, 1, 4)) + .noFluidInputs() + .noFluidOutputs() + .duration(16 * TICKS) + .eut(10) + .addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 11)) + .itemOutputs(new ItemStack(this, 1, 12)) + .noFluidInputs() + .noFluidOutputs() + .duration(16 * TICKS) + .eut(10) + .addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 0)) + .itemOutputs(new ItemStack(this, 1, 1)) + .noFluidInputs() + .noFluidOutputs() + .duration(16 * TICKS) + .eut(10) + .addTo(sHammerRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 8)) + .itemOutputs(new ItemStack(this, 1, 9)) + .noFluidInputs() + .noFluidOutputs() + .duration(16 * TICKS) + .eut(10) + .addTo(sHammerRecipes); + } + @Override public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) { - GT_Values.RA.addLaserEngraverRecipe( - new ItemStack(this, 1, 7), - GT_Utility.copyAmount(0L, aStack), - new ItemStack(this, 1, 6), - 50, - 16); - GT_Values.RA.addLaserEngraverRecipe( - new ItemStack(this, 1, 15), - GT_Utility.copyAmount(0L, aStack), - new ItemStack(this, 1, 14), - 50, - 16); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 7), GT_Utility.copyAmount(0L, aStack)) + .itemOutputs(new ItemStack(this, 1, 6)) + .noFluidInputs() + .noFluidOutputs() + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(sLaserEngraverRecipes); + + GT_Values.RA.stdBuilder() + .itemInputs(new ItemStack(this, 1, 15), GT_Utility.copyAmount(0L, aStack)) + .itemOutputs(new ItemStack(this, 1, 14)) + .noFluidInputs() + .noFluidOutputs() + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(sLaserEngraverRecipes); + } } diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java index f8cda499f1..ae40636eaf 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Casings5.java @@ -24,7 +24,6 @@ public class GT_Item_Casings5 extends GT_Item_Casings_Abstract { @Override @SideOnly(Side.CLIENT) - @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) { super.addInformation(aStack, aPlayer, aList, aF3_H); HeatingCoilLevel coilLevel = GT_Block_Casings5.getCoilHeatFromDamage(aStack.getItemDamage()); diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index 8cd4684664..2e275bc7b3 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -56,7 +56,6 @@ public class GT_Item_Machines extends ItemBlock implements IFluidContainerItem { } @Override - @SuppressWarnings("unchecked") public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List<String> aList, boolean aF3_H) { try { final int tDamage = getDamage(aStack); |
