From b9448d5d90d0b3c1b62d6e598a4cbdfd07cc8030 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Thu, 24 Mar 2016 00:39:26 +0000 Subject: [PATCH] Added code formatter --- CodeFormatter.xml | 295 + src/main/java/techreborn/Core.java | 66 +- .../achievement/AchievementMod.java | 40 +- .../achievement/AchievementTriggerer.java | 47 +- .../achievement/TRAchievements.java | 39 +- .../techreborn/api/RollingMachineRecipe.java | 209 +- .../java/techreborn/api/ScrapboxList.java | 14 +- src/main/java/techreborn/api/SlotUpgrade.java | 18 +- .../java/techreborn/api/TechRebornAPI.java | 47 +- .../java/techreborn/api/TechRebornBlocks.java | 115 +- .../java/techreborn/api/TechRebornItems.java | 112 +- .../java/techreborn/api/package-info.java | 6 +- .../api/reactor/FusionReactorRecipe.java | 152 +- .../reactor/FusionReactorRecipeHelper.java | 30 +- .../techreborn/api/reactor/package-info.java | 6 +- .../techreborn/api/recipe/BaseRecipe.java | 143 +- .../api/recipe/IBaseRecipeType.java | 126 +- .../techreborn/api/recipe/IRecipeCompact.java | 5 +- .../techreborn/api/recipe/RecipeCrafter.java | 664 +- .../techreborn/api/recipe/RecipeHandler.java | 194 +- .../techreborn/api/recipe/RecyclerRecipe.java | 12 +- .../techreborn/api/recipe/ScrapboxRecipe.java | 9 +- .../recipe/machines/AlloySmelterRecipe.java | 31 +- .../machines/AssemblingMachineRecipe.java | 31 +- .../recipe/machines/BlastFurnaceRecipe.java | 68 +- .../api/recipe/machines/CentrifugeRecipe.java | 44 +- .../machines/ChemicalReactorRecipe.java | 31 +- .../api/recipe/machines/CompressorRecipe.java | 28 +- .../api/recipe/machines/ExtractorRecipe.java | 28 +- .../api/recipe/machines/GrinderRecipe.java | 28 +- .../machines/ImplosionCompressorRecipe.java | 36 +- .../IndustrialElectrolyzerRecipe.java | 55 +- .../machines/IndustrialGrinderRecipe.java | 146 +- .../machines/IndustrialSawmillRecipe.java | 184 +- .../machines/PlateCuttingMachineRecipe.java | 27 +- .../recipe/machines/VacuumFreezerRecipe.java | 48 +- .../api/recipe/machines/package-info.java | 5 +- .../techreborn/api/recipe/package-info.java | 6 +- .../api/recipe/recipeConfig/ConfigItem.java | 69 +- .../api/recipe/recipeConfig/RecipeConfig.java | 95 +- .../recipeConfig/RecipeConfigManager.java | 106 +- .../api/upgrade/IMachineUpgrade.java | 5 +- .../api/upgrade/UpgradeHandler.java | 61 +- .../techreborn/api/upgrade/package-info.java | 6 +- .../techreborn/blocks/BlockComputerCube.java | 69 +- .../techreborn/blocks/BlockDigitalChest.java | 77 +- .../blocks/BlockElectricCraftingTable.java | 54 +- .../techreborn/blocks/BlockFusionCoil.java | 27 +- .../blocks/BlockFusionControlComputer.java | 104 +- .../blocks/BlockHighlyAdvancedMachine.java | 26 +- .../techreborn/blocks/BlockIronFence.java | 14 +- .../techreborn/blocks/BlockMachineCasing.java | 159 +- .../techreborn/blocks/BlockMachineFrame.java | 121 +- .../java/techreborn/blocks/BlockNuke.java | 174 +- src/main/java/techreborn/blocks/BlockOre.java | 325 +- .../java/techreborn/blocks/BlockOre2.java | 187 +- .../blocks/BlockPlayerDetector.java | 235 +- .../techreborn/blocks/BlockQuantumChest.java | 79 +- .../techreborn/blocks/BlockQuantumTank.java | 87 +- .../blocks/BlockReinforcedGlass.java | 23 +- .../techreborn/blocks/BlockRubberLeaves.java | 45 +- .../techreborn/blocks/BlockRubberLog.java | 124 +- .../techreborn/blocks/BlockRubberPlank.java | 36 +- .../techreborn/blocks/BlockRubberSapling.java | 53 +- .../java/techreborn/blocks/BlockStorage.java | 137 +- .../java/techreborn/blocks/BlockStorage2.java | 134 +- .../blocks/BlockSupercondensator.java | 53 +- .../advanced_machine/BlockBlastFurnace.java | 93 +- .../advanced_machine/BlockCentrifuge.java | 87 +- .../BlockDistillationTower.java | 61 +- .../BlockImplosionCompressor.java | 84 +- .../BlockIndustrialElectrolyzer.java | 84 +- .../BlockIndustrialGrinder.java | 91 +- .../BlockIndustrialSawmill.java | 91 +- .../blocks/fluid/BlockFluidBase.java | 39 +- .../blocks/fluid/BlockFluidTechReborn.java | 25 +- .../blocks/fluid/TechRebornFluid.java | 12 +- .../generator/BlockDieselGenerator.java | 87 +- .../generator/BlockDragonEggSiphoner.java | 64 +- .../blocks/generator/BlockGasTurbine.java | 85 +- .../blocks/generator/BlockGenerator.java | 98 +- .../blocks/generator/BlockHeatGenerator.java | 64 +- .../blocks/generator/BlockLightningRod.java | 52 +- .../generator/BlockMagicEnergyAbsorber.java | 53 +- .../generator/BlockMagicEnergyConverter.java | 54 +- .../generator/BlockPlasmaGenerator.java | 52 +- .../generator/BlockSemiFluidGenerator.java | 86 +- .../blocks/generator/BlockSolarPanel.java | 88 +- .../generator/BlockThermalGenerator.java | 87 +- .../blocks/generator/BlockWaterMill.java | 62 +- .../blocks/generator/BlockWindMill.java | 63 +- .../iron_machines/BlockAlloyFurnace.java | 103 +- .../iron_machines/BlockIronFurnace.java | 175 +- .../machine/BlockAssemblingMachine.java | 85 +- .../blocks/machine/BlockChargeBench.java | 84 +- .../blocks/machine/BlockChemicalReactor.java | 85 +- .../blocks/machine/BlockChunkLoader.java | 78 +- .../blocks/machine/BlockMatterFabricator.java | 84 +- .../blocks/machine/BlockRollingMachine.java | 75 +- .../blocks/machine/BlockScrapboxinator.java | 87 +- .../blocks/machine/BlockVacuumFreezer.java | 79 +- .../techreborn/blocks/storage/BlockAESU.java | 86 +- .../blocks/storage/BlockBatBox.java | 535 +- .../techreborn/blocks/storage/BlockIDSU.java | 99 +- .../techreborn/blocks/storage/BlockLESU.java | 80 +- .../blocks/storage/BlockLESUStorage.java | 102 +- .../techreborn/blocks/storage/BlockMFE.java | 68 +- .../techreborn/blocks/storage/BlockMFSU.java | 68 +- .../blocks/tier1/BlockAlloySmelter.java | 84 +- .../blocks/tier1/BlockCompressor.java | 87 +- .../blocks/tier1/BlockElectricFurnace.java | 87 +- .../blocks/tier1/BlockExtractor.java | 87 +- .../techreborn/blocks/tier1/BlockGrinder.java | 78 +- .../blocks/tier1/BlockRecycler.java | 87 +- .../transformers/BlockHVTransformer.java | 72 +- .../transformers/BlockLVTransformer.java | 69 +- .../transformers/BlockMVTransformer.java | 70 +- .../techreborn/client/ClientMultiBlocks.java | 104 +- .../java/techreborn/client/GuiHandler.java | 637 +- .../java/techreborn/client/IconSupplier.java | 81 +- .../techreborn/client/RegisterItemJsons.java | 16 +- .../techreborn/client/StackToolTipEvent.java | 111 +- .../client/TechRebornCreativeTab.java | 21 +- .../client/TechRebornCreativeTabMisc.java | 21 +- .../client/VersionCheckerClient.java | 76 +- .../container/ContainerAlloyFurnace.java | 155 +- .../container/ContainerAlloySmelter.java | 78 +- .../container/ContainerAssemblingMachine.java | 77 +- .../client/container/ContainerBatbox.java | 130 +- .../container/ContainerBlastFurnace.java | 121 +- .../client/container/ContainerCentrifuge.java | 82 +- .../container/ContainerChargeBench.java | 60 +- .../container/ContainerChemicalReactor.java | 77 +- .../container/ContainerChunkloader.java | 45 +- .../client/container/ContainerCompressor.java | 71 +- .../client/container/ContainerCrafting.java | 109 +- .../container/ContainerDestructoPack.java | 59 +- .../container/ContainerDieselGenerator.java | 128 +- .../container/ContainerDigitalChest.java | 59 +- .../container/ContainerElectricFurnace.java | 85 +- .../client/container/ContainerExtractor.java | 124 +- .../container/ContainerFusionReactor.java | 199 +- .../client/container/ContainerGasTurbine.java | 60 +- .../client/container/ContainerGenerator.java | 154 +- .../client/container/ContainerGrinder.java | 71 +- .../client/container/ContainerIDSU.java | 141 +- .../ContainerImplosionCompressor.java | 126 +- .../ContainerIndustrialElectrolyzer.java | 74 +- .../container/ContainerIndustrialGrinder.java | 120 +- .../container/ContainerIndustrialSawmill.java | 68 +- .../container/ContainerIronFurnace.java | 78 +- .../container/ContainerMatterFabricator.java | 134 +- .../client/container/ContainerPda.java | 19 +- .../container/ContainerQuantumChest.java | 59 +- .../container/ContainerQuantumTank.java | 59 +- .../client/container/ContainerRecycler.java | 85 +- .../container/ContainerRollingMachine.java | 194 +- .../container/ContainerScrapboxinator.java | 85 +- .../ContainerSemifluidGenerator.java | 60 +- .../container/ContainerThermalGenerator.java | 60 +- .../container/ContainerVacuumFreezer.java | 115 +- .../client/container/SlotScrapbox.java | 31 +- .../java/techreborn/client/gui/GuiAesu.java | 98 +- .../client/gui/GuiAlloyFurnace.java | 88 +- .../client/gui/GuiAlloySmelter.java | 84 +- .../client/gui/GuiAssemblingMachine.java | 88 +- .../java/techreborn/client/gui/GuiBatbox.java | 97 +- .../client/gui/GuiBlastFurnace.java | 181 +- .../techreborn/client/gui/GuiCentrifuge.java | 95 +- .../techreborn/client/gui/GuiChargeBench.java | 74 +- .../client/gui/GuiChemicalReactor.java | 88 +- .../techreborn/client/gui/GuiChunkLoader.java | 93 +- .../techreborn/client/gui/GuiCompressor.java | 74 +- .../client/gui/GuiDestructoPack.java | 48 +- .../client/gui/GuiElectricFurnace.java | 74 +- .../techreborn/client/gui/GuiExtractor.java | 74 +- .../client/gui/GuiFusionReactor.java | 166 +- .../techreborn/client/gui/GuiGasTurbine.java | 62 +- .../techreborn/client/gui/GuiGenerator.java | 89 +- .../techreborn/client/gui/GuiGrinder.java | 74 +- .../java/techreborn/client/gui/GuiIDSU.java | 141 +- .../client/gui/GuiImplosionCompressor.java | 102 +- .../client/gui/GuiIndustrialElectrolyzer.java | 89 +- .../client/gui/GuiIndustrialGrinder.java | 123 +- .../client/gui/GuiIndustrialSawmill.java | 138 +- .../techreborn/client/gui/GuiIronFurnace.java | 75 +- .../java/techreborn/client/gui/GuiLesu.java | 68 +- .../client/gui/GuiMatterFabricator.java | 75 +- .../techreborn/client/gui/GuiQuantumTank.java | 61 +- .../techreborn/client/gui/GuiRecycler.java | 76 +- .../client/gui/GuiRollingMachine.java | 89 +- .../client/gui/GuiScrapboxinator.java | 79 +- .../client/gui/GuiSemifluidGenerator.java | 62 +- .../client/gui/GuiThermalGenerator.java | 62 +- .../client/gui/GuiVacuumFreezer.java | 166 +- .../java/techreborn/client/hud/ChargeHud.java | 178 +- .../client/keybindings/KeyBindings.java | 8 +- .../keybindings/KeyInputEventHandler.java | 26 +- .../render/entitys/RenderNukePrimed.java | 98 +- .../client/render/parts/ClientPartLoader.java | 33 +- .../render/parts/ClientPartModelBakery.java | 37 +- .../client/render/parts/RenderCablePart.java | 220 +- .../CasingConnectedTextureGenerator.java | 236 +- .../LesuConnectedTextureGenerator.java | 253 +- .../command/TechRebornDevCommand.java | 124 +- .../java/techreborn/compat/CompatManager.java | 185 +- .../java/techreborn/compat/ICompatModule.java | 11 +- .../compat/jei/BaseRecipeWrapper.java | 52 +- .../compat/jei/RecipeCategoryUids.java | 6 +- .../techreborn/compat/jei/RecipeUtil.java | 61 +- .../compat/jei/TechRebornJeiPlugin.java | 262 +- .../AlloySmelterRecipeCategory.java | 35 +- .../AlloySmelterRecipeHandler.java | 22 +- .../AlloySmelterRecipeWrapper.java | 16 +- .../AssemblingMachineRecipeCategory.java | 35 +- .../AssemblingMachineRecipeHandler.java | 22 +- .../AssemblingMachineRecipeWrapper.java | 16 +- .../BlastFurnaceRecipeCategory.java | 29 +- .../BlastFurnaceRecipeHandler.java | 22 +- .../BlastFurnaceRecipeWrapper.java | 18 +- .../centrifuge/CentrifugeRecipeCategory.java | 29 +- .../centrifuge/CentrifugeRecipeHandler.java | 22 +- .../centrifuge/CentrifugeRecipeWrapper.java | 28 +- .../ChemicalReactorRecipeCategory.java | 29 +- .../ChemicalReactorRecipeHandler.java | 22 +- .../ChemicalReactorRecipeWrapper.java | 16 +- .../compressor/CompressorRecipeCategory.java | 29 +- .../compressor/CompressorRecipeHandler.java | 22 +- .../compressor/CompressorRecipeWrapper.java | 16 +- .../extractor/ExtractorRecipeCategory.java | 29 +- .../jei/extractor/ExtractorRecipeHandler.java | 22 +- .../jei/extractor/ExtractorRecipeWrapper.java | 16 +- .../FusionReactorRecipeCategory.java | 91 +- .../FusionReactorRecipeHandler.java | 49 +- .../FusionReactorRecipeWrapper.java | 69 +- .../jei/grinder/GrinderRecipeCategory.java | 29 +- .../jei/grinder/GrinderRecipeHandler.java | 22 +- .../jei/grinder/GrinderRecipeWrapper.java | 16 +- .../ImplosionCompressorRecipeCategory.java | 35 +- .../ImplosionCompressorRecipeHandler.java | 22 +- .../ImplosionCompressorRecipeWrapper.java | 17 +- .../IndustrialElectrolyzerRecipeCategory.java | 29 +- .../IndustrialElectrolyzerRecipeHandler.java | 22 +- .../IndustrialElectrolyzerRecipeWrapper.java | 17 +- .../IndustrialGrinderRecipeCategory.java | 37 +- .../IndustrialGrinderRecipeHandler.java | 22 +- .../IndustrialGrinderRecipeWrapper.java | 30 +- .../IndustrialSawmillRecipeCategory.java | 37 +- .../IndustrialSawmillRecipeHandler.java | 22 +- .../IndustrialSawmillRecipeWrapper.java | 30 +- .../jei/recycler/RecyclerRecipeCategory.java | 29 +- .../jei/recycler/RecyclerRecipeHandler.java | 22 +- .../jei/recycler/RecyclerRecipeWrapper.java | 16 +- .../RollingMachineRecipeCategory.java | 38 +- .../RollingMachineRecipeHandler.java | 19 +- .../RollingMachineRecipeMaker.java | 21 +- .../RollingMachineRecipeWrapper.java | 39 +- .../jei/scrapbox/ScrapboxRecipeCategory.java | 29 +- .../jei/scrapbox/ScrapboxRecipeHandler.java | 22 +- .../jei/scrapbox/ScrapboxRecipeWrapper.java | 16 +- .../VacuumFreezerRecipeCategory.java | 29 +- .../VacuumFreezerRecipeHandler.java | 22 +- .../VacuumFreezerRecipeWrapper.java | 16 +- .../compat/waila/CompatModuleWaila.java | 40 +- .../compat/waila/WailaProviderMachines.java | 64 +- .../techreborn/config/ConfigTechReborn.java | 104 +- .../config/TechRebornConfigGui.java | 341 +- .../config/TechRebornGUIFactory.java | 42 +- .../dispenser/BehaviorDispenseScrapbox.java | 6 +- .../techreborn/entitys/EntityNukePrimed.java | 88 +- .../java/techreborn/events/OreUnifier.java | 81 +- .../java/techreborn/events/TRTickHandler.java | 43 +- src/main/java/techreborn/init/ModBlocks.java | 931 +-- src/main/java/techreborn/init/ModFluids.java | 313 +- src/main/java/techreborn/init/ModItems.java | 1338 ++-- src/main/java/techreborn/init/ModLoot.java | 67 +- src/main/java/techreborn/init/ModParts.java | 47 +- src/main/java/techreborn/init/ModRecipes.java | 5721 +++++++++-------- src/main/java/techreborn/init/ModSounds.java | 23 +- .../java/techreborn/init/RecipeCompact.java | 171 +- .../techreborn/itemblocks/ItemBlockAesu.java | 127 +- .../itemblocks/ItemBlockDigitalChest.java | 76 +- .../itemblocks/ItemBlockMachineCasing.java | 11 +- .../itemblocks/ItemBlockMachineFrame.java | 10 +- .../techreborn/itemblocks/ItemBlockOre.java | 10 +- .../techreborn/itemblocks/ItemBlockOre2.java | 10 +- .../itemblocks/ItemBlockPlayerDetector.java | 10 +- .../itemblocks/ItemBlockQuantumChest.java | 76 +- .../itemblocks/ItemBlockQuantumTank.java | 48 +- .../itemblocks/ItemBlockRubberSapling.java | 45 +- .../itemblocks/ItemBlockStorage.java | 10 +- .../itemblocks/ItemBlockStorage2.java | 11 +- src/main/java/techreborn/items/ItemCells.java | 285 +- .../java/techreborn/items/ItemCrushedOre.java | 107 +- src/main/java/techreborn/items/ItemDusts.java | 149 +- .../java/techreborn/items/ItemDustsSmall.java | 128 +- .../techreborn/items/ItemEnergyCrystal.java | 88 +- src/main/java/techreborn/items/ItemGems.java | 105 +- .../java/techreborn/items/ItemIngots.java | 110 +- .../techreborn/items/ItemLapotronCrystal.java | 88 +- .../techreborn/items/ItemLapotronicOrb.java | 91 +- .../techreborn/items/ItemLithiumBattery.java | 127 +- .../techreborn/items/ItemMissingRecipe.java | 3 +- .../java/techreborn/items/ItemNuggets.java | 108 +- src/main/java/techreborn/items/ItemParts.java | 142 +- .../java/techreborn/items/ItemPlates.java | 115 +- .../items/ItemPurifiedCrushedOre.java | 107 +- .../java/techreborn/items/ItemReBattery.java | 127 +- .../java/techreborn/items/ItemScrapBox.java | 27 +- src/main/java/techreborn/items/ItemTR.java | 14 +- .../techreborn/items/ItemTextureBase.java | 12 +- .../java/techreborn/items/ItemUUmatter.java | 31 +- .../java/techreborn/items/ItemUpgrade.java | 125 +- .../items/armor/ItemLapotronPack.java | 153 +- .../items/armor/ItemLithiumBatpack.java | 155 +- .../items/tools/ItemAdvancedChainsaw.java | 40 +- .../items/tools/ItemAdvancedDrill.java | 40 +- .../techreborn/items/tools/ItemChainsaw.java | 106 +- .../items/tools/ItemCloakingDevice.java | 170 +- .../techreborn/items/tools/ItemDebugTool.java | 59 +- .../items/tools/ItemDiamondChainsaw.java | 40 +- .../items/tools/ItemDiamondDrill.java | 40 +- .../items/tools/ItemDiamondJackhammer.java | 31 +- .../techreborn/items/tools/ItemDrill.java | 97 +- .../items/tools/ItemFluidbucket.java | 82 +- .../techreborn/items/tools/ItemHammer.java | 95 +- .../items/tools/ItemIronChainsaw.java | 40 +- .../techreborn/items/tools/ItemIronDrill.java | 40 +- .../items/tools/ItemIronJackhammer.java | 31 +- .../items/tools/ItemJackhammer.java | 100 +- .../techreborn/items/tools/ItemNanosaber.java | 82 +- .../techreborn/items/tools/ItemOmniTool.java | 247 +- .../items/tools/ItemRockCutter.java | 238 +- .../items/tools/ItemSteelJackhammer.java | 15 +- .../items/tools/ItemTechManual.java | 47 +- .../techreborn/items/tools/ItemTreeTap.java | 35 +- .../techreborn/items/tools/ItemWrench.java | 209 +- src/main/java/techreborn/lib/Key.java | 5 +- src/main/java/techreborn/lib/ModInfo.java | 63 +- src/main/java/techreborn/lib/Reference.java | 39 +- .../java/techreborn/manual/GuiManual.java | 307 +- .../techreborn/manual/PageCollection.java | 147 +- .../java/techreborn/manual/Reference.java | 5 +- .../manual/pages/AdvancedMachines.java | 87 +- .../techreborn/manual/pages/BasePage.java | 157 +- .../manual/pages/BasicMachinesPage.java | 79 +- .../techreborn/manual/pages/ContentsPage.java | 83 +- .../manual/pages/CraftingInfoPage.java | 614 +- .../manual/pages/DescriptionPage.java | 215 +- .../manual/pages/GeneratingPowerPage.java | 79 +- .../manual/pages/GettingStartedPage.java | 55 +- .../techreborn/manual/pages/TitledPage.java | 33 +- .../techreborn/manual/pages/ToolsPage.java | 117 +- .../techreborn/manual/util/ButtonUtil.java | 12 +- .../manual/util/GuiButtonAHeight.java | 82 +- .../manual/util/GuiButtonCustomTexture.java | 116 +- .../manual/util/GuiButtonItemTexture.java | 90 +- .../manual/util/GuiButtonTextOnly.java | 108 +- .../multiblocks/MultiBlockCasing.java | 782 +-- .../java/techreborn/packets/PacketAesu.java | 64 +- .../java/techreborn/packets/PacketIdsu.java | 64 +- .../java/techreborn/parts/CableMultipart.java | 771 ++- .../java/techreborn/parts/EnumCableType.java | 70 +- .../java/techreborn/parts/ICableType.java | 5 +- .../java/techreborn/parts/ItemCables.java | 130 +- .../parts/ItemStandaloneCables.java | 133 +- .../parts/StandalonePartCompact.java | 37 +- .../techreborn/parts/TechRebornParts.java | 58 +- .../techreborn/parts/types/CopperCable.java | 12 +- .../parts/types/GlassFiberCable.java | 12 +- .../techreborn/parts/types/GoldCable.java | 12 +- .../java/techreborn/parts/types/HVCable.java | 12 +- .../parts/types/InsulatedCopperCable.java | 12 +- .../parts/types/InsulatedGoldCable.java | 12 +- .../parts/types/InsulatedHVCable.java | 12 +- .../java/techreborn/parts/types/TinCable.java | 12 +- .../parts/walia/IPartWaliaProvider.java | 5 +- .../parts/walia/WailaMcMultiPartCompact.java | 41 +- .../parts/walia/WaliaPartProvider.java | 111 +- .../java/techreborn/power/PowerTickEvent.java | 7 +- .../java/techreborn/power/TRPowerNet.java | 558 +- .../java/techreborn/proxies/ClientProxy.java | 65 +- .../java/techreborn/proxies/CommonProxy.java | 32 +- src/main/java/techreborn/tiles/TileAesu.java | 281 +- .../techreborn/tiles/TileAlloyFurnace.java | 667 +- .../techreborn/tiles/TileAlloySmelter.java | 413 +- .../tiles/TileAssemblingMachine.java | 405 +- .../techreborn/tiles/TileBlastFurnace.java | 482 +- .../java/techreborn/tiles/TileCentrifuge.java | 410 +- .../techreborn/tiles/TileChargeBench.java | 389 +- .../techreborn/tiles/TileChemicalReactor.java | 404 +- .../techreborn/tiles/TileChunkLoader.java | 288 +- .../techreborn/tiles/TileDigitalChest.java | 402 +- .../tiles/TileImplosionCompressor.java | 453 +- .../tiles/TileIndustrialElectrolyzer.java | 409 +- .../tiles/TileIndustrialGrinder.java | 550 +- .../tiles/TileIndustrialSawmill.java | 545 +- .../techreborn/tiles/TileIronFurnace.java | 558 +- .../techreborn/tiles/TileMachineCasing.java | 85 +- .../tiles/TileMatterFabricator.java | 514 +- .../techreborn/tiles/TilePlayerDectector.java | 184 +- .../techreborn/tiles/TileQuantumChest.java | 448 +- .../techreborn/tiles/TileQuantumTank.java | 440 +- .../techreborn/tiles/TileRollingMachine.java | 501 +- .../techreborn/tiles/TileScrapboxinator.java | 180 +- .../techreborn/tiles/TileVacuumFreezer.java | 421 +- .../TileEntityFusionController.java | 683 +- .../tiles/generator/TileDieselGenerator.java | 458 +- .../generator/TileDragonEggSiphoner.java | 328 +- .../tiles/generator/TileGasTurbine.java | 486 +- .../tiles/generator/TileGenerator.java | 452 +- .../tiles/generator/TileHeatGenerator.java | 188 +- .../generator/TileSemifluidGenerator.java | 494 +- .../tiles/generator/TileSolarPanel.java | 144 +- .../tiles/generator/TileThermalGenerator.java | 492 +- .../tiles/generator/TileWaterMill.java | 109 +- .../tiles/generator/TileWindMill.java | 93 +- .../techreborn/tiles/idsu/IDSUManager.java | 377 +- .../java/techreborn/tiles/idsu/TileIDSU.java | 311 +- .../techreborn/tiles/lesu/LesuNetwork.java | 92 +- .../java/techreborn/tiles/lesu/TileLesu.java | 195 +- .../tiles/lesu/TileLesuStorage.java | 111 +- .../techreborn/tiles/storage/TileBatBox.java | 125 +- .../techreborn/tiles/storage/TileMFE.java | 48 +- .../techreborn/tiles/storage/TileMFSU.java | 48 +- .../tiles/teir1/TileCompressor.java | 381 +- .../tiles/teir1/TileElectricFurnace.java | 562 +- .../techreborn/tiles/teir1/TileExtractor.java | 381 +- .../techreborn/tiles/teir1/TileGrinder.java | 379 +- .../techreborn/tiles/teir1/TileRecycler.java | 560 +- .../tiles/transformers/TileHVTransformer.java | 30 +- .../tiles/transformers/TileLVTransformer.java | 51 +- .../tiles/transformers/TileMVTransformer.java | 30 +- .../java/techreborn/utils/OreDictUtils.java | 28 +- .../java/techreborn/utils/RecipeUtils.java | 23 +- .../damageSources/ElectrialShockSource.java | 10 +- .../damageSources/FusionDamageSource.java | 10 +- .../techreborn/world/RubberTreeGenerator.java | 295 +- .../techreborn/world/TechRebornRetroGen.java | 135 +- .../techreborn/world/TechRebornWorldGen.java | 381 +- .../world/config/IOreNameProvider.java | 5 +- .../techreborn/world/config/OreConfig.java | 55 +- .../world/config/RubberTreeConfig.java | 17 +- .../world/config/WorldGenConfig.java | 17 +- 444 files changed, 32383 insertions(+), 26254 deletions(-) create mode 100644 CodeFormatter.xml diff --git a/CodeFormatter.xml b/CodeFormatter.xml new file mode 100644 index 000000000..10c498c26 --- /dev/null +++ b/CodeFormatter.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/techreborn/Core.java b/src/main/java/techreborn/Core.java index 9ec00ad81..6daafe2a7 100644 --- a/src/main/java/techreborn/Core.java +++ b/src/main/java/techreborn/Core.java @@ -1,5 +1,7 @@ package techreborn; +import java.io.File; + import net.minecraft.block.BlockDispenser; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.event.ConfigChangedEvent; @@ -14,7 +16,9 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; + import org.apache.commons.lang3.time.StopWatch; + import reborncore.common.multiblock.MultiblockEventHandler; import reborncore.common.multiblock.MultiblockServerTickHandler; import reborncore.common.packets.AddDiscriminatorEvent; @@ -33,19 +37,24 @@ import techreborn.dispenser.BehaviorDispenseScrapbox; import techreborn.entitys.EntityNukePrimed; import techreborn.events.OreUnifier; import techreborn.events.TRTickHandler; -import techreborn.init.*; +import techreborn.init.ModBlocks; +import techreborn.init.ModFluids; +import techreborn.init.ModItems; +import techreborn.init.ModLoot; +import techreborn.init.ModParts; +import techreborn.init.ModRecipes; +import techreborn.init.ModSounds; +import techreborn.init.RecipeCompact; import techreborn.lib.ModInfo; import techreborn.packets.PacketAesu; import techreborn.packets.PacketIdsu; import techreborn.proxies.CommonProxy; import techreborn.tiles.idsu.IDSUManager; -import techreborn.utils.StackWIPHandler; import techreborn.world.TechRebornWorldGen; -import java.io.File; - @Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCUIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.9]") -public class Core { +public class Core +{ public static ConfigTechReborn config; @SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS) @@ -64,14 +73,16 @@ public class Core { public static TechRebornWorldGen worldGen; @Mod.EventHandler - public void preinit(FMLPreInitializationEvent event) { + public void preinit(FMLPreInitializationEvent event) + { event.getModMetadata().version = ModInfo.MOD_VERSION; INSTANCE = this; FMLCommonHandler.instance().bus().register(this); MinecraftForge.EVENT_BUS.register(this); configDir = new File(event.getModConfigurationDirectory(), "techreborn"); - if(!configDir.exists()){ + if (!configDir.exists()) + { configDir.mkdir(); } config = ConfigTechReborn.initialize(new File(configDir, "main.cfg")); @@ -81,10 +92,11 @@ public class Core { recipeCompact = new RecipeCompact(); TechRebornAPI.recipeCompact = recipeCompact; - for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) { + for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) + { compatModule.preInit(event); } - //Entitys + // Entitys EntityRegistry.registerModEntity(EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true); proxy.preInit(event); @@ -96,7 +108,8 @@ public class Core { } @Mod.EventHandler - public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException { + public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException + { // Register ModBlocks ModBlocks.init(); // Register Fluids @@ -107,10 +120,11 @@ public class Core { ModLoot.init(); // Multiparts ModParts.init(); - //Sounds + // Sounds ModSounds.init(); // Compat - for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) { + for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) + { compatModule.init(event); } // Recipes @@ -134,24 +148,27 @@ public class Core { MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler()); // IDSU manager IDSUManager.INSTANCE = new IDSUManager(); - //Event busses + // Event busses MinecraftForge.EVENT_BUS.register(IDSUManager.INSTANCE); MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler()); MinecraftForge.EVENT_BUS.register(new TRTickHandler()); MinecraftForge.EVENT_BUS.register(new OreUnifier()); MinecraftForge.EVENT_BUS.register(worldGen.retroGen); MinecraftForge.EVENT_BUS.register(new StackWIPHandler()); - //Scrapbox - if (config.scrapboxDispenser) { + // Scrapbox + if (config.scrapboxDispenser) + { BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.scrapBox, new BehaviorDispenseScrapbox()); } logHelper.info("Initialization Complete"); } @Mod.EventHandler - public void postinit(FMLPostInitializationEvent event) throws Exception { + public void postinit(FMLPostInitializationEvent event) throws Exception + { // Has to be done here as Buildcraft registers their recipes late - for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) { + for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) + { compatModule.postInit(event); } proxy.postInit(event); @@ -164,22 +181,27 @@ public class Core { } @Mod.EventHandler - public void serverStarting(FMLServerStartingEvent event) { + public void serverStarting(FMLServerStartingEvent event) + { event.registerServerCommand(new TechRebornDevCommand()); - for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) { + for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) + { compatModule.serverStarting(event); } } @SubscribeEvent - public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent cfgChange) { - if (cfgChange.modID.equals("TechReborn")) { + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent cfgChange) + { + if (cfgChange.modID.equals("TechReborn")) + { ConfigTechReborn.Configs(); } } @SubscribeEvent - public void addDiscriminator(AddDiscriminatorEvent event) { + public void addDiscriminator(AddDiscriminatorEvent event) + { event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketAesu.class); event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketIdsu.class); } diff --git a/src/main/java/techreborn/achievement/AchievementMod.java b/src/main/java/techreborn/achievement/AchievementMod.java index 4cc7e9f6b..2f5ac4f35 100644 --- a/src/main/java/techreborn/achievement/AchievementMod.java +++ b/src/main/java/techreborn/achievement/AchievementMod.java @@ -1,33 +1,33 @@ package techreborn.achievement; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.Achievement; -import java.util.ArrayList; -import java.util.List; +public class AchievementMod extends Achievement +{ -public class AchievementMod extends Achievement { + public static List achievements = new ArrayList(); - public static List achievements = new ArrayList(); + public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent) + { + super("achievement.techreborn:" + name, "TechReborn:" + name, x, y, icon, parent); + achievements.add(this); + registerStat(); + } - public AchievementMod(String name, int x, int y, ItemStack icon, - Achievement parent) { - super("achievement.techreborn:" + name, "TechReborn:" + name, x, y, - icon, parent); - achievements.add(this); - registerStat(); - } + public AchievementMod(String name, int x, int y, Item icon, Achievement parent) + { + this(name, x, y, new ItemStack(icon), parent); + } - public AchievementMod(String name, int x, int y, Item icon, - Achievement parent) { - this(name, x, y, new ItemStack(icon), parent); - } - - public AchievementMod(String name, int x, int y, Block icon, - Achievement parent) { - this(name, x, y, new ItemStack(icon), parent); - } + public AchievementMod(String name, int x, int y, Block icon, Achievement parent) + { + this(name, x, y, new ItemStack(icon), parent); + } } diff --git a/src/main/java/techreborn/achievement/AchievementTriggerer.java b/src/main/java/techreborn/achievement/AchievementTriggerer.java index 9428b5f7e..05afb747a 100644 --- a/src/main/java/techreborn/achievement/AchievementTriggerer.java +++ b/src/main/java/techreborn/achievement/AchievementTriggerer.java @@ -8,29 +8,32 @@ import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent; import reborncore.common.achievement.ICraftAchievement; import reborncore.common.achievement.IPickupAchievement; -public class AchievementTriggerer { +public class AchievementTriggerer +{ - @SubscribeEvent - public void onItemPickedUp(ItemPickupEvent event) { - ItemStack stack = event.pickedUp.getEntityItem(); - if (stack != null && stack.getItem() instanceof IPickupAchievement) { - Achievement achievement = ((IPickupAchievement) stack.getItem()) - .getAchievementOnPickup(stack, event.player, event.pickedUp); - if (achievement != null) - event.player.addStat(achievement, 1); - } - } + @SubscribeEvent + public void onItemPickedUp(ItemPickupEvent event) + { + ItemStack stack = event.pickedUp.getEntityItem(); + if (stack != null && stack.getItem() instanceof IPickupAchievement) + { + Achievement achievement = ((IPickupAchievement) stack.getItem()).getAchievementOnPickup(stack, event.player, + event.pickedUp); + if (achievement != null) + event.player.addStat(achievement, 1); + } + } - @SubscribeEvent - public void onItemCrafted(ItemCraftedEvent event) { - if (event.crafting != null - && event.crafting.getItem() instanceof ICraftAchievement) { - Achievement achievement = ((ICraftAchievement) event.crafting - .getItem()).getAchievementOnCraft(event.crafting, - event.player, event.craftMatrix); - if (achievement != null) - event.player.addStat(achievement, 1); - } - } + @SubscribeEvent + public void onItemCrafted(ItemCraftedEvent event) + { + if (event.crafting != null && event.crafting.getItem() instanceof ICraftAchievement) + { + Achievement achievement = ((ICraftAchievement) event.crafting.getItem()) + .getAchievementOnCraft(event.crafting, event.player, event.craftMatrix); + if (achievement != null) + event.player.addStat(achievement, 1); + } + } } diff --git a/src/main/java/techreborn/achievement/TRAchievements.java b/src/main/java/techreborn/achievement/TRAchievements.java index 62a868a25..d4be4acbc 100644 --- a/src/main/java/techreborn/achievement/TRAchievements.java +++ b/src/main/java/techreborn/achievement/TRAchievements.java @@ -7,32 +7,29 @@ import net.minecraftforge.fml.common.FMLCommonHandler; import techreborn.init.ModBlocks; import techreborn.lib.ModInfo; -public class TRAchievements { +public class TRAchievements +{ - public static AchievementPage techrebornPage; - public static int pageIndex; + public static AchievementPage techrebornPage; + public static int pageIndex; - public static Achievement ore_PickUp; - public static Achievement thermalgen_Craft; - public static Achievement centrifuge_Craft; + public static Achievement ore_PickUp; + public static Achievement thermalgen_Craft; + public static Achievement centrifuge_Craft; - public static void init() { - ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack( - ModBlocks.ore, 1, 0), null); - centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1, - ModBlocks.centrifuge, ore_PickUp); - thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1, - ModBlocks.thermalGenerator, ore_PickUp); + public static void init() + { + ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack(ModBlocks.ore, 1, 0), null); + centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1, ModBlocks.centrifuge, ore_PickUp); + thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1, ModBlocks.thermalGenerator, ore_PickUp); - pageIndex = AchievementPage.getAchievementPages().size(); - techrebornPage = new AchievementPage(ModInfo.MOD_NAME, - AchievementMod.achievements - .toArray(new Achievement[AchievementMod.achievements - .size()])); - AchievementPage.registerAchievementPage(techrebornPage); + pageIndex = AchievementPage.getAchievementPages().size(); + techrebornPage = new AchievementPage(ModInfo.MOD_NAME, + AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()])); + AchievementPage.registerAchievementPage(techrebornPage); - FMLCommonHandler.instance().bus().register(new AchievementTriggerer()); + FMLCommonHandler.instance().bus().register(new AchievementTriggerer()); - } + } } diff --git a/src/main/java/techreborn/api/RollingMachineRecipe.java b/src/main/java/techreborn/api/RollingMachineRecipe.java index 4ca34459b..2963e8b90 100644 --- a/src/main/java/techreborn/api/RollingMachineRecipe.java +++ b/src/main/java/techreborn/api/RollingMachineRecipe.java @@ -1,5 +1,9 @@ package techreborn.api; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -11,111 +15,128 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; +public class RollingMachineRecipe +{ -public class RollingMachineRecipe { + private final List recipes = new ArrayList(); - private final List recipes = new ArrayList(); + public static final RollingMachineRecipe instance = new RollingMachineRecipe(); - public static final RollingMachineRecipe instance = new RollingMachineRecipe(); + public void addShapedOreRecipe(ItemStack outputItemStack, Object... objectInputs) + { + recipes.add(new ShapedOreRecipe(outputItemStack, objectInputs)); + } - public void addShapedOreRecipe(ItemStack outputItemStack, - Object... objectInputs) { - recipes.add(new ShapedOreRecipe(outputItemStack, objectInputs)); - } + public void addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs) + { + recipes.add(new ShapelessOreRecipe(outputItemStack, objectInputs)); + } - public void addShapelessOreRecipe(ItemStack outputItemStack, - Object... objectInputs) { - recipes - .add(new ShapelessOreRecipe(outputItemStack, objectInputs)); - } + public void addRecipe(ItemStack output, Object... components) + { + String s = ""; + int i = 0; + int j = 0; + int k = 0; + if (components[i] instanceof String[]) + { + String as[] = (String[]) components[i++]; + for (int l = 0; l < as.length; l++) + { + String s2 = as[l]; + k++; + j = s2.length(); + s = (new StringBuilder()).append(s).append(s2).toString(); + } + } else + { + while (components[i] instanceof String) + { + String s1 = (String) components[i++]; + k++; + j = s1.length(); + s = (new StringBuilder()).append(s).append(s1).toString(); + } + } + HashMap hashmap = new HashMap(); + for (; i < components.length; i += 2) + { + Character character = (Character) components[i]; + ItemStack itemstack1 = null; + if (components[i + 1] instanceof Item) + { + itemstack1 = new ItemStack((Item) components[i + 1]); + } else if (components[i + 1] instanceof Block) + { + itemstack1 = new ItemStack((Block) components[i + 1], 1, -1); + } else if (components[i + 1] instanceof ItemStack) + { + itemstack1 = (ItemStack) components[i + 1]; + } + hashmap.put(character, itemstack1); + } - public void addRecipe(ItemStack output, Object... components) { - String s = ""; - int i = 0; - int j = 0; - int k = 0; - if (components[i] instanceof String[]) { - String as[] = (String[]) components[i++]; - for (int l = 0; l < as.length; l++) { - String s2 = as[l]; - k++; - j = s2.length(); - s = (new StringBuilder()).append(s).append(s2).toString(); - } - } else { - while (components[i] instanceof String) { - String s1 = (String) components[i++]; - k++; - j = s1.length(); - s = (new StringBuilder()).append(s).append(s1).toString(); - } - } - HashMap hashmap = new HashMap(); - for (; i < components.length; i += 2) { - Character character = (Character) components[i]; - ItemStack itemstack1 = null; - if (components[i + 1] instanceof Item) { - itemstack1 = new ItemStack((Item) components[i + 1]); - } else if (components[i + 1] instanceof Block) { - itemstack1 = new ItemStack((Block) components[i + 1], 1, -1); - } else if (components[i + 1] instanceof ItemStack) { - itemstack1 = (ItemStack) components[i + 1]; - } - hashmap.put(character, itemstack1); - } + ItemStack recipeArray[] = new ItemStack[j * k]; + for (int i1 = 0; i1 < j * k; i1++) + { + char c = s.charAt(i1); + if (hashmap.containsKey(Character.valueOf(c))) + { + recipeArray[i1] = ((ItemStack) hashmap.get(Character.valueOf(c))).copy(); + } else + { + recipeArray[i1] = null; + } + } - ItemStack recipeArray[] = new ItemStack[j * k]; - for (int i1 = 0; i1 < j * k; i1++) { - char c = s.charAt(i1); - if (hashmap.containsKey(Character.valueOf(c))) { - recipeArray[i1] = ((ItemStack) hashmap - .get(Character.valueOf(c))).copy(); - } else { - recipeArray[i1] = null; - } - } + recipes.add(new ShapedRecipes(j, k, recipeArray, output)); + } - recipes.add(new ShapedRecipes(j, k, recipeArray, output)); - } + public void addShapelessRecipe(ItemStack output, Object... components) + { + List ingredients = new ArrayList(); + for (int j = 0; j < components.length; j++) + { + Object obj = components[j]; + if (obj instanceof ItemStack) + { + ingredients.add(((ItemStack) obj).copy()); + continue; + } + if (obj instanceof Item) + { + ingredients.add(new ItemStack((Item) obj)); + continue; + } + if (obj instanceof Block) + { + ingredients.add(new ItemStack((Block) obj)); + } else + { + throw new RuntimeException("Invalid shapeless recipe!"); + } + } - public void addShapelessRecipe(ItemStack output, Object... components) { - List ingredients = new ArrayList(); - for (int j = 0; j < components.length; j++) { - Object obj = components[j]; - if (obj instanceof ItemStack) { - ingredients.add(((ItemStack) obj).copy()); - continue; - } - if (obj instanceof Item) { - ingredients.add(new ItemStack((Item) obj)); - continue; - } - if (obj instanceof Block) { - ingredients.add(new ItemStack((Block) obj)); - } else { - throw new RuntimeException("Invalid shapeless recipe!"); - } - } + recipes.add(new ShapelessRecipes(output, ingredients)); + } - recipes.add(new ShapelessRecipes(output, ingredients)); - } + public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) + { + for (int k = 0; k < recipes.size(); k++) + { + IRecipe irecipe = (IRecipe) recipes.get(k); + if (irecipe.matches(inv, world)) + { + return irecipe.getCraftingResult(inv); + } + } - public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) { - for (int k = 0; k < recipes.size(); k++) { - IRecipe irecipe = (IRecipe) recipes.get(k); - if (irecipe.matches(inv, world)) { - return irecipe.getCraftingResult(inv); - } - } + return null; + } - return null; - } - - public List getRecipeList() { - return recipes; - } + public List getRecipeList() + { + return recipes; + } } diff --git a/src/main/java/techreborn/api/ScrapboxList.java b/src/main/java/techreborn/api/ScrapboxList.java index afe701939..cff6284ef 100644 --- a/src/main/java/techreborn/api/ScrapboxList.java +++ b/src/main/java/techreborn/api/ScrapboxList.java @@ -1,15 +1,17 @@ package techreborn.api; -import net.minecraft.item.ItemStack; - import java.util.ArrayList; import java.util.List; -public class ScrapboxList { - +import net.minecraft.item.ItemStack; + +public class ScrapboxList +{ + public static List stacks = new ArrayList(); - - public static void addItemStackToList(ItemStack stack){ + + public static void addItemStackToList(ItemStack stack) + { stacks.add(stack); } } diff --git a/src/main/java/techreborn/api/SlotUpgrade.java b/src/main/java/techreborn/api/SlotUpgrade.java index 6789f1a88..f87ca7c3f 100644 --- a/src/main/java/techreborn/api/SlotUpgrade.java +++ b/src/main/java/techreborn/api/SlotUpgrade.java @@ -5,17 +5,21 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import techreborn.api.upgrade.IMachineUpgrade; -public class SlotUpgrade extends Slot{ +public class SlotUpgrade extends Slot +{ - public SlotUpgrade(IInventory inventoryIn, int index, int xPosition, int yPosition) { + public SlotUpgrade(IInventory inventoryIn, int index, int xPosition, int yPosition) + { super(inventoryIn, index, xPosition, yPosition); } - + @Override - public boolean isItemValid(ItemStack stack) { - if(stack.getItem() instanceof IMachineUpgrade){ + public boolean isItemValid(ItemStack stack) + { + if (stack.getItem() instanceof IMachineUpgrade) + { return true; - } - else return false; + } else + return false; } } diff --git a/src/main/java/techreborn/api/TechRebornAPI.java b/src/main/java/techreborn/api/TechRebornAPI.java index 51906eaa5..71989a038 100644 --- a/src/main/java/techreborn/api/TechRebornAPI.java +++ b/src/main/java/techreborn/api/TechRebornAPI.java @@ -3,34 +3,37 @@ package techreborn.api; import net.minecraft.item.ItemStack; import techreborn.api.recipe.IRecipeCompact; -public final class TechRebornAPI { +public final class TechRebornAPI +{ - public static IRecipeCompact recipeCompact; + public static IRecipeCompact recipeCompact; - public static void addRollingOreMachinceRecipe(ItemStack output, - Object... components) { - RollingMachineRecipe.instance.addShapedOreRecipe(output, components); - } + public static void addRollingOreMachinceRecipe(ItemStack output, Object... components) + { + RollingMachineRecipe.instance.addShapedOreRecipe(output, components); + } - public static void addShapelessOreRollingMachinceRecipe(ItemStack output, - Object... components) { - RollingMachineRecipe.instance.addShapelessOreRecipe(output, components); - } + public static void addShapelessOreRollingMachinceRecipe(ItemStack output, Object... components) + { + RollingMachineRecipe.instance.addShapelessOreRecipe(output, components); + } - public static void addRollingMachinceRecipe(ItemStack output, - Object... components) { - RollingMachineRecipe.instance.addRecipe(output, components); - } + public static void addRollingMachinceRecipe(ItemStack output, Object... components) + { + RollingMachineRecipe.instance.addRecipe(output, components); + } - public static void addShapelessRollingMachinceRecipe(ItemStack output, - Object... components) { - RollingMachineRecipe.instance.addShapelessRecipe(output, components); - } + public static void addShapelessRollingMachinceRecipe(ItemStack output, Object... components) + { + RollingMachineRecipe.instance.addShapelessRecipe(output, components); + } } -class RegisteredItemRecipe extends Exception { - public RegisteredItemRecipe(String message) { - super(message); - } +class RegisteredItemRecipe extends Exception +{ + public RegisteredItemRecipe(String message) + { + super(message); + } } diff --git a/src/main/java/techreborn/api/TechRebornBlocks.java b/src/main/java/techreborn/api/TechRebornBlocks.java index 723e2c5aa..3093b43bc 100644 --- a/src/main/java/techreborn/api/TechRebornBlocks.java +++ b/src/main/java/techreborn/api/TechRebornBlocks.java @@ -1,82 +1,49 @@ package techreborn.api; - import net.minecraft.block.Block; -public class TechRebornBlocks { +public class TechRebornBlocks +{ - public static Block getBlock(String name) { - try { - Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null); - return e instanceof Block ? (Block) e : null; - } catch (NoSuchFieldException e1) { - e1.printStackTrace(); - return null; - } catch (IllegalAccessException e) { - e.printStackTrace(); - return null; - } catch (ClassNotFoundException e) { - e.printStackTrace(); - return null; - } - } + public static Block getBlock(String name) + { + try + { + Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null); + return e instanceof Block ? (Block) e : null; + } catch (NoSuchFieldException e1) + { + e1.printStackTrace(); + return null; + } catch (IllegalAccessException e) + { + e.printStackTrace(); + return null; + } catch (ClassNotFoundException e) + { + e.printStackTrace(); + return null; + } + } - /** - - Full list of blocks. - - thermalGenerator - quantumTank - quantumChest - digitalChest - centrifuge - RollingMachine - MachineCasing - BlastFurnace - AlloySmelter - Grinder - ImplosionCompressor - MatterFabricator - ChunkLoader - HighAdvancedMachineBlock - Dragoneggenergysiphoner - Magicenergeyconverter - AssemblyMachine - DieselGenerator - IndustrialElectrolyzer - MagicalAbsorber - Semifluidgenerator - Gasturbine - AlloyFurnace - ChemicalReactor - lathe - platecuttingmachine - Idsu - Aesu - Lesu - Supercondensator - Woodenshelf - Metalshelf - LesuStorage - Distillationtower - ElectricCraftingTable - VacuumFreezer - PlasmaGenerator - FusionControlComputer - ComputerCube - FusionCoil - LightningRod - heatGenerator - industrialSawmill - chargeBench - farm - - ore - storage - storage2 - machineframe - - - */ + /** + * + * Full list of blocks. + * + * thermalGenerator quantumTank quantumChest digitalChest centrifuge + * RollingMachine MachineCasing BlastFurnace AlloySmelter Grinder + * ImplosionCompressor MatterFabricator ChunkLoader HighAdvancedMachineBlock + * Dragoneggenergysiphoner Magicenergeyconverter AssemblyMachine + * DieselGenerator IndustrialElectrolyzer MagicalAbsorber Semifluidgenerator + * Gasturbine AlloyFurnace ChemicalReactor lathe platecuttingmachine Idsu + * Aesu Lesu Supercondensator Woodenshelf Metalshelf LesuStorage + * Distillationtower ElectricCraftingTable VacuumFreezer PlasmaGenerator + * FusionControlComputer ComputerCube FusionCoil LightningRod heatGenerator + * industrialSawmill chargeBench farm + * + * ore storage storage2 machineframe + * + * + */ } diff --git a/src/main/java/techreborn/api/TechRebornItems.java b/src/main/java/techreborn/api/TechRebornItems.java index 3930d41fd..28a9ffd24 100644 --- a/src/main/java/techreborn/api/TechRebornItems.java +++ b/src/main/java/techreborn/api/TechRebornItems.java @@ -2,79 +2,47 @@ package techreborn.api; import net.minecraft.item.Item; -public class TechRebornItems { +public class TechRebornItems +{ - public static Item getItem(String name) { - try { - Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null); - return e instanceof Item ? (Item) e : null; - } catch (NoSuchFieldException e1) { - e1.printStackTrace(); - return null; - } catch (IllegalAccessException e) { - e.printStackTrace(); - return null; - } catch (ClassNotFoundException e) { - e.printStackTrace(); - return null; - } - } - - /* - - Items - - gems - ingots - nuggets - dusts - smallDusts - tinyDusts - parts - cells - rockCutter - lithiumBatpack - lapotronpack - omniTool - advancedDrill - lapotronicOrb - manuel - uuMatter - plate - rods - crushedOre - purifiedCrushedOre - cloakingDevice + public static Item getItem(String name) + { + try + { + Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null); + return e instanceof Item ? (Item) e : null; + } catch (NoSuchFieldException e1) + { + e1.printStackTrace(); + return null; + } catch (IllegalAccessException e) + { + e.printStackTrace(); + return null; + } catch (ClassNotFoundException e) + { + e.printStackTrace(); + return null; + } + } - bucketBerylium - bucketcalcium - bucketcalciumcarbonate - bucketChlorite - bucketDeuterium - bucketGlyceryl - bucketHelium - bucketHelium3 - bucketHeliumplasma - bucketHydrogen - bucketLithium - bucketMercury - bucketMethane - bucketNitrocoalfuel - bucketNitrofuel - bucketNitrogen - bucketNitrogendioxide - bucketPotassium - bucketSilicon - bucketSodium - bucketSodiumpersulfate - bucketTritium - bucketWolframium - - hammerIron - hammerDiamond - upgrades - farmPatten - - */ + /* + * + * Items + * + * gems ingots nuggets dusts smallDusts tinyDusts parts cells rockCutter + * lithiumBatpack lapotronpack omniTool advancedDrill lapotronicOrb manuel + * uuMatter plate rods crushedOre purifiedCrushedOre cloakingDevice + * + * bucketBerylium bucketcalcium bucketcalciumcarbonate bucketChlorite + * bucketDeuterium bucketGlyceryl bucketHelium bucketHelium3 + * bucketHeliumplasma bucketHydrogen bucketLithium bucketMercury + * bucketMethane bucketNitrocoalfuel bucketNitrofuel bucketNitrogen + * bucketNitrogendioxide bucketPotassium bucketSilicon bucketSodium + * bucketSodiumpersulfate bucketTritium bucketWolframium + * + * hammerIron hammerDiamond upgrades farmPatten + * + */ } diff --git a/src/main/java/techreborn/api/package-info.java b/src/main/java/techreborn/api/package-info.java index 99e5b33b3..5a06d53dc 100644 --- a/src/main/java/techreborn/api/package-info.java +++ b/src/main/java/techreborn/api/package-info.java @@ -1,4 +1,2 @@ -@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api; - -import net.minecraftforge.fml.common.API; - +@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") +package techreborn.api; diff --git a/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java b/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java index de6bd2f8d..0f82d88ed 100644 --- a/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java +++ b/src/main/java/techreborn/api/reactor/FusionReactorRecipe.java @@ -1,86 +1,100 @@ package techreborn.api.reactor; - import net.minecraft.item.ItemStack; -public class FusionReactorRecipe { +public class FusionReactorRecipe +{ - /** - * This is the item stack that is required in the top slot - * - * This cannot be null - */ - ItemStack topInput; + /** + * This is the item stack that is required in the top slot + * + * This cannot be null + */ + ItemStack topInput; - /** - * This is the item stack that is required in the bottom slot - * - * This can be null - */ - ItemStack bottomInput; + /** + * This is the item stack that is required in the bottom slot + * + * This can be null + */ + ItemStack bottomInput; - /** - * This is the output stack - * - * This cannot be null - */ - ItemStack output; + /** + * This is the output stack + * + * This cannot be null + */ + ItemStack output; + /** + * This is the required eu that has to be in the rector for the reaction to + * start + */ + double startEU; + /** + * This is the eu that changes every tick, set as a minus number to use + * power and a positive number to gen power. + */ + double euTick; - /** - * This is the required eu that has to be in the rector for the reaction to start - */ - double startEU; - /** - * This is the eu that changes every tick, set as a minus number to use power and a positive number to gen power. - */ - double euTick; + /** + * This is the time in ticks that the reaction takes to complete + */ + int tickTime; - /** - * This is the time in ticks that the reaction takes to complete - */ - int tickTime; + /** + * + * @param topInput + * This is the top slot stack + * @param bottomInput + * This is the bottom slot stack + * @param output + * This is the output stack + * @param startEU + * This is the inital EU amount + * @param euTick + * This is the eu that is transfured every tick + * @param tickTime + * This is the time the recipe takes to process + */ + public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, + double euTick, int tickTime) + { + this.topInput = topInput; + this.bottomInput = bottomInput; + this.output = output; + this.startEU = startEU; + this.euTick = euTick; + this.tickTime = tickTime; + } - /** - * - * @param topInput This is the top slot stack - * @param bottomInput This is the bottom slot stack - * @param output This is the output stack - * @param startEU This is the inital EU amount - * @param euTick This is the eu that is transfured every tick - * @param tickTime This is the time the recipe takes to process - */ - public FusionReactorRecipe(ItemStack topInput, ItemStack bottomInput, ItemStack output, double startEU, double euTick, int tickTime) { - this.topInput = topInput; - this.bottomInput = bottomInput; - this.output = output; - this.startEU = startEU; - this.euTick = euTick; - this.tickTime = tickTime; - } + public ItemStack getTopInput() + { + return topInput; + } + public ItemStack getBottomInput() + { + return bottomInput; + } - public ItemStack getTopInput() { - return topInput; - } + public ItemStack getOutput() + { + return output; + } - public ItemStack getBottomInput() { - return bottomInput; - } + public double getStartEU() + { + return startEU; + } - public ItemStack getOutput() { - return output; - } + public double getEuTick() + { + return euTick; + } - public double getStartEU() { - return startEU; - } - - public double getEuTick() { - return euTick; - } - - public int getTickTime() { - return tickTime; - } + public int getTickTime() + { + return tickTime; + } } diff --git a/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java b/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java index 1a23ce006..ad532bbd5 100644 --- a/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java +++ b/src/main/java/techreborn/api/reactor/FusionReactorRecipeHelper.java @@ -1,21 +1,23 @@ package techreborn.api.reactor; - import java.util.ArrayList; -public class FusionReactorRecipeHelper { +public class FusionReactorRecipeHelper +{ - /** - * This is the list of all the recipes - */ - public static ArrayList reactorRecipes = new ArrayList(); + /** + * This is the list of all the recipes + */ + public static ArrayList reactorRecipes = new ArrayList(); - /** - * Register your reactor recipe here - * - * @param reactorRecipe the recipe you want to add - */ - public static void registerRecipe(FusionReactorRecipe reactorRecipe){ - reactorRecipes.add(reactorRecipe); - } + /** + * Register your reactor recipe here + * + * @param reactorRecipe + * the recipe you want to add + */ + public static void registerRecipe(FusionReactorRecipe reactorRecipe) + { + reactorRecipes.add(reactorRecipe); + } } diff --git a/src/main/java/techreborn/api/reactor/package-info.java b/src/main/java/techreborn/api/reactor/package-info.java index 24a938caf..29e213bdd 100644 --- a/src/main/java/techreborn/api/reactor/package-info.java +++ b/src/main/java/techreborn/api/reactor/package-info.java @@ -1,4 +1,2 @@ -@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.reactor; - -import net.minecraftforge.fml.common.API; - +@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") +package techreborn.api.reactor; diff --git a/src/main/java/techreborn/api/recipe/BaseRecipe.java b/src/main/java/techreborn/api/recipe/BaseRecipe.java index da81cd469..550fa504c 100644 --- a/src/main/java/techreborn/api/recipe/BaseRecipe.java +++ b/src/main/java/techreborn/api/recipe/BaseRecipe.java @@ -1,92 +1,105 @@ package techreborn.api.recipe; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - import java.util.ArrayList; import java.util.List; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + /** * Extend this to add a recipe */ -public abstract class BaseRecipe implements IBaseRecipeType, Cloneable { +public abstract class BaseRecipe implements IBaseRecipeType, Cloneable +{ - public ArrayList inputs; + public ArrayList inputs; - private ArrayList outputs; + private ArrayList outputs; - public String name; + public String name; - public int tickTime; + public int tickTime; - public int euPerTick; + public int euPerTick; - public BaseRecipe(String name, int tickTime, int euPerTick) { - inputs = new ArrayList(); - outputs = new ArrayList(); - this.name = name; - //This adds all new recipes - this.tickTime = tickTime; - this.euPerTick = euPerTick; - } + public BaseRecipe(String name, int tickTime, int euPerTick) + { + inputs = new ArrayList(); + outputs = new ArrayList(); + this.name = name; + // This adds all new recipes + this.tickTime = tickTime; + this.euPerTick = euPerTick; + } - @Override - public ItemStack getOutput(int i) { - return outputs.get(i).copy(); - } + @Override + public ItemStack getOutput(int i) + { + return outputs.get(i).copy(); + } - @Override - public int getOutputsSize() { - return outputs.size(); - } + @Override + public int getOutputsSize() + { + return outputs.size(); + } - public void addOutput(ItemStack stack) { - outputs.add(stack); - } + public void addOutput(ItemStack stack) + { + outputs.add(stack); + } + @Override + public List getInputs() + { + return inputs; + } - @Override - public List getInputs() { - return inputs; - } + @Override + public String getRecipeName() + { + return name; + } - @Override - public String getRecipeName() { - return name; - } + @Override + public int tickTime() + { + return tickTime; + } - @Override - public int tickTime() { - return tickTime; - } + @Override + public int euPerTick() + { + return euPerTick; + } - @Override - public int euPerTick() { - return euPerTick; - } + @Override + public boolean canCraft(TileEntity tile) + { + return true; + } - @Override - public boolean canCraft(TileEntity tile) { - return true; - } + @Override + public boolean onCraft(TileEntity tile) + { + return true; + } - @Override - public boolean onCraft(TileEntity tile) { - return true; - } + @Override + public Object clone() throws CloneNotSupportedException + { + return super.clone(); + } - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } + @Override + public boolean useOreDic() + { + return true; + } - @Override - public boolean useOreDic() { - return true; - } - - @Override - public List getOutputs() { - return outputs; - } + @Override + public List getOutputs() + { + return outputs; + } } diff --git a/src/main/java/techreborn/api/recipe/IBaseRecipeType.java b/src/main/java/techreborn/api/recipe/IBaseRecipeType.java index cd47e0dfe..c7202ee4d 100644 --- a/src/main/java/techreborn/api/recipe/IBaseRecipeType.java +++ b/src/main/java/techreborn/api/recipe/IBaseRecipeType.java @@ -1,81 +1,87 @@ package techreborn.api.recipe; +import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import java.util.List; - /** * This is the base recipe class implement this to make a recipe handler */ -public interface IBaseRecipeType { +public interface IBaseRecipeType +{ - /** - * Use this to get all of the inputs - * - * @return the List of inputs - */ - public List getInputs(); + /** + * Use this to get all of the inputs + * + * @return the List of inputs + */ + public List getInputs(); - /** - * This gets the output form the array list - * @param i get output form position in arraylist - * @return the output - */ - public ItemStack getOutput(int i); + /** + * This gets the output form the array list + * + * @param i + * get output form position in arraylist + * @return the output + */ + public ItemStack getOutput(int i); - /** - * @return The ammount of outputs - */ - public int getOutputsSize(); + /** + * @return The ammount of outputs + */ + public int getOutputsSize(); - /** - * @return get outputs - */ - public List getOutputs(); + /** + * @return get outputs + */ + public List getOutputs(); - /** - * This is the name to check that the recipe is the one that should be used in - * the tile entity that is set up to process this recipe. - * - * @return The recipeName - */ - public String getRecipeName(); + /** + * This is the name to check that the recipe is the one that should be used + * in the tile entity that is set up to process this recipe. + * + * @return The recipeName + */ + public String getRecipeName(); - /** - * This should be a user friendly name - * - * @return The user friendly name of the recipe. - */ - public String getUserFreindlyName(); + /** + * This should be a user friendly name + * + * @return The user friendly name of the recipe. + */ + public String getUserFreindlyName(); - /** - * This is how long the recipe needs to tick for the crafting operation to complete - * - * @return tick length - */ - public int tickTime(); + /** + * This is how long the recipe needs to tick for the crafting operation to + * complete + * + * @return tick length + */ + public int tickTime(); - /** - * This is how much eu Per tick the machine should use - * - * @return the amount of eu to be used per tick. - */ - public int euPerTick(); + /** + * This is how much eu Per tick the machine should use + * + * @return the amount of eu to be used per tick. + */ + public int euPerTick(); - /** - * @param tile the tile that is doing the crafting - * @return if true the recipe will craft, if false it will not - */ - public boolean canCraft(TileEntity tile); + /** + * @param tile + * the tile that is doing the crafting + * @return if true the recipe will craft, if false it will not + */ + public boolean canCraft(TileEntity tile); - /** - * @param tile the tile that is doing the crafting - * @return return true if fluid was taken and should craft - */ - public boolean onCraft(TileEntity tile); + /** + * @param tile + * the tile that is doing the crafting + * @return return true if fluid was taken and should craft + */ + public boolean onCraft(TileEntity tile); - public Object clone() throws CloneNotSupportedException; + public Object clone() throws CloneNotSupportedException; - public boolean useOreDic(); + public boolean useOreDic(); } diff --git a/src/main/java/techreborn/api/recipe/IRecipeCompact.java b/src/main/java/techreborn/api/recipe/IRecipeCompact.java index 7ccb48b85..be8112d38 100644 --- a/src/main/java/techreborn/api/recipe/IRecipeCompact.java +++ b/src/main/java/techreborn/api/recipe/IRecipeCompact.java @@ -2,7 +2,8 @@ package techreborn.api.recipe; import net.minecraft.item.ItemStack; -public interface IRecipeCompact { +public interface IRecipeCompact +{ - ItemStack getItem(String name); + ItemStack getItem(String name); } diff --git a/src/main/java/techreborn/api/recipe/RecipeCrafter.java b/src/main/java/techreborn/api/recipe/RecipeCrafter.java index 47a509c7d..2c86b4dbf 100644 --- a/src/main/java/techreborn/api/recipe/RecipeCrafter.java +++ b/src/main/java/techreborn/api/recipe/RecipeCrafter.java @@ -1,5 +1,7 @@ package techreborn.api.recipe; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import reborncore.api.power.IEnergyInterfaceTile; @@ -8,327 +10,421 @@ import reborncore.common.tile.TileMachineBase; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; -import java.util.ArrayList; - /** * Use this in your tile entity to craft things */ -public class RecipeCrafter { +public class RecipeCrafter +{ - /** - * This is the recipe type to use - */ - public String recipeName; + /** + * This is the recipe type to use + */ + public String recipeName; - /** - * This is the parent tile - */ - public TileMachineBase parentTile; + /** + * This is the parent tile + */ + public TileMachineBase parentTile; - /** - * This is the place to use the power from - */ - public IEnergyInterfaceTile energy; + /** + * This is the place to use the power from + */ + public IEnergyInterfaceTile energy; - /** - * This is the amount of inputs that the setRecipe has - */ - public int inputs; + /** + * This is the amount of inputs that the setRecipe has + */ + public int inputs; - /** - * This is the amount of outputs that the recipe has - */ - public int outputs; + /** + * This is the amount of outputs that the recipe has + */ + public int outputs; - /** - * This is the inventory to use for the crafting - */ - public Inventory inventory; + /** + * This is the inventory to use for the crafting + */ + public Inventory inventory; - /** - * This is the list of the slots that the crafting logic should look for the input item stacks. - */ - public int[] inputSlots; + /** + * This is the list of the slots that the crafting logic should look for the + * input item stacks. + */ + public int[] inputSlots; - /** - * This is the list for the slots that the crafting logic should look fot the output item stacks. - */ - public int[] outputSlots; + /** + * This is the list for the slots that the crafting logic should look fot + * the output item stacks. + */ + public int[] outputSlots; - /** - * This is the constructor, not a lot to say here :P - * - * @param recipeName The recipe name that should be crafted - * @param parentTile The tile that wil be using this recipe crafter - * @param inputs The amount of input slots - * @param outputs The amount of output slots - * @param inventory The inventory of the machine - * @param inputSlots A list of the input slot ids - * @param outputSlots A list of output slot ids - */ - public RecipeCrafter(String recipeName, TileMachineBase parentTile, int inputs, int outputs, Inventory inventory, int[] inputSlots, int[] outputSlots) { - this.recipeName = recipeName; - this.parentTile = parentTile; - if (parentTile instanceof IEnergyInterfaceTile) { - energy = (IEnergyInterfaceTile) parentTile; - } - this.inputs = inputs; - this.outputs = outputs; - this.inventory = inventory; - this.inputSlots = inputSlots; - this.outputSlots = outputSlots; - } + /** + * This is the constructor, not a lot to say here :P + * + * @param recipeName + * The recipe name that should be crafted + * @param parentTile + * The tile that wil be using this recipe crafter + * @param inputs + * The amount of input slots + * @param outputs + * The amount of output slots + * @param inventory + * The inventory of the machine + * @param inputSlots + * A list of the input slot ids + * @param outputSlots + * A list of output slot ids + */ + public RecipeCrafter(String recipeName, TileMachineBase parentTile, int inputs, int outputs, Inventory inventory, + int[] inputSlots, int[] outputSlots) + { + this.recipeName = recipeName; + this.parentTile = parentTile; + if (parentTile instanceof IEnergyInterfaceTile) + { + energy = (IEnergyInterfaceTile) parentTile; + } + this.inputs = inputs; + this.outputs = outputs; + this.inventory = inventory; + this.inputSlots = inputSlots; + this.outputSlots = outputSlots; + } + public IBaseRecipeType currentRecipe; + public int currentTickTime = 0; + public int currentNeededTicks = 1;// Set to 1 to stop rare crashes + double lastEnergy; - public IBaseRecipeType currentRecipe; - public int currentTickTime = 0; - public int currentNeededTicks = 1;//Set to 1 to stop rare crashes - double lastEnergy; + /** + * This is used to change the speed of the crafting operation. + *

+ * 0 = none; 0.2 = 20% speed increase 0.75 = 75% increase + */ + double speedMultiplier = 0; - /** - * This is used to change the speed of the crafting operation. - *

- * 0 = none; - * 0.2 = 20% speed increase - * 0.75 = 75% increase - */ - double speedMultiplier = 0; + /** + * This is used to change the power of the crafting operation. + *

+ * 1 = none; 1.2 = 20% speed increase 1.75 = 75% increase 5 = uses 5 times + * more power + */ + double powerMultiplier = 1; - /** - * This is used to change the power of the crafting operation. - *

- * 1 = none; - * 1.2 = 20% speed increase - * 1.75 = 75% increase - * 5 = uses 5 times more power - */ - double powerMultiplier = 1; + int ticksSinceLastChange; - int ticksSinceLastChange; + /** + * Call this on the tile tick + */ + public void updateEntity() + { + if (parentTile.getWorld().isRemote) + { + return; + } + ticksSinceLastChange++; + if (ticksSinceLastChange == 20) + {// Force a has chanced every second + inventory.hasChanged = true; + ticksSinceLastChange = 0; + } + if (currentRecipe == null && inventory.hasChanged) + {// It will now look for new recipes. + currentTickTime = 0; + for (IBaseRecipeType recipe : RecipeHandler.getRecipeClassFromName(recipeName)) + { + if (recipe.canCraft(parentTile) && hasAllInputs(recipe)) + {// This checks to see if it has all of the inputs + boolean canGiveInvAll = true; + for (int i = 0; i < recipe.getOutputsSize(); i++) + {// This checks to see if it can fit all of the outputs + if (!canFitStack(recipe.getOutput(i), outputSlots[i], recipe.useOreDic())) + { + canGiveInvAll = false; + return; + } + } + if (canGiveInvAll) + { + setCurrentRecipe(recipe);// Sets the current recipe then + // syncs + this.currentNeededTicks = (int) (currentRecipe.tickTime() * (1.0 - speedMultiplier)); + this.currentTickTime = -1; + setIsActive(); + } else + { + this.currentTickTime = -1; + } + } + } + } else + { + if (inventory.hasChanged && !hasAllInputs()) + {// If it doesn't have all the inputs reset + currentRecipe = null; + currentTickTime = -1; + setIsActive(); + } + if (currentRecipe != null && currentTickTime >= currentNeededTicks) + {// If it has reached the recipe tick time + boolean canGiveInvAll = true; + for (int i = 0; i < currentRecipe.getOutputsSize(); i++) + {// Checks to see if it can fit the output + if (!canFitStack(currentRecipe.getOutput(i), outputSlots[i], currentRecipe.useOreDic())) + { + canGiveInvAll = false; + } + } + ArrayList filledSlots = new ArrayList();// The + // slots + // that + // have + // been + // filled + if (canGiveInvAll && currentRecipe.onCraft(parentTile)) + { + for (int i = 0; i < currentRecipe.getOutputsSize(); i++) + { + if (!filledSlots.contains(outputSlots[i])) + {// checks it has not been filled + fitStack(currentRecipe.getOutput(i).copy(), outputSlots[i]);// fills + // the + // slot + // with + // the + // output + // stack + filledSlots.add(outputSlots[i]); + } + } + useAllInputs();// this uses all the inputs + currentRecipe = null;// resets + currentTickTime = -1; + setIsActive(); + } + } else if (currentRecipe != null && currentTickTime < currentNeededTicks) + { + if (energy.canUseEnergy(getEuPerTick())) + {// This uses the power + energy.useEnergy(getEuPerTick()); + currentTickTime++;// increase the ticktime + } + } + } + if (inventory.hasChanged) + { + inventory.hasChanged = false; + } + } - /** - * Call this on the tile tick - */ - public void updateEntity() { - if (parentTile.getWorld().isRemote) { - return; - } - ticksSinceLastChange++; - if (ticksSinceLastChange == 20) {//Force a has chanced every second - inventory.hasChanged = true; - ticksSinceLastChange = 0; - } - if (currentRecipe == null && inventory.hasChanged) {//It will now look for new recipes. - currentTickTime = 0; - for (IBaseRecipeType recipe : RecipeHandler.getRecipeClassFromName(recipeName)) { - if (recipe.canCraft(parentTile) && hasAllInputs(recipe)) {//This checks to see if it has all of the inputs - boolean canGiveInvAll = true; - for (int i = 0; i < recipe.getOutputsSize(); i++) {//This checks to see if it can fit all of the outputs - if (!canFitStack(recipe.getOutput(i), outputSlots[i], recipe.useOreDic())) { - canGiveInvAll = false; - return; - } - } - if (canGiveInvAll) { - setCurrentRecipe(recipe);//Sets the current recipe then syncs - this.currentNeededTicks = (int) (currentRecipe.tickTime() * (1.0 - speedMultiplier)); - this.currentTickTime = -1; - setIsActive(); - } else { - this.currentTickTime = -1; - } - } - } - } else { - if (inventory.hasChanged && !hasAllInputs()) {//If it doesn't have all the inputs reset - currentRecipe = null; - currentTickTime = -1; - setIsActive(); - } - if (currentRecipe != null && currentTickTime >= currentNeededTicks) {//If it has reached the recipe tick time - boolean canGiveInvAll = true; - for (int i = 0; i < currentRecipe.getOutputsSize(); i++) {//Checks to see if it can fit the output - if (!canFitStack(currentRecipe.getOutput(i), outputSlots[i], currentRecipe.useOreDic())) { - canGiveInvAll = false; - } - } - ArrayList filledSlots = new ArrayList();//The slots that have been filled - if (canGiveInvAll && currentRecipe.onCraft(parentTile)) { - for (int i = 0; i < currentRecipe.getOutputsSize(); i++) { - if (!filledSlots.contains(outputSlots[i])) {//checks it has not been filled - fitStack(currentRecipe.getOutput(i).copy(), outputSlots[i]);//fills the slot with the output stack - filledSlots.add(outputSlots[i]); - } - } - useAllInputs();//this uses all the inputs - currentRecipe = null;//resets - currentTickTime = -1; - setIsActive(); - } - } else if (currentRecipe != null && currentTickTime < currentNeededTicks) { - if (energy.canUseEnergy(getEuPerTick())) {//This uses the power - energy.useEnergy(getEuPerTick()); - currentTickTime++;//increase the ticktime - } - } - } - if (inventory.hasChanged) { - inventory.hasChanged = false; - } - } + public boolean hasAllInputs() + { + if (currentRecipe == null) + { + return false; + } + for (ItemStack input : currentRecipe.getInputs()) + { + Boolean hasItem = false; + for (int inputSlot : inputSlots) + {// Checks to see if it can find the input + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, + currentRecipe.useOreDic()) && inventory.getStackInSlot(inputSlot).stackSize >= input.stackSize) + { + hasItem = true; + } + } + if (!hasItem) + return false; + } + return true; + } - public boolean hasAllInputs() { - if (currentRecipe == null) { - return false; - } - for (ItemStack input : currentRecipe.getInputs()) { - Boolean hasItem = false; - for (int inputSlot : inputSlots) {//Checks to see if it can find the input - if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, currentRecipe.useOreDic()) && inventory.getStackInSlot(inputSlot).stackSize >= input.stackSize) { - hasItem = true; - } - } - if (!hasItem) - return false; - } - return true; - } + public boolean hasAllInputs(IBaseRecipeType recipeType) + { + if (recipeType == null) + { + return false; + } + for (ItemStack input : recipeType.getInputs()) + { + Boolean hasItem = false; + for (int inputslot : inputSlots) + { + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true, + recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) + { + hasItem = true; + } + } + if (!hasItem) + return false; + } + return true; + } - public boolean hasAllInputs(IBaseRecipeType recipeType) { - if (recipeType == null) { - return false; - } - for (ItemStack input : recipeType.getInputs()) { - Boolean hasItem = false; - for (int inputslot : inputSlots) { - if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true, recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) { - hasItem = true; - } - } - if (!hasItem) - return false; - } - return true; - } + public void useAllInputs() + { + if (currentRecipe == null) + { + return; + } + for (ItemStack input : currentRecipe.getInputs()) + { + for (int inputSlot : inputSlots) + {// Uses all of the inputs + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, + currentRecipe.useOreDic())) + { + inventory.decrStackSize(inputSlot, input.stackSize); + break; + } + } + } + } - public void useAllInputs() { - if (currentRecipe == null) { - return; - } - for (ItemStack input : currentRecipe.getInputs()) { - for (int inputSlot : inputSlots) {//Uses all of the inputs - if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, currentRecipe.useOreDic())) { - inventory.decrStackSize(inputSlot, input.stackSize); - break; - } - } - } - } + public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) + {// Checks to see if it can fit the stack + if (stack == null) + { + return true; + } + if (inventory.getStackInSlot(slot) == null) + { + return true; + } + if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) + { + if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) + { + return true; + } + } + return false; + } - public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) {//Checks to see if it can fit the stack - if (stack == null) { - return true; - } - if (inventory.getStackInSlot(slot) == null) { - return true; - } - if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) { - if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) { - return true; - } - } - return false; - } + public void fitStack(ItemStack stack, int slot) + {// This fits a stack into a slot + if (stack == null) + { + return; + } + if (inventory.getStackInSlot(slot) == null) + {// If the slot is empty set the contents + inventory.setInventorySlotContents(slot, stack); + return; + } + if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, currentRecipe.useOreDic())) + {// If the slot has stuff in + if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) + {// Check to see if it fits + ItemStack newStack = stack.copy(); + newStack.stackSize = inventory.getStackInSlot(slot).stackSize + stack.stackSize;// Sets + // the + // new + // stack + // size + inventory.setInventorySlotContents(slot, newStack); + } + } + } - public void fitStack(ItemStack stack, int slot) {//This fits a stack into a slot - if (stack == null) { - return; - } - if (inventory.getStackInSlot(slot) == null) {//If the slot is empty set the contents - inventory.setInventorySlotContents(slot, stack); - return; - } - if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, currentRecipe.useOreDic())) {//If the slot has stuff in - if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) {//Check to see if it fits - ItemStack newStack = stack.copy(); - newStack.stackSize = inventory.getStackInSlot(slot).stackSize + stack.stackSize;//Sets the new stack size - inventory.setInventorySlotContents(slot, newStack); - } - } - } + public void readFromNBT(NBTTagCompound tag) + { + NBTTagCompound data = tag.getCompoundTag("Crater"); - public void readFromNBT(NBTTagCompound tag) { - NBTTagCompound data = tag.getCompoundTag("Crater"); + if (data.hasKey("currentTickTime")) + currentTickTime = data.getInteger("currentTickTime"); - if (data.hasKey("currentTickTime")) - currentTickTime = data.getInteger("currentTickTime"); + if (parentTile != null && parentTile.getWorld() != null && parentTile.getWorld().isRemote) + { + parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), + parentTile.getWorld().getBlockState(parentTile.getPos()), + parentTile.getWorld().getBlockState(parentTile.getPos()), 3); + parentTile.getWorld().markBlockRangeForRenderUpdate(parentTile.getPos().getX(), parentTile.getPos().getY(), + parentTile.getPos().getZ(), parentTile.getPos().getX(), parentTile.getPos().getY(), + parentTile.getPos().getZ()); + } + } - if (parentTile != null && parentTile.getWorld() != null && parentTile.getWorld().isRemote) { - parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), parentTile.getWorld().getBlockState(parentTile.getPos()), parentTile.getWorld().getBlockState(parentTile.getPos()), 3); - parentTile.getWorld().markBlockRangeForRenderUpdate(parentTile.getPos().getX(), parentTile.getPos().getY(), parentTile.getPos().getZ(), parentTile.getPos().getX(), parentTile.getPos().getY(), parentTile.getPos().getZ()); - } - } + public void writeToNBT(NBTTagCompound tag) + { - public void writeToNBT(NBTTagCompound tag) { + NBTTagCompound data = new NBTTagCompound(); - NBTTagCompound data = new NBTTagCompound(); + data.setDouble("currentTickTime", currentTickTime); - data.setDouble("currentTickTime", currentTickTime); + tag.setTag("Crater", data); + } - tag.setTag("Crater", data); - } + private boolean isActive() + { + return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick(); + } + public void addSpeedMulti(double amount) + { + if (speedMultiplier + amount <= 0.99) + { + speedMultiplier += amount; + } else + { + speedMultiplier = 0.99; + } + } - private boolean isActive() { - return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick(); - } + public void resetSpeedMulti() + { + speedMultiplier = 0; + } - public void addSpeedMulti(double amount) { - if (speedMultiplier + amount <= 0.99) { - speedMultiplier += amount; - } else { - speedMultiplier = 0.99; - } - } + public double getSpeedMultiplier() + { + return speedMultiplier; + } - public void resetSpeedMulti() { - speedMultiplier = 0; - } + public void addPowerMulti(double amount) + { + powerMultiplier += amount; + } - public double getSpeedMultiplier() { - return speedMultiplier; - } + public void resetPowerMulti() + { + powerMultiplier = 1; + } - public void addPowerMulti(double amount) { - powerMultiplier += amount; - } + public double getPowerMultiplier() + { + return powerMultiplier; + } - public void resetPowerMulti() { - powerMultiplier = 1; - } + public double getEuPerTick() + { + return currentRecipe.euPerTick() * powerMultiplier; + } - public double getPowerMultiplier() { - return powerMultiplier; - } + public void setIsActive() + { + if (parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock() instanceof BlockMachineBase) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) parentTile.getWorld() + .getBlockState(parentTile.getPos()).getBlock(); + blockMachineBase.setActive(isActive(), parentTile.getWorld(), parentTile.getPos()); + } + parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), + parentTile.getWorld().getBlockState(parentTile.getPos()), + parentTile.getWorld().getBlockState(parentTile.getPos()), 3); + } - public double getEuPerTick() { - return currentRecipe.euPerTick() * powerMultiplier; - } - - - public void setIsActive() { - if(parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock() instanceof BlockMachineBase){ - BlockMachineBase blockMachineBase = (BlockMachineBase) parentTile.getWorld().getBlockState(parentTile.getPos()).getBlock(); - blockMachineBase.setActive(isActive(), parentTile.getWorld(), parentTile.getPos()); - } - parentTile.getWorld().notifyBlockUpdate(parentTile.getPos(), parentTile.getWorld().getBlockState(parentTile.getPos()), parentTile.getWorld().getBlockState(parentTile.getPos()), 3); - } - - public void setCurrentRecipe(IBaseRecipeType recipe) { - try { - this.currentRecipe = (IBaseRecipeType) recipe.clone(); - } catch (CloneNotSupportedException e) { - e.printStackTrace(); - } - } + public void setCurrentRecipe(IBaseRecipeType recipe) + { + try + { + this.currentRecipe = (IBaseRecipeType) recipe.clone(); + } catch (CloneNotSupportedException e) + { + e.printStackTrace(); + } + } } diff --git a/src/main/java/techreborn/api/recipe/RecipeHandler.java b/src/main/java/techreborn/api/recipe/RecipeHandler.java index c07097342..b214d9e1f 100644 --- a/src/main/java/techreborn/api/recipe/RecipeHandler.java +++ b/src/main/java/techreborn/api/recipe/RecipeHandler.java @@ -1,103 +1,127 @@ package techreborn.api.recipe; -import net.minecraft.item.ItemStack; -import org.apache.commons.lang3.time.StopWatch; -import reborncore.common.util.ItemUtils; -import techreborn.Core; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import net.minecraft.item.ItemStack; -public class RecipeHandler { +import org.apache.commons.lang3.time.StopWatch; - /** - * This is the array list of all of the recipes for all of the machines - */ - public static final ArrayList recipeList = new ArrayList(); +import reborncore.common.util.ItemUtils; +import techreborn.Core; +public class RecipeHandler +{ - public static HashMap stackMap = new HashMap(); - /** - * This is a list of all the registered machine names. - */ - public static ArrayList machineNames = new ArrayList(); + /** + * This is the array list of all of the recipes for all of the machines + */ + public static final ArrayList recipeList = new ArrayList(); - /** - * Use this to get all of the recipes form a recipe name - * - * @param name the name that the recipe was resisted as. - * @return A list of all the recipes of a given name. - */ - public static List getRecipeClassFromName(String name) { - List baseRecipeList = new ArrayList(); - for (IBaseRecipeType baseRecipe : recipeList) { - if (baseRecipe.getRecipeName().equals(name)) { - baseRecipeList.add(baseRecipe); - } - } - return baseRecipeList; - } + public static HashMap stackMap = new HashMap(); + /** + * This is a list of all the registered machine names. + */ + public static ArrayList machineNames = new ArrayList(); - public static String getUserFreindlyName(String name) { - for (IBaseRecipeType baseRecipe : recipeList) { - if (baseRecipe.getRecipeName().equals(name)) { - return baseRecipe.getUserFreindlyName(); - } - } - return ""; - } + /** + * Use this to get all of the recipes form a recipe name + * + * @param name + * the name that the recipe was resisted as. + * @return A list of all the recipes of a given name. + */ + public static List getRecipeClassFromName(String name) + { + List baseRecipeList = new ArrayList(); + for (IBaseRecipeType baseRecipe : recipeList) + { + if (baseRecipe.getRecipeName().equals(name)) + { + baseRecipeList.add(baseRecipe); + } + } + return baseRecipeList; + } - /** - * Add a recipe to the system - * - * @param recipe The recipe to add to the system. - */ - public static void addRecipe(IBaseRecipeType recipe) { - if (recipe == null) { - return; - } - if (recipeList.contains(recipe)) { - return; - } -// if (!RecipeConfigManager.canLoadRecipe(recipe)) { -// return; -// } - if (!machineNames.contains(recipe.getRecipeName())) { - machineNames.add(recipe.getRecipeName()); - } - recipeList.add(recipe); - StringBuffer buffer = new StringBuffer(); - for (StackTraceElement ste : Thread.currentThread().getStackTrace()) { - buffer.append(ste); - } - stackMap.put(recipe, buffer.toString()); - } + public static String getUserFreindlyName(String name) + { + for (IBaseRecipeType baseRecipe : recipeList) + { + if (baseRecipe.getRecipeName().equals(name)) + { + return baseRecipe.getUserFreindlyName(); + } + } + return ""; + } + /** + * Add a recipe to the system + * + * @param recipe + * The recipe to add to the system. + */ + public static void addRecipe(IBaseRecipeType recipe) + { + if (recipe == null) + { + return; + } + if (recipeList.contains(recipe)) + { + return; + } + // if (!RecipeConfigManager.canLoadRecipe(recipe)) { + // return; + // } + if (!machineNames.contains(recipe.getRecipeName())) + { + machineNames.add(recipe.getRecipeName()); + } + recipeList.add(recipe); + StringBuffer buffer = new StringBuffer(); + for (StackTraceElement ste : Thread.currentThread().getStackTrace()) + { + buffer.append(ste); + } + stackMap.put(recipe, buffer.toString()); + } - public static void scanForDupeRecipes() throws Exception { - StopWatch watch = new StopWatch(); - watch.start(); - for (IBaseRecipeType baseRecipeType : recipeList) { - for (IBaseRecipeType recipe : recipeList) { - if (baseRecipeType != recipe && baseRecipeType.getRecipeName().equals(recipe.getRecipeName())) { - for (int i = 0; i < baseRecipeType.getInputs().size(); i++) { - if (ItemUtils.isItemEqual(baseRecipeType.getInputs().get(i), recipe.getInputs().get(i), true, false, false)) { - StringBuffer itemInfo = new StringBuffer(); - for (ItemStack inputs : baseRecipeType.getInputs()) { - itemInfo.append(":" + inputs.getItem().getUnlocalizedName() + "," + inputs.getDisplayName() + "," + inputs.stackSize); - } - Core.logHelper.all(stackMap.get(baseRecipeType)); - // throw new Exception("Found a duplicate recipe for " + baseRecipeType.getRecipeName() + " with inputs " + itemInfo.toString()); - } - } - } - } - } - Core.logHelper.all(watch + " : Scanning dupe recipes"); - watch.stop(); + public static void scanForDupeRecipes() throws Exception + { + StopWatch watch = new StopWatch(); + watch.start(); + for (IBaseRecipeType baseRecipeType : recipeList) + { + for (IBaseRecipeType recipe : recipeList) + { + if (baseRecipeType != recipe && baseRecipeType.getRecipeName().equals(recipe.getRecipeName())) + { + for (int i = 0; i < baseRecipeType.getInputs().size(); i++) + { + if (ItemUtils.isItemEqual(baseRecipeType.getInputs().get(i), recipe.getInputs().get(i), true, + false, false)) + { + StringBuffer itemInfo = new StringBuffer(); + for (ItemStack inputs : baseRecipeType.getInputs()) + { + itemInfo.append(":" + inputs.getItem().getUnlocalizedName() + "," + + inputs.getDisplayName() + "," + inputs.stackSize); + } + Core.logHelper.all(stackMap.get(baseRecipeType)); + // throw new Exception("Found a duplicate recipe for + // " + baseRecipeType.getRecipeName() + " with + // inputs " + itemInfo.toString()); + } + } + } + } + } + Core.logHelper.all(watch + " : Scanning dupe recipes"); + watch.stop(); - } + } } \ No newline at end of file diff --git a/src/main/java/techreborn/api/recipe/RecyclerRecipe.java b/src/main/java/techreborn/api/recipe/RecyclerRecipe.java index 57ef4585e..33faee782 100644 --- a/src/main/java/techreborn/api/recipe/RecyclerRecipe.java +++ b/src/main/java/techreborn/api/recipe/RecyclerRecipe.java @@ -3,17 +3,21 @@ package techreborn.api.recipe; import net.minecraft.item.ItemStack; import techreborn.items.ItemParts; import techreborn.lib.Reference; -//THIS is only here to trick JEI into showing recipes for the recycler -public class RecyclerRecipe extends BaseRecipe { - public RecyclerRecipe(ItemStack input) { +//THIS is only here to trick JEI into showing recipes for the recycler +public class RecyclerRecipe extends BaseRecipe +{ + + public RecyclerRecipe(ItemStack input) + { super(Reference.recyclerRecipe, 0, 0); inputs.add(input); addOutput(ItemParts.getPartByName("scrap")); } @Override - public String getUserFreindlyName() { + public String getUserFreindlyName() + { return "Recycler"; } } diff --git a/src/main/java/techreborn/api/recipe/ScrapboxRecipe.java b/src/main/java/techreborn/api/recipe/ScrapboxRecipe.java index e35b6fcba..3c45dba6b 100644 --- a/src/main/java/techreborn/api/recipe/ScrapboxRecipe.java +++ b/src/main/java/techreborn/api/recipe/ScrapboxRecipe.java @@ -4,16 +4,19 @@ import net.minecraft.item.ItemStack; import techreborn.init.ModItems; import techreborn.lib.Reference; -public class ScrapboxRecipe extends BaseRecipe { +public class ScrapboxRecipe extends BaseRecipe +{ - public ScrapboxRecipe(ItemStack output) { + public ScrapboxRecipe(ItemStack output) + { super(Reference.scrapboxRecipe, 0, 0); inputs.add(new ItemStack(ModItems.scrapBox)); addOutput(output); } @Override - public String getUserFreindlyName() { + public String getUserFreindlyName() + { return "Scrapbox"; } } diff --git a/src/main/java/techreborn/api/recipe/machines/AlloySmelterRecipe.java b/src/main/java/techreborn/api/recipe/machines/AlloySmelterRecipe.java index 49613cd25..4f290bc94 100644 --- a/src/main/java/techreborn/api/recipe/machines/AlloySmelterRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/AlloySmelterRecipe.java @@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class AlloySmelterRecipe extends BaseRecipe { +public class AlloySmelterRecipe extends BaseRecipe +{ - public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.alloySmelteRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - } + public AlloySmelterRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.alloySmelteRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Alloy Smelter"; - } + @Override + public String getUserFreindlyName() + { + return "Alloy Smelter"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/AssemblingMachineRecipe.java b/src/main/java/techreborn/api/recipe/machines/AssemblingMachineRecipe.java index aff4972b4..2f60f4605 100644 --- a/src/main/java/techreborn/api/recipe/machines/AssemblingMachineRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/AssemblingMachineRecipe.java @@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class AssemblingMachineRecipe extends BaseRecipe { +public class AssemblingMachineRecipe extends BaseRecipe +{ - public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.assemblingMachineRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - } + public AssemblingMachineRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.assemblingMachineRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Assembling Machine"; - } + @Override + public String getUserFreindlyName() + { + return "Assembling Machine"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/BlastFurnaceRecipe.java b/src/main/java/techreborn/api/recipe/machines/BlastFurnaceRecipe.java index a7b872c22..dc2951015 100644 --- a/src/main/java/techreborn/api/recipe/machines/BlastFurnaceRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/BlastFurnaceRecipe.java @@ -6,41 +6,47 @@ import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; import techreborn.tiles.TileBlastFurnace; -public class BlastFurnaceRecipe extends BaseRecipe { +public class BlastFurnaceRecipe extends BaseRecipe +{ + public int neededHeat; - public int neededHeat; + public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, + int euPerTick, int neededHeat) + { + super(Reference.blastFurnaceRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); - public BlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, int euPerTick, int neededHeat) { - super(Reference.blastFurnaceRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); + this.neededHeat = neededHeat; + } - this.neededHeat = neededHeat; - } + @Override + public String getUserFreindlyName() + { + return "Blast Furnace"; + } - @Override - public String getUserFreindlyName() { - return "Blast Furnace"; - } + @Override + public boolean canCraft(TileEntity tile) + { + if (tile instanceof TileBlastFurnace) + { + TileBlastFurnace blastFurnace = (TileBlastFurnace) tile; + return blastFurnace.getHeat() >= neededHeat; + } + return false; + } - @Override - public boolean canCraft(TileEntity tile) { - if (tile instanceof TileBlastFurnace) { - TileBlastFurnace blastFurnace = (TileBlastFurnace) tile; - return blastFurnace.getHeat() >= neededHeat; - } - return false; - } - - @Override - public boolean onCraft(TileEntity tile) { - return super.onCraft(tile); - } + @Override + public boolean onCraft(TileEntity tile) + { + return super.onCraft(tile); + } } diff --git a/src/main/java/techreborn/api/recipe/machines/CentrifugeRecipe.java b/src/main/java/techreborn/api/recipe/machines/CentrifugeRecipe.java index d8fd5d914..ed1e449af 100644 --- a/src/main/java/techreborn/api/recipe/machines/CentrifugeRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/CentrifugeRecipe.java @@ -4,26 +4,30 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class CentrifugeRecipe extends BaseRecipe { +public class CentrifugeRecipe extends BaseRecipe +{ - public CentrifugeRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) { - super(Reference.centrifugeRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - if (output3 != null) - addOutput(output3); - if (output4 != null) - addOutput(output4); - } + public CentrifugeRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, + ItemStack output4, int tickTime, int euPerTick) + { + super(Reference.centrifugeRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + if (output3 != null) + addOutput(output3); + if (output4 != null) + addOutput(output4); + } - @Override - public String getUserFreindlyName() { - return "Centrifuge"; - } + @Override + public String getUserFreindlyName() + { + return "Centrifuge"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/ChemicalReactorRecipe.java b/src/main/java/techreborn/api/recipe/machines/ChemicalReactorRecipe.java index b020829a0..32cb0fd58 100644 --- a/src/main/java/techreborn/api/recipe/machines/ChemicalReactorRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/ChemicalReactorRecipe.java @@ -4,20 +4,23 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class ChemicalReactorRecipe extends BaseRecipe { +public class ChemicalReactorRecipe extends BaseRecipe +{ - public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.chemicalReactorRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - } + public ChemicalReactorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.chemicalReactorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Chemical Reactor"; - } + @Override + public String getUserFreindlyName() + { + return "Chemical Reactor"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java b/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java index f7ba0407c..04185c759 100644 --- a/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java @@ -1,22 +1,24 @@ package techreborn.api.recipe.machines; - import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class CompressorRecipe extends BaseRecipe { +public class CompressorRecipe extends BaseRecipe +{ - public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.compressorRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (output1 != null) - addOutput(output1); - } + public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.compressorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Compressor"; - } + @Override + public String getUserFreindlyName() + { + return "Compressor"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java b/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java index 9da869428..a9858f4f3 100644 --- a/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java @@ -1,22 +1,24 @@ package techreborn.api.recipe.machines; - import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class ExtractorRecipe extends BaseRecipe { +public class ExtractorRecipe extends BaseRecipe +{ - public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.extractorRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (output1 != null) - addOutput(output1); - } + public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.extractorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Extractor"; - } + @Override + public String getUserFreindlyName() + { + return "Extractor"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/GrinderRecipe.java b/src/main/java/techreborn/api/recipe/machines/GrinderRecipe.java index 335293aba..efde79d6f 100644 --- a/src/main/java/techreborn/api/recipe/machines/GrinderRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/GrinderRecipe.java @@ -1,22 +1,24 @@ package techreborn.api.recipe.machines; - import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class GrinderRecipe extends BaseRecipe { +public class GrinderRecipe extends BaseRecipe +{ - public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.grinderRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (output1 != null) - addOutput(output1); - } + public GrinderRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.grinderRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Grinder"; - } + @Override + public String getUserFreindlyName() + { + return "Grinder"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/ImplosionCompressorRecipe.java b/src/main/java/techreborn/api/recipe/machines/ImplosionCompressorRecipe.java index 1be102253..df2af3859 100644 --- a/src/main/java/techreborn/api/recipe/machines/ImplosionCompressorRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/ImplosionCompressorRecipe.java @@ -4,22 +4,26 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class ImplosionCompressorRecipe extends BaseRecipe { +public class ImplosionCompressorRecipe extends BaseRecipe +{ - public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tickTime, int euPerTick) { - super(Reference.implosionCompressorRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - } + public ImplosionCompressorRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, + int tickTime, int euPerTick) + { + super(Reference.implosionCompressorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + } - @Override - public String getUserFreindlyName() { - return "Implosion Compressor"; - } + @Override + public String getUserFreindlyName() + { + return "Implosion Compressor"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java b/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java index 85ef8fdb3..f28eb4a2d 100644 --- a/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/IndustrialElectrolyzerRecipe.java @@ -4,33 +4,38 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class IndustrialElectrolyzerRecipe extends BaseRecipe { +public class IndustrialElectrolyzerRecipe extends BaseRecipe +{ - public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) { - super(Reference.industrialElectrolyzerRecipe, tickTime, euPerTick); - if (inputCells != null) - inputs.add(inputCells); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - if (output3 != null) - addOutput(output3); - if (output4 != null) - addOutput(output4); - } + public IndustrialElectrolyzerRecipe(ItemStack inputCells, ItemStack input2, ItemStack output1, ItemStack output2, + ItemStack output3, ItemStack output4, int tickTime, int euPerTick) + { + super(Reference.industrialElectrolyzerRecipe, tickTime, euPerTick); + if (inputCells != null) + inputs.add(inputCells); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + if (output3 != null) + addOutput(output3); + if (output4 != null) + addOutput(output4); + } - @Override - public String getUserFreindlyName() { - return "Industrial Electrolyzer"; - } + @Override + public String getUserFreindlyName() + { + return "Industrial Electrolyzer"; + } - @Override - public boolean useOreDic() { - return useOreDictionary; - } + @Override + public boolean useOreDic() + { + return useOreDictionary; + } - private boolean useOreDictionary = true; + private boolean useOreDictionary = true; } diff --git a/src/main/java/techreborn/api/recipe/machines/IndustrialGrinderRecipe.java b/src/main/java/techreborn/api/recipe/machines/IndustrialGrinderRecipe.java index e45ffb195..6c644a458 100644 --- a/src/main/java/techreborn/api/recipe/machines/IndustrialGrinderRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/IndustrialGrinderRecipe.java @@ -1,6 +1,5 @@ package techreborn.api.recipe.machines; - import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; @@ -8,72 +7,91 @@ import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; import techreborn.tiles.TileIndustrialGrinder; -public class IndustrialGrinderRecipe extends BaseRecipe { +public class IndustrialGrinderRecipe extends BaseRecipe +{ - public FluidStack fluidStack; + public FluidStack fluidStack; - public IndustrialGrinderRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) { - super(Reference.industrialGrinderRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - if (output3 != null) - addOutput(output3); - if (output4 != null) - addOutput(output4); - this.fluidStack = fluidStack; - } + public IndustrialGrinderRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, + ItemStack output2, ItemStack output3, ItemStack output4, int tickTime, int euPerTick) + { + super(Reference.industrialGrinderRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + if (output3 != null) + addOutput(output3); + if (output4 != null) + addOutput(output4); + this.fluidStack = fluidStack; + } - @Override - public String getUserFreindlyName() { - return "IndustrialGrinder"; - } + @Override + public String getUserFreindlyName() + { + return "IndustrialGrinder"; + } - @Override - public boolean canCraft(TileEntity tile) { - if (fluidStack == null) { - return true; - } - if (tile instanceof TileIndustrialGrinder) { - TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile; - if (grinder.tank.getFluid() == null) { - return false; - } - if (grinder.tank.getFluid() == fluidStack) { - if (grinder.tank.getFluidAmount() >= fluidStack.amount) { - return true; - } - } - } - return false; - } + @Override + public boolean canCraft(TileEntity tile) + { + if (fluidStack == null) + { + return true; + } + if (tile instanceof TileIndustrialGrinder) + { + TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile; + if (grinder.tank.getFluid() == null) + { + return false; + } + if (grinder.tank.getFluid() == fluidStack) + { + if (grinder.tank.getFluidAmount() >= fluidStack.amount) + { + return true; + } + } + } + return false; + } - @Override - public boolean onCraft(TileEntity tile) { - if (fluidStack == null) { - return true; - } - if (tile instanceof TileIndustrialGrinder) { - TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile; - if (grinder.tank.getFluid() == null) { - return false; - } - if (grinder.tank.getFluid() == fluidStack) { - if (grinder.tank.getFluidAmount() >= fluidStack.amount) { - if (grinder.tank.getFluidAmount() > 0) { - grinder.tank.setFluid(new FluidStack(fluidStack.getFluid(), grinder.tank.getFluidAmount() - fluidStack.amount)); - } else { - grinder.tank.setFluid(null); - } - return true; - } - } - } - return false; - } + @Override + public boolean onCraft(TileEntity tile) + { + if (fluidStack == null) + { + return true; + } + if (tile instanceof TileIndustrialGrinder) + { + TileIndustrialGrinder grinder = (TileIndustrialGrinder) tile; + if (grinder.tank.getFluid() == null) + { + return false; + } + if (grinder.tank.getFluid() == fluidStack) + { + if (grinder.tank.getFluidAmount() >= fluidStack.amount) + { + if (grinder.tank.getFluidAmount() > 0) + { + grinder.tank.setFluid(new FluidStack(fluidStack.getFluid(), + grinder.tank.getFluidAmount() - fluidStack.amount)); + } else + { + grinder.tank.setFluid(null); + } + return true; + } + } + } + return false; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/IndustrialSawmillRecipe.java b/src/main/java/techreborn/api/recipe/machines/IndustrialSawmillRecipe.java index 2bf48aed6..2da4c3733 100644 --- a/src/main/java/techreborn/api/recipe/machines/IndustrialSawmillRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/IndustrialSawmillRecipe.java @@ -7,93 +7,115 @@ import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; import techreborn.tiles.TileIndustrialSawmill; -public class IndustrialSawmillRecipe extends BaseRecipe { +public class IndustrialSawmillRecipe extends BaseRecipe +{ - public FluidStack fluidStack; + public FluidStack fluidStack; - public boolean canUseOreDict = false; + public boolean canUseOreDict = false; - public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, int tickTime, int euPerTick) { - super(Reference.industrialSawmillRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - if (output3 != null) - addOutput(output3); - this.fluidStack = fluidStack; - } + public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, + ItemStack output2, ItemStack output3, int tickTime, int euPerTick) + { + super(Reference.industrialSawmillRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + if (output3 != null) + addOutput(output3); + this.fluidStack = fluidStack; + } - public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict) { - super(Reference.industrialSawmillRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (input2 != null) - inputs.add(input2); - if (output1 != null) - addOutput(output1); - if (output2 != null) - addOutput(output2); - if (output3 != null) - addOutput(output3); - this.fluidStack = fluidStack; - this.canUseOreDict = canUseOreDict; - } + public IndustrialSawmillRecipe(ItemStack input1, ItemStack input2, FluidStack fluidStack, ItemStack output1, + ItemStack output2, ItemStack output3, int tickTime, int euPerTick, boolean canUseOreDict) + { + super(Reference.industrialSawmillRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (input2 != null) + inputs.add(input2); + if (output1 != null) + addOutput(output1); + if (output2 != null) + addOutput(output2); + if (output3 != null) + addOutput(output3); + this.fluidStack = fluidStack; + this.canUseOreDict = canUseOreDict; + } - @Override - public String getUserFreindlyName() { - return "Industrial Sawmill"; - } + @Override + public String getUserFreindlyName() + { + return "Industrial Sawmill"; + } - @Override - public boolean canCraft(TileEntity tile) { - if (fluidStack == null) { - return true; - } - if (tile instanceof TileIndustrialSawmill) { - TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile; - if (sawmill.tank.getFluid() == null) { - return false; - } - if (sawmill.tank.getFluid()== fluidStack) { - if (sawmill.tank.getFluidAmount() >= fluidStack.amount) { - return true; - } - } - } - return false; - } + @Override + public boolean canCraft(TileEntity tile) + { + if (fluidStack == null) + { + return true; + } + if (tile instanceof TileIndustrialSawmill) + { + TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile; + if (sawmill.tank.getFluid() == null) + { + return false; + } + if (sawmill.tank.getFluid() == fluidStack) + { + if (sawmill.tank.getFluidAmount() >= fluidStack.amount) + { + return true; + } + } + } + return false; + } - @Override - public boolean onCraft(TileEntity tile) { - if (fluidStack == null) { - return true; - } - if (tile instanceof TileIndustrialSawmill) { - TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile; - if (sawmill.tank.getFluid() == null) { - return false; - } - if (sawmill.tank.getFluid() == fluidStack) { - if (sawmill.tank.getFluidAmount() >= fluidStack.amount) { - if (sawmill.tank.getFluidAmount() > 0) { - sawmill.tank.setFluid(new FluidStack(fluidStack.getFluid(), sawmill.tank.getFluidAmount() - fluidStack.amount)); - } else { - sawmill.tank.setFluid(null); - } - return true; - } - } - } - return false; - } + @Override + public boolean onCraft(TileEntity tile) + { + if (fluidStack == null) + { + return true; + } + if (tile instanceof TileIndustrialSawmill) + { + TileIndustrialSawmill sawmill = (TileIndustrialSawmill) tile; + if (sawmill.tank.getFluid() == null) + { + return false; + } + if (sawmill.tank.getFluid() == fluidStack) + { + if (sawmill.tank.getFluidAmount() >= fluidStack.amount) + { + if (sawmill.tank.getFluidAmount() > 0) + { + sawmill.tank.setFluid(new FluidStack(fluidStack.getFluid(), + sawmill.tank.getFluidAmount() - fluidStack.amount)); + } else + { + sawmill.tank.setFluid(null); + } + return true; + } + } + } + return false; + } - @Override - public boolean useOreDic() { - return canUseOreDict; - } + @Override + public boolean useOreDic() + { + return canUseOreDict; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/PlateCuttingMachineRecipe.java b/src/main/java/techreborn/api/recipe/machines/PlateCuttingMachineRecipe.java index 430d2c04c..b26269b25 100644 --- a/src/main/java/techreborn/api/recipe/machines/PlateCuttingMachineRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/PlateCuttingMachineRecipe.java @@ -4,18 +4,21 @@ import net.minecraft.item.ItemStack; import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; -public class PlateCuttingMachineRecipe extends BaseRecipe { +public class PlateCuttingMachineRecipe extends BaseRecipe +{ - public PlateCuttingMachineRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { - super(Reference.plateCuttingMachineRecipe, tickTime, euPerTick); - if (input1 != null) - inputs.add(input1); - if (output1 != null) - addOutput(output1); - } + public PlateCuttingMachineRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) + { + super(Reference.plateCuttingMachineRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } - @Override - public String getUserFreindlyName() { - return "Plate Cutting Machine"; - } + @Override + public String getUserFreindlyName() + { + return "Plate Cutting Machine"; + } } diff --git a/src/main/java/techreborn/api/recipe/machines/VacuumFreezerRecipe.java b/src/main/java/techreborn/api/recipe/machines/VacuumFreezerRecipe.java index 187bb1e05..e19f2b1eb 100644 --- a/src/main/java/techreborn/api/recipe/machines/VacuumFreezerRecipe.java +++ b/src/main/java/techreborn/api/recipe/machines/VacuumFreezerRecipe.java @@ -6,28 +6,34 @@ import techreborn.api.recipe.BaseRecipe; import techreborn.lib.Reference; import techreborn.tiles.TileVacuumFreezer; -public class VacuumFreezerRecipe extends BaseRecipe { +public class VacuumFreezerRecipe extends BaseRecipe +{ - public VacuumFreezerRecipe(ItemStack input, ItemStack output, int tickTime, int euPerTick) { - super(Reference.vacuumFreezerRecipe, tickTime, euPerTick); - if (input != null) - inputs.add(input); - if (output != null) - addOutput(output); - } + public VacuumFreezerRecipe(ItemStack input, ItemStack output, int tickTime, int euPerTick) + { + super(Reference.vacuumFreezerRecipe, tickTime, euPerTick); + if (input != null) + inputs.add(input); + if (output != null) + addOutput(output); + } - @Override - public String getUserFreindlyName() { - return "Vacuum Freezer"; - } + @Override + public String getUserFreindlyName() + { + return "Vacuum Freezer"; + } - @Override - public boolean canCraft(TileEntity tile) { - if(tile instanceof TileVacuumFreezer){ - if(((TileVacuumFreezer) tile).multiBlockStatus == 1){ - return true; - } - } - return false; - } + @Override + public boolean canCraft(TileEntity tile) + { + if (tile instanceof TileVacuumFreezer) + { + if (((TileVacuumFreezer) tile).multiBlockStatus == 1) + { + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/api/recipe/machines/package-info.java b/src/main/java/techreborn/api/recipe/machines/package-info.java index b78194ac1..dac7c5126 100644 --- a/src/main/java/techreborn/api/recipe/machines/package-info.java +++ b/src/main/java/techreborn/api/recipe/machines/package-info.java @@ -1,4 +1,3 @@ -@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.recipe.machines; - -import net.minecraftforge.fml.common.API; +@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") +package techreborn.api.recipe.machines; diff --git a/src/main/java/techreborn/api/recipe/package-info.java b/src/main/java/techreborn/api/recipe/package-info.java index 05972c5df..d04d6b467 100644 --- a/src/main/java/techreborn/api/recipe/package-info.java +++ b/src/main/java/techreborn/api/recipe/package-info.java @@ -1,4 +1,2 @@ -@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.recipe; - -import net.minecraftforge.fml.common.API; - +@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") +package techreborn.api.recipe; diff --git a/src/main/java/techreborn/api/recipe/recipeConfig/ConfigItem.java b/src/main/java/techreborn/api/recipe/recipeConfig/ConfigItem.java index bf9dcf1aa..394424d5d 100644 --- a/src/main/java/techreborn/api/recipe/recipeConfig/ConfigItem.java +++ b/src/main/java/techreborn/api/recipe/recipeConfig/ConfigItem.java @@ -1,46 +1,53 @@ package techreborn.api.recipe.recipeConfig; +public class ConfigItem +{ -public class ConfigItem { + String localName; - String localName; + String itemName; - String itemName; + int meta; - int meta; + int stackSize; - int stackSize; + public String getItemName() + { + return itemName; + } + public void setItemName(String itemName) + { + this.itemName = itemName; + } - public String getItemName() { - return itemName; - } + public int getMeta() + { + return meta; + } - public void setItemName(String itemName) { - this.itemName = itemName; - } + public void setMeta(int meta) + { + this.meta = meta; + } - public int getMeta() { - return meta; - } + public int getStackSize() + { + return stackSize; + } - public void setMeta(int meta) { - this.meta = meta; - } + public void setStackSize(int stackSize) + { + this.stackSize = stackSize; + } - public int getStackSize() { - return stackSize; - } + public String getLocalName() + { + return localName; + } - public void setStackSize(int stackSize) { - this.stackSize = stackSize; - } - - public String getLocalName() { - return localName; - } - - public void setLocalName(String localName) { - this.localName = localName; - } + public void setLocalName(String localName) + { + this.localName = localName; + } } diff --git a/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfig.java b/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfig.java index 2b25c88d6..b37132287 100644 --- a/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfig.java +++ b/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfig.java @@ -2,59 +2,72 @@ package techreborn.api.recipe.recipeConfig; import java.util.ArrayList; -public class RecipeConfig { +public class RecipeConfig +{ - ArrayList inputs; + ArrayList inputs; - ArrayList outputs; + ArrayList outputs; - Boolean enabled; + Boolean enabled; - String machine; + String machine; - public ArrayList getInputs() { - return inputs; - } + public ArrayList getInputs() + { + return inputs; + } - public void setInputs(ArrayList inputs) { - this.inputs = inputs; - } + public void setInputs(ArrayList inputs) + { + this.inputs = inputs; + } - public ArrayList getOutputs() { - return outputs; - } + public ArrayList getOutputs() + { + return outputs; + } - public void setOutputs(ArrayList outputs) { - this.outputs = outputs; - } + public void setOutputs(ArrayList outputs) + { + this.outputs = outputs; + } - public Boolean getEnabled() { - return enabled; - } + public Boolean getEnabled() + { + return enabled; + } - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } + public void setEnabled(Boolean enabled) + { + this.enabled = enabled; + } - public String getMachine() { - return machine; - } + public String getMachine() + { + return machine; + } - public void setMachine(String machine) { - this.machine = machine; - } + public void setMachine(String machine) + { + this.machine = machine; + } - public void addInputs(ConfigItem item) { - if (inputs == null) { - inputs = new ArrayList(); - } - inputs.add(item); - } + public void addInputs(ConfigItem item) + { + if (inputs == null) + { + inputs = new ArrayList(); + } + inputs.add(item); + } - public void addOutputs(ConfigItem item) { - if (outputs == null) { - outputs = new ArrayList(); - } - outputs.add(item); - } + public void addOutputs(ConfigItem item) + { + if (outputs == null) + { + outputs = new ArrayList(); + } + outputs.add(item); + } } diff --git a/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfigManager.java b/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfigManager.java index cb5e9f505..9e85f2918 100644 --- a/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfigManager.java +++ b/src/main/java/techreborn/api/recipe/recipeConfig/RecipeConfigManager.java @@ -1,65 +1,75 @@ package techreborn.api.recipe.recipeConfig; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import net.minecraft.item.ItemStack; -import techreborn.api.recipe.IBaseRecipeType; - import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; -public class RecipeConfigManager { +import net.minecraft.item.ItemStack; +import techreborn.api.recipe.IBaseRecipeType; - public static ArrayList configs = new ArrayList(); +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; - static File configFile = null; +public class RecipeConfigManager +{ - public static void load(File configDir) { - if (configFile == null) { - configFile = new File(configDir, "techRebornRecipes.json"); - } - } + public static ArrayList configs = new ArrayList(); - public static void save() { - if (configFile.exists()) { - configFile.delete(); - } - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(configs); - try { - FileWriter writer = new FileWriter(configFile); - writer.write(json); - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } + static File configFile = null; + public static void load(File configDir) + { + if (configFile == null) + { + configFile = new File(configDir, "techRebornRecipes.json"); + } + } - public static boolean canLoadRecipe(IBaseRecipeType recipeType) { - RecipeConfig config = new RecipeConfig(); - for (ItemStack stack : recipeType.getInputs()) { - config.addInputs(itemToConfig(stack)); - } - for (ItemStack stack : recipeType.getOutputs()) { - config.addOutputs(itemToConfig(stack)); - } - config.enabled = true; - config.setMachine(recipeType.getRecipeName()); - configs.add(config); - return config.enabled; - } + public static void save() + { + if (configFile.exists()) + { + configFile.delete(); + } + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String json = gson.toJson(configs); + try + { + FileWriter writer = new FileWriter(configFile); + writer.write(json); + writer.close(); + } catch (IOException e) + { + e.printStackTrace(); + } + } + public static boolean canLoadRecipe(IBaseRecipeType recipeType) + { + RecipeConfig config = new RecipeConfig(); + for (ItemStack stack : recipeType.getInputs()) + { + config.addInputs(itemToConfig(stack)); + } + for (ItemStack stack : recipeType.getOutputs()) + { + config.addOutputs(itemToConfig(stack)); + } + config.enabled = true; + config.setMachine(recipeType.getRecipeName()); + configs.add(config); + return config.enabled; + } - public static ConfigItem itemToConfig(ItemStack stack) { - ConfigItem newItem = new ConfigItem(); - newItem.setItemName(stack.getItem().getUnlocalizedName()); - newItem.setMeta(stack.getItemDamage()); - newItem.setStackSize(stack.stackSize); - newItem.setLocalName(stack.getDisplayName()); - return newItem; - } + public static ConfigItem itemToConfig(ItemStack stack) + { + ConfigItem newItem = new ConfigItem(); + newItem.setItemName(stack.getItem().getUnlocalizedName()); + newItem.setMeta(stack.getItemDamage()); + newItem.setStackSize(stack.stackSize); + newItem.setLocalName(stack.getDisplayName()); + return newItem; + } } diff --git a/src/main/java/techreborn/api/upgrade/IMachineUpgrade.java b/src/main/java/techreborn/api/upgrade/IMachineUpgrade.java index 0ff52d2c4..d528e41c1 100644 --- a/src/main/java/techreborn/api/upgrade/IMachineUpgrade.java +++ b/src/main/java/techreborn/api/upgrade/IMachineUpgrade.java @@ -3,7 +3,8 @@ package techreborn.api.upgrade; import net.minecraft.item.ItemStack; import techreborn.api.recipe.RecipeCrafter; -public interface IMachineUpgrade { +public interface IMachineUpgrade +{ - public void processUpgrade(RecipeCrafter crafter, ItemStack stack); + public void processUpgrade(RecipeCrafter crafter, ItemStack stack); } diff --git a/src/main/java/techreborn/api/upgrade/UpgradeHandler.java b/src/main/java/techreborn/api/upgrade/UpgradeHandler.java index 575a18b26..53b8cc0c3 100644 --- a/src/main/java/techreborn/api/upgrade/UpgradeHandler.java +++ b/src/main/java/techreborn/api/upgrade/UpgradeHandler.java @@ -1,39 +1,46 @@ package techreborn.api.upgrade; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; -import java.util.ArrayList; +public class UpgradeHandler +{ -public class UpgradeHandler { + RecipeCrafter crafter; - RecipeCrafter crafter; + Inventory inventory; - Inventory inventory; + ArrayList slots = new ArrayList(); - ArrayList slots = new ArrayList(); + public UpgradeHandler(RecipeCrafter crafter, Inventory inventory, int... slots) + { + this.crafter = crafter; + this.inventory = inventory; + for (int slot : slots) + { + this.slots.add(slot); + } + } - public UpgradeHandler(RecipeCrafter crafter, Inventory inventory, int... slots) { - this.crafter = crafter; - this.inventory = inventory; - for (int slot : slots) { - this.slots.add(slot); - } - } - - public void tick() { - if (crafter.parentTile.getWorld().isRemote) - return; - crafter.resetPowerMulti(); - crafter.resetSpeedMulti(); - for (int slot : this.slots) { - ItemStack stack = inventory.getStackInSlot(slot); - if (stack != null && stack.getItem() instanceof IMachineUpgrade) { - ((IMachineUpgrade) stack.getItem()).processUpgrade(crafter, stack); - } - } - if (crafter.currentRecipe != null) - crafter.currentNeededTicks = (int) (crafter.currentRecipe.tickTime() * (1.0 - crafter.getSpeedMultiplier())); - } + public void tick() + { + if (crafter.parentTile.getWorld().isRemote) + return; + crafter.resetPowerMulti(); + crafter.resetSpeedMulti(); + for (int slot : this.slots) + { + ItemStack stack = inventory.getStackInSlot(slot); + if (stack != null && stack.getItem() instanceof IMachineUpgrade) + { + ((IMachineUpgrade) stack.getItem()).processUpgrade(crafter, stack); + } + } + if (crafter.currentRecipe != null) + crafter.currentNeededTicks = (int) (crafter.currentRecipe.tickTime() + * (1.0 - crafter.getSpeedMultiplier())); + } } diff --git a/src/main/java/techreborn/api/upgrade/package-info.java b/src/main/java/techreborn/api/upgrade/package-info.java index 2f223430f..54f640a22 100644 --- a/src/main/java/techreborn/api/upgrade/package-info.java +++ b/src/main/java/techreborn/api/upgrade/package-info.java @@ -1,4 +1,2 @@ -@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.upgrade; - -import net.minecraftforge.fml.common.API; - +@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") +package techreborn.api.upgrade; diff --git a/src/main/java/techreborn/blocks/BlockComputerCube.java b/src/main/java/techreborn/blocks/BlockComputerCube.java index 197f63559..fdcbe10c4 100644 --- a/src/main/java/techreborn/blocks/BlockComputerCube.java +++ b/src/main/java/techreborn/blocks/BlockComputerCube.java @@ -9,44 +9,49 @@ import techreborn.Core; import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; -public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockComputerCube(Material material) + { + super(); + setUnlocalizedName("techreborn.computercube"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockComputerCube(Material material) { - super(); - setUnlocalizedName("techreborn.computercube"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x, y, z); + return true; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x, - y, z); - return true; - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "computer_cube"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "computer_cube"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "computer_cube"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "computer_cube" ; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "computer_cube"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "computer_cube"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "computer_cube"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "computer_cube"; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/blocks/BlockDigitalChest.java b/src/main/java/techreborn/blocks/BlockDigitalChest.java index 73b6b699b..ec3515a37 100644 --- a/src/main/java/techreborn/blocks/BlockDigitalChest.java +++ b/src/main/java/techreborn/blocks/BlockDigitalChest.java @@ -10,48 +10,55 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileDigitalChest; -public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockDigitalChest() { - super(); - setUnlocalizedName("techreborn.digitalChest"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockDigitalChest() + { + super(); + setUnlocalizedName("techreborn.digitalChest"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileDigitalChest(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileDigitalChest(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.digitalChestID, world, x, - y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.digitalChestID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFront(boolean isActive) { - return prefix + "quantum_chest"; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "quantum_chest"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "qchest_side" ; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "qchest_side"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "quantum_top"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "quantum_top"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/BlockElectricCraftingTable.java b/src/main/java/techreborn/blocks/BlockElectricCraftingTable.java index 7673ebab9..2a38bc41c 100644 --- a/src/main/java/techreborn/blocks/BlockElectricCraftingTable.java +++ b/src/main/java/techreborn/blocks/BlockElectricCraftingTable.java @@ -5,36 +5,40 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; +public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture +{ -public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture { + public BlockElectricCraftingTable(Material material) + { + super(); + setUnlocalizedName("techreborn.electriccraftingtable"); + setCreativeTab(TechRebornCreativeTab.instance); + } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - public BlockElectricCraftingTable(Material material) { - super(); - setUnlocalizedName("techreborn.electriccraftingtable"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public String getFront(boolean isActive) + { + return prefix + "electric_crafting_table_front"; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getSide(boolean isActive) + { + return prefix + "machine_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "electric_crafting_table_front"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "electric_crafting_table_top"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "machine_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "electric_crafting_table_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/BlockFusionCoil.java b/src/main/java/techreborn/blocks/BlockFusionCoil.java index f13379342..952f74d76 100644 --- a/src/main/java/techreborn/blocks/BlockFusionCoil.java +++ b/src/main/java/techreborn/blocks/BlockFusionCoil.java @@ -6,20 +6,21 @@ import net.minecraft.util.EnumFacing; import reborncore.common.blocks.BlockMachineBase; import techreborn.client.TechRebornCreativeTab; -public class BlockFusionCoil extends BlockMachineBase { +public class BlockFusionCoil extends BlockMachineBase +{ + public BlockFusionCoil(Material material) + { + super(); + setUnlocalizedName("techreborn.fusioncoil"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockFusionCoil(Material material) { - super(); - setUnlocalizedName("techreborn.fusioncoil"); - setCreativeTab(TechRebornCreativeTab.instance); - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - - private final String prefix = "techreborn:blocks/machine/greg_machines/"; - - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return prefix + "fusion_coil"; - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return prefix + "fusion_coil"; + } } diff --git a/src/main/java/techreborn/blocks/BlockFusionControlComputer.java b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java index a72c295d1..41e48f6f3 100644 --- a/src/main/java/techreborn/blocks/BlockFusionControlComputer.java +++ b/src/main/java/techreborn/blocks/BlockFusionControlComputer.java @@ -14,59 +14,71 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.fusionReactor.TileEntityFusionController; import techreborn.utils.damageSources.FusionDamageSource; -public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockFusionControlComputer(Material material) { - super(); - setUnlocalizedName("techreborn.fusioncontrolcomputer"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockFusionControlComputer(Material material) + { + super(); + setUnlocalizedName("techreborn.fusioncontrolcomputer"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)); - tileEntityFusionController.checkCoils(); - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.fusionID, world, x, y, - z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world + .getTileEntity(new BlockPos(x, y, z)); + tileEntityFusionController.checkCoils(); + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.fusionID, world, x, y, z); + return true; + } - @Override - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) { - super.onEntityCollidedWithBlock(worldIn, pos, entityIn); - if(worldIn.getTileEntity(pos) instanceof TileEntityFusionController){ - if(((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0 && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()){ - entityIn.attackEntityFrom(new FusionDamageSource(), 200F); - } - } - } + @Override + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn) + { + super.onEntityCollidedWithBlock(worldIn, pos, entityIn); + if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) + { + if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0 + && ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) + { + entityIn.attackEntityFrom(new FusionDamageSource(), 200F); + } + } + } - @Override - public TileEntity createNewTileEntity(World world, int meta) { - return new TileEntityFusionController(); - } + @Override + public TileEntity createNewTileEntity(World world, int meta) + { + return new TileEntityFusionController(); + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFront(boolean isActive) { - return prefix + "fusion_control_computer_front"; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "fusion_control_computer_front"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "machine_side" ; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "machine_side"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "machine_side"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "machine_side"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_side"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_side"; + } } diff --git a/src/main/java/techreborn/blocks/BlockHighlyAdvancedMachine.java b/src/main/java/techreborn/blocks/BlockHighlyAdvancedMachine.java index 9c299d3ab..cfdb4927d 100644 --- a/src/main/java/techreborn/blocks/BlockHighlyAdvancedMachine.java +++ b/src/main/java/techreborn/blocks/BlockHighlyAdvancedMachine.java @@ -6,20 +6,22 @@ import net.minecraft.util.EnumFacing; import reborncore.common.blocks.BlockMachineBase; import techreborn.client.TechRebornCreativeTab; -public class BlockHighlyAdvancedMachine extends BlockMachineBase { +public class BlockHighlyAdvancedMachine extends BlockMachineBase +{ - public BlockHighlyAdvancedMachine(Material material) { - super(); - setUnlocalizedName("techreborn.highlyAdvancedMachine"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockHighlyAdvancedMachine(Material material) + { + super(); + setUnlocalizedName("techreborn.highlyAdvancedMachine"); + setCreativeTab(TechRebornCreativeTab.instance); + } - private final String prefix = "techreborn:blocks/machine/machine_blocks/"; + private final String prefix = "techreborn:blocks/machine/machine_blocks/"; - - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return prefix + "highlyadvancedmachine"; - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return prefix + "highlyadvancedmachine"; + } } diff --git a/src/main/java/techreborn/blocks/BlockIronFence.java b/src/main/java/techreborn/blocks/BlockIronFence.java index 04cf1bd65..bd0ef3f66 100644 --- a/src/main/java/techreborn/blocks/BlockIronFence.java +++ b/src/main/java/techreborn/blocks/BlockIronFence.java @@ -5,14 +5,16 @@ import net.minecraft.block.BlockPlanks; import net.minecraft.block.material.Material; import techreborn.client.TechRebornCreativeTabMisc; -public class BlockIronFence extends BlockFence { +public class BlockIronFence extends BlockFence +{ - public BlockIronFence() { + public BlockIronFence() + { super(Material.iron, BlockPlanks.EnumType.OAK.getMapColor()); - setUnlocalizedName("techreborn.ironfence"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHardness(2.0F); - setHarvestLevel("pickaxe", 2); + setUnlocalizedName("techreborn.ironfence"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHardness(2.0F); + setHarvestLevel("pickaxe", 2); } } diff --git a/src/main/java/techreborn/blocks/BlockMachineCasing.java b/src/main/java/techreborn/blocks/BlockMachineCasing.java index 0406c8d01..e30f41940 100644 --- a/src/main/java/techreborn/blocks/BlockMachineCasing.java +++ b/src/main/java/techreborn/blocks/BlockMachineCasing.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -20,93 +23,105 @@ import reborncore.common.multiblock.BlockMultiblockBase; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileMachineCasing; -import java.util.List; -import java.util.Random; +public class BlockMachineCasing extends BlockMultiblockBase implements ITexturedBlock +{ -public class BlockMachineCasing extends BlockMultiblockBase implements ITexturedBlock { + public static final String[] types = new String[] { "standard", "reinforced", "advanced" }; - public static final String[] types = new String[] - {"standard", "reinforced", "advanced"}; + public BlockMachineCasing(Material material) + { + super(material); + setCreativeTab(TechRebornCreativeTab.instance); + setUnlocalizedName("techreborn.machineCasing"); + setHardness(2F); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); + } - public BlockMachineCasing(Material material) { - super(material); - setCreativeTab(TechRebornCreativeTab.instance); - setUnlocalizedName("techreborn.machineCasing"); - setHardness(2F); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); - } + public PropertyInteger METADATA; - public PropertyInteger METADATA; + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + @Override + public int getMetaFromState(IBlockState state) + { + return (Integer) state.getValue(METADATA); + } - @Override - public int getMetaFromState(IBlockState state) { - return (Integer) state.getValue(METADATA); - } + protected BlockStateContainer createBlockState() + { - protected BlockStateContainer createBlockState() { + METADATA = PropertyInteger.create("type", 0, types.length); + return new BlockStateContainer(this, METADATA); + } - METADATA = PropertyInteger.create("type", 0, types.length); - return new BlockStateContainer(this, METADATA); - } + public int getHeatFromState(IBlockState state) + { + switch (getMetaFromState(state)) + { + case 0: + return 1020 / 25; + case 1: + return 1700 / 25; + case 2: + return 2380 / 25; + } + return 0; + } - public int getHeatFromState(IBlockState state) { - switch (getMetaFromState(state)) { - case 0: - return 1020 / 25; - case 1: - return 1700 / 25; - case 2: - return 2380 / 25; - } - return 0; - } + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this); + } - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return Item.getItemFromBlock(this); - } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public int damageDropped(IBlockState state) + { + return super.damageDropped(state); + } - @Override - public int damageDropped(IBlockState state) { - return super.damageDropped(state); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileMachineCasing(); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileMachineCasing(); - } + @Override + public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side) + { + Block b = worldIn.getBlockState(pos).getBlock(); + return b == (Block) this ? false : super.shouldSideBeRendered(blockState, worldIn, pos, side); + } - @Override - public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side) { - Block b = worldIn.getBlockState(pos).getBlock(); - return b == (Block) this ? false : super.shouldSideBeRendered(blockState, worldIn, pos, side); - } + public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) + { + return block == (Block) this; + } - public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) { - return block == (Block) this; - } + @Override + public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) + { + return "techreborn:blocks/machine/machine_blocks/casing" + types[getMetaFromState(blockState)] + "_full"; + } - @Override - public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) { - return "techreborn:blocks/machine/machine_blocks/casing" + types[getMetaFromState(blockState)] + "_full"; - } - - @Override - public int amountOfStates() { - return types.length; - } + @Override + public int amountOfStates() + { + return types.length; + } } diff --git a/src/main/java/techreborn/blocks/BlockMachineFrame.java b/src/main/java/techreborn/blocks/BlockMachineFrame.java index 76d780c27..1cde557c0 100644 --- a/src/main/java/techreborn/blocks/BlockMachineFrame.java +++ b/src/main/java/techreborn/blocks/BlockMachineFrame.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.security.InvalidParameterException; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -15,70 +18,78 @@ import reborncore.common.BaseBlock; import techreborn.client.TechRebornCreativeTab; import techreborn.init.ModBlocks; -import java.security.InvalidParameterException; -import java.util.List; +public class BlockMachineFrame extends BaseBlock implements ITexturedBlock +{ + public PropertyInteger METADATA; -public class BlockMachineFrame extends BaseBlock implements ITexturedBlock { - public PropertyInteger METADATA; + public static ItemStack getFrameByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModBlocks.machineframe, count, i); + } + } + throw new InvalidParameterException("The part " + name + " could not be found."); + } - public static ItemStack getFrameByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModBlocks.machineframe, count, i); - } - } - throw new InvalidParameterException("The part " + name + " could not be found."); - } + public static final String[] types = new String[] { "aluminum", "iron", "bronze", "brass", "steel", "titanium", + "machine", "advancedMachine" }; - public static final String[] types = new String[] - {"aluminum", "iron", "bronze", "brass", "steel", "titanium", "machine", "advancedMachine"}; + public BlockMachineFrame(Material material) + { + super(material); + setUnlocalizedName("techreborn.machineFrame"); + setCreativeTab(TechRebornCreativeTab.instance); + setHardness(1f); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); + } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - public BlockMachineFrame(Material material) { - super(material); - setUnlocalizedName("techreborn.machineFrame"); - setCreativeTab(TechRebornCreativeTab.instance); - setHardness(1f); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); - } + @Override + public int damageDropped(IBlockState state) + { + return super.damageDropped(state); + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) + { + return "techreborn:blocks/machine/machine_blocks/" + types[getMetaFromState(blockState)] + "_machine_block"; + } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public int damageDropped(IBlockState state) { - return super.damageDropped(state); - } + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(METADATA); + } - @Override - public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) { - return "techreborn:blocks/machine/machine_blocks/" + types[getMetaFromState(blockState)] + "_machine_block"; - } + protected BlockStateContainer createBlockState() + { - @Override - public int amountOfStates() { - return types.length; - } + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA); + } - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(METADATA); - } - - protected BlockStateContainer createBlockState() { - - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA); - } - - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } } diff --git a/src/main/java/techreborn/blocks/BlockNuke.java b/src/main/java/techreborn/blocks/BlockNuke.java index c06b00be0..99b6b8477 100644 --- a/src/main/java/techreborn/blocks/BlockNuke.java +++ b/src/main/java/techreborn/blocks/BlockNuke.java @@ -9,8 +9,8 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; @@ -24,92 +24,116 @@ import techreborn.entitys.EntityNukePrimed; /** * Created by Mark on 13/03/2016. */ -public class BlockNuke extends BaseBlock implements ITexturedBlock { - public static final PropertyBool OVERLAY = PropertyBool.create("overlay"); +public class BlockNuke extends BaseBlock implements ITexturedBlock +{ + public static final PropertyBool OVERLAY = PropertyBool.create("overlay"); - public BlockNuke() { - super(Material.tnt); - setUnlocalizedName("techreborn.nuke"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - RebornCore.jsonDestroyer.registerObject(this); - this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false)); - } + public BlockNuke() + { + super(Material.tnt); + setUnlocalizedName("techreborn.nuke"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + RebornCore.jsonDestroyer.registerObject(this); + this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false)); + } - public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) { - if (!worldIn.isRemote) { - EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter); - worldIn.spawnEntityInWorld(entitynukeprimed); - // worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed", 1.0F, 1.0F); - } - } + public void explode(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase igniter) + { + if (!worldIn.isRemote) + { + EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), + (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), igniter); + worldIn.spawnEntityInWorld(entitynukeprimed); + // worldIn.playSoundAtEntity(entitynukeprimed, "game.tnt.primed", + // 1.0F, 1.0F); + } + } - @Override - public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { - if (!worldIn.isRemote) { - EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); - entitynukeprimed.fuse = worldIn.rand.nextInt(entitynukeprimed.fuse / 4) + entitynukeprimed.fuse / 8; - worldIn.spawnEntityInWorld(entitynukeprimed); - } - } + @Override + public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) + { + if (!worldIn.isRemote) + { + EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F), + (double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); + entitynukeprimed.fuse = worldIn.rand.nextInt(entitynukeprimed.fuse / 4) + entitynukeprimed.fuse / 8; + worldIn.spawnEntityInWorld(entitynukeprimed); + } + } - public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { - if (!worldIn.isRemote && entityIn instanceof EntityArrow) { - EntityArrow entityarrow = (EntityArrow) entityIn; + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if (!worldIn.isRemote && entityIn instanceof EntityArrow) + { + EntityArrow entityarrow = (EntityArrow) entityIn; - if (entityarrow.isBurning()) { - this.explode(worldIn, pos, state, entityarrow.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase) entityarrow.shootingEntity : null); - worldIn.setBlockToAir(pos); - } - } - } + if (entityarrow.isBurning()) + { + this.explode(worldIn, pos, state, entityarrow.shootingEntity instanceof EntityLivingBase + ? (EntityLivingBase) entityarrow.shootingEntity : null); + worldIn.setBlockToAir(pos); + } + } + } - public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { - super.onBlockAdded(worldIn, pos, state); - if (worldIn.isBlockPowered(pos)) { - this.explode(worldIn, pos, state, null); - worldIn.setBlockToAir(pos); - } - } + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + if (worldIn.isBlockPowered(pos)) + { + this.explode(worldIn, pos, state, null); + worldIn.setBlockToAir(pos); + } + } - /** - * Called when a neighboring block changes. - */ - public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { - if (worldIn.isBlockPowered(pos)) { - this.explode(worldIn, pos, state, null); - worldIn.setBlockToAir(pos); - } - } + /** + * Called when a neighboring block changes. + */ + public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) + { + if (worldIn.isBlockPowered(pos)) + { + this.explode(worldIn, pos, state, null); + worldIn.setBlockToAir(pos); + } + } - @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - return false; - } + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { + return false; + } - @Override - public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) { - if (iBlockState.getValue(OVERLAY)) { - return "techreborn:blocks/nuke_overlay"; - } - return "techreborn:blocks/nuke"; - } + @Override + public String getTextureNameFromState(IBlockState iBlockState, EnumFacing enumFacing) + { + if (iBlockState.getValue(OVERLAY)) + { + return "techreborn:blocks/nuke_overlay"; + } + return "techreborn:blocks/nuke"; + } - @Override - public int amountOfStates() { - return 2; - } + @Override + public int amountOfStates() + { + return 2; + } - public int getMetaFromState(IBlockState state) { - return state.getValue(OVERLAY) ? 1 : 0; - } + public int getMetaFromState(IBlockState state) + { + return state.getValue(OVERLAY) ? 1 : 0; + } - public IBlockState getStateFromMeta(int meta) - { - return this.getDefaultState().withProperty(OVERLAY, Boolean.valueOf((meta & 1) > 0)); - } + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(OVERLAY, Boolean.valueOf((meta & 1) > 0)); + } - protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, OVERLAY); - } + protected BlockStateContainer createBlockState() + { + return new BlockStateContainer(this, OVERLAY); + } } diff --git a/src/main/java/techreborn/blocks/BlockOre.java b/src/main/java/techreborn/blocks/BlockOre.java index 5cd015473..e15210b3a 100644 --- a/src/main/java/techreborn/blocks/BlockOre.java +++ b/src/main/java/techreborn/blocks/BlockOre.java @@ -1,5 +1,10 @@ package techreborn.blocks; +import java.security.InvalidParameterException; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -27,173 +32,203 @@ import techreborn.items.ItemDusts; import techreborn.items.ItemGems; import techreborn.world.config.IOreNameProvider; -import java.security.InvalidParameterException; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; +public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvider +{ -public class BlockOre extends BaseBlock implements ITexturedBlock, IOreNameProvider { + public static ItemStack getOreByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModBlocks.ore, count, i); + } + } + throw new InvalidParameterException("The ore block " + name + " could not be found."); + } - public static ItemStack getOreByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModBlocks.ore, count, i); - } - } - throw new InvalidParameterException("The ore block " + name + " could not be found."); - } + public static ItemStack getOreByName(String name) + { + return getOreByName(name, 1); + } - public static ItemStack getOreByName(String name) { - return getOreByName(name, 1); - } + public IBlockState getBlockStateFromName(String name) + { + int index = -1; + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + index = i; + break; + } + } + if (index == -1) + { + return ModBlocks.ore2.getBlockStateFromName(name); + } + return getStateFromMeta(index); + } - public IBlockState getBlockStateFromName(String name){ - int index = -1; - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - index = i; - break; - } - } - if(index == -1){ - return ModBlocks.ore2.getBlockStateFromName(name); - } - return getStateFromMeta(index); - } + public static final String[] types = new String[] { "Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", + "Cinnabar", "Sphalerite", "Tungston", "Sheldonite", "Peridot", "Sodalite", "Tetrahedrite", "Cassiterite", + "Lead", "Silver" }; - public static final String[] types = new String[] - {"Galena", "Iridium", "Ruby", "Sapphire", "Bauxite", "Pyrite", "Cinnabar", - "Sphalerite", "Tungston", "Sheldonite", "Peridot", "Sodalite", - "Tetrahedrite", "Cassiterite", "Lead", "Silver"}; + public PropertyInteger METADATA; - public PropertyInteger METADATA; + public BlockOre(Material material) + { + super(material); + setUnlocalizedName("techreborn.ore"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHardness(2.0f); + setHarvestLevel("pickaxe", 2); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); + } - public BlockOre(Material material) { - super(material); - setUnlocalizedName("techreborn.ore"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHardness(2.0f); - setHarvestLevel("pickaxe", 2); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); - } + @Deprecated + public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + int metadata = getMetaFromState(state); + Random random = new Random(); + // Ruby + if (metadata == 2) + { + OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 0.02); + OreDropSet set = new OreDropSet(ruby, redGarnet); + return set.drop(fortune, random); + } + // Sapphire + if (metadata == 3) + { + OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03); + OreDropSet set = new OreDropSet(sapphire, peridot); + return set.drop(fortune, random); + } + // Pyrite + if (metadata == 5) + { + OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDropSet set = new OreDropSet(pyriteDust); + return set.drop(fortune, random); + } - @Deprecated - public ArrayList getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - int metadata = getMetaFromState(state); - Random random = new Random(); - //Ruby - if (metadata == 2) { - OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 0.02); - OreDropSet set = new OreDropSet(ruby, redGarnet); - return set.drop(fortune, random); - } + // Sodolite + if (metadata == 11) + { + OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50); + OreDropSet set = new OreDropSet(sodalite, aluminum); + return set.drop(fortune, random); + } - //Sapphire - if (metadata == 3) { - OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03); - OreDropSet set = new OreDropSet(sapphire, peridot); - return set.drop(fortune, random); - } + // Cinnabar + if (metadata == 6) + { + OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDrop redstone = new OreDrop(new ItemStack(Items.redstone), 0.25); + OreDropSet set = new OreDropSet(cinnabar, redstone); + return set.drop(fortune, random); + } - //Pyrite - if (metadata == 5) { - OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDropSet set = new OreDropSet(pyriteDust); - return set.drop(fortune, random); - } + // Sphalerite 1, 1/8 yellow garnet + if (metadata == 7) + { + OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"), + ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); + OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125); + OreDropSet set = new OreDropSet(sphalerite, yellowGarnet); + return set.drop(fortune, random); + } - //Sodolite - if (metadata == 11) { - OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50); - OreDropSet set = new OreDropSet(sodalite, aluminum); - return set.drop(fortune, random); - } + ArrayList block = new ArrayList(); + block.add(new ItemStack(Item.getItemFromBlock(this), 1, metadata)); + return block; + } - //Cinnabar - if (metadata == 6) { - OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDrop redstone = new OreDrop(new ItemStack(Items.redstone), 0.25); - OreDropSet set = new OreDropSet(cinnabar, redstone); - return set.drop(fortune, random); - } + @Override + protected boolean canSilkHarvest() + { + return true; + } - //Sphalerite 1, 1/8 yellow garnet - if (metadata == 7) { - OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel); - OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125); - OreDropSet set = new OreDropSet(sphalerite, yellowGarnet); - return set.drop(fortune, random); - } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - ArrayList block = new ArrayList(); - block.add(new ItemStack(Item.getItemFromBlock(this), 1, metadata)); - return block; - } + @Override + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, + EntityPlayer player) + { + return super.getPickBlock(state, target, world, pos, player); + } - @Override - protected boolean canSilkHarvest() { - return true; - } + @Override + public int damageDropped(IBlockState state) + { + int meta = getMetaFromState(state); + if (meta == 2) + { + return 0; + } else if (meta == 3) + { + return 1; + } else if (meta == 5) + { + return 60; + } + return meta; + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)]; + } - @Override - public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { - return super.getPickBlock(state, target, world, pos, player); - } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public int damageDropped(IBlockState state) { - int meta = getMetaFromState(state); - if (meta == 2) { - return 0; - } else if (meta == 3) { - return 1; - } else if (meta == 5) { - return 60; - } - return meta; - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)]; - } + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(METADATA); + } - @Override - public int amountOfStates() { - return types.length; - } + protected BlockStateContainer createBlockState() + { - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA); + } - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(METADATA); - } - - protected BlockStateContainer createBlockState() { - - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA); - } - - @Override - public String getUserLoclisedName(IBlockState state) { - return types[state.getValue(METADATA)]; - } + @Override + public String getUserLoclisedName(IBlockState state) + { + return types[state.getValue(METADATA)]; + } } diff --git a/src/main/java/techreborn/blocks/BlockOre2.java b/src/main/java/techreborn/blocks/BlockOre2.java index faf785f57..579997a6c 100644 --- a/src/main/java/techreborn/blocks/BlockOre2.java +++ b/src/main/java/techreborn/blocks/BlockOre2.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.security.InvalidParameterException; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -20,104 +23,122 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModBlocks; import techreborn.world.config.IOreNameProvider; -import java.security.InvalidParameterException; -import java.util.List; +public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProvider +{ -public class BlockOre2 extends BaseBlock implements ITexturedBlock, IOreNameProvider { + public static ItemStack getOreByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModBlocks.ore2, count, i); + } + } + throw new InvalidParameterException("The ore block " + name + " could not be found."); + } - public static ItemStack getOreByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModBlocks.ore2, count, i); - } - } - throw new InvalidParameterException("The ore block " + name + " could not be found."); - } + public static ItemStack getOreByName(String name) + { + return getOreByName(name, 1); + } - public static ItemStack getOreByName(String name) { - return getOreByName(name, 1); - } + public IBlockState getBlockStateFromName(String name) + { + int index = -1; + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + index = i; + break; + } + } + if (index == -1) + { + throw new InvalidParameterException("The ore block " + name + " could not be found."); + } + return getStateFromMeta(index); + } - public IBlockState getBlockStateFromName(String name){ - int index = -1; - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - index = i; - break; - } - } - if(index == -1){ - throw new InvalidParameterException("The ore block " + name + " could not be found."); - } - return getStateFromMeta(index); - } + public static final String[] types = new String[] { "Copper", "Tin" }; - public static final String[] types = new String[] - {"Copper", "Tin"}; + public PropertyInteger METADATA; - public PropertyInteger METADATA; + public BlockOre2(Material material) + { + super(material); + setUnlocalizedName("techreborn.ore2"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHardness(2.0f); + setHarvestLevel("pickaxe", 1); + this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0)); + } - public BlockOre2(Material material) { - super(material); - setUnlocalizedName("techreborn.ore2"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHardness(2.0f); - setHarvestLevel("pickaxe", 1); - this.setDefaultState(this.blockState.getBaseState().withProperty(METADATA, 0)); - } + @Override + protected boolean canSilkHarvest() + { + return true; + } - @Override - protected boolean canSilkHarvest() { - return true; - } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, + EntityPlayer player) + { + return super.getPickBlock(state, target, world, pos, player); + } - @Override - public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { - return super.getPickBlock(state, target, world, pos, player); - } + @Override + public int damageDropped(IBlockState state) + { + int meta = getMetaFromState(state); + return meta; + } - @Override - public int damageDropped(IBlockState state) { - int meta = getMetaFromState(state); - return meta; - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)]; + } - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return "techreborn:blocks/ore/ore" + types[getMetaFromState(BlockStateContainer)]; - } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public int amountOfStates() { - return types.length; - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(METADATA); + } - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(METADATA); - } + protected BlockStateContainer createBlockState() + { - protected BlockStateContainer createBlockState() { + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA); + } - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA); - } - - @Override - public String getUserLoclisedName(IBlockState state) { - return types[state.getValue(METADATA)]; - } + @Override + public String getUserLoclisedName(IBlockState state) + { + return types[state.getValue(METADATA)]; + } } diff --git a/src/main/java/techreborn/blocks/BlockPlayerDetector.java b/src/main/java/techreborn/blocks/BlockPlayerDetector.java index 96dec90ef..ee5c6deee 100644 --- a/src/main/java/techreborn/blocks/BlockPlayerDetector.java +++ b/src/main/java/techreborn/blocks/BlockPlayerDetector.java @@ -1,8 +1,9 @@ package techreborn.blocks; +import java.util.List; +import java.util.Random; import me.modmuss50.jsonDestroyer.api.ITexturedBlock; -import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyInteger; @@ -23,132 +24,150 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import reborncore.common.BaseTileBlock; import reborncore.common.blocks.BlockMachineBase; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TilePlayerDectector; -import java.util.List; -import java.util.Random; +public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBlock +{ -public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBlock { + public PropertyInteger METADATA; - public PropertyInteger METADATA; + public BlockPlayerDetector() + { + super(); + setUnlocalizedName("techreborn.playerDetector"); + setCreativeTab(TechRebornCreativeTab.instance); + setHardness(2f); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0).withProperty(FACING, EnumFacing.NORTH) + .withProperty(ACTIVE, false)); + } - public BlockPlayerDetector() { - super(); - setUnlocalizedName("techreborn.playerDetector"); - setCreativeTab(TechRebornCreativeTab.instance); - setHardness(2f); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0).withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false)); - } + public static final String[] types = new String[] { "all", "others", "you" }; - public static final String[] types = new String[] - {"all", "others", "you"}; + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this); + } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return Item.getItemFromBlock(this); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TilePlayerDectector(); + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) + { + return true; + } + @Override + public boolean canProvidePower(IBlockState state) + { + return true; + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TilePlayerDectector(); - } + @Override + public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) + { + TileEntity entity = blockAccess.getTileEntity(pos); + if (entity instanceof TilePlayerDectector) + { + return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; + } + return 0; + } - @Override - public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { - return true; - } + @Override + public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) + { + TileEntity entity = blockAccess.getTileEntity(pos); + if (entity instanceof TilePlayerDectector) + { + return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; + } + return 0; + } - @Override - public boolean canProvidePower(IBlockState state) { - return true; - } + @Override + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, + ItemStack stack) + { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + TileEntity tile = worldIn.getTileEntity(pos); + if (tile instanceof TilePlayerDectector) + { + ((TilePlayerDectector) tile).owenerUdid = placer.getUniqueID().toString(); + } + } - @Override - public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { - TileEntity entity = blockAccess.getTileEntity(pos); - if (entity instanceof TilePlayerDectector) { - return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; - } - return 0; - } + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { + // int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 3; + int newMeta = getMetaFromState(state); + String message = ""; + switch (newMeta) + { + case 0: + message = TextFormatting.GREEN + "Detects all Players"; + break; + case 1: + message = TextFormatting.RED + "Detects only other Players"; + break; + case 2: + message = TextFormatting.BLUE + "Detects only you"; + } + if (!world.isRemote) + { + entityPlayer.addChatComponentMessage(new TextComponentString(message)); + // world.setBlockMetadataWithNotify(x, y, z, newMeta, 2); + } + return true; + } - @Override - public int getStrongPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { - TileEntity entity = blockAccess.getTileEntity(pos); - if (entity instanceof TilePlayerDectector) { - return ((TilePlayerDectector) entity).isProvidingPower() ? 15 : 0; - } - return 0; - } + @Override + public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) + { + return "techreborn:blocks/machine/greg_machines/player_detector_" + types[getMetaFromState(blockState)]; + } - @Override - public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { - super.onBlockPlacedBy(worldIn, pos, state, placer, stack); - TileEntity tile = worldIn.getTileEntity(pos); - if (tile instanceof TilePlayerDectector) { - ((TilePlayerDectector) tile).owenerUdid = placer.getUniqueID().toString(); - } - } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityPlayer, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - // int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 3; - int newMeta = getMetaFromState(state); - String message = ""; - switch (newMeta) { - case 0: - message = TextFormatting.GREEN + "Detects all Players"; - break; - case 1: - message = TextFormatting.RED + "Detects only other Players"; - break; - case 2: - message = TextFormatting.BLUE + "Detects only you"; - } - if(!world.isRemote){ - entityPlayer.addChatComponentMessage(new TextComponentString(message)); - //world.setBlockMetadataWithNotify(x, y, z, newMeta, 2); - } - return true; - } + @Override + public int getMetaFromState(IBlockState state) + { + return (Integer) state.getValue(METADATA); + } - @Override - public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) { - return "techreborn:blocks/machine/greg_machines/player_detector_" + types[getMetaFromState(blockState)]; - } + protected BlockStateContainer createBlockState() + { + FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); + ACTIVE = PropertyBool.create("active"); + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA, FACING, ACTIVE); + } - @Override - public int amountOfStates() { - return types.length; - } - - @Override - public int getMetaFromState(IBlockState state) { - return (Integer) state.getValue(METADATA); - } - - protected BlockStateContainer createBlockState() { - FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); - ACTIVE = PropertyBool.create("active"); - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA, FACING, ACTIVE); - } - - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } } diff --git a/src/main/java/techreborn/blocks/BlockQuantumChest.java b/src/main/java/techreborn/blocks/BlockQuantumChest.java index 6345b7acd..7770c8eb2 100644 --- a/src/main/java/techreborn/blocks/BlockQuantumChest.java +++ b/src/main/java/techreborn/blocks/BlockQuantumChest.java @@ -15,48 +15,55 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileQuantumChest; -public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockQuantumChest() { - super(); - setUnlocalizedName("techreborn.quantumChest"); - setCreativeTab(TechRebornCreativeTab.instance); - setHardness(2.0F); - } + public BlockQuantumChest() + { + super(); + setUnlocalizedName("techreborn.quantumChest"); + setCreativeTab(TechRebornCreativeTab.instance); + setHardness(2.0F); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileQuantumChest(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileQuantumChest(); + } - @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - if (!playerIn.isSneaking()) - playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(), - pos.getY(), pos.getZ()); - return true; - } + @Override + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!playerIn.isSneaking()) + playerIn.openGui(Core.INSTANCE, GuiHandler.quantumChestID, worldIn, pos.getX(), pos.getY(), pos.getZ()); + return true; + } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "quantum_chest"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "quantum_chest"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "qchest_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "qchest_side"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "quantum_top"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "quantum_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/BlockQuantumTank.java b/src/main/java/techreborn/blocks/BlockQuantumTank.java index 0655fa469..fc03944e9 100644 --- a/src/main/java/techreborn/blocks/BlockQuantumTank.java +++ b/src/main/java/techreborn/blocks/BlockQuantumTank.java @@ -11,50 +11,61 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileQuantumTank; -public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockQuantumTank() { - super(); - setUnlocalizedName("techreborn.quantumTank"); - setHardness(2.0F); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockQuantumTank() + { + super(); + setUnlocalizedName("techreborn.quantumTank"); + setHardness(2.0F); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileQuantumTank(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileQuantumTank(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)) { - return true; - } - if (!player.isSneaking()) { - player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z); - } - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z); + } + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFront(boolean isActive) { - return "techreborn:blocks/machine/generators/thermal_generator_side_off"; - } + @Override + public String getFront(boolean isActive) + { + return "techreborn:blocks/machine/generators/thermal_generator_side_off"; + } - @Override - public String getSide(boolean isActive) { - return "techreborn:blocks/machine/generators/thermal_generator_side_off"; - } + @Override + public String getSide(boolean isActive) + { + return "techreborn:blocks/machine/generators/thermal_generator_side_off"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "quantum_top"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "quantum_top"; + } - @Override - public String getBottom(boolean isActive) { - return "techreborn:blocks/machine/generators/thermal_generator_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return "techreborn:blocks/machine/generators/thermal_generator_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/BlockReinforcedGlass.java b/src/main/java/techreborn/blocks/BlockReinforcedGlass.java index 085a11f86..54d174c82 100644 --- a/src/main/java/techreborn/blocks/BlockReinforcedGlass.java +++ b/src/main/java/techreborn/blocks/BlockReinforcedGlass.java @@ -10,9 +10,11 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.BaseBlock; import techreborn.client.TechRebornCreativeTabMisc; -public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock { - - public BlockReinforcedGlass(Material materialIn) { +public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock +{ + + public BlockReinforcedGlass(Material materialIn) + { super(materialIn); setUnlocalizedName("techreborn.reinforcedglass"); setCreativeTab(TechRebornCreativeTabMisc.instance); @@ -20,7 +22,8 @@ public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock { } @Override - public boolean isOpaqueCube(IBlockState state) { + public boolean isOpaqueCube(IBlockState state) + { return false; } @@ -34,17 +37,19 @@ public class BlockReinforcedGlass extends BaseBlock implements ITexturedBlock { { return false; } - - private final String prefix = "techreborn:blocks/"; + + private final String prefix = "techreborn:blocks/"; @Override - public int amountOfStates() { + public int amountOfStates() + { return 1; } @Override - public String getTextureNameFromState(IBlockState arg0, EnumFacing arg1) { + public String getTextureNameFromState(IBlockState arg0, EnumFacing arg1) + { return prefix + "reinforcedglass"; } - + } diff --git a/src/main/java/techreborn/blocks/BlockRubberLeaves.java b/src/main/java/techreborn/blocks/BlockRubberLeaves.java index 08db1cbf3..667f1a19c 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLeaves.java +++ b/src/main/java/techreborn/blocks/BlockRubberLeaves.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.IOpaqueBlock; import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.BlockLeaves; @@ -20,29 +23,31 @@ import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModBlocks; -import java.util.List; -import java.util.Random; - /** * Created by modmuss50 on 20/02/2016. */ -public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IOpaqueBlock { +public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IOpaqueBlock +{ - public BlockRubberLeaves() { + public BlockRubberLeaves() + { super(); setUnlocalizedName("techreborn.rubberleaves"); setCreativeTab(TechRebornCreativeTabMisc.instance); RebornCore.jsonDestroyer.registerObject(this); - this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, Boolean.valueOf(true)).withProperty(DECAYABLE, Boolean.valueOf(true))); + this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, Boolean.valueOf(true)) + .withProperty(DECAYABLE, Boolean.valueOf(true))); } @Override - public BlockPlanks.EnumType getWoodType(int meta) { + public BlockPlanks.EnumType getWoodType(int meta) + { return null; } @Override - public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) + { List list = new java.util.ArrayList(); list.add(new ItemStack(this, 1, 0)); return list; @@ -65,46 +70,49 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO return false; } - - @Override protected ItemStack createStackedBlock(IBlockState state) { - IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false)); + IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, + Boolean.valueOf(false)); return super.createStackedBlock(newState); } @Override - public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) { + public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) + { return "techreborn:blocks/rubber_leaves"; } @Override - public int amountOfStates() { + public int amountOfStates() + { return 4; } @Override protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE}); + return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE }); } @Override public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 1) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & 2) > 0)); + return this.getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 1) == 0)) + .withProperty(CHECK_DECAY, Boolean.valueOf((meta & 2) > 0)); } + @Override public int getMetaFromState(IBlockState state) { int meta = 0; - if (!((Boolean)state.getValue(DECAYABLE)).booleanValue()) + if (!((Boolean) state.getValue(DECAYABLE)).booleanValue()) { meta |= 1; } - if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue()) + if (((Boolean) state.getValue(CHECK_DECAY)).booleanValue()) { meta |= 2; } @@ -130,7 +138,8 @@ public class BlockRubberLeaves extends BlockLeaves implements ITexturedBlock, IO } @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { return Item.getItemFromBlock(ModBlocks.rubberSapling); } } diff --git a/src/main/java/techreborn/blocks/BlockRubberLog.java b/src/main/java/techreborn/blocks/BlockRubberLog.java index f120b12d0..02ecae67c 100644 --- a/src/main/java/techreborn/blocks/BlockRubberLog.java +++ b/src/main/java/techreborn/blocks/BlockRubberLog.java @@ -1,5 +1,9 @@ package techreborn.blocks; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -20,37 +24,39 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.items.ItemParts; import techreborn.items.tools.ItemTreeTap; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - /** * Created by modmuss50 on 19/02/2016. */ -public class BlockRubberLog extends Block implements ITexturedBlock { +public class BlockRubberLog extends Block implements ITexturedBlock +{ public static PropertyDirection SAP_SIDE = PropertyDirection.create("sapside", EnumFacing.Plane.HORIZONTAL); public static PropertyBool HAS_SAP = PropertyBool.create("hassap"); - public BlockRubberLog() { + public BlockRubberLog() + { super(Material.wood); setUnlocalizedName("techreborn.rubberlog"); setCreativeTab(TechRebornCreativeTabMisc.instance); this.setHardness(2.0F); RebornCore.jsonDestroyer.registerObject(this); - this.setDefaultState(this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false)); + this.setDefaultState( + this.getDefaultState().withProperty(SAP_SIDE, EnumFacing.NORTH).withProperty(HAS_SAP, false)); this.setTickRandomly(true); } - protected BlockStateContainer createBlockState() { + protected BlockStateContainer createBlockState() + { return new BlockStateContainer(this, SAP_SIDE, HAS_SAP); } @Override - public IBlockState getStateFromMeta(int meta) { + public IBlockState getStateFromMeta(int meta) + { boolean hasSap = false; int tempMeta = meta; - if(meta > 3){ + if (meta > 3) + { hasSap = true; tempMeta -= 3; } @@ -59,10 +65,12 @@ public class BlockRubberLog extends Block implements ITexturedBlock { } @Override - public int getMetaFromState(IBlockState state) { + public int getMetaFromState(IBlockState state) + { int tempMeta = 0; EnumFacing facing = state.getValue(SAP_SIDE); - switch (facing){ + switch (facing) + { case SOUTH: tempMeta = 0; break; @@ -75,19 +83,24 @@ public class BlockRubberLog extends Block implements ITexturedBlock { case EAST: tempMeta = 3; } - if(state.getValue(HAS_SAP)){ + if (state.getValue(HAS_SAP)) + { tempMeta += 3; } return tempMeta; } @Override - public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) { - if(enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.UP){ - return "techreborn:blocks/rubber_log_top"; + public String getTextureNameFromState(IBlockState IBlockState, EnumFacing enumFacing) + { + if (enumFacing == EnumFacing.DOWN || enumFacing == EnumFacing.UP) + { + return "techreborn:blocks/rubber_log_top"; } - if(IBlockState.getValue(HAS_SAP)){ - if(IBlockState.getValue(SAP_SIDE) == enumFacing){ + if (IBlockState.getValue(HAS_SAP)) + { + if (IBlockState.getValue(SAP_SIDE) == enumFacing) + { return "techreborn:blocks/rubber_log_sap"; } } @@ -95,40 +108,52 @@ public class BlockRubberLog extends Block implements ITexturedBlock { } @Override - public int amountOfStates() { + public int amountOfStates() + { return 8; } @Override - public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) { + public boolean canSustainLeaves(IBlockState state, IBlockAccess world, BlockPos pos) + { return true; } @Override - public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos) { + public boolean isWood(net.minecraft.world.IBlockAccess world, BlockPos pos) + { return true; } - public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { int i = 4; int j = i + 1; - if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j))) { - for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i))) { + if (worldIn.isAreaLoaded(pos.add(-j, -j, -j), pos.add(j, j, j))) + { + for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-i, -i, -i), pos.add(i, i, i))) + { IBlockState state1 = worldIn.getBlockState(blockpos); - if (state1.getBlock().isLeaves(state1, worldIn, blockpos)) { - state1.getBlock().beginLeavesDecay(state1,worldIn, blockpos); + if (state1.getBlock().isLeaves(state1, worldIn, blockpos)) + { + state1.getBlock().beginLeavesDecay(state1, worldIn, blockpos); } } } } @Override - public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { super.updateTick(worldIn, pos, state, rand); - if(!state.getValue(HAS_SAP)){ - if(rand.nextInt(50) == 0){ + if (!state.getValue(HAS_SAP)) + { + if (rand.nextInt(50) == 0) + { EnumFacing facing = EnumFacing.getHorizontal(rand.nextInt(4)); - if(worldIn.getBlockState(pos.down()).getBlock() == this && worldIn.getBlockState(pos.up()).getBlock() == this){ + if (worldIn.getBlockState(pos.down()).getBlock() == this + && worldIn.getBlockState(pos.up()).getBlock() == this) + { worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing)); } } @@ -136,18 +161,27 @@ public class BlockRubberLog extends Block implements ITexturedBlock { } @Override - public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, + EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ); - if(playerIn.getHeldItem(EnumHand.MAIN_HAND) != null && playerIn.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemTreeTap) - if(state.getValue(HAS_SAP)){ - if(state.getValue(SAP_SIDE) == side){ - worldIn.setBlockState(pos, state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0))); - //TODO 1.9 sounds - //worldIn.playSoundAtEntity(playerIn, "techreborn:sap_extract", 0.8F, 1F); - if(!worldIn.isRemote){ + if (playerIn.getHeldItem(EnumHand.MAIN_HAND) != null + && playerIn.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof ItemTreeTap) + if (state.getValue(HAS_SAP)) + { + if (state.getValue(SAP_SIDE) == side) + { + worldIn.setBlockState(pos, + state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0))); + // TODO 1.9 sounds + // worldIn.playSoundAtEntity(playerIn, + // "techreborn:sap_extract", 0.8F, 1F); + if (!worldIn.isRemote) + { Random rand = new Random(); BlockPos itemPos = pos.offset(side); - EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy()); + EntityItem item = new EntityItem(worldIn, itemPos.getX(), itemPos.getY(), itemPos.getZ(), + ItemParts.getPartByName("rubberSap").copy()); float factor = 0.05F; playerIn.getHeldItem(EnumHand.MAIN_HAND).damageItem(1, playerIn); item.motionX = rand.nextGaussian() * factor; @@ -162,16 +196,20 @@ public class BlockRubberLog extends Block implements ITexturedBlock { } @Override - public int damageDropped(IBlockState state) { + public int damageDropped(IBlockState state) + { return 0; } @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { List drops = new ArrayList(); drops.add(new ItemStack(this)); - if(state.getValue(HAS_SAP)){ - if(new Random().nextInt(4) == 0){ + if (state.getValue(HAS_SAP)) + { + if (new Random().nextInt(4) == 0) + { drops.add(ItemParts.getPartByName("rubberSap")); } } diff --git a/src/main/java/techreborn/blocks/BlockRubberPlank.java b/src/main/java/techreborn/blocks/BlockRubberPlank.java index 805156c9b..f9795d575 100644 --- a/src/main/java/techreborn/blocks/BlockRubberPlank.java +++ b/src/main/java/techreborn/blocks/BlockRubberPlank.java @@ -11,23 +11,27 @@ import techreborn.client.TechRebornCreativeTabMisc; /** * Created by modmuss50 on 20/02/2016. */ -public class BlockRubberPlank extends Block implements ITexturedBlock { +public class BlockRubberPlank extends Block implements ITexturedBlock +{ - public BlockRubberPlank() { - super(Material.wood); - RebornCore.jsonDestroyer.registerObject(this); - setUnlocalizedName("techreborn.rubberplank"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - this.setHardness(2.0F); - } + public BlockRubberPlank() + { + super(Material.wood); + RebornCore.jsonDestroyer.registerObject(this); + setUnlocalizedName("techreborn.rubberplank"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + this.setHardness(2.0F); + } - @Override - public String getTextureNameFromState(IBlockState state, EnumFacing side) { - return "techreborn:blocks/rubber_planks"; - } + @Override + public String getTextureNameFromState(IBlockState state, EnumFacing side) + { + return "techreborn:blocks/rubber_planks"; + } - @Override - public int amountOfStates() { - return 1; - } + @Override + public int amountOfStates() + { + return 1; + } } diff --git a/src/main/java/techreborn/blocks/BlockRubberSapling.java b/src/main/java/techreborn/blocks/BlockRubberSapling.java index ef177dfc7..63e408a53 100644 --- a/src/main/java/techreborn/blocks/BlockRubberSapling.java +++ b/src/main/java/techreborn/blocks/BlockRubberSapling.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.util.List; +import java.util.Random; + import net.minecraft.block.BlockSapling; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -10,33 +13,37 @@ import net.minecraft.world.World; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.world.RubberTreeGenerator; -import java.util.List; -import java.util.Random; - /** * Created by modmuss50 on 20/02/2016. */ -public class BlockRubberSapling extends BlockSapling { +public class BlockRubberSapling extends BlockSapling +{ - public BlockRubberSapling() { - setUnlocalizedName("techreborn.rubbersapling"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0))); - } + public BlockRubberSapling() + { + setUnlocalizedName("techreborn.rubbersapling"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + this.setDefaultState(this.getDefaultState().withProperty(STAGE, Integer.valueOf(0))); + } - @Override - public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) { - if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos)) { - return; - } - worldIn.setBlockToAir(pos); - if(!new RubberTreeGenerator(false).generate(worldIn, rand, pos)){ - worldIn.setBlockState(pos, state); //Re-add the sapling if the tree failed to grow - } - } + @Override + public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (!net.minecraftforge.event.terraingen.TerrainGen.saplingGrowTree(worldIn, rand, pos)) + { + return; + } + worldIn.setBlockToAir(pos); + if (!new RubberTreeGenerator(false).generate(worldIn, rand, pos)) + { + worldIn.setBlockState(pos, state); // Re-add the sapling if the tree + // failed to grow + } + } - @Override - public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { - list.add(new ItemStack(itemIn, 1, 0)); - } + @Override + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) + { + list.add(new ItemStack(itemIn, 1, 0)); + } } diff --git a/src/main/java/techreborn/blocks/BlockStorage.java b/src/main/java/techreborn/blocks/BlockStorage.java index e2fc81654..8a512f619 100644 --- a/src/main/java/techreborn/blocks/BlockStorage.java +++ b/src/main/java/techreborn/blocks/BlockStorage.java @@ -1,5 +1,8 @@ package techreborn.blocks; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -15,81 +18,91 @@ import reborncore.common.BaseBlock; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModBlocks; -import java.util.List; -import java.util.Random; +public class BlockStorage extends BaseBlock implements ITexturedBlock +{ -public class BlockStorage extends BaseBlock implements ITexturedBlock { + public static ItemStack getStorageBlockByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equals(name)) + { + return new ItemStack(ModBlocks.storage, count, i); + } + } + return BlockStorage2.getStorageBlockByName(name, count); + } - public static ItemStack getStorageBlockByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equals(name)) { - return new ItemStack(ModBlocks.storage, count, i); - } - } - return BlockStorage2.getStorageBlockByName(name, count); - } + public static ItemStack getStorageBlockByName(String name) + { + return getStorageBlockByName(name, 1); + } - public static ItemStack getStorageBlockByName(String name) { - return getStorageBlockByName(name, 1); - } + public static final String[] types = new String[] { "silver", "aluminum", "titanium", "chrome", "steel", "brass", + "lead", "electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium", "iridium" }; - public static final String[] types = new String[] - {"silver", "aluminum", "titanium", "chrome", "steel", "brass", "lead", - "electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium", - "iridium"}; + public PropertyInteger METADATA; - public PropertyInteger METADATA; + public BlockStorage(Material material) + { + super(material); + setUnlocalizedName("techreborn.storage"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHardness(2f); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); + } + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this); + } - public BlockStorage(Material material) { - super(material); - setUnlocalizedName("techreborn.storage"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHardness(2f); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); - } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return Item.getItemFromBlock(this); - } + @Override + public int damageDropped(IBlockState state) + { + return getMetaFromState(state); + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block"; + } - @Override - public int damageDropped(IBlockState state) { - return getMetaFromState(state); - } - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block"; - } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public int amountOfStates() { - return types.length; - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(METADATA); + } - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(METADATA); - } + protected BlockStateContainer createBlockState() + { - protected BlockStateContainer createBlockState() { - - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA); - } + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA); + } } diff --git a/src/main/java/techreborn/blocks/BlockStorage2.java b/src/main/java/techreborn/blocks/BlockStorage2.java index 5532902bd..afbe1a1b1 100644 --- a/src/main/java/techreborn/blocks/BlockStorage2.java +++ b/src/main/java/techreborn/blocks/BlockStorage2.java @@ -1,5 +1,9 @@ package techreborn.blocks; +import java.security.InvalidParameterException; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedBlock; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyInteger; @@ -15,79 +19,87 @@ import reborncore.common.BaseBlock; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModBlocks; -import java.security.InvalidParameterException; -import java.util.List; -import java.util.Random; +public class BlockStorage2 extends BaseBlock implements ITexturedBlock +{ -public class BlockStorage2 extends BaseBlock implements ITexturedBlock { + public static ItemStack getStorageBlockByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equals(name)) + { + return new ItemStack(ModBlocks.storage2, count, i); + } + } + throw new InvalidParameterException("The storage block " + name + " could not be found."); + } - public static ItemStack getStorageBlockByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equals(name)) { - return new ItemStack(ModBlocks.storage2, count, i); - } - } - throw new InvalidParameterException("The storage block " + name + " could not be found."); - } + public static final String[] types = new String[] { "tungstensteel", "lodestone", "tellurium", + "iridium_reinforced_tungstensteel", "iridium_reinforced_stone", "ruby", "sapphire", "peridot", + "yellowGarnet", "redGarnet", "copper", "tin" }; - public static final String[] types = new String[] - {"tungstensteel", "lodestone", "tellurium", "iridium_reinforced_tungstensteel", - "iridium_reinforced_stone", "ruby", "sapphire", "peridot", "yellowGarnet", "redGarnet", "copper", "tin"}; + public BlockStorage2(Material material) + { + super(material); + setUnlocalizedName("techreborn.storage2"); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHardness(2f); + this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); + } - public BlockStorage2(Material material) { - super(material); - setUnlocalizedName("techreborn.storage2"); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHardness(2f); - this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0)); - } + public PropertyInteger METADATA; - public PropertyInteger METADATA; + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) + { + return Item.getItemFromBlock(this); + } + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; meta++) + { + list.add(new ItemStack(item, 1, meta)); + } + } + @Override + public int damageDropped(IBlockState state) + { + return getMetaFromState(state); + } - @Override - public Item getItemDropped(IBlockState state, Random rand, int fortune) { - return Item.getItemFromBlock(this); - } + @Override + public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) + { + return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block"; + } - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; meta++) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public int amountOfStates() + { + return types.length; + } - @Override - public int damageDropped(IBlockState state) { - return getMetaFromState(state); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return this.getDefaultState().withProperty(METADATA, meta); + } - @Override - public String getTextureNameFromState(IBlockState BlockStateContainer, EnumFacing facing) { - return "techreborn:blocks/storage/" + types[getMetaFromState(BlockStateContainer)] + "_block"; - } + @Override + public int getMetaFromState(IBlockState state) + { + return (Integer) state.getValue(METADATA); + } - @Override - public int amountOfStates() { - return types.length; - } + protected BlockStateContainer createBlockState() + { - @Override - public IBlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(METADATA, meta); - } - - @Override - public int getMetaFromState(IBlockState state) { - return (Integer) state.getValue(METADATA); - } - - protected BlockStateContainer createBlockState() { - - METADATA = PropertyInteger.create("type", 0, types.length -1); - return new BlockStateContainer(this, METADATA); - } + METADATA = PropertyInteger.create("type", 0, types.length - 1); + return new BlockStateContainer(this, METADATA); + } } diff --git a/src/main/java/techreborn/blocks/BlockSupercondensator.java b/src/main/java/techreborn/blocks/BlockSupercondensator.java index 2869fdbb8..33362111f 100644 --- a/src/main/java/techreborn/blocks/BlockSupercondensator.java +++ b/src/main/java/techreborn/blocks/BlockSupercondensator.java @@ -5,35 +5,40 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockSupercondensator(Material material) + { + super(); + setUnlocalizedName("techreborn.supercondensator"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockSupercondensator(Material material) { - super(); - setUnlocalizedName("techreborn.supercondensator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "supercondensator_front"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "supercondensator_front"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "supercondensator_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "supercondensator_side" ; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "supercondensator_side"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "supercondensator_side"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockBlastFurnace.java b/src/main/java/techreborn/blocks/advanced_machine/BlockBlastFurnace.java index 98c175447..8d4ca2a96 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockBlastFurnace.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockBlastFurnace.java @@ -11,55 +11,66 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileBlastFurnace; -public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture { +public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture +{ - public BlockBlastFurnace(Material material) { - super(); - setUnlocalizedName("techreborn.blastfurnace"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockBlastFurnace(Material material) + { + super(); + setUnlocalizedName("techreborn.blastfurnace"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileBlastFurnace(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileBlastFurnace(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.blastFurnaceID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.blastFurnaceID, world, x, y, z); + return true; + } - @Override - public boolean isAdvanced() { - return true; - } + @Override + public boolean isAdvanced() + { + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "industrial_blast_furnace_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "industrial_blast_furnace_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "industrial_blast_furnace_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "industrial_blast_furnace_front_on"; + } - @Override - public String getSide() { - return prefix + "advanced_machine_side"; - } + @Override + public String getSide() + { + return prefix + "advanced_machine_side"; + } - @Override - public String getTop() { - return prefix + "advanced_machine_top"; - } + @Override + public String getTop() + { + return prefix + "advanced_machine_top"; + } - @Override - public String getBottom() { - return prefix + "advanced_machine_bottom"; - } + @Override + public String getBottom() + { + return prefix + "advanced_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockCentrifuge.java b/src/main/java/techreborn/blocks/advanced_machine/BlockCentrifuge.java index 8ffd3a3b4..e4c006a10 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockCentrifuge.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockCentrifuge.java @@ -10,51 +10,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileCentrifuge; -public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture { +public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture +{ - public BlockCentrifuge() { - super(); - setUnlocalizedName("techreborn.centrifuge"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockCentrifuge() + { + super(); + setUnlocalizedName("techreborn.centrifuge"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileCentrifuge(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileCentrifuge(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) { - player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z); - } - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.centrifugeID, world, x, y, z); + } + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "industrial_centrifuge_side_off"; - } + @Override + public String getFrontOff() + { + return prefix + "industrial_centrifuge_side_off"; + } - @Override - public String getFrontOn() { - return prefix + "industrial_centrifuge_side_on"; - } + @Override + public String getFrontOn() + { + return prefix + "industrial_centrifuge_side_on"; + } - @Override - public String getSide() { - return getFrontOff(); - } + @Override + public String getSide() + { + return getFrontOff(); + } - @Override - public String getTop() { - return prefix + "industrial_centrifuge_top_off"; - } + @Override + public String getTop() + { + return prefix + "industrial_centrifuge_top_off"; + } - @Override - public String getBottom() { - return prefix + "industrial_centrifuge_bottom"; - } + @Override + public String getBottom() + { + return prefix + "industrial_centrifuge_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockDistillationTower.java b/src/main/java/techreborn/blocks/advanced_machine/BlockDistillationTower.java index 1adc3b48d..a352560bf 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockDistillationTower.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockDistillationTower.java @@ -5,38 +5,45 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture { +public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture +{ - public BlockDistillationTower(Material material) { - super(); - setUnlocalizedName("techreborn.distillationtower"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockDistillationTower(Material material) + { + super(); + setUnlocalizedName("techreborn.distillationtower"); + setCreativeTab(TechRebornCreativeTab.instance); + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "distillation_tower_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "distillation_tower_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "distillation_tower_front_off"; - } + @Override + public String getFrontOn() + { + return prefix + "distillation_tower_front_off"; + } - @Override - public String getSide() { - return prefix + "advanced_machine_side"; - } + @Override + public String getSide() + { + return prefix + "advanced_machine_side"; + } - @Override - public String getTop() { - return prefix + "industrial_centrifuge_top_off"; - } + @Override + public String getTop() + { + return prefix + "industrial_centrifuge_top_off"; + } - @Override - public String getBottom() { - return prefix + "industrial_centrifuge_bottom"; - } + @Override + public String getBottom() + { + return prefix + "industrial_centrifuge_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockImplosionCompressor.java b/src/main/java/techreborn/blocks/advanced_machine/BlockImplosionCompressor.java index a40ac2cdf..c038e0ea1 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockImplosionCompressor.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockImplosionCompressor.java @@ -11,50 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileImplosionCompressor; -public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture { +public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture +{ - public BlockImplosionCompressor(Material material) { - super(); - setUnlocalizedName("techreborn.implosioncompressor"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockImplosionCompressor(Material material) + { + super(); + setUnlocalizedName("techreborn.implosioncompressor"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileImplosionCompressor(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileImplosionCompressor(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "implosion_compressor_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "implosion_compressor_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "implosion_compressor_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "implosion_compressor_front_on"; + } - @Override - public String getSide() { - return prefix + "advanced_machine_side"; - } + @Override + public String getSide() + { + return prefix + "advanced_machine_side"; + } - @Override - public String getTop() { - return prefix + "industrial_centrifuge_top_off"; - } + @Override + public String getTop() + { + return prefix + "industrial_centrifuge_top_off"; + } - @Override - public String getBottom() { - return prefix + "implosion_compressor_bottom"; - } + @Override + public String getBottom() + { + return prefix + "implosion_compressor_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialElectrolyzer.java b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialElectrolyzer.java index aca563760..f276bea23 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialElectrolyzer.java @@ -11,50 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileIndustrialElectrolyzer; -public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture { +public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture +{ - public BlockIndustrialElectrolyzer(Material material) { - super(); - setUnlocalizedName("techreborn.industrialelectrolyzer"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockIndustrialElectrolyzer(Material material) + { + super(); + setUnlocalizedName("techreborn.industrialelectrolyzer"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileIndustrialElectrolyzer(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileIndustrialElectrolyzer(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.industrialElectrolyzerID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.industrialElectrolyzerID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "industrial_electrolyzer_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "industrial_electrolyzer_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "industrial_electrolyzer_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "industrial_electrolyzer_front_on"; + } - @Override - public String getSide() { - return prefix + "industrial_electrolyzer_front_off"; - } + @Override + public String getSide() + { + return prefix + "industrial_electrolyzer_front_off"; + } - @Override - public String getTop() { - return prefix + "machine_top"; - } + @Override + public String getTop() + { + return prefix + "machine_top"; + } - @Override - public String getBottom() { - return prefix + "machine_bottom"; - } + @Override + public String getBottom() + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialGrinder.java b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialGrinder.java index 3559fb142..06ba303d2 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialGrinder.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialGrinder.java @@ -12,53 +12,64 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileIndustrialGrinder; -public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture { +public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture +{ - public BlockIndustrialGrinder(Material material) { - super(); - setUnlocalizedName("techreborn.industrialgrinder"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockIndustrialGrinder(Material material) + { + super(); + setUnlocalizedName("techreborn.industrialgrinder"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileIndustrialGrinder(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileIndustrialGrinder(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.industrialGrinderID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.industrialGrinderID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "industrial_grinder_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "industrial_grinder_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "industrial_grinder_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "industrial_grinder_front_on"; + } - @Override - public String getSide() { - return prefix + "machine_side"; - } + @Override + public String getSide() + { + return prefix + "machine_side"; + } - @Override - public String getTop() { - return prefix + "industrial_grinder_top_off"; - } + @Override + public String getTop() + { + return prefix + "industrial_grinder_top_off"; + } - @Override - public String getBottom() { - return prefix + "industrial_centrifuge_bottom"; - } + @Override + public String getBottom() + { + return prefix + "industrial_centrifuge_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialSawmill.java b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialSawmill.java index c55606036..fd9094179 100644 --- a/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialSawmill.java +++ b/src/main/java/techreborn/blocks/advanced_machine/BlockIndustrialSawmill.java @@ -12,53 +12,64 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileIndustrialSawmill; -public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture { +public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture +{ - public BlockIndustrialSawmill(Material material) { - super(); - setUnlocalizedName("techreborn.industrialsawmill"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockIndustrialSawmill(Material material) + { + super(); + setUnlocalizedName("techreborn.industrialsawmill"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileIndustrialSawmill(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileIndustrialSawmill(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/advanced_machines/"; + private final String prefix = "techreborn:blocks/machine/advanced_machines/"; - @Override - public String getFrontOff() { - return prefix + "industrial_sawmill_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "industrial_sawmill_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "industrial_sawmill_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "industrial_sawmill_front_on"; + } - @Override - public String getSide() { - return prefix + "advanced_machine_side"; - } + @Override + public String getSide() + { + return prefix + "advanced_machine_side"; + } - @Override - public String getTop() { - return prefix + "advanced_machine_side"; - } + @Override + public String getTop() + { + return prefix + "advanced_machine_side"; + } - @Override - public String getBottom() { - return prefix + "advanced_machine_side"; - } + @Override + public String getBottom() + { + return prefix + "advanced_machine_side"; + } } diff --git a/src/main/java/techreborn/blocks/fluid/BlockFluidBase.java b/src/main/java/techreborn/blocks/fluid/BlockFluidBase.java index 78cf23fa3..8ccc0b917 100644 --- a/src/main/java/techreborn/blocks/fluid/BlockFluidBase.java +++ b/src/main/java/techreborn/blocks/fluid/BlockFluidBase.java @@ -8,26 +8,29 @@ import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; import reborncore.RebornCore; -public class BlockFluidBase extends BlockFluidClassic { +public class BlockFluidBase extends BlockFluidClassic +{ - public BlockFluidBase(Fluid fluid, Material material) { - super(fluid, material); - RebornCore.jsonDestroyer.registerObject(this); - } + public BlockFluidBase(Fluid fluid, Material material) + { + super(fluid, material); + RebornCore.jsonDestroyer.registerObject(this); + } + @Override + public boolean canDisplace(IBlockAccess world, BlockPos pos) + { + if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) + return false; + return super.canDisplace(world, pos); + } - @Override - public boolean canDisplace(IBlockAccess world, BlockPos pos) { - if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) - return false; - return super.canDisplace(world, pos); - } - - @Override - public boolean displaceIfPossible(World world, BlockPos pos) { - if(world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) - return false; - return super.displaceIfPossible(world, pos); - } + @Override + public boolean displaceIfPossible(World world, BlockPos pos) + { + if (world.getBlockState(pos).getBlock().getMaterial(world.getBlockState(pos)).isLiquid()) + return false; + return super.displaceIfPossible(world, pos); + } } diff --git a/src/main/java/techreborn/blocks/fluid/BlockFluidTechReborn.java b/src/main/java/techreborn/blocks/fluid/BlockFluidTechReborn.java index 8b11f6682..587afabb0 100644 --- a/src/main/java/techreborn/blocks/fluid/BlockFluidTechReborn.java +++ b/src/main/java/techreborn/blocks/fluid/BlockFluidTechReborn.java @@ -4,18 +4,21 @@ import me.modmuss50.jsonDestroyer.api.ITexturedFluid; import net.minecraft.block.material.Material; import net.minecraftforge.fluids.Fluid; -public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFluid { +public class BlockFluidTechReborn extends BlockFluidBase implements ITexturedFluid +{ - String name; + String name; - public BlockFluidTechReborn(Fluid fluid, Material material, String name) { - super(fluid, material); - setUnlocalizedName(name); - this.name = name; - } + public BlockFluidTechReborn(Fluid fluid, Material material, String name) + { + super(fluid, material); + setUnlocalizedName(name); + this.name = name; + } - @Override - public String getTextureName() { - return "techreborn:blocks/fluids/" + name.replaceAll("techreborn.", "") + "_flowing"; - } + @Override + public String getTextureName() + { + return "techreborn:blocks/fluids/" + name.replaceAll("techreborn.", "") + "_flowing"; + } } diff --git a/src/main/java/techreborn/blocks/fluid/TechRebornFluid.java b/src/main/java/techreborn/blocks/fluid/TechRebornFluid.java index 5d2b0ab86..ad33fd095 100644 --- a/src/main/java/techreborn/blocks/fluid/TechRebornFluid.java +++ b/src/main/java/techreborn/blocks/fluid/TechRebornFluid.java @@ -3,8 +3,12 @@ package techreborn.blocks.fluid; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.Fluid; -public class TechRebornFluid extends Fluid { - public TechRebornFluid(String fluidName) { - super(fluidName, new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"), new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing")); - } +public class TechRebornFluid extends Fluid +{ + public TechRebornFluid(String fluidName) + { + super(fluidName, + new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing"), + new ResourceLocation("techreborn:blocks/fluids/" + fluidName.replaceFirst("fluid", "") + "_flowing")); + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java b/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java index 6633d3a4b..794ce9d20 100644 --- a/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockDieselGenerator.java @@ -12,54 +12,59 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileDieselGenerator; -public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockDieselGenerator(Material material) + { + super(); + setUnlocalizedName("techreborn.dieselgenerator"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockDieselGenerator(Material material) { - super(); - setUnlocalizedName("techreborn.dieselgenerator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileDieselGenerator(); + } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y, z); + return true; + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileDieselGenerator(); - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y, - z); - return true; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "generator_machine_side"; + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getSide(boolean isActive) + { + return prefix + "generator_machine_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "generator_machine_side"; - } - - @Override - public String getSide(boolean isActive) { - return prefix + "generator_machine_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "diesel_generator_top_off"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "generator_machine_bottom"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "diesel_generator_top_off"; + } + @Override + public String getBottom(boolean isActive) + { + return prefix + "generator_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockDragonEggSiphoner.java b/src/main/java/techreborn/blocks/generator/BlockDragonEggSiphoner.java index 6c7d94f36..072bd7827 100644 --- a/src/main/java/techreborn/blocks/generator/BlockDragonEggSiphoner.java +++ b/src/main/java/techreborn/blocks/generator/BlockDragonEggSiphoner.java @@ -8,42 +8,46 @@ import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileDragonEggSiphoner; -public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockDragonEggSiphoner(Material material) + { + super(); + setUnlocalizedName("techreborn.dragoneggsiphoner"); + setCreativeTab(TechRebornCreativeTab.instance); + } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileDragonEggSiphoner(); + } - public BlockDragonEggSiphoner(Material material) { - super(); - setUnlocalizedName("techreborn.dragoneggsiphoner"); - setCreativeTab(TechRebornCreativeTab.instance); - } + private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "dragon_egg_energy_siphon_side_off"; + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileDragonEggSiphoner(); - } + @Override + public String getSide(boolean isActive) + { + return prefix + "dragon_egg_energy_siphon_side_off"; + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getTop(boolean isActive) + { + return prefix + "dragon_egg_energy_siphon_top"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "dragon_egg_energy_siphon_side_off"; - } - - @Override - public String getSide(boolean isActive) { - return prefix + "dragon_egg_energy_siphon_side_off" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "dragon_egg_energy_siphon_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "generator_machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "generator_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java b/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java index 1a0b94f90..ed4110189 100644 --- a/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java +++ b/src/main/java/techreborn/blocks/generator/BlockGasTurbine.java @@ -12,52 +12,59 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileGasTurbine; -public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockGasTurbine(Material material) + { + super(); + setUnlocalizedName("techreborn.gasTurbine"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockGasTurbine(Material material) { - super(); - setUnlocalizedName("techreborn.gasTurbine"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileGasTurbine(); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileGasTurbine(); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y, z); + return true; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y, - z); - return true; - } + private final String prefix = "techreborn:blocks/machine/generators/"; - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "generator_machine_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "generator_machine_side"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "generator_machine_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "generator_machine_side" ; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "gas_generator_top"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "gas_generator_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "gas_generator_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "gas_generator_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockGenerator.java b/src/main/java/techreborn/blocks/generator/BlockGenerator.java index 3c9b4a670..c2c70d3fb 100644 --- a/src/main/java/techreborn/blocks/generator/BlockGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockGenerator.java @@ -17,58 +17,70 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileGenerator; -public class BlockGenerator extends BlockMachineBase implements IRotationTexture { +public class BlockGenerator extends BlockMachineBase implements IRotationTexture +{ - public BlockGenerator() { + public BlockGenerator() + { super(); setUnlocalizedName("techreborn.generator"); - setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileGenerator(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z); - } - return true; - } - - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - List items = new ArrayList(); - items.add(new ItemStack(this)); - return items; - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileGenerator(); + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.generatorID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "generator_front_off"; - } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + List items = new ArrayList(); + items.add(new ItemStack(this)); + return items; + } - @Override - public String getFrontOn() { - return prefix + "generator_front_on"; - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public String getSide() { - return prefix + "generator_machine_side" ; - } + @Override + public String getFrontOff() + { + return prefix + "generator_front_off"; + } - @Override - public String getTop() { - return prefix + "generator_machine_top"; - } + @Override + public String getFrontOn() + { + return prefix + "generator_front_on"; + } - @Override - public String getBottom() { - return prefix + "generator_machine_bottom"; - } + @Override + public String getSide() + { + return prefix + "generator_machine_side"; + } + + @Override + public String getTop() + { + return prefix + "generator_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "generator_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockHeatGenerator.java b/src/main/java/techreborn/blocks/generator/BlockHeatGenerator.java index f20367b6d..44605b7a5 100644 --- a/src/main/java/techreborn/blocks/generator/BlockHeatGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockHeatGenerator.java @@ -8,42 +8,46 @@ import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileHeatGenerator; -public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockHeatGenerator(Material material) + { + super(); + setUnlocalizedName("techreborn.heatgenerator"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockHeatGenerator(Material material) { - super(); - setUnlocalizedName("techreborn.heatgenerator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileHeatGenerator(); + } + private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "heat_generator_side"; + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileHeatGenerator(); - } + @Override + public String getSide(boolean isActive) + { + return prefix + "heat_generator_side"; + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getTop(boolean isActive) + { + return prefix + "heat_generator_top"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "heat_generator_side"; - } - - @Override - public String getSide(boolean isActive) { - return prefix + "heat_generator_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "heat_generator_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "heat_generator_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "heat_generator_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockLightningRod.java b/src/main/java/techreborn/blocks/generator/BlockLightningRod.java index 99568bda0..18405897b 100644 --- a/src/main/java/techreborn/blocks/generator/BlockLightningRod.java +++ b/src/main/java/techreborn/blocks/generator/BlockLightningRod.java @@ -5,33 +5,39 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockLightningRod(Material material) { - super(); - setUnlocalizedName("techreborn.lightningrod"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockLightningRod(Material material) + { + super(); + setUnlocalizedName("techreborn.lightningrod"); + setCreativeTab(TechRebornCreativeTab.instance); + } - private final String prefix = "techreborn:blocks/machine/generators/"; + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public String getFront(boolean isActive) { - return prefix + "plasma_generator_side_off"; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "plasma_generator_side_off" ; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "plasma_generator_side_off"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "plasma_generator_side_off"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java index c875db2c1..759743c51 100644 --- a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java +++ b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyAbsorber.java @@ -5,35 +5,40 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockMagicEnergyAbsorber(Material material) { - super(); - setUnlocalizedName("techreborn.magicenergyabsorber"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMagicEnergyAbsorber(Material material) + { + super(); + setUnlocalizedName("techreborn.magicenergyabsorber"); + setCreativeTab(TechRebornCreativeTab.instance); + } + private final String prefix = "techreborn:blocks/machine/generators/"; - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "magic_energy_absorber_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "magic_energy_absorber_side"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "magic_energy_absorber_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "magic_energy_absorber_side" ; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "magic_energy_absorber_top"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "magic_energy_absorber_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "magic_energy_absorber_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "magic_energy_absorber_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyConverter.java b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyConverter.java index 31417b778..3bd93fc86 100644 --- a/src/main/java/techreborn/blocks/generator/BlockMagicEnergyConverter.java +++ b/src/main/java/techreborn/blocks/generator/BlockMagicEnergyConverter.java @@ -5,36 +5,40 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockMagicEnergyConverter(Material material) { - super(); - setUnlocalizedName("techreborn.magicenergyconverter"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMagicEnergyConverter(Material material) + { + super(); + setUnlocalizedName("techreborn.magicenergyconverter"); + setCreativeTab(TechRebornCreativeTab.instance); + } + private final String prefix = "techreborn:blocks/machine/generators/"; - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "magic_energy_converter_front_off"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "magic_energy_converter_front_off"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "magic_energy_converter_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "magic_energy_converter_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "magic_energy_converter_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "magic_energy_converter_bottom"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "magic_energy_converter_top"; + } + @Override + public String getBottom(boolean isActive) + { + return prefix + "magic_energy_converter_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java b/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java index a1046678b..97e66e102 100644 --- a/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockPlasmaGenerator.java @@ -5,33 +5,39 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; -public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockPlasmaGenerator(Material material) { - super(); - setUnlocalizedName("techreborn.plasmagenerator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockPlasmaGenerator(Material material) + { + super(); + setUnlocalizedName("techreborn.plasmagenerator"); + setCreativeTab(TechRebornCreativeTab.instance); + } - private final String prefix = "techreborn:blocks/machine/generators/"; + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public String getFront(boolean isActive) { - return prefix + "plasma_generator_front"; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "plasma_generator_front"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "plasma_generator_side_off" ; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "plasma_generator_side_off"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "plasma_generator_side_off"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "plasma_generator_side_off"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java b/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java index 37556f5e0..07f7d8d40 100644 --- a/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockSemiFluidGenerator.java @@ -12,53 +12,59 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileSemifluidGenerator; -public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockSemiFluidGenerator(Material material) + { + super(); + setUnlocalizedName("techreborn.semifluidgenerator"); + setCreativeTab(TechRebornCreativeTab.instance); + } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileSemifluidGenerator(); + } - public BlockSemiFluidGenerator(Material material) { - super(); - setUnlocalizedName("techreborn.semifluidgenerator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y, z); + return true; + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileSemifluidGenerator(); - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y, - z); - return true; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "semifluid_generator_side"; + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getSide(boolean isActive) + { + return prefix + "semifluid_generator_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "semifluid_generator_side"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "generator_machine_top"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "semifluid_generator_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "generator_machine_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "generator_machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "generator_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java b/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java index 0335fab5f..506952518 100644 --- a/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java +++ b/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java @@ -15,52 +15,62 @@ import techreborn.tiles.generator.TileSolarPanel; /** * Created by modmuss50 on 25/02/2016. */ -public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock { +public class BlockSolarPanel extends BaseTileBlock implements ITexturedBlock +{ - public static PropertyBool ACTIVE = PropertyBool.create("active"); + public static PropertyBool ACTIVE = PropertyBool.create("active"); - public BlockSolarPanel() { - super(Material.iron); - setUnlocalizedName("techreborn.solarpanel"); - setCreativeTab(TechRebornCreativeTab.instance); - this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false)); - } + public BlockSolarPanel() + { + super(Material.iron); + setUnlocalizedName("techreborn.solarpanel"); + setCreativeTab(TechRebornCreativeTab.instance); + this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false)); + } - protected BlockStateContainer createBlockState() { - ACTIVE = PropertyBool.create("active"); - return new BlockStateContainer(this, ACTIVE); - } + protected BlockStateContainer createBlockState() + { + ACTIVE = PropertyBool.create("active"); + return new BlockStateContainer(this, ACTIVE); + } - @Override - public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(ACTIVE, meta == 0 ? false : true); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + return getDefaultState().withProperty(ACTIVE, meta == 0 ? false : true); + } - @Override - public int getMetaFromState(IBlockState state) { - return state.getValue(ACTIVE) == true ? 1 : 0; - } + @Override + public int getMetaFromState(IBlockState state) + { + return state.getValue(ACTIVE) == true ? 1 : 0; + } - @Override - public TileEntity createNewTileEntity(World worldIn, int meta) { - return new TileSolarPanel(); - } + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileSolarPanel(); + } - private final String prefix = "techreborn:blocks/machine/generators/"; + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public String getTextureNameFromState(IBlockState state, EnumFacing side) { - boolean isActive = state.getValue(ACTIVE); - if(side == EnumFacing.UP){ - return prefix + "solar_panel_top_" + (isActive ? "on" : "off"); - } else if(side==EnumFacing.DOWN){ - return prefix + "generator_machine_bottom"; - } - return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); - } + @Override + public String getTextureNameFromState(IBlockState state, EnumFacing side) + { + boolean isActive = state.getValue(ACTIVE); + if (side == EnumFacing.UP) + { + return prefix + "solar_panel_top_" + (isActive ? "on" : "off"); + } else if (side == EnumFacing.DOWN) + { + return prefix + "generator_machine_bottom"; + } + return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); + } - @Override - public int amountOfStates() { - return 2; - } + @Override + public int amountOfStates() + { + return 2; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java b/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java index 90c908665..0522e1401 100644 --- a/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java +++ b/src/main/java/techreborn/blocks/generator/BlockThermalGenerator.java @@ -11,53 +11,58 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileThermalGenerator; -public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockThermalGenerator() + { + super(); + setUnlocalizedName("techreborn.thermalGenerator"); + setCreativeTab(TechRebornCreativeTab.instance); + } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileThermalGenerator(); + } - public BlockThermalGenerator() { - super(); - setUnlocalizedName("techreborn.thermalGenerator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (fillBlockWithFluid(world, new BlockPos(x, y, z), player)) + { + return true; + } + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, z); + return true; + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileThermalGenerator(); - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if(fillBlockWithFluid(world, new BlockPos(x, y, z), player)){ - return true; - } - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y, - z); - return true; - } + @Override + public String getFront(boolean isActive) + { + return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off"; + } - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public String getSide(boolean isActive) + { + return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off"; + } + @Override + public String getTop(boolean isActive) + { + return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off"; + } - @Override - public String getFront(boolean isActive) { - return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off"; - } - - @Override - public String getSide(boolean isActive) { - return isActive ? prefix + "thermal_generator_side_on" : prefix + "thermal_generator_side_off"; - } - - @Override - public String getTop(boolean isActive) { - return isActive ? prefix + "thermal_generator_top_on" : prefix + "thermal_generator_top_off"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "generator_machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "generator_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/generator/BlockWaterMill.java b/src/main/java/techreborn/blocks/generator/BlockWaterMill.java index 5a9c99ad1..df977ad18 100644 --- a/src/main/java/techreborn/blocks/generator/BlockWaterMill.java +++ b/src/main/java/techreborn/blocks/generator/BlockWaterMill.java @@ -14,35 +14,43 @@ import techreborn.tiles.generator.TileWaterMill; /** * Created by modmuss50 on 25/02/2016. */ -public class BlockWaterMill extends BaseTileBlock implements ITexturedBlock{ +public class BlockWaterMill extends BaseTileBlock implements ITexturedBlock +{ - public BlockWaterMill() { - super(Material.iron); - setUnlocalizedName("techreborn.watermill"); - setCreativeTab(TechRebornCreativeTab.instance); - RebornCore.jsonDestroyer.registerObject(this); - } + public BlockWaterMill() + { + super(Material.iron); + setUnlocalizedName("techreborn.watermill"); + setCreativeTab(TechRebornCreativeTab.instance); + RebornCore.jsonDestroyer.registerObject(this); + } - @Override - public TileEntity createNewTileEntity(World worldIn, int meta) { - return new TileWaterMill(); - } - - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileWaterMill(); + } - @Override - public String getTextureNameFromState(IBlockState state, EnumFacing side) { - boolean isActive = false; - if(side == EnumFacing.UP){ - return prefix + "generator_machine_bottom";// + (isActive ? "on" : "off"); - } else if(side==EnumFacing.DOWN){ - return prefix + "generator_machine_bottom"; - } - return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public int amountOfStates() { - return 2; - } + @Override + public String getTextureNameFromState(IBlockState state, EnumFacing side) + { + boolean isActive = false; + if (side == EnumFacing.UP) + { + return prefix + "generator_machine_bottom";// + (isActive ? "on" : + // "off"); + } else if (side == EnumFacing.DOWN) + { + return prefix + "generator_machine_bottom"; + } + return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); + } + + @Override + public int amountOfStates() + { + return 2; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/blocks/generator/BlockWindMill.java b/src/main/java/techreborn/blocks/generator/BlockWindMill.java index 271bd5c46..e9bb17248 100644 --- a/src/main/java/techreborn/blocks/generator/BlockWindMill.java +++ b/src/main/java/techreborn/blocks/generator/BlockWindMill.java @@ -8,42 +8,49 @@ import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import reborncore.RebornCore; import reborncore.common.BaseTileBlock; -import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.generator.TileWindMill; /** * Created by modmuss50 on 25/02/2016. */ -public class BlockWindMill extends BaseTileBlock implements ITexturedBlock { +public class BlockWindMill extends BaseTileBlock implements ITexturedBlock +{ - public BlockWindMill() { - super(Material.iron); - setUnlocalizedName("techreborn.windmill"); - setCreativeTab(TechRebornCreativeTab.instance); - RebornCore.jsonDestroyer.registerObject(this); - } + public BlockWindMill() + { + super(Material.iron); + setUnlocalizedName("techreborn.windmill"); + setCreativeTab(TechRebornCreativeTab.instance); + RebornCore.jsonDestroyer.registerObject(this); + } - @Override - public TileEntity createNewTileEntity(World worldIn, int meta) { - return new TileWindMill(); - } - - private final String prefix = "techreborn:blocks/machine/generators/"; + @Override + public TileEntity createNewTileEntity(World worldIn, int meta) + { + return new TileWindMill(); + } - @Override - public String getTextureNameFromState(IBlockState state, EnumFacing side) { - boolean isActive = false; - if(side == EnumFacing.UP){ - return prefix + "generator_machine_bottom";// + (isActive ? "on" : "off"); - } else if(side==EnumFacing.DOWN){ - return prefix + "generator_machine_bottom"; - } - return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); - } + private final String prefix = "techreborn:blocks/machine/generators/"; - @Override - public int amountOfStates() { - return 2; - } + @Override + public String getTextureNameFromState(IBlockState state, EnumFacing side) + { + boolean isActive = false; + if (side == EnumFacing.UP) + { + return prefix + "generator_machine_bottom";// + (isActive ? "on" : + // "off"); + } else if (side == EnumFacing.DOWN) + { + return prefix + "generator_machine_bottom"; + } + return prefix + "solar_panel_side_" + (isActive ? "on" : "off"); + } + + @Override + public int amountOfStates() + { + return 2; + } } diff --git a/src/main/java/techreborn/blocks/iron_machines/BlockAlloyFurnace.java b/src/main/java/techreborn/blocks/iron_machines/BlockAlloyFurnace.java index 595facfbb..40b1f5981 100644 --- a/src/main/java/techreborn/blocks/iron_machines/BlockAlloyFurnace.java +++ b/src/main/java/techreborn/blocks/iron_machines/BlockAlloyFurnace.java @@ -1,5 +1,8 @@ package techreborn.blocks.iron_machines; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -15,60 +18,68 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileAlloyFurnace; -import java.util.ArrayList; -import java.util.List; +public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture +{ -public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture { + public BlockAlloyFurnace(Material material) + { + super(); + setUnlocalizedName("techreborn.alloyfurnace"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockAlloyFurnace(Material material) { - super(); - setUnlocalizedName("techreborn.alloyfurnace"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileAlloyFurnace(); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileAlloyFurnace(); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z); + return true; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.alloyFurnaceID, world, x, y, z); - return true; - } - - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - List items = new ArrayList(); - items.add(new ItemStack(this)); - return items; - } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + List items = new ArrayList(); + items.add(new ItemStack(this)); + return items; + } - private final String prefix = "techreborn:blocks/machine/iron_machines/"; + private final String prefix = "techreborn:blocks/machine/iron_machines/"; - @Override - public String getFrontOff() { - return prefix + "alloy_furnace_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "alloy_furnace_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "alloy_furnace_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "alloy_furnace_front_on"; + } - @Override - public String getSide() { - return prefix + "iron_machine_side"; - } + @Override + public String getSide() + { + return prefix + "iron_machine_side"; + } - @Override - public String getTop() { - return prefix + "iron_machine_top"; - } + @Override + public String getTop() + { + return prefix + "iron_machine_top"; + } - @Override - public String getBottom() { - return prefix + "iron_machine_bottom"; - } + @Override + public String getBottom() + { + return prefix + "iron_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/iron_machines/BlockIronFurnace.java b/src/main/java/techreborn/blocks/iron_machines/BlockIronFurnace.java index f02f45f07..d96b8a669 100644 --- a/src/main/java/techreborn/blocks/iron_machines/BlockIronFurnace.java +++ b/src/main/java/techreborn/blocks/iron_machines/BlockIronFurnace.java @@ -1,5 +1,9 @@ package techreborn.blocks.iron_machines; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -18,95 +22,106 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileIronFurnace; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; +public class BlockIronFurnace extends BlockMachineBase implements IRotationTexture +{ -public class BlockIronFurnace extends BlockMachineBase implements IRotationTexture { - - public BlockIronFurnace() { + public BlockIronFurnace() + { super(); setUnlocalizedName("techreborn.ironfurnace"); - setCreativeTab(TechRebornCreativeTab.instance); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileIronFurnace(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z); - return true; - } - - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - List items = new ArrayList(); - items.add(new ItemStack(this)); - return items; - } - - @SideOnly(Side.CLIENT) - @SuppressWarnings("incomplete-switch") - public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) - { - if (this.isActive(state)) - { - EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); - double d0 = (double)pos.getX() + 0.5D; - double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D; - double d2 = (double)pos.getZ() + 0.5D; - double d3 = 0.52D; - double d4 = rand.nextDouble() * 0.6D - 0.3D; - switch (enumfacing) - { - case WEST: - worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); - worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); - break; - case EAST: - worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); - worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); - break; - case NORTH: - worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); - worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); - break; - case SOUTH: - worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); - worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); - } - } - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileIronFurnace(); + } - private final String prefix = "techreborn:blocks/machine/iron_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.ironFurnace, world, x, y, z); + return true; + } - @Override - public String getFrontOff() { - return prefix + "iron_furnace_front_off"; - } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + List items = new ArrayList(); + items.add(new ItemStack(this)); + return items; + } - @Override - public String getFrontOn() { - return prefix + "iron_furnace_front_on"; - } + @SideOnly(Side.CLIENT) + @SuppressWarnings("incomplete-switch") + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) + { + if (this.isActive(state)) + { + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + double d0 = (double) pos.getX() + 0.5D; + double d1 = (double) pos.getY() + rand.nextDouble() * 6.0D / 16.0D; + double d2 = (double) pos.getZ() + 0.5D; + double d3 = 0.52D; + double d4 = rand.nextDouble() * 0.6D - 0.3D; - @Override - public String getSide() { - return prefix + "iron_machine_side"; - } + switch (enumfacing) + { + case WEST: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, + new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case EAST: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, + new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case NORTH: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, + new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); + break; + case SOUTH: + worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, + new int[0]); + worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); + } + } + } - @Override - public String getTop() { - return prefix + "iron_machine_top"; - } + private final String prefix = "techreborn:blocks/machine/iron_machines/"; - @Override - public String getBottom() { - return prefix + "iron_machine_bottom"; - } + @Override + public String getFrontOff() + { + return prefix + "iron_furnace_front_off"; + } + + @Override + public String getFrontOn() + { + return prefix + "iron_furnace_front_on"; + } + + @Override + public String getSide() + { + return prefix + "iron_machine_side"; + } + + @Override + public String getTop() + { + return prefix + "iron_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "iron_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockAssemblingMachine.java b/src/main/java/techreborn/blocks/machine/BlockAssemblingMachine.java index 31f3357b4..5508979b8 100644 --- a/src/main/java/techreborn/blocks/machine/BlockAssemblingMachine.java +++ b/src/main/java/techreborn/blocks/machine/BlockAssemblingMachine.java @@ -11,51 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileAssemblingMachine; -public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture { +public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture +{ - public BlockAssemblingMachine(Material material) { - super(); - setUnlocalizedName("techreborn.assemblingmachine"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockAssemblingMachine(Material material) + { + super(); + setUnlocalizedName("techreborn.assemblingmachine"); + setCreativeTab(TechRebornCreativeTab.instance); + } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileAssemblingMachine(); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileAssemblingMachine(); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.assemblingmachineID, world, x, y, z); + return true; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.assemblingmachineID, world, x, y, z); - return true; - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getFrontOff() + { + return prefix + "assembling_machine_front_off"; + } - @Override - public String getFrontOff() { - return prefix + "assembling_machine_front_off"; - } + @Override + public String getFrontOn() + { + return prefix + "assembling_machine_front_on"; + } - @Override - public String getFrontOn() { - return prefix + "assembling_machine_front_on"; - } + @Override + public String getSide() + { + return prefix + "machine_side"; + } - @Override - public String getSide() { - return prefix + "machine_side"; - } + @Override + public String getTop() + { + return prefix + "machine_top"; + } - @Override - public String getTop() { - return prefix + "machine_top"; - } - - @Override - public String getBottom() { - return prefix + "assembling_machine_top"; - } + @Override + public String getBottom() + { + return prefix + "assembling_machine_top"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockChargeBench.java b/src/main/java/techreborn/blocks/machine/BlockChargeBench.java index fb56b6e35..a0f5036df 100644 --- a/src/main/java/techreborn/blocks/machine/BlockChargeBench.java +++ b/src/main/java/techreborn/blocks/machine/BlockChargeBench.java @@ -11,50 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileChargeBench; -public class BlockChargeBench extends BlockMachineBase implements IRotationTexture { +public class BlockChargeBench extends BlockMachineBase implements IRotationTexture +{ - public BlockChargeBench(Material material) { - super(); - setUnlocalizedName("techreborn.chargebench"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockChargeBench(Material material) + { + super(); + setUnlocalizedName("techreborn.chargebench"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileChargeBench(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileChargeBench(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.chargeBench, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.chargeBench, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFrontOff() { - return prefix + "chargeBench_side"; - } + @Override + public String getFrontOff() + { + return prefix + "chargeBench_side"; + } - @Override - public String getFrontOn() { - return prefix + "chargeBench_side"; - } + @Override + public String getFrontOn() + { + return prefix + "chargeBench_side"; + } - @Override - public String getSide() { - return prefix + "chargeBench_side"; - } + @Override + public String getSide() + { + return prefix + "chargeBench_side"; + } - @Override - public String getTop() { - return prefix + "chargeBench_side"; - } + @Override + public String getTop() + { + return prefix + "chargeBench_side"; + } - @Override - public String getBottom() { - return prefix + "chargeBench_side"; - } + @Override + public String getBottom() + { + return prefix + "chargeBench_side"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockChemicalReactor.java b/src/main/java/techreborn/blocks/machine/BlockChemicalReactor.java index 9574f2421..2aae084a2 100644 --- a/src/main/java/techreborn/blocks/machine/BlockChemicalReactor.java +++ b/src/main/java/techreborn/blocks/machine/BlockChemicalReactor.java @@ -11,51 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileChemicalReactor; -public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture { +public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture +{ - public BlockChemicalReactor(Material material) { - super(); - setUnlocalizedName("techreborn.chemicalreactor"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockChemicalReactor(Material material) + { + super(); + setUnlocalizedName("techreborn.chemicalreactor"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileChemicalReactor(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileChemicalReactor(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.chemicalReactorID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.chemicalReactorID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFrontOff() { - return prefix + "chemical_reactor_side_off"; - } + @Override + public String getFrontOff() + { + return prefix + "chemical_reactor_side_off"; + } - @Override - public String getFrontOn() { - return prefix + "chemical_reactor_side_on"; - } + @Override + public String getFrontOn() + { + return prefix + "chemical_reactor_side_on"; + } - @Override - public String getSide() { - return prefix + "machine_side"; - } + @Override + public String getSide() + { + return prefix + "machine_side"; + } - @Override - public String getTop() { - return prefix + "machine_top"; - } + @Override + public String getTop() + { + return prefix + "machine_top"; + } - @Override - public String getBottom() { - return prefix + "chemical_reactor_bottom"; - } + @Override + public String getBottom() + { + return prefix + "chemical_reactor_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockChunkLoader.java b/src/main/java/techreborn/blocks/machine/BlockChunkLoader.java index c0faae1fc..308fd5195 100644 --- a/src/main/java/techreborn/blocks/machine/BlockChunkLoader.java +++ b/src/main/java/techreborn/blocks/machine/BlockChunkLoader.java @@ -11,48 +11,54 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileChunkLoader; -public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockChunkLoader(Material material) + { + super(); + setUnlocalizedName("techreborn.chunkloader"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockChunkLoader(Material material) { - super(); - setUnlocalizedName("techreborn.chunkloader"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileChunkLoader(); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileChunkLoader(); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y, z); + return true; + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y, - z); - return true; - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public String getFront(boolean isActive) + { + return prefix + "industrial_chunk_loader_side"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "industrial_chunk_loader_side"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "industrial_chunk_loader_side"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "industrial_chunk_loader_side" ; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "machine_top"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "machine_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockMatterFabricator.java b/src/main/java/techreborn/blocks/machine/BlockMatterFabricator.java index 0ce91a44c..93fbc9f4e 100644 --- a/src/main/java/techreborn/blocks/machine/BlockMatterFabricator.java +++ b/src/main/java/techreborn/blocks/machine/BlockMatterFabricator.java @@ -11,50 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileMatterFabricator; -public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockMatterFabricator(Material material) { - super(); - setUnlocalizedName("techreborn.matterfabricator"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMatterFabricator(Material material) + { + super(); + setUnlocalizedName("techreborn.matterfabricator"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileMatterFabricator(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileMatterFabricator(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.matterfabID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public boolean isAdvanced() { - return true; - } + @Override + public boolean isAdvanced() + { + return true; + } - @Override - public String getFront(boolean isActive) { - return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; - } + @Override + public String getFront(boolean isActive) + { + return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; + } - @Override - public String getSide(boolean isActive) { - return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; - } + @Override + public String getSide(boolean isActive) + { + return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; + } - @Override - public String getTop(boolean isActive) { - return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; - } + @Override + public String getTop(boolean isActive) + { + return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; + } - @Override - public String getBottom(boolean isActive) { - return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; - } + @Override + public String getBottom(boolean isActive) + { + return isActive ? prefix + "matter_fabricator_on" : prefix + "matter_fabricator_off"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockRollingMachine.java b/src/main/java/techreborn/blocks/machine/BlockRollingMachine.java index 727241532..4b30e79e4 100644 --- a/src/main/java/techreborn/blocks/machine/BlockRollingMachine.java +++ b/src/main/java/techreborn/blocks/machine/BlockRollingMachine.java @@ -11,45 +11,54 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileRollingMachine; -public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockRollingMachine(Material material) { - super(); - setUnlocalizedName("techreborn.rollingmachine"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockRollingMachine(Material material) + { + super(); + setUnlocalizedName("techreborn.rollingmachine"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileRollingMachine(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileRollingMachine(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.rollingMachineID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFront(boolean isActive) { - return isActive ? prefix + "rolling_machine_side_on" : prefix + "rolling_machine_side_off"; - } + @Override + public String getFront(boolean isActive) + { + return isActive ? prefix + "rolling_machine_side_on" : prefix + "rolling_machine_side_off"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "machine_side"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "machine_side"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "machine_top"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "machine_top"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockScrapboxinator.java b/src/main/java/techreborn/blocks/machine/BlockScrapboxinator.java index ac675ecc9..c2963b0ea 100644 --- a/src/main/java/techreborn/blocks/machine/BlockScrapboxinator.java +++ b/src/main/java/techreborn/blocks/machine/BlockScrapboxinator.java @@ -11,51 +11,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileScrapboxinator; -public class BlockScrapboxinator extends BlockMachineBase implements IRotationTexture{ +public class BlockScrapboxinator extends BlockMachineBase implements IRotationTexture +{ - public BlockScrapboxinator(Material material) { - super(); - setUnlocalizedName("techreborn.scrapboxinator"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockScrapboxinator(Material material) + { + super(); + setUnlocalizedName("techreborn.scrapboxinator"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileScrapboxinator(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.scrapboxinatorID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileScrapboxinator(); + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.scrapboxinatorID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "scrapboxinator_front_off"; - } + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFrontOn() { - return prefix + "scrapboxinator_front_on"; - } + @Override + public String getFrontOff() + { + return prefix + "scrapboxinator_front_off"; + } - @Override - public String getSide() { - return prefix + "machine_side"; - } + @Override + public String getFrontOn() + { + return prefix + "scrapboxinator_front_on"; + } - @Override - public String getTop() { - return prefix + "machine_top"; - } + @Override + public String getSide() + { + return prefix + "machine_side"; + } - @Override - public String getBottom() { - return prefix + "machine_bottom"; - } + @Override + public String getTop() + { + return prefix + "machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/machine/BlockVacuumFreezer.java b/src/main/java/techreborn/blocks/machine/BlockVacuumFreezer.java index 93e88e3fc..58460e6c7 100644 --- a/src/main/java/techreborn/blocks/machine/BlockVacuumFreezer.java +++ b/src/main/java/techreborn/blocks/machine/BlockVacuumFreezer.java @@ -12,47 +12,56 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileVacuumFreezer; -public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRotationTexture{ +public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockVacuumFreezer(Material material) { - super(); - setUnlocalizedName("techreborn.vacuumfreezer"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockVacuumFreezer(Material material) + { + super(); + setUnlocalizedName("techreborn.vacuumfreezer"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileVacuumFreezer(); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileVacuumFreezer(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - TileVacuumFreezer tileVacuumFreezer = (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)); - tileVacuumFreezer.multiBlockStatus = tileVacuumFreezer.checkMachine() ? 1 : 0; - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.vacuumFreezerID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + TileVacuumFreezer tileVacuumFreezer = (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)); + tileVacuumFreezer.multiBlockStatus = tileVacuumFreezer.checkMachine() ? 1 : 0; + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.vacuumFreezerID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/greg_machines/"; + private final String prefix = "techreborn:blocks/machine/greg_machines/"; - @Override - public String getFront(boolean isActive) { - return prefix + "vacuum_freezer_front"; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "vacuum_freezer_front"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "machine_side" ; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "machine_side"; + } - @Override - public String getTop(boolean isActive) { - return prefix + "vacuum_freezer_top"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "vacuum_freezer_top"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "machine_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockAESU.java b/src/main/java/techreborn/blocks/storage/BlockAESU.java index 1c78d39b7..01161ee51 100644 --- a/src/main/java/techreborn/blocks/storage/BlockAESU.java +++ b/src/main/java/techreborn/blocks/storage/BlockAESU.java @@ -11,53 +11,61 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileAesu; -public class BlockAESU extends BlockMachineBase implements IRotationTexture { +public class BlockAESU extends BlockMachineBase implements IRotationTexture +{ - public BlockAESU(Material material) { - super(); - setUnlocalizedName("techreborn.aesu"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockAESU(Material material) + { + super(); + setUnlocalizedName("techreborn.aesu"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileAesu(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileAesu(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.aesuID, world, x, y, - z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.aesuID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/storage/"; + private final String prefix = "techreborn:blocks/machine/storage/"; - @Override - public String getFrontOff() { - return prefix + "aesu_front"; - } + @Override + public String getFrontOff() + { + return prefix + "aesu_front"; + } - @Override - public String getFrontOn() { - return prefix + "aesu_front"; - } + @Override + public String getFrontOn() + { + return prefix + "aesu_front"; + } - @Override - public String getSide() { - return prefix + "aesu_side"; - } + @Override + public String getSide() + { + return prefix + "aesu_side"; + } - @Override - public String getTop() { - return prefix + "aesu_top"; - } + @Override + public String getTop() + { + return prefix + "aesu_top"; + } - @Override - public String getBottom() { - return prefix + "aesu_bottom"; - } + @Override + public String getBottom() + { + return prefix + "aesu_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockBatBox.java b/src/main/java/techreborn/blocks/storage/BlockBatBox.java index e63752253..ac04308a4 100644 --- a/src/main/java/techreborn/blocks/storage/BlockBatBox.java +++ b/src/main/java/techreborn/blocks/storage/BlockBatBox.java @@ -1,303 +1,350 @@ package techreborn.blocks.storage; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterators; -import me.modmuss50.jsonDestroyer.api.ITexturedBlock; -import net.minecraft.block.Block; -import net.minecraft.block.BlockDynamicLiquid; -import net.minecraft.block.BlockStaticLiquid; -import net.minecraft.block.material.Material; -import net.minecraft.block.properties.PropertyDirection; -import net.minecraft.block.state.BlockStateContainer; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import net.minecraftforge.fluids.BlockFluidBase; -import reborncore.common.BaseTileBlock; -import reborncore.common.blocks.IAdvancedRotationTexture; import reborncore.common.blocks.IRotationTexture; import techreborn.Core; import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.storage.TileBatBox; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - /** * Created by modmuss50 on 14/03/2016. */ -public class BlockBatBox extends BaseTileBlock implements IRotationTexture , ITexturedBlock { +public class BlockBatBox extends BaseTileBlock implements IRotationTexture, ITexturedBlock +{ - public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL); - protected final String prefix = "techreborn:blocks/machine/storage/"; + public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL); + protected final String prefix = "techreborn:blocks/machine/storage/"; - public BlockBatBox() { - super(Material.rock); - setUnlocalizedName("techreborn.batBox"); - setCreativeTab(TechRebornCreativeTab.instance); - this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); - } + public BlockBatBox() + { + super(Material.rock); + setUnlocalizedName("techreborn.batBox"); + setCreativeTab(TechRebornCreativeTab.instance); + this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); + } - @Override - public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.batboxID, world, pos.getX(), pos.getY(), pos.getZ()); - return true; - } + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, + ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.batboxID, world, pos.getX(), pos.getY(), pos.getZ()); + return true; + } - protected BlockStateContainer createBlockState() { - FACING = PropertyDirection.create("facing", Facings.ALL); - return new BlockStateContainer(this, FACING); - } + protected BlockStateContainer createBlockState() + { + FACING = PropertyDirection.create("facing", Facings.ALL); + return new BlockStateContainer(this, FACING); + } - @Override - public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { - super.onBlockAdded(worldIn, pos, state); - this.setDefaultFacing(worldIn, pos, state); - } + @Override + public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) + { + super.onBlockAdded(worldIn, pos, state); + this.setDefaultFacing(worldIn, pos, state); + } - private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { - if (!worldIn.isRemote) { - IBlockState sate = worldIn.getBlockState(pos.north()); - Block block = sate.getBlock(); - IBlockState state1 = worldIn.getBlockState(pos.south()); - Block block1 = state1.getBlock(); - IBlockState state2 = worldIn.getBlockState(pos.west()); - Block block2 = state2.getBlock(); - IBlockState state3 = worldIn.getBlockState(pos.east()); - Block block3 = state3.getBlock(); - EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); + private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) + { + if (!worldIn.isRemote) + { + IBlockState sate = worldIn.getBlockState(pos.north()); + Block block = sate.getBlock(); + IBlockState state1 = worldIn.getBlockState(pos.south()); + Block block1 = state1.getBlock(); + IBlockState state2 = worldIn.getBlockState(pos.west()); + Block block2 = state2.getBlock(); + IBlockState state3 = worldIn.getBlockState(pos.east()); + Block block3 = state3.getBlock(); + EnumFacing enumfacing = (EnumFacing) state.getValue(FACING); - if (enumfacing == EnumFacing.NORTH && block.isFullBlock(state) && !block1.isFullBlock(state1)) { - enumfacing = EnumFacing.SOUTH; - } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock(state1) && !block.isFullBlock(state)) { - enumfacing = EnumFacing.NORTH; - } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock(state2) && !block3.isFullBlock(state2)) { - enumfacing = EnumFacing.EAST; - } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock(state3) && !block2.isFullBlock(state2)) { - enumfacing = EnumFacing.WEST; - } + if (enumfacing == EnumFacing.NORTH && block.isFullBlock(state) && !block1.isFullBlock(state1)) + { + enumfacing = EnumFacing.SOUTH; + } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock(state1) && !block.isFullBlock(state)) + { + enumfacing = EnumFacing.NORTH; + } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock(state2) && !block3.isFullBlock(state2)) + { + enumfacing = EnumFacing.EAST; + } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock(state3) && !block2.isFullBlock(state2)) + { + enumfacing = EnumFacing.WEST; + } - worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); - } - } + worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); + } + } - @Override - public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { - super.onBlockPlacedBy(worldIn, pos, state, placer, stack); - EnumFacing facing = placer.getHorizontalFacing().getOpposite(); - if(placer.rotationPitch < -50){ - facing = EnumFacing.DOWN; - } else if (placer.rotationPitch > 50){ - facing = EnumFacing.UP; - } - setFacing(facing, worldIn, pos); - } - @Override - public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { - dropInventory(worldIn, pos); - super.breakBlock(worldIn, pos, state); - } + @Override + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, + ItemStack stack) + { + super.onBlockPlacedBy(worldIn, pos, state, placer, stack); + EnumFacing facing = placer.getHorizontalFacing().getOpposite(); + if (placer.rotationPitch < -50) + { + facing = EnumFacing.DOWN; + } else if (placer.rotationPitch > 50) + { + facing = EnumFacing.UP; + } + setFacing(facing, worldIn, pos); + } - protected void dropInventory(World world, BlockPos pos) { - TileEntity tileEntity = world.getTileEntity(pos); + @Override + public void breakBlock(World worldIn, BlockPos pos, IBlockState state) + { + dropInventory(worldIn, pos); + super.breakBlock(worldIn, pos, state); + } - if(tileEntity == null){ - return; - } - if (!(tileEntity instanceof IInventory)) { - return; - } + protected void dropInventory(World world, BlockPos pos) + { + TileEntity tileEntity = world.getTileEntity(pos); - IInventory inventory = (IInventory) tileEntity; + if (tileEntity == null) + { + return; + } + if (!(tileEntity instanceof IInventory)) + { + return; + } - List items = new ArrayList(); + IInventory inventory = (IInventory) tileEntity; - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack itemStack = inventory.getStackInSlot(i); + List items = new ArrayList(); - if(itemStack == null){ - continue; - } - if (itemStack != null && itemStack.stackSize > 0) { - if (itemStack.getItem() instanceof ItemBlock) { - if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) { - continue; - } - } - } - items.add(itemStack.copy()); - } + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack itemStack = inventory.getStackInSlot(i); - for (ItemStack itemStack : items){ - Random rand = new Random(); + if (itemStack == null) + { + continue; + } + if (itemStack != null && itemStack.stackSize > 0) + { + if (itemStack.getItem() instanceof ItemBlock) + { + if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase + || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid + || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) + { + continue; + } + } + } + items.add(itemStack.copy()); + } - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; + for (ItemStack itemStack : items) + { + Random rand = new Random(); - EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, itemStack.copy()); + float dX = rand.nextFloat() * 0.8F + 0.1F; + float dY = rand.nextFloat() * 0.8F + 0.1F; + float dZ = rand.nextFloat() * 0.8F + 0.1F; - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } + EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, + itemStack.copy()); - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - world.spawnEntityInWorld(entityItem); - itemStack.stackSize = 0; - } - } + if (itemStack.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileBatBox(); - } + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + world.spawnEntityInWorld(entityItem); + itemStack.stackSize = 0; + } + } - @Override - public int getMetaFromState(IBlockState state) { - int facingInt = getSideFromEnum(state.getValue(FACING)); - return facingInt; - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileBatBox(); + } - @Override - public IBlockState getStateFromMeta(int meta) { - boolean active = false; - EnumFacing facing = getSideFromint(meta); - return this.getDefaultState().withProperty(FACING, facing); - } + @Override + public int getMetaFromState(IBlockState state) + { + int facingInt = getSideFromEnum(state.getValue(FACING)); + return facingInt; + } - public void setFacing(EnumFacing facing, World world, BlockPos pos){ - world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); - } + @Override + public IBlockState getStateFromMeta(int meta) + { + boolean active = false; + EnumFacing facing = getSideFromint(meta); + return this.getDefaultState().withProperty(FACING, facing); + } - public EnumFacing getSideFromint(int i){ - if(i == 0){ - return EnumFacing.NORTH; - } else if(i == 1){ - return EnumFacing.SOUTH; - }else if(i == 2){ - return EnumFacing.EAST; - }else if(i == 3){ - return EnumFacing.WEST; - }else if(i == 4){ - return EnumFacing.UP; - }else if(i == 5){ - return EnumFacing.DOWN; - } - return EnumFacing.NORTH; - } + public void setFacing(EnumFacing facing, World world, BlockPos pos) + { + world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing)); + } - public int getSideFromEnum(EnumFacing facing){ - if(facing == EnumFacing.NORTH){ - return 0; - } else if(facing == EnumFacing.SOUTH){ - return 1; - }else if(facing == EnumFacing.EAST){ - return 2; - }else if(facing == EnumFacing.WEST){ - return 3; - }else if(facing == EnumFacing.UP){ - return 4; - }else if(facing == EnumFacing.DOWN){ - return 5; - } - return 0; - } + public EnumFacing getSideFromint(int i) + { + if (i == 0) + { + return EnumFacing.NORTH; + } else if (i == 1) + { + return EnumFacing.SOUTH; + } else if (i == 2) + { + return EnumFacing.EAST; + } else if (i == 3) + { + return EnumFacing.WEST; + } else if (i == 4) + { + return EnumFacing.UP; + } else if (i == 5) + { + return EnumFacing.DOWN; + } + return EnumFacing.NORTH; + } - @Override - public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { - List items = new ArrayList(); - items.add(new ItemStack(this)); - return items; - } + public int getSideFromEnum(EnumFacing facing) + { + if (facing == EnumFacing.NORTH) + { + return 0; + } else if (facing == EnumFacing.SOUTH) + { + return 1; + } else if (facing == EnumFacing.EAST) + { + return 2; + } else if (facing == EnumFacing.WEST) + { + return 3; + } else if (facing == EnumFacing.UP) + { + return 4; + } else if (facing == EnumFacing.DOWN) + { + return 5; + } + return 0; + } - @Override - public String getFrontOff() { - return prefix + "batbox_front"; - } + @Override + public List getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) + { + List items = new ArrayList(); + items.add(new ItemStack(this)); + return items; + } - @Override - public String getFrontOn() { - return prefix + "batbox_front"; - } + @Override + public String getFrontOff() + { + return prefix + "batbox_front"; + } - @Override - public String getSide() { - return prefix + "batbox_side"; - } + @Override + public String getFrontOn() + { + return prefix + "batbox_front"; + } - @Override - public String getTop() { - return prefix + "batbox_top"; - } + @Override + public String getSide() + { + return prefix + "batbox_side"; + } - @Override - public String getBottom() { - return prefix + "batbox_bottom"; - } + @Override + public String getTop() + { + return prefix + "batbox_top"; + } - @Override - public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) { - if(this instanceof IRotationTexture){ - IRotationTexture rotationTexture = (IRotationTexture) this; - if(getFacing(blockState) == facing){ - return rotationTexture.getFrontOff(); - } - if(facing == EnumFacing.UP){ - return rotationTexture.getTop(); - } - if(facing == EnumFacing.DOWN){ - return rotationTexture.getBottom(); - } - return rotationTexture.getSide(); - } - return "techreborn:blocks/machine/machine_side"; - } + @Override + public String getBottom() + { + return prefix + "batbox_bottom"; + } - public EnumFacing getFacing(IBlockState state){ - return state.getValue(FACING); - } + @Override + public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) + { + if (this instanceof IRotationTexture) + { + IRotationTexture rotationTexture = (IRotationTexture) this; + if (getFacing(blockState) == facing) + { + return rotationTexture.getFrontOff(); + } + if (facing == EnumFacing.UP) + { + return rotationTexture.getTop(); + } + if (facing == EnumFacing.DOWN) + { + return rotationTexture.getBottom(); + } + return rotationTexture.getSide(); + } + return "techreborn:blocks/machine/machine_side"; + } - @Override - public int amountOfStates() { - return 6; - } + public EnumFacing getFacing(IBlockState state) + { + return state.getValue(FACING); + } - public enum Facings implements Predicate, Iterable { - ALL; + @Override + public int amountOfStates() + { + return 6; + } - public EnumFacing[] facings() { - return new EnumFacing[]{EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.UP, EnumFacing.DOWN}; - } + public enum Facings implements Predicate,Iterable + { + ALL; - public EnumFacing random(Random rand) { - EnumFacing[] aenumfacing = this.facings(); - return aenumfacing[rand.nextInt(aenumfacing.length)]; - } + public EnumFacing[] facings() + { + return new EnumFacing[] { EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST, + EnumFacing.UP, EnumFacing.DOWN }; + } - public boolean apply(EnumFacing p_apply_1_) { - return p_apply_1_ != null; - } + public EnumFacing random(Random rand) + { + EnumFacing[] aenumfacing = this.facings(); + return aenumfacing[rand.nextInt(aenumfacing.length)]; + } - public Iterator iterator() { - return Iterators.forArray(this.facings()); - } - } + public boolean apply(EnumFacing p_apply_1_) + { + return p_apply_1_ != null; + } + + public Iterator iterator() + { + return Iterators.forArray(this.facings()); + } + } } \ No newline at end of file diff --git a/src/main/java/techreborn/blocks/storage/BlockIDSU.java b/src/main/java/techreborn/blocks/storage/BlockIDSU.java index 86782a4cd..f0e357219 100644 --- a/src/main/java/techreborn/blocks/storage/BlockIDSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockIDSU.java @@ -14,61 +14,66 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.idsu.TileIDSU; -public class BlockIDSU extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockIDSU extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockIDSU(Material material) + { + super(); + setUnlocalizedName("techreborn.idsu"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockIDSU(Material material) { - super(); - setUnlocalizedName("techreborn.idsu"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileIDSU(5, 2048, 100000000); + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileIDSU(5, 2048, 100000000); - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.idsuID, world, x, y, z); + return true; + } + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) + { + super.onBlockPlacedBy(world, x, y, z, player, itemstack); + TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); + if (tile instanceof TileIDSU) + { + ((TileIDSU) tile).ownerUdid = player.getUniqueID().toString(); + } + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.idsuID, world, x, y, - z); - return true; - } + private final String prefix = "techreborn:blocks/machine/storage/"; - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { - super.onBlockPlacedBy(world, x, y, z, player, itemstack); - TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); - if (tile instanceof TileIDSU) { - ((TileIDSU) tile).ownerUdid = player.getUniqueID().toString(); - } - } + @Override + public String getFront(boolean isActive) + { + return prefix + "idsu_front"; + } + @Override + public String getSide(boolean isActive) + { + return prefix + "idsu_side"; + } - private final String prefix = "techreborn:blocks/machine/storage/"; + @Override + public String getTop(boolean isActive) + { + return prefix + "idsu_top"; + } - - @Override - public String getFront(boolean isActive) { - return prefix + "idsu_front"; - } - - @Override - public String getSide(boolean isActive) { - return prefix + "idsu_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "idsu_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "idsu_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "idsu_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockLESU.java b/src/main/java/techreborn/blocks/storage/BlockLESU.java index 3f23d4457..468407757 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLESU.java +++ b/src/main/java/techreborn/blocks/storage/BlockLESU.java @@ -11,51 +11,55 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.lesu.TileLesu; -public class BlockLESU extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockLESU extends BlockMachineBase implements IAdvancedRotationTexture +{ + public BlockLESU(Material material) + { + super(); + setUnlocalizedName("techreborn.lesu"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public BlockLESU(Material material) { - super(); - setUnlocalizedName("techreborn.lesu"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileLesu(); + } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.lesuID, world, x, y, z); + return true; + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileLesu(); - } + private final String prefix = "techreborn:blocks/machine/storage/"; - @Override - public boolean onBlockActivated(World world, int x, int y, int z, - EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.lesuID, world, x, y, - z); - return true; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "lesu_front"; + } - private final String prefix = "techreborn:blocks/machine/storage/"; + @Override + public String getSide(boolean isActive) + { + return prefix + "lesu_side"; + } + @Override + public String getTop(boolean isActive) + { + return prefix + "lesu_top"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "lesu_front"; - } - - @Override - public String getSide(boolean isActive) { - return prefix + "lesu_side" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "lesu_top"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "lesu_bottom"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "lesu_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockLESUStorage.java b/src/main/java/techreborn/blocks/storage/BlockLESUStorage.java index 4fd805849..c257ed146 100644 --- a/src/main/java/techreborn/blocks/storage/BlockLESUStorage.java +++ b/src/main/java/techreborn/blocks/storage/BlockLESUStorage.java @@ -13,60 +13,70 @@ import reborncore.common.blocks.IAdvancedRotationTexture; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.lesu.TileLesuStorage; -public class BlockLESUStorage extends BlockMachineBase implements IAdvancedRotationTexture { +public class BlockLESUStorage extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockLESUStorage(Material material) { - super(); - setUnlocalizedName("techreborn.lesustorage"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockLESUStorage(Material material) + { + super(); + setUnlocalizedName("techreborn.lesustorage"); + setCreativeTab(TechRebornCreativeTab.instance); + } + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) + { + super.onBlockPlacedBy(world, x, y, z, player, itemstack); + if (world.getTileEntity(new BlockPos(x, y, z)) instanceof TileLesuStorage) + { + ((TileLesuStorage) world.getTileEntity(new BlockPos(x, y, z))).rebuildNetwork(); + } + } - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { - super.onBlockPlacedBy(world, x, y, z, player, itemstack); - if (world.getTileEntity(new BlockPos(x, y, z)) instanceof TileLesuStorage) { - ((TileLesuStorage) world.getTileEntity(new BlockPos(x, y, z))).rebuildNetwork(); - } - } + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) + { + if (world.getTileEntity(new BlockPos(x, y, z)) instanceof TileLesuStorage) + { + ((TileLesuStorage) world.getTileEntity(new BlockPos(x, y, z))).removeFromNetwork(); + } + super.breakBlock(world, x, y, z, block, meta); + } - @Override - public void breakBlock(World world, int x, int y, int z, Block block, int meta) { - if (world.getTileEntity(new BlockPos(x, y, z)) instanceof TileLesuStorage) { - ((TileLesuStorage) world.getTileEntity(new BlockPos(x, y, z))).removeFromNetwork(); - } - super.breakBlock(world, x, y, z, block, meta); - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileLesuStorage(); + } + public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) + { + return block == (Block) this; + } - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileLesuStorage(); - } + private final String prefix = "techreborn:blocks/machine/storage/"; - public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) { - return block == (Block) this; - } + @Override + public String getFront(boolean isActive) + { + return prefix + "lesu_block"; + } - private final String prefix = "techreborn:blocks/machine/storage/"; + @Override + public String getSide(boolean isActive) + { + return prefix + "lesu_block"; + } - @Override - public String getFront(boolean isActive) { - return prefix + "lesu_block"; - } + @Override + public String getTop(boolean isActive) + { + return prefix + "lesu_block"; + } - @Override - public String getSide(boolean isActive) { - return prefix + "lesu_block" ; - } - - @Override - public String getTop(boolean isActive) { - return prefix + "lesu_block"; - } - - @Override - public String getBottom(boolean isActive) { - return prefix + "lesu_block"; - } + @Override + public String getBottom(boolean isActive) + { + return prefix + "lesu_block"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockMFE.java b/src/main/java/techreborn/blocks/storage/BlockMFE.java index edd6bae17..2215e0ba8 100644 --- a/src/main/java/techreborn/blocks/storage/BlockMFE.java +++ b/src/main/java/techreborn/blocks/storage/BlockMFE.java @@ -8,41 +8,49 @@ import techreborn.tiles.storage.TileMFE; /** * Created by modmuss50 on 14/03/2016. */ -public class BlockMFE extends BlockBatBox { +public class BlockMFE extends BlockBatBox +{ - public BlockMFE() { - super(); - setUnlocalizedName("techreborn.mfe"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMFE() + { + super(); + setUnlocalizedName("techreborn.mfe"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileMFE(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileMFE(); + } - @Override - public String getFrontOff() { - return prefix + "mfe_front"; - } + @Override + public String getFrontOff() + { + return prefix + "mfe_front"; + } - @Override - public String getFrontOn() { - return prefix + "mfe_front"; - } + @Override + public String getFrontOn() + { + return prefix + "mfe_front"; + } - @Override - public String getSide() { - return prefix + "mfe_side"; - } + @Override + public String getSide() + { + return prefix + "mfe_side"; + } - @Override - public String getTop() { - return prefix + "mfe_top"; - } + @Override + public String getTop() + { + return prefix + "mfe_top"; + } - @Override - public String getBottom() { - return prefix + "mfe_bottom"; - } + @Override + public String getBottom() + { + return prefix + "mfe_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/storage/BlockMFSU.java b/src/main/java/techreborn/blocks/storage/BlockMFSU.java index 96bfe9fb8..bab0055fe 100644 --- a/src/main/java/techreborn/blocks/storage/BlockMFSU.java +++ b/src/main/java/techreborn/blocks/storage/BlockMFSU.java @@ -8,41 +8,49 @@ import techreborn.tiles.storage.TileMFSU; /** * Created by modmuss50 on 14/03/2016. */ -public class BlockMFSU extends BlockBatBox { +public class BlockMFSU extends BlockBatBox +{ - public BlockMFSU() { - super(); - setUnlocalizedName("techreborn.mfsu"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMFSU() + { + super(); + setUnlocalizedName("techreborn.mfsu"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileMFSU(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileMFSU(); + } - @Override - public String getFrontOff() { - return prefix + "mfsu_front"; - } + @Override + public String getFrontOff() + { + return prefix + "mfsu_front"; + } - @Override - public String getFrontOn() { - return prefix + "mfsu_front"; - } + @Override + public String getFrontOn() + { + return prefix + "mfsu_front"; + } - @Override - public String getSide() { - return prefix + "mfsu_side"; - } + @Override + public String getSide() + { + return prefix + "mfsu_side"; + } - @Override - public String getTop() { - return prefix + "mfsu_top"; - } + @Override + public String getTop() + { + return prefix + "mfsu_top"; + } - @Override - public String getBottom() { - return prefix + "mfsu_bottom"; - } + @Override + public String getBottom() + { + return prefix + "mfsu_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java b/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java index 32b9c1c04..b46cc5da2 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java +++ b/src/main/java/techreborn/blocks/tier1/BlockAlloySmelter.java @@ -11,50 +11,60 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.TileAlloySmelter; -public class BlockAlloySmelter extends BlockMachineBase implements IRotationTexture { +public class BlockAlloySmelter extends BlockMachineBase implements IRotationTexture +{ - public BlockAlloySmelter(Material material) { - super(); - setUnlocalizedName("techreborn.alloysmelter"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockAlloySmelter(Material material) + { + super(); + setUnlocalizedName("techreborn.alloysmelter"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileAlloySmelter(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileAlloySmelter(); + } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.alloySmelterID, world, x, y, z); - return true; - } + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + player.openGui(Core.INSTANCE, GuiHandler.alloySmelterID, world, x, y, z); + return true; + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getFrontOff() { - return prefix + "electric_alloy_furnace_front_off"; - } + @Override + public String getFrontOff() + { + return prefix + "electric_alloy_furnace_front_off"; + } - @Override - public String getFrontOn() { - return prefix + "electric_alloy_furnace_front_on"; - } + @Override + public String getFrontOn() + { + return prefix + "electric_alloy_furnace_front_on"; + } - @Override - public String getSide() { - return prefix + "tier1_machine_side"; - } + @Override + public String getSide() + { + return prefix + "tier1_machine_side"; + } - @Override - public String getTop() { - return prefix + "tier1_machine_top"; - } + @Override + public String getTop() + { + return prefix + "tier1_machine_top"; + } - @Override - public String getBottom() { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getBottom() + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockCompressor.java b/src/main/java/techreborn/blocks/tier1/BlockCompressor.java index 4baf139e7..f924ada53 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockCompressor.java +++ b/src/main/java/techreborn/blocks/tier1/BlockCompressor.java @@ -11,51 +11,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.teir1.TileCompressor; -public class BlockCompressor extends BlockMachineBase implements IRotationTexture{ +public class BlockCompressor extends BlockMachineBase implements IRotationTexture +{ - public BlockCompressor(Material material) { - super(); - setUnlocalizedName("techreborn.compressor"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockCompressor(Material material) + { + super(); + setUnlocalizedName("techreborn.compressor"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileCompressor(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.compressorID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileCompressor(); + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.compressorID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "compressor_front_off"; - } + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getFrontOn() { - return prefix + "compressor_front_on"; - } + @Override + public String getFrontOff() + { + return prefix + "compressor_front_off"; + } - @Override - public String getSide() { - return prefix + "tier1_machine_side"; - } + @Override + public String getFrontOn() + { + return prefix + "compressor_front_on"; + } - @Override - public String getTop() { - return prefix + "tier1_machine_top"; - } + @Override + public String getSide() + { + return prefix + "tier1_machine_side"; + } - @Override - public String getBottom() { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getTop() + { + return prefix + "tier1_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java b/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java index 528791efa..8c10dc2ff 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java +++ b/src/main/java/techreborn/blocks/tier1/BlockElectricFurnace.java @@ -11,51 +11,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.teir1.TileElectricFurnace; -public class BlockElectricFurnace extends BlockMachineBase implements IRotationTexture{ +public class BlockElectricFurnace extends BlockMachineBase implements IRotationTexture +{ - public BlockElectricFurnace(Material material) { - super(); - setUnlocalizedName("techreborn.electricfurnace"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockElectricFurnace(Material material) + { + super(); + setUnlocalizedName("techreborn.electricfurnace"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileElectricFurnace(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.electricFurnaceID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileElectricFurnace(); + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.electricFurnaceID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "electric_furnace_front_off"; - } + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getFrontOn() { - return prefix + "electric_furnace_front_on"; - } + @Override + public String getFrontOff() + { + return prefix + "electric_furnace_front_off"; + } - @Override - public String getSide() { - return prefix + "tier1_machine_side" ; - } + @Override + public String getFrontOn() + { + return prefix + "electric_furnace_front_on"; + } - @Override - public String getTop() { - return prefix + "tier1_machine_top"; - } + @Override + public String getSide() + { + return prefix + "tier1_machine_side"; + } - @Override - public String getBottom() { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getTop() + { + return prefix + "tier1_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockExtractor.java b/src/main/java/techreborn/blocks/tier1/BlockExtractor.java index c620d5599..eb5c3a080 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockExtractor.java +++ b/src/main/java/techreborn/blocks/tier1/BlockExtractor.java @@ -11,51 +11,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.teir1.TileExtractor; -public class BlockExtractor extends BlockMachineBase implements IRotationTexture{ +public class BlockExtractor extends BlockMachineBase implements IRotationTexture +{ - public BlockExtractor(Material material) { - super(); - setUnlocalizedName("techreborn.extractor"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockExtractor(Material material) + { + super(); + setUnlocalizedName("techreborn.extractor"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileExtractor(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.extractorID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileExtractor(); + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.extractorID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "extractor_front_off"; - } + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getFrontOn() { - return prefix + "extractor_front_on"; - } + @Override + public String getFrontOff() + { + return prefix + "extractor_front_off"; + } - @Override - public String getSide() { - return prefix + "tier1_machine_side"; - } + @Override + public String getFrontOn() + { + return prefix + "extractor_front_on"; + } - @Override - public String getTop() { - return prefix + "tier1_machine_top"; - } + @Override + public String getSide() + { + return prefix + "tier1_machine_side"; + } - @Override - public String getBottom() { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getTop() + { + return prefix + "tier1_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockGrinder.java b/src/main/java/techreborn/blocks/tier1/BlockGrinder.java index fe40f878e..bd809596b 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockGrinder.java +++ b/src/main/java/techreborn/blocks/tier1/BlockGrinder.java @@ -11,46 +11,56 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.teir1.TileGrinder; -public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationTexture{ +public class BlockGrinder extends BlockMachineBase implements IAdvancedRotationTexture +{ - public BlockGrinder(Material material) { - super(); - setUnlocalizedName("techreborn.grinder"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockGrinder(Material material) + { + super(); + setUnlocalizedName("techreborn.grinder"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileGrinder(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileGrinder(); + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y, z); + } + return true; + } - @Override - public String getFront(boolean isActive) { - return isActive ? prefix + "grinder_front_on" : prefix + "grinder_front_off"; - } + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getSide(boolean isActive) { - return prefix + "tier1_machine_side"; - } + @Override + public String getFront(boolean isActive) + { + return isActive ? prefix + "grinder_front_on" : prefix + "grinder_front_off"; + } - @Override - public String getTop(boolean isActive) { - return isActive ? prefix + "grinder_top_on" : prefix + "grinder_top_off"; - } + @Override + public String getSide(boolean isActive) + { + return prefix + "tier1_machine_side"; + } - @Override - public String getBottom(boolean isActive) { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getTop(boolean isActive) + { + return isActive ? prefix + "grinder_top_on" : prefix + "grinder_top_off"; + } + + @Override + public String getBottom(boolean isActive) + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/tier1/BlockRecycler.java b/src/main/java/techreborn/blocks/tier1/BlockRecycler.java index f001fd3e2..9b346d1dc 100644 --- a/src/main/java/techreborn/blocks/tier1/BlockRecycler.java +++ b/src/main/java/techreborn/blocks/tier1/BlockRecycler.java @@ -11,51 +11,62 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.tiles.teir1.TileRecycler; -public class BlockRecycler extends BlockMachineBase implements IRotationTexture{ +public class BlockRecycler extends BlockMachineBase implements IRotationTexture +{ - public BlockRecycler(Material material) { - super(); - setUnlocalizedName("techreborn.recycler"); - setCreativeTab(TechRebornCreativeTab.instance); + public BlockRecycler(Material material) + { + super(); + setUnlocalizedName("techreborn.recycler"); + setCreativeTab(TechRebornCreativeTab.instance); } - - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { - return new TileRecycler(); - } - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { - if (!player.isSneaking()){ - player.openGui(Core.INSTANCE, GuiHandler.recyclerID, world, x, y, z); - } - return true; - } + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return new TileRecycler(); + } - private final String prefix = "techreborn:blocks/machine/tier1_machines/"; + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) + { + if (!player.isSneaking()) + { + player.openGui(Core.INSTANCE, GuiHandler.recyclerID, world, x, y, z); + } + return true; + } - @Override - public String getFrontOff() { - return prefix + "recycler_front_off"; - } + private final String prefix = "techreborn:blocks/machine/tier1_machines/"; - @Override - public String getFrontOn() { - return prefix + "recycler_front_on"; - } + @Override + public String getFrontOff() + { + return prefix + "recycler_front_off"; + } - @Override - public String getSide() { - return prefix + "tier1_machine_side"; - } + @Override + public String getFrontOn() + { + return prefix + "recycler_front_on"; + } - @Override - public String getTop() { - return prefix + "tier1_machine_top"; - } + @Override + public String getSide() + { + return prefix + "tier1_machine_side"; + } - @Override - public String getBottom() { - return prefix + "tier1_machine_bottom"; - } + @Override + public String getTop() + { + return prefix + "tier1_machine_top"; + } + + @Override + public String getBottom() + { + return prefix + "tier1_machine_bottom"; + } } diff --git a/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java index 0aa5515db..e15a3b38c 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockHVTransformer.java @@ -2,50 +2,56 @@ package techreborn.blocks.transformers; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import techreborn.blocks.storage.BlockBatBox; import techreborn.client.TechRebornCreativeTab; -import techreborn.tiles.storage.TileMFE; import techreborn.tiles.transformers.TileHVTransformer; /** * Created by modmuss50 on 16/03/2016. */ -public class BlockHVTransformer extends BlockLVTransformer { +public class BlockHVTransformer extends BlockLVTransformer +{ - public BlockHVTransformer() { - super(); - setUnlocalizedName("techreborn.hvt"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockHVTransformer() + { + super(); + setUnlocalizedName("techreborn.hvt"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileHVTransformer(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileHVTransformer(); + } - @Override - public String getFrontOff() { - return prefix + "hv_transformer_front"; - } + @Override + public String getFrontOff() + { + return prefix + "hv_transformer_front"; + } - @Override - public String getFrontOn() { - return prefix + "hv_transformer_front"; - } + @Override + public String getFrontOn() + { + return prefix + "hv_transformer_front"; + } - @Override - public String getSide() { - return prefix + "hv_transformer_side"; - } + @Override + public String getSide() + { + return prefix + "hv_transformer_side"; + } - @Override - public String getTop() { - return prefix + "hv_transformer_side"; - } + @Override + public String getTop() + { + return prefix + "hv_transformer_side"; + } + + @Override + public String getBottom() + { + return prefix + "hv_transformer_bottom"; + } - @Override - public String getBottom() { - return prefix + "hv_transformer_bottom"; - } - } diff --git a/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java index 8bb05d041..0e76b27d8 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockLVTransformer.java @@ -4,47 +4,54 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import techreborn.blocks.storage.BlockBatBox; import techreborn.client.TechRebornCreativeTab; -import techreborn.tiles.storage.TileMFE; import techreborn.tiles.transformers.TileLVTransformer; /** * Created by modmuss50 on 16/03/2016. */ -public class BlockLVTransformer extends BlockBatBox { +public class BlockLVTransformer extends BlockBatBox +{ - public BlockLVTransformer() { - super(); - setUnlocalizedName("techreborn.lvt"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockLVTransformer() + { + super(); + setUnlocalizedName("techreborn.lvt"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileLVTransformer(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileLVTransformer(); + } - @Override - public String getFrontOff() { - return prefix + "lv_transformer_front"; - } + @Override + public String getFrontOff() + { + return prefix + "lv_transformer_front"; + } - @Override - public String getFrontOn() { - return prefix + "lv_transformer_front"; - } + @Override + public String getFrontOn() + { + return prefix + "lv_transformer_front"; + } - @Override - public String getSide() { - return prefix + "lv_transformer_side"; - } + @Override + public String getSide() + { + return prefix + "lv_transformer_side"; + } - @Override - public String getTop() { - return prefix + "lv_transformer_side"; - } + @Override + public String getTop() + { + return prefix + "lv_transformer_side"; + } - @Override - public String getBottom() { - return prefix + "lv_transformer_side"; - } + @Override + public String getBottom() + { + return prefix + "lv_transformer_side"; + } } diff --git a/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java b/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java index fd1df7e47..58b1b9037 100644 --- a/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java +++ b/src/main/java/techreborn/blocks/transformers/BlockMVTransformer.java @@ -2,49 +2,55 @@ package techreborn.blocks.transformers; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import techreborn.blocks.storage.BlockBatBox; import techreborn.client.TechRebornCreativeTab; -import techreborn.tiles.storage.TileMFE; import techreborn.tiles.transformers.TileMVTransformer; /** * Created by modmuss50 on 16/03/2016. */ -public class BlockMVTransformer extends BlockLVTransformer { +public class BlockMVTransformer extends BlockLVTransformer +{ - public BlockMVTransformer() { - super(); - setUnlocalizedName("techreborn.mvt"); - setCreativeTab(TechRebornCreativeTab.instance); - } + public BlockMVTransformer() + { + super(); + setUnlocalizedName("techreborn.mvt"); + setCreativeTab(TechRebornCreativeTab.instance); + } - @Override - public TileEntity createNewTileEntity(World world, int p_149915_2_) { - return new TileMVTransformer(); - } + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) + { + return new TileMVTransformer(); + } - @Override - public String getFrontOff() { - return prefix + "mv_transformer_front"; - } + @Override + public String getFrontOff() + { + return prefix + "mv_transformer_front"; + } - @Override - public String getFrontOn() { - return prefix + "mv_transformer_front"; - } + @Override + public String getFrontOn() + { + return prefix + "mv_transformer_front"; + } - @Override - public String getSide() { - return prefix + "mv_transformer_side"; - } + @Override + public String getSide() + { + return prefix + "mv_transformer_side"; + } - @Override - public String getTop() { - return prefix + "mv_transformer_side"; - } + @Override + public String getTop() + { + return prefix + "mv_transformer_side"; + } - @Override - public String getBottom() { - return prefix + "mv_transformer_side"; - } + @Override + public String getBottom() + { + return prefix + "mv_transformer_side"; + } } diff --git a/src/main/java/techreborn/client/ClientMultiBlocks.java b/src/main/java/techreborn/client/ClientMultiBlocks.java index 9dcf21402..989b8dd23 100644 --- a/src/main/java/techreborn/client/ClientMultiBlocks.java +++ b/src/main/java/techreborn/client/ClientMultiBlocks.java @@ -1,70 +1,62 @@ package techreborn.client; - import net.minecraft.util.EnumFacing; import reborncore.client.multiblock.Multiblock; import techreborn.init.ModBlocks; -public class ClientMultiBlocks { +public class ClientMultiBlocks +{ - public static Multiblock reactor; - public static Multiblock frezzer; + public static Multiblock reactor; + public static Multiblock frezzer; - public static void init(){ - reactor = new Multiblock(); - checkCoils(); + public static void init() + { + reactor = new Multiblock(); + checkCoils(); + frezzer = new Multiblock(); + checkMachine(); + } - frezzer = new Multiblock(); - checkMachine(); - } + public static void checkCoils() + { + if ((isCoil(3, 0, 1)) && (isCoil(3, 0, 0)) && (isCoil(3, 0, 0 - 1)) && (isCoil(0 - 3, 0, 1)) + && (isCoil(0 - 3, 0, 0)) && (isCoil(0 - 3, 0, 0 - 1)) && (isCoil(2, 0, 2)) && (isCoil(2, 0, 1)) + && (isCoil(2, 0, 0 - 1)) && (isCoil(2, 0, 0 - 2)) && (isCoil(0 - 2, 0, 2)) && (isCoil(0 - 2, 0, 1)) + && (isCoil(0 - 2, 0, 0 - 1)) && (isCoil(0 - 2, 0, 0 - 2)) && (isCoil(1, 0, 3)) && (isCoil(1, 0, 2)) + && (isCoil(1, 0, 0 - 2)) && (isCoil(1, 0, 0 - 3)) && (isCoil(0 - 1, 0, 3)) && (isCoil(0 - 1, 0, 2)) + && (isCoil(0 - 1, 0, 0 - 2)) && (isCoil(0 - 1, 0, 0 - 3)) && (isCoil(0, 0, 3)) && (isCoil(0, 0, 0 - 3))) + { + } + } - public static void checkCoils() { - if ((isCoil(3, 0, 1)) && - (isCoil(3, 0, 0)) && - (isCoil(3, 0, 0 - 1)) && - (isCoil(0 - 3, 0, 1)) && - (isCoil(0 - 3, 0, 0)) && - (isCoil(0 - 3, 0, 0 - 1)) && - (isCoil(2, 0, 2)) && - (isCoil(2, 0, 1)) && - (isCoil(2, 0, 0 - 1)) && - (isCoil(2, 0, 0 - 2)) && - (isCoil(0 - 2, 0, 2)) && - (isCoil(0 - 2, 0, 1)) && - (isCoil(0 - 2, 0, 0 - 1)) && - (isCoil(0 - 2, 0, 0 - 2)) && - (isCoil(1, 0, 3)) && - (isCoil(1, 0, 2)) && - (isCoil(1, 0, 0 - 2)) && - (isCoil(1, 0, 0 - 3)) && - (isCoil(0 - 1, 0, 3)) && - (isCoil(0 - 1, 0, 2)) && - (isCoil(0 - 1, 0, 0 - 2)) && - (isCoil(0 - 1, 0, 0 - 3)) && - (isCoil(0, 0, 3)) && - (isCoil(0, 0, 0 - 3))) { - } - } + private static boolean isCoil(int x, int y, int z) + { + reactor.addComponent(x, y, z, ModBlocks.FusionCoil, 0); + return true; + } - private static boolean isCoil(int x, int y, int z) { - reactor.addComponent(x, y, z, ModBlocks.FusionCoil, 0); - return true; - } + public static void checkMachine() + { + int xDir = EnumFacing.UP.getFrontOffsetX() * 2; + int yDir = EnumFacing.UP.getFrontOffsetY() * 2; + int zDir = EnumFacing.UP.getFrontOffsetZ() * 2; + for (int i = -1; i < 2; i++) + { + for (int j = -1; j < 2; j++) + { + for (int k = -1; k < 2; k++) + { + if ((i != 0) || (j != 0) || (k != 0)) + { + frezzer.addComponent(xDir + i, yDir + j, zDir + k, ModBlocks.MachineCasing, + (((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0)) + || ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1)); + } + } + } + } + } - public static void checkMachine() { - int xDir = EnumFacing.UP.getFrontOffsetX() * 2; - int yDir = EnumFacing.UP.getFrontOffsetY() * 2; - int zDir = EnumFacing.UP.getFrontOffsetZ() * 2; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int k = -1; k < 2; k++) { - if ((i != 0) || (j != 0) || (k != 0)) { - frezzer.addComponent(xDir + i, yDir + j, zDir + k, ModBlocks.MachineCasing, (((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1)); - } - } - } - } - } - } diff --git a/src/main/java/techreborn/client/GuiHandler.java b/src/main/java/techreborn/client/GuiHandler.java index d854411db..694ed03e1 100644 --- a/src/main/java/techreborn/client/GuiHandler.java +++ b/src/main/java/techreborn/client/GuiHandler.java @@ -4,258 +4,405 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; -import techreborn.client.container.*; -import techreborn.client.gui.*; +import techreborn.client.container.ContainerAesu; +import techreborn.client.container.ContainerAlloyFurnace; +import techreborn.client.container.ContainerAlloySmelter; +import techreborn.client.container.ContainerAssemblingMachine; +import techreborn.client.container.ContainerBatbox; +import techreborn.client.container.ContainerBlastFurnace; +import techreborn.client.container.ContainerCentrifuge; +import techreborn.client.container.ContainerChargeBench; +import techreborn.client.container.ContainerChemicalReactor; +import techreborn.client.container.ContainerChunkloader; +import techreborn.client.container.ContainerCompressor; +import techreborn.client.container.ContainerDestructoPack; +import techreborn.client.container.ContainerDieselGenerator; +import techreborn.client.container.ContainerDigitalChest; +import techreborn.client.container.ContainerElectricFurnace; +import techreborn.client.container.ContainerExtractor; +import techreborn.client.container.ContainerFusionReactor; +import techreborn.client.container.ContainerGasTurbine; +import techreborn.client.container.ContainerGenerator; +import techreborn.client.container.ContainerGrinder; +import techreborn.client.container.ContainerIDSU; +import techreborn.client.container.ContainerImplosionCompressor; +import techreborn.client.container.ContainerIndustrialElectrolyzer; +import techreborn.client.container.ContainerIndustrialGrinder; +import techreborn.client.container.ContainerIndustrialSawmill; +import techreborn.client.container.ContainerIronFurnace; +import techreborn.client.container.ContainerLesu; +import techreborn.client.container.ContainerMatterFabricator; +import techreborn.client.container.ContainerQuantumChest; +import techreborn.client.container.ContainerQuantumTank; +import techreborn.client.container.ContainerRecycler; +import techreborn.client.container.ContainerRollingMachine; +import techreborn.client.container.ContainerScrapboxinator; +import techreborn.client.container.ContainerSemifluidGenerator; +import techreborn.client.container.ContainerThermalGenerator; +import techreborn.client.container.ContainerVacuumFreezer; +import techreborn.client.gui.GuiAesu; +import techreborn.client.gui.GuiAlloyFurnace; +import techreborn.client.gui.GuiAlloySmelter; +import techreborn.client.gui.GuiAssemblingMachine; +import techreborn.client.gui.GuiBatbox; +import techreborn.client.gui.GuiBlastFurnace; +import techreborn.client.gui.GuiCentrifuge; +import techreborn.client.gui.GuiChargeBench; +import techreborn.client.gui.GuiChemicalReactor; +import techreborn.client.gui.GuiChunkLoader; +import techreborn.client.gui.GuiCompressor; +import techreborn.client.gui.GuiDestructoPack; +import techreborn.client.gui.GuiDieselGenerator; +import techreborn.client.gui.GuiDigitalChest; +import techreborn.client.gui.GuiElectricFurnace; +import techreborn.client.gui.GuiExtractor; +import techreborn.client.gui.GuiFusionReactor; +import techreborn.client.gui.GuiGasTurbine; +import techreborn.client.gui.GuiGenerator; +import techreborn.client.gui.GuiGrinder; +import techreborn.client.gui.GuiIDSU; +import techreborn.client.gui.GuiImplosionCompressor; +import techreborn.client.gui.GuiIndustrialElectrolyzer; +import techreborn.client.gui.GuiIndustrialGrinder; +import techreborn.client.gui.GuiIndustrialSawmill; +import techreborn.client.gui.GuiIronFurnace; +import techreborn.client.gui.GuiLesu; +import techreborn.client.gui.GuiMatterFabricator; +import techreborn.client.gui.GuiQuantumChest; +import techreborn.client.gui.GuiQuantumTank; +import techreborn.client.gui.GuiRecycler; +import techreborn.client.gui.GuiRollingMachine; +import techreborn.client.gui.GuiScrapboxinator; +import techreborn.client.gui.GuiSemifluidGenerator; +import techreborn.client.gui.GuiThermalGenerator; +import techreborn.client.gui.GuiVacuumFreezer; import techreborn.manual.GuiManual; -import techreborn.tiles.*; +import techreborn.tiles.TileAesu; +import techreborn.tiles.TileAlloyFurnace; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileAssemblingMachine; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileCentrifuge; +import techreborn.tiles.TileChargeBench; +import techreborn.tiles.TileChemicalReactor; +import techreborn.tiles.TileChunkLoader; +import techreborn.tiles.TileDigitalChest; +import techreborn.tiles.TileImplosionCompressor; +import techreborn.tiles.TileIndustrialElectrolyzer; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.TileIndustrialSawmill; +import techreborn.tiles.TileIronFurnace; +import techreborn.tiles.TileMatterFabricator; +import techreborn.tiles.TileQuantumChest; +import techreborn.tiles.TileQuantumTank; +import techreborn.tiles.TileRollingMachine; +import techreborn.tiles.TileScrapboxinator; +import techreborn.tiles.TileVacuumFreezer; import techreborn.tiles.fusionReactor.TileEntityFusionController; -import techreborn.tiles.generator.*; +import techreborn.tiles.generator.TileDieselGenerator; +import techreborn.tiles.generator.TileGasTurbine; +import techreborn.tiles.generator.TileGenerator; +import techreborn.tiles.generator.TileSemifluidGenerator; +import techreborn.tiles.generator.TileThermalGenerator; import techreborn.tiles.idsu.TileIDSU; import techreborn.tiles.lesu.TileLesu; import techreborn.tiles.storage.TileBatBox; -import techreborn.tiles.teir1.*; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; +import techreborn.tiles.teir1.TileRecycler; -public class GuiHandler implements IGuiHandler { +public class GuiHandler implements IGuiHandler +{ - public static final int thermalGeneratorID = 0; - public static final int quantumTankID = 1; - public static final int quantumChestID = 2; - public static final int centrifugeID = 3; - public static final int rollingMachineID = 4; - public static final int blastFurnaceID = 5; - public static final int alloySmelterID = 6; - public static final int industrialGrinderID = 7; - public static final int implosionCompresserID = 8; - public static final int matterfabID = 9; - public static final int manuelID = 10; - public static final int chunkloaderID = 11; - public static final int assemblingmachineID = 12; - public static final int dieselGeneratorID = 15; - public static final int industrialElectrolyzerID = 16; - public static final int aesuID = 17; - public static final int alloyFurnaceID = 18; - public static final int sawMillID = 19; - public static final int chemicalReactorID = 20; - public static final int semifluidGeneratorID = 21; - public static final int gasTurbineID = 22; - public static final int digitalChestID = 23; - public static final int destructoPackID = 25; - public static final int lesuID = 26; - public static final int idsuID = 27; - public static final int chargeBench = 28; - public static final int fusionID = 29; - public static final int vacuumFreezerID = 30; - public static final int grinderID = 31; - public static final int generatorID = 32; - public static final int extractorID = 33; - public static final int compressorID = 34; - public static final int electricFurnaceID = 35; - public static final int ironFurnace = 36; - public static final int recyclerID = 37; - public static final int scrapboxinatorID = 38; - public static final int batboxID = 39; + public static final int thermalGeneratorID = 0; + public static final int quantumTankID = 1; + public static final int quantumChestID = 2; + public static final int centrifugeID = 3; + public static final int rollingMachineID = 4; + public static final int blastFurnaceID = 5; + public static final int alloySmelterID = 6; + public static final int industrialGrinderID = 7; + public static final int implosionCompresserID = 8; + public static final int matterfabID = 9; + public static final int manuelID = 10; + public static final int chunkloaderID = 11; + public static final int assemblingmachineID = 12; + public static final int dieselGeneratorID = 15; + public static final int industrialElectrolyzerID = 16; + public static final int aesuID = 17; + public static final int alloyFurnaceID = 18; + public static final int sawMillID = 19; + public static final int chemicalReactorID = 20; + public static final int semifluidGeneratorID = 21; + public static final int gasTurbineID = 22; + public static final int digitalChestID = 23; + public static final int destructoPackID = 25; + public static final int lesuID = 26; + public static final int idsuID = 27; + public static final int chargeBench = 28; + public static final int fusionID = 29; + public static final int vacuumFreezerID = 30; + public static final int grinderID = 31; + public static final int generatorID = 32; + public static final int extractorID = 33; + public static final int compressorID = 34; + public static final int electricFurnaceID = 35; + public static final int ironFurnace = 36; + public static final int recyclerID = 37; + public static final int scrapboxinatorID = 38; + public static final int batboxID = 39; + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + if (ID == thermalGeneratorID) + { + return new ContainerThermalGenerator((TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == semifluidGeneratorID) + { + return new ContainerSemifluidGenerator((TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == gasTurbineID) + { + return new ContainerGasTurbine((TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == quantumTankID) + { + return new ContainerQuantumTank((TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == digitalChestID) + { + return new ContainerDigitalChest((TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == quantumChestID) + { + return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == centrifugeID) + { + return new ContainerCentrifuge((TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == rollingMachineID) + { + return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == blastFurnaceID) + { + return new ContainerBlastFurnace((TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == alloySmelterID) + { + return new ContainerAlloySmelter((TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == industrialGrinderID) + { + return new ContainerIndustrialGrinder((TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == implosionCompresserID) + { + return new ContainerImplosionCompressor( + (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == matterfabID) + { + return new ContainerMatterFabricator((TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == chunkloaderID) + { + return new ContainerChunkloader((TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == assemblingmachineID) + { + return new ContainerAssemblingMachine((TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == dieselGeneratorID) + { + return new ContainerDieselGenerator((TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == industrialElectrolyzerID) + { + return new ContainerIndustrialElectrolyzer( + (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == aesuID) + { + return new ContainerAesu((TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == alloyFurnaceID) + { + return new ContainerAlloyFurnace((TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == sawMillID) + { + return new ContainerIndustrialSawmill((TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == chemicalReactorID) + { + return new ContainerChemicalReactor((TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == manuelID) + { + return null; + } else if (ID == destructoPackID) + { + return new ContainerDestructoPack(player); + } else if (ID == lesuID) + { + return new ContainerLesu((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == idsuID) + { + return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == chargeBench) + { + return new ContainerChargeBench((TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == fusionID) + { + return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == vacuumFreezerID) + { + return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == grinderID) + { + return new ContainerGrinder((TileGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == generatorID) + { + return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == extractorID) + { + return new ContainerExtractor((TileExtractor) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == compressorID) + { + return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == electricFurnaceID) + { + return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)), + player); + } else if (ID == ironFurnace) + { + return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == recyclerID) + { + return new ContainerRecycler((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == scrapboxinatorID) + { + return new ContainerScrapboxinator((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)), player); + } else if (ID == batboxID) + { + return new ContainerBatbox((TileBatBox) world.getTileEntity(new BlockPos(x, y, z)), player); + } + return null; + } - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - if (ID == thermalGeneratorID) { - return new ContainerThermalGenerator( - (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == semifluidGeneratorID) { - return new ContainerSemifluidGenerator( - (TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == gasTurbineID) { - return new ContainerGasTurbine( - (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == quantumTankID) { - return new ContainerQuantumTank( - (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == digitalChestID) { - return new ContainerDigitalChest( - (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == quantumChestID) { - return new ContainerQuantumChest( - (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == centrifugeID) { - return new ContainerCentrifuge( - (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == rollingMachineID) { - return new ContainerRollingMachine( - (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == blastFurnaceID) { - return new ContainerBlastFurnace( - (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == alloySmelterID) { - return new ContainerAlloySmelter( - (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == industrialGrinderID) { - return new ContainerIndustrialGrinder( - (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == implosionCompresserID) { - return new ContainerImplosionCompressor( - (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == matterfabID) { - return new ContainerMatterFabricator( - (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == chunkloaderID) { - return new ContainerChunkloader( - (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == assemblingmachineID) { - return new ContainerAssemblingMachine( - (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == dieselGeneratorID) { - return new ContainerDieselGenerator( - (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == industrialElectrolyzerID) { - return new ContainerIndustrialElectrolyzer( - (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == aesuID) { - return new ContainerAesu( - (TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == alloyFurnaceID) { - return new ContainerAlloyFurnace( - (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == sawMillID) { - return new ContainerIndustrialSawmill( - (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == chemicalReactorID) { - return new ContainerChemicalReactor( - (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == manuelID) { - return null; - } else if (ID == destructoPackID) { - return new ContainerDestructoPack(player); - } else if (ID == lesuID) { - return new ContainerLesu((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == idsuID) { - return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == chargeBench) { - return new ContainerChargeBench((TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == fusionID) { - return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == vacuumFreezerID) { - return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == grinderID) { - return new ContainerGrinder((TileGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == generatorID) { - return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == extractorID) { - return new ContainerExtractor((TileExtractor) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == compressorID) { - return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == electricFurnaceID) { - return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == ironFurnace) { - return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == recyclerID) { - return new ContainerRecycler((TileRecycler) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == scrapboxinatorID) { - return new ContainerScrapboxinator((TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z)), player); - }else if (ID == batboxID) { - return new ContainerBatbox((TileBatBox) world.getTileEntity(new BlockPos(x, y, z)), player); - } - return null; - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, - int x, int y, int z) { - if (ID == thermalGeneratorID) { - return new GuiThermalGenerator(player, - (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == semifluidGeneratorID) { - return new GuiSemifluidGenerator(player, - (TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == gasTurbineID) { - return new GuiGasTurbine(player, - (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == quantumTankID) { - return new GuiQuantumTank(player, - (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == digitalChestID) { - return new GuiDigitalChest(player, - (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == quantumChestID) { - return new GuiQuantumChest(player, - (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == centrifugeID) { - return new GuiCentrifuge(player, - (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == rollingMachineID) { - return new GuiRollingMachine(player, - (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == blastFurnaceID) { - return new GuiBlastFurnace(player, - (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == alloySmelterID) { - return new GuiAlloySmelter(player, - (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == industrialGrinderID) { - return new GuiIndustrialGrinder(player, - (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == implosionCompresserID) { - return new GuiImplosionCompressor(player, - (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == matterfabID) { - return new GuiMatterFabricator(player, - (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == chunkloaderID) { - return new GuiChunkLoader(player, - (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == assemblingmachineID) { - return new GuiAssemblingMachine(player, - (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == dieselGeneratorID) { - return new GuiDieselGenerator(player, - (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == industrialElectrolyzerID) { - return new GuiIndustrialElectrolyzer(player, - (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == aesuID) { - return new GuiAesu(player, - (TileAesu) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == alloyFurnaceID) { - return new GuiAlloyFurnace(player, - (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == sawMillID) { - return new GuiIndustrialSawmill(player, - (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == chemicalReactorID) { - return new GuiChemicalReactor(player, - (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == manuelID) { - return new GuiManual(); - } else if (ID == destructoPackID) { - return new GuiDestructoPack(new ContainerDestructoPack(player)); - } else if (ID == lesuID) { - return new GuiLesu(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == idsuID) { - return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == chargeBench) { - return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == fusionID) { - return new GuiFusionReactor(player, (TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == vacuumFreezerID) { - return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == grinderID) { - return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == generatorID) { - return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == extractorID) { - return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == compressorID) { - return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == electricFurnaceID) { - return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == ironFurnace) { - return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == recyclerID) { - return new GuiRecycler(player, (TileRecycler) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == scrapboxinatorID) { - return new GuiScrapboxinator(player, (TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z))); - }else if (ID == batboxID) { - return new GuiBatbox(player, (TileBatBox) world.getTileEntity(new BlockPos(x, y, z))); - } - return null; - } + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + if (ID == thermalGeneratorID) + { + return new GuiThermalGenerator(player, (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == semifluidGeneratorID) + { + return new GuiSemifluidGenerator(player, + (TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == gasTurbineID) + { + return new GuiGasTurbine(player, (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == quantumTankID) + { + return new GuiQuantumTank(player, (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == digitalChestID) + { + return new GuiDigitalChest(player, (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == quantumChestID) + { + return new GuiQuantumChest(player, (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == centrifugeID) + { + return new GuiCentrifuge(player, (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == rollingMachineID) + { + return new GuiRollingMachine(player, (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == blastFurnaceID) + { + return new GuiBlastFurnace(player, (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == alloySmelterID) + { + return new GuiAlloySmelter(player, (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == industrialGrinderID) + { + return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == implosionCompresserID) + { + return new GuiImplosionCompressor(player, + (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == matterfabID) + { + return new GuiMatterFabricator(player, (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == chunkloaderID) + { + return new GuiChunkLoader(player, (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == assemblingmachineID) + { + return new GuiAssemblingMachine(player, (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == dieselGeneratorID) + { + return new GuiDieselGenerator(player, (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == industrialElectrolyzerID) + { + return new GuiIndustrialElectrolyzer(player, + (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == aesuID) + { + return new GuiAesu(player, (TileAesu) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == alloyFurnaceID) + { + return new GuiAlloyFurnace(player, (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == sawMillID) + { + return new GuiIndustrialSawmill(player, (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == chemicalReactorID) + { + return new GuiChemicalReactor(player, (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == manuelID) + { + return new GuiManual(); + } else if (ID == destructoPackID) + { + return new GuiDestructoPack(new ContainerDestructoPack(player)); + } else if (ID == lesuID) + { + return new GuiLesu(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == idsuID) + { + return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == chargeBench) + { + return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == fusionID) + { + return new GuiFusionReactor(player, + (TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == vacuumFreezerID) + { + return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == grinderID) + { + return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == generatorID) + { + return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == extractorID) + { + return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == compressorID) + { + return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == electricFurnaceID) + { + return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == ironFurnace) + { + return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == recyclerID) + { + return new GuiRecycler(player, (TileRecycler) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == scrapboxinatorID) + { + return new GuiScrapboxinator(player, (TileScrapboxinator) world.getTileEntity(new BlockPos(x, y, z))); + } else if (ID == batboxID) + { + return new GuiBatbox(player, (TileBatBox) world.getTileEntity(new BlockPos(x, y, z))); + } + return null; + } } diff --git a/src/main/java/techreborn/client/IconSupplier.java b/src/main/java/techreborn/client/IconSupplier.java index f406996b7..b6802df9c 100644 --- a/src/main/java/techreborn/client/IconSupplier.java +++ b/src/main/java/techreborn/client/IconSupplier.java @@ -1,40 +1,51 @@ package techreborn.client; //TODO recode for 1.8 -public class IconSupplier { -// public static IIcon insulatedCopperCable; -// public static IIcon copperCable; -// public static IIcon goldCable; -// public static IIcon insulatedGoldCable; -// public static IIcon doubleInsulatedGoldCable; -// public static IIcon ironCable; -// public static IIcon insulatedIronCable; -// public static IIcon doubleInsulatedIronCable; -// public static IIcon trippleInsulatedIronCable; -// public static IIcon glassFiberCable; -// public static IIcon tinCable; -// public static IIcon detectorCableBlock; -// public static IIcon splitterCableBlock; -// public static IIcon insulatedtinCableBlock; +public class IconSupplier +{ + // public static IIcon insulatedCopperCable; + // public static IIcon copperCable; + // public static IIcon goldCable; + // public static IIcon insulatedGoldCable; + // public static IIcon doubleInsulatedGoldCable; + // public static IIcon ironCable; + // public static IIcon insulatedIronCable; + // public static IIcon doubleInsulatedIronCable; + // public static IIcon trippleInsulatedIronCable; + // public static IIcon glassFiberCable; + // public static IIcon tinCable; + // public static IIcon detectorCableBlock; + // public static IIcon splitterCableBlock; + // public static IIcon insulatedtinCableBlock; -// @SubscribeEvent -// public void onTextureStitch(TextureStitchEvent.Pre event) { -// TextureMap reg = event.map; -// if (reg.getTextureType() == 0) { -// insulatedCopperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCable"); -// copperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCableO"); -// goldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCable"); -// insulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableI"); -// doubleInsulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableII"); -// ironCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCable"); -// insulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableI"); -// doubleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableII"); -// trippleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableIII"); -// glassFiberCable = reg.registerIcon("ic2" + ":wiring/cable/blockGlassCable"); -// tinCable = reg.registerIcon("ic2" + ":wiring/cable/blockTinCable"); -// detectorCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockDetectorCable"); -// splitterCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockSplitterCable"); -// insulatedtinCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockTinCableI"); -// } -// } + // @SubscribeEvent + // public void onTextureStitch(TextureStitchEvent.Pre event) { + // TextureMap reg = event.map; + // if (reg.getTextureType() == 0) { + // insulatedCopperCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockCable"); + // copperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCableO"); + // goldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCable"); + // insulatedGoldCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockGoldCableI"); + // doubleInsulatedGoldCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockGoldCableII"); + // ironCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCable"); + // insulatedIronCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockIronCableI"); + // doubleInsulatedIronCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockIronCableII"); + // trippleInsulatedIronCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockIronCableIII"); + // glassFiberCable = reg.registerIcon("ic2" + + // ":wiring/cable/blockGlassCable"); + // tinCable = reg.registerIcon("ic2" + ":wiring/cable/blockTinCable"); + // detectorCableBlock = reg.registerIcon("ic2" + + // ":wiring/cable/blockDetectorCable"); + // splitterCableBlock = reg.registerIcon("ic2" + + // ":wiring/cable/blockSplitterCable"); + // insulatedtinCableBlock = reg.registerIcon("ic2" + + // ":wiring/cable/blockTinCableI"); + // } + // } } diff --git a/src/main/java/techreborn/client/RegisterItemJsons.java b/src/main/java/techreborn/client/RegisterItemJsons.java index c4fc8a503..463c0eaf4 100644 --- a/src/main/java/techreborn/client/RegisterItemJsons.java +++ b/src/main/java/techreborn/client/RegisterItemJsons.java @@ -5,16 +5,22 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import techreborn.init.ModBlocks; -public class RegisterItemJsons { - public static void registerModels() { +public class RegisterItemJsons +{ + public static void registerModels() + { registerItems(); registerBlocks(); } - private static void registerItems() { + private static void registerItems() + { } - private static void registerBlocks() { - Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(ModBlocks.ironFence), 0, new ModelResourceLocation("techreborn:ironFence", "inventory")); + private static void registerBlocks() + { + Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( + Item.getItemFromBlock(ModBlocks.ironFence), 0, + new ModelResourceLocation("techreborn:ironFence", "inventory")); } } diff --git a/src/main/java/techreborn/client/StackToolTipEvent.java b/src/main/java/techreborn/client/StackToolTipEvent.java index f5f810c71..c8cb99f34 100644 --- a/src/main/java/techreborn/client/StackToolTipEvent.java +++ b/src/main/java/techreborn/client/StackToolTipEvent.java @@ -1,61 +1,90 @@ package techreborn.client; -import com.mojang.realmsclient.gui.ChatFormatting; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.client.Minecraft; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + import org.lwjgl.input.Keyboard; + import reborncore.api.IListInfoProvider; import reborncore.api.power.IEnergyInterfaceItem; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.Color; import techreborn.Core; -public class StackToolTipEvent { +import com.mojang.realmsclient.gui.ChatFormatting; - @SubscribeEvent - public void handleItemTooltipEvent(ItemTooltipEvent event) { - if (event.itemStack.getItem() instanceof IListInfoProvider) { - ((IListInfoProvider) event.itemStack.getItem()).addInfo(event.toolTip, false); - } else if (event.itemStack.getItem() instanceof IEnergyInterfaceItem) { - if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - int percentage = percentage((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack), (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack)); - ChatFormatting color; - if (percentage <= 10) { - color = ChatFormatting.RED; - } else if (percentage >= 75) { - color = ChatFormatting.GREEN; - } else { - color = ChatFormatting.YELLOW; - } - event.toolTip.add(color + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " stored"); - event.toolTip.add(Color.GREEN + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " max"); - event.toolTip.add(ChatFormatting.GREEN + "" + percentage + "%" + ChatFormatting.LIGHT_PURPLE + " charged"); - event.toolTip.add(Color.GREEN + "" + PowerSystem.getLocaliszedPower((int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack)) + ChatFormatting.LIGHT_PURPLE + " /tick in/out"); - } - } else { - try{ - Block block = Block.getBlockFromItem(event.itemStack.getItem()); - if (block != null && block instanceof BlockContainer && block.getClass().getCanonicalName().startsWith("techreborn.")) { - TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld, block.getDefaultState()); - if (tile instanceof IListInfoProvider) { - ((IListInfoProvider) tile).addInfo(event.toolTip, false); - } - } - } catch (NullPointerException e){ - Core.logHelper.debug("Failed to load info for " + event.itemStack.getDisplayName()); - } - } - } +public class StackToolTipEvent +{ + @SubscribeEvent + public void handleItemTooltipEvent(ItemTooltipEvent event) + { + if (event.itemStack.getItem() instanceof IListInfoProvider) + { + ((IListInfoProvider) event.itemStack.getItem()).addInfo(event.toolTip, false); + } else if (event.itemStack.getItem() instanceof IEnergyInterfaceItem) + { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) + { + int percentage = percentage( + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack), + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack)); + ChatFormatting color; + if (percentage <= 10) + { + color = ChatFormatting.RED; + } else if (percentage >= 75) + { + color = ChatFormatting.GREEN; + } else + { + color = ChatFormatting.YELLOW; + } + event.toolTip.add(color + "" + + PowerSystem.getLocaliszedPower( + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getEnergy(event.itemStack)) + + ChatFormatting.LIGHT_PURPLE + " stored"); + event.toolTip.add(Color.GREEN + "" + + PowerSystem.getLocaliszedPower( + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxPower(event.itemStack)) + + ChatFormatting.LIGHT_PURPLE + " max"); + event.toolTip + .add(ChatFormatting.GREEN + "" + percentage + "%" + ChatFormatting.LIGHT_PURPLE + " charged"); + event.toolTip.add(Color.GREEN + "" + PowerSystem.getLocaliszedPower( + (int) ((IEnergyInterfaceItem) event.itemStack.getItem()).getMaxTransfer(event.itemStack)) + + ChatFormatting.LIGHT_PURPLE + " /tick in/out"); + } + } else + { + try + { + Block block = Block.getBlockFromItem(event.itemStack.getItem()); + if (block != null && block instanceof BlockContainer + && block.getClass().getCanonicalName().startsWith("techreborn.")) + { + TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld, + block.getDefaultState()); + if (tile instanceof IListInfoProvider) + { + ((IListInfoProvider) tile).addInfo(event.toolTip, false); + } + } + } catch (NullPointerException e) + { + Core.logHelper.debug("Failed to load info for " + event.itemStack.getDisplayName()); + } + } + } - public int percentage(int MaxValue, int CurrentValue) { - if (CurrentValue == 0) - return 0; - return (int) ((CurrentValue * 100.0f) / MaxValue); - } + public int percentage(int MaxValue, int CurrentValue) + { + if (CurrentValue == 0) + return 0; + return (int) ((CurrentValue * 100.0f) / MaxValue); + } } diff --git a/src/main/java/techreborn/client/TechRebornCreativeTab.java b/src/main/java/techreborn/client/TechRebornCreativeTab.java index c05e2a489..cb2e26e0b 100644 --- a/src/main/java/techreborn/client/TechRebornCreativeTab.java +++ b/src/main/java/techreborn/client/TechRebornCreativeTab.java @@ -4,16 +4,19 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import techreborn.init.ModBlocks; -public class TechRebornCreativeTab extends CreativeTabs { +public class TechRebornCreativeTab extends CreativeTabs +{ - public static TechRebornCreativeTab instance = new TechRebornCreativeTab(); + public static TechRebornCreativeTab instance = new TechRebornCreativeTab(); - public TechRebornCreativeTab() { - super("techreborn"); - } + public TechRebornCreativeTab() + { + super("techreborn"); + } - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(ModBlocks.thermalGenerator); - } + @Override + public Item getTabIconItem() + { + return Item.getItemFromBlock(ModBlocks.thermalGenerator); + } } diff --git a/src/main/java/techreborn/client/TechRebornCreativeTabMisc.java b/src/main/java/techreborn/client/TechRebornCreativeTabMisc.java index f51eece6b..ff4925d92 100644 --- a/src/main/java/techreborn/client/TechRebornCreativeTabMisc.java +++ b/src/main/java/techreborn/client/TechRebornCreativeTabMisc.java @@ -4,17 +4,20 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import techreborn.init.ModItems; -public class TechRebornCreativeTabMisc extends CreativeTabs { +public class TechRebornCreativeTabMisc extends CreativeTabs +{ - public static TechRebornCreativeTabMisc instance = new TechRebornCreativeTabMisc(); + public static TechRebornCreativeTabMisc instance = new TechRebornCreativeTabMisc(); - public TechRebornCreativeTabMisc() { - super("techreborn"); - } + public TechRebornCreativeTabMisc() + { + super("techreborn"); + } - @Override - public Item getTabIconItem() { - return ModItems.cells; - } + @Override + public Item getTabIconItem() + { + return ModItems.cells; + } } diff --git a/src/main/java/techreborn/client/VersionCheckerClient.java b/src/main/java/techreborn/client/VersionCheckerClient.java index 839e69d4e..e02a8fcdb 100644 --- a/src/main/java/techreborn/client/VersionCheckerClient.java +++ b/src/main/java/techreborn/client/VersionCheckerClient.java @@ -1,5 +1,8 @@ package techreborn.client; +import java.awt.*; +import java.util.ArrayList; + import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.client.GuiModList; @@ -7,39 +10,46 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import reborncore.client.gui.GuiUtil; import techreborn.Core; -import java.awt.*; -import java.util.ArrayList; +public class VersionCheckerClient +{ + ResourceLocation texture; -public class VersionCheckerClient { - ResourceLocation texture; + public VersionCheckerClient() + { + texture = new ResourceLocation("textures/gui/demo_background.png"); + } - public VersionCheckerClient() { - texture = new ResourceLocation("textures/gui/demo_background.png"); - } - - @SubscribeEvent - public void drawGui(GuiScreenEvent.DrawScreenEvent event) { - if (event.gui instanceof GuiModList) { - ArrayList changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion(); - String s = ""; - if (Core.INSTANCE.versionChecker.isChecking) { - s = "Checking for update..."; - } else if (Core.INSTANCE.versionChecker.isLatestVersion()) { - s = "You have the latest version of TechReborn"; - } else { - s = "There is an update for TechReborn with " + changeLog.size() + " changes."; - } - event.gui.drawString(event.gui.mc.fontRendererObj, s, 10, 5, Color.white.getRGB()); - if (!Core.INSTANCE.versionChecker.isLatestVersion()) { - if (event.mouseY < 20) { - GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5); - int y = 20; - for (String change : changeLog) { - event.gui.drawString(event.gui.mc.fontRendererObj, change, 10, y, Color.white.getRGB()); - y += 10; - } - } - } - } - } + @SubscribeEvent + public void drawGui(GuiScreenEvent.DrawScreenEvent event) + { + if (event.gui instanceof GuiModList) + { + ArrayList changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion(); + String s = ""; + if (Core.INSTANCE.versionChecker.isChecking) + { + s = "Checking for update..."; + } else if (Core.INSTANCE.versionChecker.isLatestVersion()) + { + s = "You have the latest version of TechReborn"; + } else + { + s = "There is an update for TechReborn with " + changeLog.size() + " changes."; + } + event.gui.drawString(event.gui.mc.fontRendererObj, s, 10, 5, Color.white.getRGB()); + if (!Core.INSTANCE.versionChecker.isLatestVersion()) + { + if (event.mouseY < 20) + { + GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5); + int y = 20; + for (String change : changeLog) + { + event.gui.drawString(event.gui.mc.fontRendererObj, change, 10, y, Color.white.getRGB()); + y += 10; + } + } + } + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java b/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java index cd0fb88a3..806d45acb 100644 --- a/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java +++ b/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java @@ -7,88 +7,101 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileAlloyFurnace; -public class ContainerAlloyFurnace extends RebornContainer { +public class ContainerAlloyFurnace extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileAlloyFurnace tile; + TileAlloyFurnace tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, - EntityPlayer player) { - tile = tileAlloyfurnace; - this.player = player; + public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace, EntityPlayer player) + { + tile = tileAlloyfurnace; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 0, 47, 17)); - this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 1, 65, 17)); - // outputs - this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35)); - // Fuel - this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 3, 56, 53)); + // input + this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 0, 47, 17)); + this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 1, 65, 17)); + // outputs + this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35)); + // Fuel + this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 3, 56, 53)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - int currentItemBurnTime; - int burnTime; - int cookTime; + int currentItemBurnTime; + int burnTime; + int cookTime; - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime); - crafting.sendProgressBarUpdate(this, 1, tile.burnTime); - crafting.sendProgressBarUpdate(this, 2, tile.cookTime); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime); + crafting.sendProgressBarUpdate(this, 1, tile.burnTime); + crafting.sendProgressBarUpdate(this, 2, tile.cookTime); + } - @Override - public void detectAndSendChanges() { - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting crafting = (ICrafting) this.crafters.get(i); - if (this.currentItemBurnTime != tile.currentItemBurnTime) { - crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime); - } - if (this.burnTime != tile.burnTime) { - crafting.sendProgressBarUpdate(this, 1, tile.burnTime); - } - if (this.cookTime != tile.cookTime) { - crafting.sendProgressBarUpdate(this, 2, tile.cookTime); - } - } - super.detectAndSendChanges(); - } + @Override + public void detectAndSendChanges() + { + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting crafting = (ICrafting) this.crafters.get(i); + if (this.currentItemBurnTime != tile.currentItemBurnTime) + { + crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime); + } + if (this.burnTime != tile.burnTime) + { + crafting.sendProgressBarUpdate(this, 1, tile.burnTime); + } + if (this.cookTime != tile.cookTime) + { + crafting.sendProgressBarUpdate(this, 2, tile.cookTime); + } + } + super.detectAndSendChanges(); + } - @Override - public void updateProgressBar(int id, int value) { - super.updateProgressBar(id, value); - if (id == 0) { - this.currentItemBurnTime = value; - } else if (id == 1) { - this.burnTime = value; - } else if (id == 2) { - this.cookTime = value; - } - this.tile.currentItemBurnTime = this.currentItemBurnTime; - this.tile.burnTime = this.burnTime; - this.tile.cookTime = this.cookTime; - } + @Override + public void updateProgressBar(int id, int value) + { + super.updateProgressBar(id, value); + if (id == 0) + { + this.currentItemBurnTime = value; + } else if (id == 1) + { + this.burnTime = value; + } else if (id == 2) + { + this.cookTime = value; + } + this.tile.currentItemBurnTime = this.currentItemBurnTime; + this.tile.burnTime = this.burnTime; + this.tile.cookTime = this.cookTime; + } } diff --git a/src/main/java/techreborn/client/container/ContainerAlloySmelter.java b/src/main/java/techreborn/client/container/ContainerAlloySmelter.java index 1556e9473..c3299a430 100644 --- a/src/main/java/techreborn/client/container/ContainerAlloySmelter.java +++ b/src/main/java/techreborn/client/container/ContainerAlloySmelter.java @@ -6,52 +6,54 @@ import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.TileAlloySmelter; -public class ContainerAlloySmelter extends ContainerCrafting { +public class ContainerAlloySmelter extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileAlloySmelter tile; + TileAlloySmelter tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter, - EntityPlayer player) { - super(tileAlloysmelter.crafter); - tile = tileAlloysmelter; - this.player = player; + public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter, EntityPlayer player) + { + super(tileAlloysmelter.crafter); + tile = tileAlloysmelter; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 47, 17)); - this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 1, 65, 17)); - // outputs - this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 2, 116, 35)); - // battery - this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 3, 56, 53)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 4, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 5, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 6, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 7, 152, 62)); + // input + this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 47, 17)); + this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 1, 65, 17)); + // outputs + this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 2, 116, 35)); + // battery + this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 3, 56, 53)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 4, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 5, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 6, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileAlloysmelter.inventory, 7, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java b/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java index 670c9dc24..8bc6c6e8a 100644 --- a/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java +++ b/src/main/java/techreborn/client/container/ContainerAssemblingMachine.java @@ -6,51 +6,54 @@ import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.TileAssemblingMachine; -public class ContainerAssemblingMachine extends ContainerCrafting { +public class ContainerAssemblingMachine extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileAssemblingMachine tile; + TileAssemblingMachine tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerAssemblingMachine(TileAssemblingMachine tileAssemblingMachine, - EntityPlayer player) { - super(tileAssemblingMachine.crafter); - tile = tileAssemblingMachine; - this.player = player; + public ContainerAssemblingMachine(TileAssemblingMachine tileAssemblingMachine, EntityPlayer player) + { + super(tileAssemblingMachine.crafter); + tile = tileAssemblingMachine; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 0, 47, 17)); - this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 1, 65, 17)); - // outputs - this.addSlotToContainer(new SlotOutput(tileAssemblingMachine.inventory, 2, 116, 35)); - // power - this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 3, 56, 53)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 4, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 5, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 6, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 7, 152, 62)); + // input + this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 0, 47, 17)); + this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 1, 65, 17)); + // outputs + this.addSlotToContainer(new SlotOutput(tileAssemblingMachine.inventory, 2, 116, 35)); + // power + this.addSlotToContainer(new Slot(tileAssemblingMachine.inventory, 3, 56, 53)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 4, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 5, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 6, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileAssemblingMachine.inventory, 7, 152, 62)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerBatbox.java b/src/main/java/techreborn/client/container/ContainerBatbox.java index 80b38d06b..1a7174473 100644 --- a/src/main/java/techreborn/client/container/ContainerBatbox.java +++ b/src/main/java/techreborn/client/container/ContainerBatbox.java @@ -3,82 +3,92 @@ package techreborn.client.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotFurnaceFuel; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.container.RebornContainer; -import techreborn.tiles.generator.TileGenerator; import techreborn.tiles.storage.TileBatBox; -public class ContainerBatbox extends RebornContainer { +public class ContainerBatbox extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileBatBox tile; + TileBatBox tile; - public int burnTime = 0; - public int totalBurnTime = 0; - public int energy; + public int burnTime = 0; + public int totalBurnTime = 0; + public int energy; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerBatbox(TileBatBox tile, EntityPlayer player) { - super(); - this.tile = tile; - this.player = player; + public ContainerBatbox(TileBatBox tile, EntityPlayer player) + { + super(); + this.tile = tile; + this.player = player; + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.energy != (int) tile.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.energy != (int) tile.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.burnTime = value; + } else if (id == 1) + { + this.totalBurnTime = value; + } else if (id == 2) + { + this.energy = value; + } + this.tile.setEnergy(energy); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.burnTime = value; - } else if (id == 1) { - this.totalBurnTime = value; - } else if (id == 2) { - this.energy = value; - } - this.tile.setEnergy(energy); - } - - public int getScaledBurnTime(int i) { - return (int) (((float) burnTime / (float) totalBurnTime) * i); - } + public int getScaledBurnTime(int i) + { + return (int) (((float) burnTime / (float) totalBurnTime) * i); + } } diff --git a/src/main/java/techreborn/client/container/ContainerBlastFurnace.java b/src/main/java/techreborn/client/container/ContainerBlastFurnace.java index 32f95c522..0752d39bc 100644 --- a/src/main/java/techreborn/client/container/ContainerBlastFurnace.java +++ b/src/main/java/techreborn/client/container/ContainerBlastFurnace.java @@ -6,71 +6,84 @@ import net.minecraft.inventory.Slot; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileBlastFurnace; -public class ContainerBlastFurnace extends ContainerCrafting { +public class ContainerBlastFurnace extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileBlastFurnace tile; + TileBlastFurnace tile; - public int heat; + public int heat; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, - EntityPlayer player) { - super(tileblastfurnace.crafter); - tile = tileblastfurnace; - this.player = player; + public ContainerBlastFurnace(TileBlastFurnace tileblastfurnace, EntityPlayer player) + { + super(tileblastfurnace.crafter); + tile = tileblastfurnace; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 40, 25));//Input 1 - this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 40, 43));//Input 2 - // outputs - this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));//Output 1 - this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));//Output 2 + // input + this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 40, 25));// Input + // 1 + this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 40, 43));// Input + // 2 + // outputs + this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 100, 35));// Output + // 1 + this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 118, 35));// Output + // 2 - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.heat != tile.getHeat()) { - icrafting.sendProgressBarUpdate(this, 10, tile.getHeat()); - } - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.heat != tile.getHeat()) + { + icrafting.sendProgressBarUpdate(this, 10, tile.getHeat()); + } + } + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 10, tile.getHeat()); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 10, tile.getHeat()); + } - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.heat = value; - } - super.updateProgressBar(id, value); - } + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.heat = value; + } + super.updateProgressBar(id, value); + } } diff --git a/src/main/java/techreborn/client/container/ContainerCentrifuge.java b/src/main/java/techreborn/client/container/ContainerCentrifuge.java index 589b71b25..52d773644 100644 --- a/src/main/java/techreborn/client/container/ContainerCentrifuge.java +++ b/src/main/java/techreborn/client/container/ContainerCentrifuge.java @@ -6,53 +6,57 @@ import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.TileCentrifuge; -public class ContainerCentrifuge extends ContainerCrafting { +public class ContainerCentrifuge extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileCentrifuge tile; + TileCentrifuge tile; - public int tickTime; + public int tickTime; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) { - super(tileCentrifuge.crafter); - tile = tileCentrifuge; - this.player = player; + public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) + { + super(tileCentrifuge.crafter); + tile = tileCentrifuge; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 0, 80, 35)); - this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 1, 50, 5)); - // outputs - this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 2, 80, 5)); - this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 3, 110, 35)); - this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 4, 80, 65)); - this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 5, 50, 35)); - // battery - this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 6, 8, 51)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 7, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 8, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 9, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 10, 152, 62)); + // input + this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 0, 80, 35)); + this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 1, 50, 5)); + // outputs + this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 2, 80, 5)); + this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 3, 110, 35)); + this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 4, 80, 65)); + this.addSlotToContainer(new SlotOutput(tileCentrifuge.inventory, 5, 50, 35)); + // battery + this.addSlotToContainer(new Slot(tileCentrifuge.inventory, 6, 8, 51)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 7, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 8, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 9, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileCentrifuge.inventory, 10, 152, 62)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerChargeBench.java b/src/main/java/techreborn/client/container/ContainerChargeBench.java index 931b1ab99..52e391d8c 100644 --- a/src/main/java/techreborn/client/container/ContainerChargeBench.java +++ b/src/main/java/techreborn/client/container/ContainerChargeBench.java @@ -5,41 +5,47 @@ import net.minecraft.inventory.Slot; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileChargeBench; -public class ContainerChargeBench extends RebornContainer { +public class ContainerChargeBench extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileChargeBench tile; + TileChargeBench tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) { - tile = tileChargeBench; - this.player = player; + public ContainerChargeBench(TileChargeBench tileChargeBench, EntityPlayer player) + { + tile = tileChargeBench; + this.player = player; - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 0, 62, 21)); - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 1, 80, 21)); - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 2, 98, 21)); - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 3, 62, 39)); - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 4, 80, 39)); - this.addSlotToContainer(new Slot(tileChargeBench.inventory, 5, 98, 39)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 0, 62, 21)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 1, 80, 21)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 2, 98, 21)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 3, 62, 39)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 4, 80, 39)); + this.addSlotToContainer(new Slot(tileChargeBench.inventory, 5, 98, 39)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerChemicalReactor.java b/src/main/java/techreborn/client/container/ContainerChemicalReactor.java index e61e44ded..05e6cb819 100644 --- a/src/main/java/techreborn/client/container/ContainerChemicalReactor.java +++ b/src/main/java/techreborn/client/container/ContainerChemicalReactor.java @@ -6,51 +6,54 @@ import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.TileChemicalReactor; -public class ContainerChemicalReactor extends ContainerCrafting { +public class ContainerChemicalReactor extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileChemicalReactor tile; + TileChemicalReactor tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, - EntityPlayer player) { - super(tilechemicalReactor.crafter); - tile = tilechemicalReactor; - this.player = player; + public ContainerChemicalReactor(TileChemicalReactor tilechemicalReactor, EntityPlayer player) + { + super(tilechemicalReactor.crafter); + tile = tilechemicalReactor; + this.player = player; - // input - this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 0, 70, 21)); - this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 1, 90, 21)); - // outputs - this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51)); - // battery - this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 3, 8, 51)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62)); + // input + this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 0, 70, 21)); + this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 1, 90, 21)); + // outputs + this.addSlotToContainer(new SlotOutput(tilechemicalReactor.inventory, 2, 80, 51)); + // battery + this.addSlotToContainer(new Slot(tilechemicalReactor.inventory, 3, 8, 51)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 4, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 5, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 6, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tilechemicalReactor.inventory, 7, 152, 62)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerChunkloader.java b/src/main/java/techreborn/client/container/ContainerChunkloader.java index de27e9aeb..3042f220b 100644 --- a/src/main/java/techreborn/client/container/ContainerChunkloader.java +++ b/src/main/java/techreborn/client/container/ContainerChunkloader.java @@ -5,33 +5,36 @@ import net.minecraft.inventory.Slot; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileChunkLoader; -public class ContainerChunkloader extends RebornContainer { +public class ContainerChunkloader extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; + public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) + { + this.player = player; - public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player) { - this.player = player; + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } + } - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerCompressor.java b/src/main/java/techreborn/client/container/ContainerCompressor.java index 427a85aa7..5fcee1e46 100644 --- a/src/main/java/techreborn/client/container/ContainerCompressor.java +++ b/src/main/java/techreborn/client/container/ContainerCompressor.java @@ -2,53 +2,54 @@ package techreborn.client.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.teir1.TileCompressor; -public class ContainerCompressor extends ContainerCrafting { +public class ContainerCompressor extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileCompressor tile; + TileCompressor tile; - public int connectionStatus; + public int connectionStatus; - public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) { - super(tileGrinder.crafter); - tile = tileGrinder; - this.player = player; + public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) + { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerCrafting.java b/src/main/java/techreborn/client/container/ContainerCrafting.java index 6eb909f3c..f4b54ed2f 100644 --- a/src/main/java/techreborn/client/container/ContainerCrafting.java +++ b/src/main/java/techreborn/client/container/ContainerCrafting.java @@ -6,58 +6,71 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.container.RebornContainer; import techreborn.api.recipe.RecipeCrafter; -public abstract class ContainerCrafting extends RebornContainer { +public abstract class ContainerCrafting extends RebornContainer +{ - RecipeCrafter crafter; + RecipeCrafter crafter; - int currentTickTime = 0; - int currentNeededTicks = 0; - int energy; + int currentTickTime = 0; + int currentNeededTicks = 0; + int energy; - public ContainerCrafting(RecipeCrafter crafter) { - this.crafter = crafter; - } + public ContainerCrafting(RecipeCrafter crafter) + { + this.crafter = crafter; + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) { - icrafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); - } - if (this.currentNeededTicks != crafter.currentNeededTicks) { - icrafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks); - } - if (this.energy != (int) crafter.energy.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy()); - } - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.currentTickTime != crafter.currentTickTime || crafter.currentTickTime == -1) + { + icrafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); + } + if (this.currentNeededTicks != crafter.currentNeededTicks) + { + icrafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks); + } + if (this.energy != (int) crafter.energy.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy()); + } + } + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); - crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks); - crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy()); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); + crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks); + crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy()); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.currentTickTime = value; - if(this.currentTickTime == -1){ - this.currentTickTime = 0; - } - } else if (id == 1) { - this.currentNeededTicks = value; - } else if (id == 2) { - this.energy = value; - } - this.crafter.currentTickTime = currentTickTime; - this.crafter.currentNeededTicks = currentNeededTicks; - this.crafter.energy.setEnergy(energy); - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.currentTickTime = value; + if (this.currentTickTime == -1) + { + this.currentTickTime = 0; + } + } else if (id == 1) + { + this.currentNeededTicks = value; + } else if (id == 2) + { + this.energy = value; + } + this.crafter.currentTickTime = currentTickTime; + this.crafter.currentNeededTicks = currentNeededTicks; + this.crafter.energy.setEnergy(energy); + } } diff --git a/src/main/java/techreborn/client/container/ContainerDestructoPack.java b/src/main/java/techreborn/client/container/ContainerDestructoPack.java index 093e4a8e0..cb0b5eb0d 100644 --- a/src/main/java/techreborn/client/container/ContainerDestructoPack.java +++ b/src/main/java/techreborn/client/container/ContainerDestructoPack.java @@ -8,37 +8,42 @@ import reborncore.common.container.RebornContainer; import reborncore.common.util.Inventory; import techreborn.init.ModItems; -public class ContainerDestructoPack extends RebornContainer { +public class ContainerDestructoPack extends RebornContainer +{ - private EntityPlayer player; - private Inventory inv; + private EntityPlayer player; + private Inventory inv; - public ContainerDestructoPack(EntityPlayer player) { - this.player = player; - inv = new Inventory(1, "destructopack", 64, null); - buildContainer(); - } + public ContainerDestructoPack(EntityPlayer player) + { + this.player = player; + inv = new Inventory(1, "destructopack", 64, null); + buildContainer(); + } - @Override - public boolean canInteractWith(EntityPlayer arg0) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer arg0) + { + return true; + } + private void buildContainer() + { + this.addSlotToContainer( + new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[] { new ItemStack(ModItems.parts, 1, 37) })); + int i; - private void buildContainer() { - this.addSlotToContainer(new SlotFilteredVoid(inv, 0, 80, 36, new ItemStack[]{new ItemStack(ModItems.parts, 1, 37)})); - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerDieselGenerator.java b/src/main/java/techreborn/client/container/ContainerDieselGenerator.java index 0cb22f098..333b39434 100644 --- a/src/main/java/techreborn/client/container/ContainerDieselGenerator.java +++ b/src/main/java/techreborn/client/container/ContainerDieselGenerator.java @@ -10,73 +10,81 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.generator.TileDieselGenerator; -public class ContainerDieselGenerator extends RebornContainer { - public TileDieselGenerator tiledieselGenerator; - public EntityPlayer player; - public int energy; - public int fluid; +public class ContainerDieselGenerator extends RebornContainer +{ + public TileDieselGenerator tiledieselGenerator; + public EntityPlayer player; + public int energy; + public int fluid; - public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, - EntityPlayer player) { - super(); - this.tiledieselGenerator = tiledieselGenerator; - this.player = player; + public ContainerDieselGenerator(TileDieselGenerator tiledieselGenerator, EntityPlayer player) + { + super(); + this.tiledieselGenerator = tiledieselGenerator; + this.player = player; - this.addSlotToContainer(new Slot(tiledieselGenerator.inventory, 0, 80, - 17)); - this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory, - 1, 80, 53)); - this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2, - 59, 42, false, false, 1)); + this.addSlotToContainer(new Slot(tiledieselGenerator.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tiledieselGenerator.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tiledieselGenerator.inventory, 2, 59, 42, false, false, 1)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.energy != (int) tiledieselGenerator.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy()); - } - if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) { - icrafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount()); - } - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.energy != (int) tiledieselGenerator.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy()); + } + if (this.fluid != tiledieselGenerator.tank.getFluidAmount()) + { + icrafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount()); + } + } + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy()); - crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount()); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy()); + crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount()); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.energy = value; - } else if (id == 1) { - this.fluid = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.energy = value; + } else if (id == 1) + { + this.fluid = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerDigitalChest.java b/src/main/java/techreborn/client/container/ContainerDigitalChest.java index 80425ba0b..06991e675 100644 --- a/src/main/java/techreborn/client/container/ContainerDigitalChest.java +++ b/src/main/java/techreborn/client/container/ContainerDigitalChest.java @@ -7,40 +7,41 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileDigitalChest; -public class ContainerDigitalChest extends RebornContainer { - public TileDigitalChest tileDigitalChest; - public EntityPlayer player; +public class ContainerDigitalChest extends RebornContainer +{ + public TileDigitalChest tileDigitalChest; + public EntityPlayer player; - public ContainerDigitalChest(TileDigitalChest tileDigitalChest, - EntityPlayer player) { - super(); - this.tileDigitalChest = tileDigitalChest; - this.player = player; + public ContainerDigitalChest(TileDigitalChest tileDigitalChest, EntityPlayer player) + { + super(); + this.tileDigitalChest = tileDigitalChest; + this.player = player; - this.addSlotToContainer(new Slot(tileDigitalChest.inventory, 0, 80, 17)); - this.addSlotToContainer(new SlotOutput(tileDigitalChest.inventory, 1, - 80, 53)); - this.addSlotToContainer(new SlotFake(tileDigitalChest.inventory, 2, 59, - 42, false, false, Integer.MAX_VALUE)); + this.addSlotToContainer(new Slot(tileDigitalChest.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileDigitalChest.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileDigitalChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/client/container/ContainerElectricFurnace.java b/src/main/java/techreborn/client/container/ContainerElectricFurnace.java index 5508b8d33..9f0ed2d20 100644 --- a/src/main/java/techreborn/client/container/ContainerElectricFurnace.java +++ b/src/main/java/techreborn/client/container/ContainerElectricFurnace.java @@ -9,56 +9,61 @@ import reborncore.common.container.RebornContainer; import techreborn.api.SlotUpgrade; import techreborn.tiles.teir1.TileElectricFurnace; -public class ContainerElectricFurnace extends RebornContainer { +public class ContainerElectricFurnace extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileElectricFurnace tile; + TileElectricFurnace tile; - public int connectionStatus; + public int connectionStatus; - public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) { - super(); - tile = tileGrinder; - this.player = player; + public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) + { + super(); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.connectionStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.connectionStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerExtractor.java b/src/main/java/techreborn/client/container/ContainerExtractor.java index 7d0d16440..6e181fa8c 100644 --- a/src/main/java/techreborn/client/container/ContainerExtractor.java +++ b/src/main/java/techreborn/client/container/ContainerExtractor.java @@ -1,82 +1,82 @@ package techreborn.client.container; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.teir1.TileExtractor; -public class ContainerExtractor extends ContainerCrafting { +public class ContainerExtractor extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileExtractor tile; - - public int connectionStatus; + TileExtractor tile; - public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player) { - super(tileGrinder.crafter); - tile = tileGrinder; - this.player = player; + public int connectionStatus; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player) + { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - -// @Override -// public void onCraftGuiOpened(ICrafting crafting) { -// super.onCraftGuiOpened(crafting); -// crafting.sendProgressBarUpdate(this, 0, (int) tile.getProgressScaled(0)); -// crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); -// } -// -// @SideOnly(Side.CLIENT) -// @Override -// public void updateProgressBar(int id, int value) { -// if (id == 0) { -// this.progress = value; -// } -// else if (id == 2) { -// this.energy = value; -// } -// this.tile.setEnergy(energy); -// } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } -// @SideOnly(Side.CLIENT) -// @Override -// public void updateProgressBar(int id, int value) { -// if (id == 10) { -// this.connectionStatus = value; -// } -// } + // @Override + // public void onCraftGuiOpened(ICrafting crafting) { + // super.onCraftGuiOpened(crafting); + // crafting.sendProgressBarUpdate(this, 0, (int) tile.getProgressScaled(0)); + // crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + // } + // + // @SideOnly(Side.CLIENT) + // @Override + // public void updateProgressBar(int id, int value) { + // if (id == 0) { + // this.progress = value; + // } + // else if (id == 2) { + // this.energy = value; + // } + // this.tile.setEnergy(energy); + // } + + // @SideOnly(Side.CLIENT) + // @Override + // public void updateProgressBar(int id, int value) { + // if (id == 10) { + // this.connectionStatus = value; + // } + // } } diff --git a/src/main/java/techreborn/client/container/ContainerFusionReactor.java b/src/main/java/techreborn/client/container/ContainerFusionReactor.java index 82285eca3..8d9181db5 100644 --- a/src/main/java/techreborn/client/container/ContainerFusionReactor.java +++ b/src/main/java/techreborn/client/container/ContainerFusionReactor.java @@ -9,106 +9,127 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.fusionReactor.TileEntityFusionController; +public class ContainerFusionReactor extends RebornContainer +{ -public class ContainerFusionReactor extends RebornContainer { + public int coilStatus; + public int energy; + public int tickTime; + public int finalTickTime; + public int neededEU; - public int coilStatus; - public int energy; - public int tickTime; - public int finalTickTime; - public int neededEU; + TileEntityFusionController fusionController; - TileEntityFusionController fusionController; + public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, EntityPlayer player) + { + super(); + this.fusionController = tileEntityFusionController; - public ContainerFusionReactor(TileEntityFusionController tileEntityFusionController, - EntityPlayer player) { - super(); - this.fusionController = tileEntityFusionController; + addSlotToContainer(new Slot(tileEntityFusionController, 0, 88, 17)); + addSlotToContainer(new Slot(tileEntityFusionController, 1, 88, 53)); + addSlotToContainer(new SlotOutput(tileEntityFusionController, 2, 148, 35)); - addSlotToContainer(new Slot(tileEntityFusionController, 0, 88, 17)); - addSlotToContainer(new Slot(tileEntityFusionController, 1, 88, 53)); - addSlotToContainer(new SlotOutput(tileEntityFusionController, 2, 148, 35)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } + } - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.coilStatus != fusionController.coilStatus) + { + icrafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); + } + if (this.energy != (int) fusionController.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); + } + if (this.tickTime != fusionController.crafingTickTime) + { + icrafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); + } + if (this.finalTickTime != fusionController.finalTickTime) + { + icrafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime); + } + if (this.neededEU != fusionController.neededPower) + { + icrafting.sendProgressBarUpdate(this, 4, fusionController.neededPower); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.coilStatus != fusionController.coilStatus) { - icrafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); - } - if (this.energy != (int) fusionController.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); - } - if (this.tickTime != fusionController.crafingTickTime) { - icrafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); - } - if (this.finalTickTime != fusionController.finalTickTime) { - icrafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime); - } - if (this.neededEU != fusionController.neededPower) { - icrafting.sendProgressBarUpdate(this, 4, fusionController.neededPower); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); + crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); + crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); + crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime); + crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); - crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); - crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); - crafting.sendProgressBarUpdate(this, 3, fusionController.finalTickTime); - crafting.sendProgressBarUpdate(this, 4, fusionController.neededPower); - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.coilStatus = value; + } else if (id == 1) + { + this.energy = value; + } else if (id == 2) + { + this.tickTime = value; + } else if (id == 3) + { + this.finalTickTime = value; + } else if (id == 4) + { + this.neededEU = value; + } + if (tickTime == -1) + { + tickTime = 0; + } + if (finalTickTime == -1) + { + finalTickTime = 0; + } + if (neededEU == -1) + { + neededEU = 0; + } + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.coilStatus = value; - } else if (id == 1) { - this.energy = value; - } else if(id == 2){ - this.tickTime = value; - } else if(id == 3){ - this.finalTickTime = value; - } else if(id == 4){ - this.neededEU = value; - } - if(tickTime == -1){ - tickTime = 0; - } - if(finalTickTime == -1){ - finalTickTime = 0; - } - if(neededEU == -1){ - neededEU = 0; - } - } - - public int getProgressScaled(){ - return Math.max(0, Math.min(24, (this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime))); - } + public int getProgressScaled() + { + return Math.max(0, Math.min(24, + (this.tickTime > 0 ? 1 : 0) + this.tickTime * 24 / (this.finalTickTime < 1 ? 1 : this.finalTickTime))); + } } diff --git a/src/main/java/techreborn/client/container/ContainerGasTurbine.java b/src/main/java/techreborn/client/container/ContainerGasTurbine.java index 363ba56b0..bbc13b26d 100644 --- a/src/main/java/techreborn/client/container/ContainerGasTurbine.java +++ b/src/main/java/techreborn/client/container/ContainerGasTurbine.java @@ -7,40 +7,40 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.generator.TileGasTurbine; -public class ContainerGasTurbine extends RebornContainer { - public TileGasTurbine tileGasTurbine; - public EntityPlayer player; +public class ContainerGasTurbine extends RebornContainer +{ + public TileGasTurbine tileGasTurbine; + public EntityPlayer player; - public ContainerGasTurbine(TileGasTurbine tileGasTurbine, - EntityPlayer player) { - super(); - this.tileGasTurbine = tileGasTurbine; - this.player = player; + public ContainerGasTurbine(TileGasTurbine tileGasTurbine, EntityPlayer player) + { + super(); + this.tileGasTurbine = tileGasTurbine; + this.player = player; - this.addSlotToContainer(new Slot(tileGasTurbine.inventory, 0, 80, - 17)); - this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory, - 1, 80, 53)); - this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2, - 59, 42, false, false, 1)); + this.addSlotToContainer(new Slot(tileGasTurbine.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileGasTurbine.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileGasTurbine.inventory, 2, 59, 42, false, false, 1)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerGenerator.java b/src/main/java/techreborn/client/container/ContainerGenerator.java index b54ff51d3..acd1fcc07 100644 --- a/src/main/java/techreborn/client/container/ContainerGenerator.java +++ b/src/main/java/techreborn/client/container/ContainerGenerator.java @@ -9,89 +9,103 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.container.RebornContainer; import techreborn.tiles.generator.TileGenerator; -public class ContainerGenerator extends RebornContainer { +public class ContainerGenerator extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileGenerator tile; + TileGenerator tile; - public int burnTime = 0; - public int totalBurnTime = 0; - public int energy; + public int burnTime = 0; + public int totalBurnTime = 0; + public int energy; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerGenerator(TileGenerator tile, EntityPlayer player) { - super(); - this.tile = tile; - this.player = player; + public ContainerGenerator(TileGenerator tile, EntityPlayer player) + { + super(); + this.tile = tile; + this.player = player; - // fuel - this.addSlotToContainer(new Slot(tile.inventory, 0, 80, 53)); - // charge - this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 1, 80, 17)); + // fuel + this.addSlotToContainer(new Slot(tile.inventory, 0, 80, 53)); + // charge + this.addSlotToContainer(new SlotFurnaceFuel(tile.inventory, 1, 80, 17)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.burnTime != tile.burnTime) + { + icrafting.sendProgressBarUpdate(this, 0, tile.burnTime); + } + if (this.totalBurnTime != tile.totalBurnTime) + { + icrafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime); + } + if (this.energy != (int) tile.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.burnTime != tile.burnTime) { - icrafting.sendProgressBarUpdate(this, 0, tile.burnTime); - } - if (this.totalBurnTime != tile.totalBurnTime) { - icrafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime); - } - if (this.energy != (int) tile.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, tile.burnTime); + crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime); + crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, tile.burnTime); - crafting.sendProgressBarUpdate(this, 1, tile.totalBurnTime); - crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.burnTime = value; + } else if (id == 1) + { + this.totalBurnTime = value; + } else if (id == 2) + { + this.energy = value; + } + this.tile.setEnergy(energy); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.burnTime = value; - } else if (id == 1) { - this.totalBurnTime = value; - } else if (id == 2) { - this.energy = value; - } - this.tile.setEnergy(energy); - } - - public int getScaledBurnTime(int i) { - return (int) (((float) burnTime / (float) totalBurnTime) * i); - } + public int getScaledBurnTime(int i) + { + return (int) (((float) burnTime / (float) totalBurnTime) * i); + } } diff --git a/src/main/java/techreborn/client/container/ContainerGrinder.java b/src/main/java/techreborn/client/container/ContainerGrinder.java index 773ac0f60..c0c539a7f 100644 --- a/src/main/java/techreborn/client/container/ContainerGrinder.java +++ b/src/main/java/techreborn/client/container/ContainerGrinder.java @@ -2,53 +2,54 @@ package techreborn.client.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Slot; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.api.SlotUpgrade; import techreborn.tiles.teir1.TileGrinder; -public class ContainerGrinder extends ContainerCrafting { +public class ContainerGrinder extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileGrinder tile; + TileGrinder tile; - public int connectionStatus; + public int connectionStatus; - public ContainerGrinder(TileGrinder tileGrinder, EntityPlayer player) { - super(tileGrinder.crafter); - tile = tileGrinder; - this.player = player; + public ContainerGrinder(TileGrinder tileGrinder, EntityPlayer player) + { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerIDSU.java b/src/main/java/techreborn/client/container/ContainerIDSU.java index 5bc326a57..d57045654 100644 --- a/src/main/java/techreborn/client/container/ContainerIDSU.java +++ b/src/main/java/techreborn/client/container/ContainerIDSU.java @@ -8,80 +8,93 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.common.container.RebornContainer; import techreborn.tiles.idsu.TileIDSU; +public class ContainerIDSU extends RebornContainer +{ -public class ContainerIDSU extends RebornContainer { + EntityPlayer player; - EntityPlayer player; + TileIDSU tile; - TileIDSU tile; + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + public int euOut; + public int storedEu; + public int euChange; + public int channel; - public int euOut; - public int storedEu; - public int euChange; - public int channel; + public ContainerIDSU(TileIDSU tileIDSU, EntityPlayer player) + { + tile = tileIDSU; + this.player = player; - public ContainerIDSU(TileIDSU tileIDSU, - EntityPlayer player) { - tile = tileIDSU; - this.player = player; + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.euOut != tile.output) + { + icrafting.sendProgressBarUpdate(this, 0, tile.output); + } + if (this.storedEu != (int) tile.getEnergy()) + { + icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); + } + if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) + { + icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.euOut != tile.output) { - icrafting.sendProgressBarUpdate(this, 0, tile.output); - } - if (this.storedEu != (int) tile.getEnergy()) { - icrafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); - } - if (this.euChange != tile.getEuChange() && tile.getEuChange() != -1) { - icrafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, tile.output); + crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); + crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, tile.output); - crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); - crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.euOut = value; - } else if (id == 1) { - this.storedEu = value; - } else if (id == 2) { - this.euChange = value; - } else if (id == 3) { - this.channel = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.euOut = value; + } else if (id == 1) + { + this.storedEu = value; + } else if (id == 2) + { + this.euChange = value; + } else if (id == 3) + { + this.channel = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerImplosionCompressor.java b/src/main/java/techreborn/client/container/ContainerImplosionCompressor.java index c0d12d13c..c1aaa19dc 100644 --- a/src/main/java/techreborn/client/container/ContainerImplosionCompressor.java +++ b/src/main/java/techreborn/client/container/ContainerImplosionCompressor.java @@ -8,77 +8,85 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileImplosionCompressor; -public class ContainerImplosionCompressor extends ContainerCrafting { +public class ContainerImplosionCompressor extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileImplosionCompressor tile; + TileImplosionCompressor tile; - public int tickTime; - public int multIBlockState = 0; + public int tickTime; + public int multIBlockState = 0; - public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, - EntityPlayer player) { - super(tilecompressor.crafter); - tile = tilecompressor; - this.player = player; + public ContainerImplosionCompressor(TileImplosionCompressor tilecompressor, EntityPlayer player) + { + super(tilecompressor.crafter); + tile = tilecompressor; + this.player = player; - // input - this.addSlotToContainer(new Slot(tilecompressor.inventory, 0, 37, 26)); - this.addSlotToContainer(new Slot(tilecompressor.inventory, 1, 37, 44)); - // outputs - this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35)); - this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 35)); + // input + this.addSlotToContainer(new Slot(tilecompressor.inventory, 0, 37, 26)); + this.addSlotToContainer(new Slot(tilecompressor.inventory, 1, 37, 44)); + // outputs + this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 2, 93, 35)); + this.addSlotToContainer(new SlotOutput(tilecompressor.inventory, 3, 111, 35)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.multIBlockState != getMultIBlockStateint()) + { + icrafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint()); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.multIBlockState != getMultIBlockStateint()) { - icrafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint()); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint()); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 3, getMultIBlockStateint()); - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 3) { - this.multIBlockState = value; - } - } - - public int getMultIBlockStateint(){ - return tile.getMutliBlock() ? 1 : 0; - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 3) + { + this.multIBlockState = value; + } + } + public int getMultIBlockStateint() + { + return tile.getMutliBlock() ? 1 : 0; + } } diff --git a/src/main/java/techreborn/client/container/ContainerIndustrialElectrolyzer.java b/src/main/java/techreborn/client/container/ContainerIndustrialElectrolyzer.java index 79f2f7343..4bfdae45d 100644 --- a/src/main/java/techreborn/client/container/ContainerIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/client/container/ContainerIndustrialElectrolyzer.java @@ -5,48 +5,52 @@ import net.minecraft.inventory.Slot; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileIndustrialElectrolyzer; -public class ContainerIndustrialElectrolyzer extends ContainerCrafting { +public class ContainerIndustrialElectrolyzer extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileIndustrialElectrolyzer tile; + TileIndustrialElectrolyzer tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) { - super(electrolyzer.crafter); - tile = electrolyzer; - this.player = player; + public ContainerIndustrialElectrolyzer(TileIndustrialElectrolyzer electrolyzer, EntityPlayer player) + { + super(electrolyzer.crafter); + tile = electrolyzer; + this.player = player; - // input - this.addSlotToContainer(new Slot(electrolyzer.inventory, 0, 80, 51)); - this.addSlotToContainer(new Slot(electrolyzer.inventory, 1, 50, 51)); - // outputs - this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 2, 50, 19)); - this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 3, 70, 19)); - this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 4, 90, 19)); - this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 5, 110, 19)); - - // battery - this.addSlotToContainer(new Slot(electrolyzer.inventory, 6, 18, 51)); + // input + this.addSlotToContainer(new Slot(electrolyzer.inventory, 0, 80, 51)); + this.addSlotToContainer(new Slot(electrolyzer.inventory, 1, 50, 51)); + // outputs + this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 2, 50, 19)); + this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 3, 70, 19)); + this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 4, 90, 19)); + this.addSlotToContainer(new SlotOutput(electrolyzer.inventory, 5, 110, 19)); - int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + // battery + this.addSlotToContainer(new Slot(electrolyzer.inventory, 6, 18, 51)); - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerIndustrialGrinder.java b/src/main/java/techreborn/client/container/ContainerIndustrialGrinder.java index 543736871..593367390 100644 --- a/src/main/java/techreborn/client/container/ContainerIndustrialGrinder.java +++ b/src/main/java/techreborn/client/container/ContainerIndustrialGrinder.java @@ -8,74 +8,82 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileIndustrialGrinder; -public class ContainerIndustrialGrinder extends ContainerCrafting { +public class ContainerIndustrialGrinder extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileIndustrialGrinder tile; + TileIndustrialGrinder tile; - public int connectionStatus; + public int connectionStatus; - public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, - EntityPlayer player) { - super(tileGrinder.crafter); - tile = tileGrinder; - this.player = player; + public ContainerIndustrialGrinder(TileIndustrialGrinder tileGrinder, EntityPlayer player) + { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 32, 26)); - this.addSlotToContainer(new Slot(tileGrinder.inventory, 1, 32, 44)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 32, 26)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 1, 32, 44)); + // outputs + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35)); - // outputs - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 2, 77, 35)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 3, 95, 35)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 4, 113, 35)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 5, 131, 35)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.connectionStatus != tile.connectionStatus) + { + icrafting.sendProgressBarUpdate(this, 10, tile.connectionStatus); + } + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.connectionStatus != tile.connectionStatus) { - icrafting.sendProgressBarUpdate(this, 10, tile.connectionStatus); - } - } - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 10, tile.connectionStatus); + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 10, tile.connectionStatus); - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.connectionStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.connectionStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerIndustrialSawmill.java b/src/main/java/techreborn/client/container/ContainerIndustrialSawmill.java index 3fd31a3c4..6979ca6c2 100644 --- a/src/main/java/techreborn/client/container/ContainerIndustrialSawmill.java +++ b/src/main/java/techreborn/client/container/ContainerIndustrialSawmill.java @@ -5,47 +5,49 @@ import net.minecraft.inventory.Slot; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileIndustrialSawmill; -public class ContainerIndustrialSawmill extends ContainerCrafting { +public class ContainerIndustrialSawmill extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileIndustrialSawmill tile; + TileIndustrialSawmill tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; + public int tickTime; - public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, - EntityPlayer player) { - super(tileIndustrialSawmill.crafter); - tile = tileIndustrialSawmill; - this.player = player; + public ContainerIndustrialSawmill(TileIndustrialSawmill tileIndustrialSawmill, EntityPlayer player) + { + super(tileIndustrialSawmill.crafter); + tile = tileIndustrialSawmill; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 0, 32, 26)); - this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 1, 32, 44)); - // outputs - this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35)); - this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35)); - this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35)); + // input + this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 0, 32, 26)); + this.addSlotToContainer(new Slot(tileIndustrialSawmill.inventory, 1, 32, 44)); + // outputs + this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 2, 84, 35)); + this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 3, 102, 35)); + this.addSlotToContainer(new SlotOutput(tileIndustrialSawmill.inventory, 4, 120, 35)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerIronFurnace.java b/src/main/java/techreborn/client/container/ContainerIronFurnace.java index 199a64e41..3a7b931f7 100644 --- a/src/main/java/techreborn/client/container/ContainerIronFurnace.java +++ b/src/main/java/techreborn/client/container/ContainerIronFurnace.java @@ -9,50 +9,56 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileIronFurnace; -public class ContainerIronFurnace extends RebornContainer { +public class ContainerIronFurnace extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileIronFurnace tile; + TileIronFurnace tile; - public int connectionStatus; + public int connectionStatus; - public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) { - super(); - tile = tileGrinder; - this.player = player; + public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) + { + super(); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 17)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); - //Fuel - this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 17)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // Fuel + this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.connectionStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.connectionStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerMatterFabricator.java b/src/main/java/techreborn/client/container/ContainerMatterFabricator.java index 8786ed4b7..8e9e65042 100644 --- a/src/main/java/techreborn/client/container/ContainerMatterFabricator.java +++ b/src/main/java/techreborn/client/container/ContainerMatterFabricator.java @@ -9,81 +9,91 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileMatterFabricator; -public class ContainerMatterFabricator extends RebornContainer { +public class ContainerMatterFabricator extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileMatterFabricator tile; + TileMatterFabricator tile; - public int progressTime; + public int progressTime; - public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, - EntityPlayer player) { - tile = tileMatterfab; - this.player = player; + public ContainerMatterFabricator(TileMatterFabricator tileMatterfab, EntityPlayer player) + { + tile = tileMatterfab; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 0, 33, 17)); - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 1, 33, 35)); - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 2, 33, 53)); - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 3, 51, 17)); - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 4, 51, 35)); - this.addSlotToContainer(new Slot(tileMatterfab.inventory, 5, 51, 53)); + // input + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 0, 33, 17)); + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 1, 33, 35)); + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 2, 33, 53)); + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 3, 51, 17)); + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 4, 51, 35)); + this.addSlotToContainer(new Slot(tileMatterfab.inventory, 5, 51, 53)); - // outputs - this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6, - 116, 35)); + // outputs + this.addSlotToContainer(new SlotOutput(tileMatterfab.inventory, 6, 116, 35)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.progressTime != tile.progresstime) { - icrafting.sendProgressBarUpdate(this, 0, tile.progresstime); - } - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.progressTime != tile.progresstime) + { + icrafting.sendProgressBarUpdate(this, 0, tile.progresstime); + } + } + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, tile.progresstime); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, tile.progresstime); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 0) { - this.progressTime = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 0) + { + this.progressTime = value; + } + } - public int getProgressScaled(int scale) { - if (progressTime != 0) { - return progressTime * scale / tile.maxProgresstime(); - } - return 0; - } + public int getProgressScaled(int scale) + { + if (progressTime != 0) + { + return progressTime * scale / tile.maxProgresstime(); + } + return 0; + } } diff --git a/src/main/java/techreborn/client/container/ContainerPda.java b/src/main/java/techreborn/client/container/ContainerPda.java index f5c62ef52..525acaa37 100644 --- a/src/main/java/techreborn/client/container/ContainerPda.java +++ b/src/main/java/techreborn/client/container/ContainerPda.java @@ -3,17 +3,20 @@ package techreborn.client.container; import net.minecraft.entity.player.EntityPlayer; import reborncore.common.container.RebornContainer; -public class ContainerPda extends RebornContainer { +public class ContainerPda extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - public ContainerPda(EntityPlayer player) { + public ContainerPda(EntityPlayer player) + { - } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerQuantumChest.java b/src/main/java/techreborn/client/container/ContainerQuantumChest.java index 9aa2798be..a3a2d4759 100644 --- a/src/main/java/techreborn/client/container/ContainerQuantumChest.java +++ b/src/main/java/techreborn/client/container/ContainerQuantumChest.java @@ -7,40 +7,41 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileQuantumChest; -public class ContainerQuantumChest extends RebornContainer { - public TileQuantumChest tileQuantumChest; - public EntityPlayer player; +public class ContainerQuantumChest extends RebornContainer +{ + public TileQuantumChest tileQuantumChest; + public EntityPlayer player; - public ContainerQuantumChest(TileQuantumChest tileQuantumChest, - EntityPlayer player) { - super(); - this.tileQuantumChest = tileQuantumChest; - this.player = player; + public ContainerQuantumChest(TileQuantumChest tileQuantumChest, EntityPlayer player) + { + super(); + this.tileQuantumChest = tileQuantumChest; + this.player = player; - this.addSlotToContainer(new Slot(tileQuantumChest.inventory, 0, 80, 17)); - this.addSlotToContainer(new SlotOutput(tileQuantumChest.inventory, 1, - 80, 53)); - this.addSlotToContainer(new SlotFake(tileQuantumChest.inventory, 2, 59, - 42, false, false, Integer.MAX_VALUE)); + this.addSlotToContainer(new Slot(tileQuantumChest.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileQuantumChest.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileQuantumChest.inventory, 2, 59, 42, false, false, Integer.MAX_VALUE)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerQuantumTank.java b/src/main/java/techreborn/client/container/ContainerQuantumTank.java index 497df43a2..78f9e667f 100644 --- a/src/main/java/techreborn/client/container/ContainerQuantumTank.java +++ b/src/main/java/techreborn/client/container/ContainerQuantumTank.java @@ -8,39 +8,40 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.TileQuantumTank; -public class ContainerQuantumTank extends RebornContainer { - public TileQuantumTank tileQuantumTank; - public EntityPlayer player; +public class ContainerQuantumTank extends RebornContainer +{ + public TileQuantumTank tileQuantumTank; + public EntityPlayer player; - public ContainerQuantumTank(TileQuantumTank tileQuantumTank, - EntityPlayer player) { - super(); - this.tileQuantumTank = tileQuantumTank; - this.player = player; + public ContainerQuantumTank(TileQuantumTank tileQuantumTank, EntityPlayer player) + { + super(); + this.tileQuantumTank = tileQuantumTank; + this.player = player; - this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17)); - this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1, - 80, 53)); - this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59, - 42, false, false, 1)); + this.addSlotToContainer(new SlotFluid(tileQuantumTank.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileQuantumTank.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileQuantumTank.inventory, 2, 59, 42, false, false, 1)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerRecycler.java b/src/main/java/techreborn/client/container/ContainerRecycler.java index 437c0ef4e..db2ff3299 100644 --- a/src/main/java/techreborn/client/container/ContainerRecycler.java +++ b/src/main/java/techreborn/client/container/ContainerRecycler.java @@ -9,55 +9,60 @@ import reborncore.common.container.RebornContainer; import techreborn.api.SlotUpgrade; import techreborn.tiles.teir1.TileRecycler; -public class ContainerRecycler extends RebornContainer { +public class ContainerRecycler extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileRecycler tile; + TileRecycler tile; - public int connectionStatus; + public int connectionStatus; - public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) { - super(); - tile = tileGrinder; - this.player = player; + public ContainerRecycler(TileRecycler tileGrinder, EntityPlayer player) + { + super(); + tile = tileGrinder; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileGrinder.inventory, 5, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.connectionStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.connectionStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerRollingMachine.java b/src/main/java/techreborn/client/container/ContainerRollingMachine.java index 2876a969c..1b4b22c2c 100644 --- a/src/main/java/techreborn/client/container/ContainerRollingMachine.java +++ b/src/main/java/techreborn/client/container/ContainerRollingMachine.java @@ -10,107 +10,125 @@ import reborncore.common.container.RebornContainer; import techreborn.api.RollingMachineRecipe; import techreborn.tiles.TileRollingMachine; -public class ContainerRollingMachine extends RebornContainer { +public class ContainerRollingMachine extends RebornContainer +{ - EntityPlayer player; - TileRollingMachine tile; + EntityPlayer player; + TileRollingMachine tile; - public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) { - tile = tileRollingmachine; - this.player = player; + public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player) + { + tile = tileRollingmachine; + this.player = player; - for (int l = 0; l < 3; l++) { - for (int k1 = 0; k1 < 3; k1++) { - this.addSlotToContainer(new Slot( - tileRollingmachine.craftMatrix, k1 + l * 3, - 30 + k1 * 18, 17 + l * 18)); - } - } + for (int l = 0; l < 3; l++) + { + for (int k1 = 0; k1 < 3; k1++) + { + this.addSlotToContainer( + new Slot(tileRollingmachine.craftMatrix, k1 + l * 3, 30 + k1 * 18, 17 + l * 18)); + } + } - // output - this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 0, 124, 35)); - // battery - this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 8, 51)); + // output + this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 0, 124, 35)); + // battery + this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 8, 51)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - @Override - public final void onCraftMatrixChanged(IInventory inv) { - ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe( - tile.craftMatrix, tile.getWorld()); - tile.inventory.setInventorySlotContents(1, output); - } + @Override + public final void onCraftMatrixChanged(IInventory inv) + { + ItemStack output = RollingMachineRecipe.instance.findMatchingRecipe(tile.craftMatrix, tile.getWorld()); + tile.inventory.setInventorySlotContents(1, output); + } - int currentItemBurnTime; - int burnTime; - int energy; + int currentItemBurnTime; + int burnTime; + int energy; - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 0, tile.runTime); - crafting.sendProgressBarUpdate(this, 1, tile.tickTime); - crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 0, tile.runTime); + crafting.sendProgressBarUpdate(this, 1, tile.tickTime); + crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } - @Override - public void detectAndSendChanges() { - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting crafting = (ICrafting) this.crafters.get(i); - if (this.currentItemBurnTime != tile.runTime) { - crafting.sendProgressBarUpdate(this, 0, tile.runTime); - } - if (this.burnTime != tile.tickTime || tile.tickTime == -1) { - crafting.sendProgressBarUpdate(this, 1, tile.tickTime); - } - if (this.energy != (int) tile.getEnergy()) { - crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); - } - } - super.detectAndSendChanges(); - } + @Override + public void detectAndSendChanges() + { + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting crafting = (ICrafting) this.crafters.get(i); + if (this.currentItemBurnTime != tile.runTime) + { + crafting.sendProgressBarUpdate(this, 0, tile.runTime); + } + if (this.burnTime != tile.tickTime || tile.tickTime == -1) + { + crafting.sendProgressBarUpdate(this, 1, tile.tickTime); + } + if (this.energy != (int) tile.getEnergy()) + { + crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); + } + } + super.detectAndSendChanges(); + } - @Override - public void updateProgressBar(int id, int value) { - super.updateProgressBar(id, value); - if (id == 0) { - this.currentItemBurnTime = value; - } else if (id == 1) { - this.burnTime = value; - } else if (id == 2) { - this.energy = value; - } - this.tile.runTime = this.currentItemBurnTime; - if(this.burnTime == -1){ - this.burnTime = 0; - } - this.tile.tickTime = this.burnTime; - this.tile.setEnergy(this.energy); - } + @Override + public void updateProgressBar(int id, int value) + { + super.updateProgressBar(id, value); + if (id == 0) + { + this.currentItemBurnTime = value; + } else if (id == 1) + { + this.burnTime = value; + } else if (id == 2) + { + this.energy = value; + } + this.tile.runTime = this.currentItemBurnTime; + if (this.burnTime == -1) + { + this.burnTime = 0; + } + this.tile.tickTime = this.burnTime; + this.tile.setEnergy(this.energy); + } - public int getBurnTimeRemainingScaled(int scale) { - if (burnTime == 0 || this.currentItemBurnTime == 0) { - return 0; - } - return this.burnTime * scale / this.currentItemBurnTime; - } + public int getBurnTimeRemainingScaled(int scale) + { + if (burnTime == 0 || this.currentItemBurnTime == 0) + { + return 0; + } + return this.burnTime * scale / this.currentItemBurnTime; + } } diff --git a/src/main/java/techreborn/client/container/ContainerScrapboxinator.java b/src/main/java/techreborn/client/container/ContainerScrapboxinator.java index 13c6f76ca..61f5e4b57 100644 --- a/src/main/java/techreborn/client/container/ContainerScrapboxinator.java +++ b/src/main/java/techreborn/client/container/ContainerScrapboxinator.java @@ -9,55 +9,60 @@ import reborncore.common.container.RebornContainer; import techreborn.api.SlotUpgrade; import techreborn.tiles.TileScrapboxinator; -public class ContainerScrapboxinator extends RebornContainer { +public class ContainerScrapboxinator extends RebornContainer +{ - EntityPlayer player; + EntityPlayer player; - TileScrapboxinator tile; + TileScrapboxinator tile; - public int connectionStatus; + public int connectionStatus; - public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) { - super(); - tile = tileScrapboxinator; - this.player = player; + public ContainerScrapboxinator(TileScrapboxinator tileScrapboxinator, EntityPlayer player) + { + super(); + tile = tileScrapboxinator; + this.player = player; - // input - this.addSlotToContainer(new SlotScrapbox(tileScrapboxinator.inventory, 0, 56, 34)); - this.addSlotToContainer(new SlotOutput(tileScrapboxinator.inventory, 1, 116, 34)); + // input + this.addSlotToContainer(new SlotScrapbox(tileScrapboxinator.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileScrapboxinator.inventory, 1, 116, 34)); + // upgrades + this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 2, 152, 8)); + this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 3, 152, 26)); + this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 4, 152, 44)); + this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 5, 152, 62)); - // upgrades - this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 2, 152, 8)); - this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 3, 152, 26)); - this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 4, 152, 44)); - this.addSlotToContainer(new SlotUpgrade(tileScrapboxinator.inventory, 5, 152, 62)); + int i; - int i; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } - - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - if (id == 10) { - this.connectionStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + if (id == 10) + { + this.connectionStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/ContainerSemifluidGenerator.java b/src/main/java/techreborn/client/container/ContainerSemifluidGenerator.java index 89fa81c5f..301d01530 100644 --- a/src/main/java/techreborn/client/container/ContainerSemifluidGenerator.java +++ b/src/main/java/techreborn/client/container/ContainerSemifluidGenerator.java @@ -7,40 +7,40 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.generator.TileSemifluidGenerator; -public class ContainerSemifluidGenerator extends RebornContainer { - public TileSemifluidGenerator tileSemifluidGenerator; - public EntityPlayer player; +public class ContainerSemifluidGenerator extends RebornContainer +{ + public TileSemifluidGenerator tileSemifluidGenerator; + public EntityPlayer player; - public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, - EntityPlayer player) { - super(); - this.tileSemifluidGenerator = tileSemifluidGenerator; - this.player = player; + public ContainerSemifluidGenerator(TileSemifluidGenerator tileSemifluidGenerator, EntityPlayer player) + { + super(); + this.tileSemifluidGenerator = tileSemifluidGenerator; + this.player = player; - this.addSlotToContainer(new Slot(tileSemifluidGenerator.inventory, 0, 80, - 17)); - this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory, - 1, 80, 53)); - this.addSlotToContainer(new SlotFake(tileSemifluidGenerator.inventory, 2, - 59, 42, false, false, 1)); + this.addSlotToContainer(new Slot(tileSemifluidGenerator.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileSemifluidGenerator.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileSemifluidGenerator.inventory, 2, 59, 42, false, false, 1)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerThermalGenerator.java b/src/main/java/techreborn/client/container/ContainerThermalGenerator.java index 0f35d2213..0fe9e0bb9 100644 --- a/src/main/java/techreborn/client/container/ContainerThermalGenerator.java +++ b/src/main/java/techreborn/client/container/ContainerThermalGenerator.java @@ -8,40 +8,40 @@ import reborncore.client.gui.SlotOutput; import reborncore.common.container.RebornContainer; import techreborn.tiles.generator.TileThermalGenerator; -public class ContainerThermalGenerator extends RebornContainer { - public TileThermalGenerator tileThermalGenerator; - public EntityPlayer player; +public class ContainerThermalGenerator extends RebornContainer +{ + public TileThermalGenerator tileThermalGenerator; + public EntityPlayer player; - public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, - EntityPlayer player) { - super(); - this.tileThermalGenerator = tileThermalGenerator; - this.player = player; + public ContainerThermalGenerator(TileThermalGenerator tileThermalGenerator, EntityPlayer player) + { + super(); + this.tileThermalGenerator = tileThermalGenerator; + this.player = player; - this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80, - 17)); - this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory, - 1, 80, 53)); - this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2, - 59, 42, false, false, 1)); + this.addSlotToContainer(new SlotFluid(tileThermalGenerator.inventory, 0, 80, 17)); + this.addSlotToContainer(new SlotOutput(tileThermalGenerator.inventory, 1, 80, 53)); + this.addSlotToContainer(new SlotFake(tileThermalGenerator.inventory, 2, 59, 42, false, false, 1)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } } diff --git a/src/main/java/techreborn/client/container/ContainerVacuumFreezer.java b/src/main/java/techreborn/client/container/ContainerVacuumFreezer.java index f085e7b94..d32446259 100644 --- a/src/main/java/techreborn/client/container/ContainerVacuumFreezer.java +++ b/src/main/java/techreborn/client/container/ContainerVacuumFreezer.java @@ -8,70 +8,79 @@ import net.minecraftforge.fml.relauncher.SideOnly; import reborncore.client.gui.SlotOutput; import techreborn.tiles.TileVacuumFreezer; -public class ContainerVacuumFreezer extends ContainerCrafting { +public class ContainerVacuumFreezer extends ContainerCrafting +{ - EntityPlayer player; + EntityPlayer player; - TileVacuumFreezer tile; + TileVacuumFreezer tile; - @Override - public boolean canInteractWith(EntityPlayer player) { - return true; - } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } - public int tickTime; - public int machineStatus; + public int tickTime; + public int machineStatus; - public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, - EntityPlayer player) { - super(tileAlloysmelter.crafter); - tile = tileAlloysmelter; - this.player = player; + public ContainerVacuumFreezer(TileVacuumFreezer tileAlloysmelter, EntityPlayer player) + { + super(tileAlloysmelter.crafter); + tile = tileAlloysmelter; + this.player = player; - // input - this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 56, 34)); - // outputs - this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35)); + // input + this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 56, 34)); + // outputs + this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 1, 116, 35)); - int i; + int i; - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(player.inventory, j + i * 9 - + 9, 8 + j * 18, 84 + i * 18)); - } - } + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, - 142)); - } - } + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); + } + } - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); i++) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - if (this.machineStatus != tile.multiBlockStatus) { - icrafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus); - } - } - } + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for (int i = 0; i < this.crafters.size(); i++) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + if (this.machineStatus != tile.multiBlockStatus) + { + icrafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus); + } + } + } - @Override - public void onCraftGuiOpened(ICrafting crafting) { - super.onCraftGuiOpened(crafting); - crafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus); - } + @Override + public void onCraftGuiOpened(ICrafting crafting) + { + super.onCraftGuiOpened(crafting); + crafting.sendProgressBarUpdate(this, 3, tile.multiBlockStatus); + } - @SideOnly(Side.CLIENT) - @Override - public void updateProgressBar(int id, int value) { - super.updateProgressBar(id, value); - if (id == 3) { - machineStatus = value; - } - } + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) + { + super.updateProgressBar(id, value); + if (id == 3) + { + machineStatus = value; + } + } } diff --git a/src/main/java/techreborn/client/container/SlotScrapbox.java b/src/main/java/techreborn/client/container/SlotScrapbox.java index 04b0bfd69..82882b9a4 100644 --- a/src/main/java/techreborn/client/container/SlotScrapbox.java +++ b/src/main/java/techreborn/client/container/SlotScrapbox.java @@ -5,20 +5,25 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import techreborn.init.ModItems; -public class SlotScrapbox extends Slot { +public class SlotScrapbox extends Slot +{ - public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) { - super(par1iInventory, par2, par3, par4); - } + public SlotScrapbox(IInventory par1iInventory, int par2, int par3, int par4) + { + super(par1iInventory, par2, par3, par4); + } - public boolean isItemValid(ItemStack par1ItemStack) { - if(par1ItemStack.getItem()==ModItems.scrapBox){ - return true; - } - return false; - } + public boolean isItemValid(ItemStack par1ItemStack) + { + if (par1ItemStack.getItem() == ModItems.scrapBox) + { + return true; + } + return false; + } - public int getSlotStackLimit() { - return 64; - } + public int getSlotStackLimit() + { + return 64; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/client/gui/GuiAesu.java b/src/main/java/techreborn/client/gui/GuiAesu.java index b23d64d4d..7dd0c79ed 100644 --- a/src/main/java/techreborn/client/gui/GuiAesu.java +++ b/src/main/java/techreborn/client/gui/GuiAesu.java @@ -1,5 +1,8 @@ package techreborn.client.gui; +import java.awt.*; +import java.io.IOException; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; @@ -12,54 +15,61 @@ import techreborn.client.container.ContainerAesu; import techreborn.packets.PacketAesu; import techreborn.tiles.TileAesu; -import java.awt.*; -import java.io.IOException; +public class GuiAesu extends GuiContainer +{ -public class GuiAesu extends GuiContainer { + private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png"); + TileAesu aesu; + ContainerAesu containerAesu; - private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png"); - TileAesu aesu; - ContainerAesu containerAesu; + public GuiAesu(EntityPlayer player, TileAesu tileaesu) + { + super(new ContainerAesu(tileaesu, player)); + this.xSize = 176; + this.ySize = 197; + aesu = tileaesu; + this.containerAesu = (ContainerAesu) this.inventorySlots; + } - public GuiAesu(EntityPlayer player, TileAesu tileaesu) { - super(new ContainerAesu(tileaesu, player)); - this.xSize = 176; - this.ySize = 197; - aesu = tileaesu; - this.containerAesu = (ContainerAesu) this.inventorySlots; - } + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.buttonList.add(new GuiButton(0, k + 117, l + 20, 15, 15, "++")); + this.buttonList.add(new GuiButton(1, k + 117, l + 20 + 20, 15, 15, "+")); + this.buttonList.add(new GuiButton(2, k + 117, l + 20 + (20 * 2), 15, 15, "-")); + this.buttonList.add(new GuiButton(3, k + 117, l + 20 + (20 * 3), 15, 15, "--")); + } - @Override - public void initGui() { - super.initGui(); - this.buttonList.clear(); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.buttonList.add(new GuiButton(0, k + 117, l + 20, 15, 15, "++")); - this.buttonList.add(new GuiButton(1, k + 117, l + 20 + 20, 15, 15, "+")); - this.buttonList.add(new GuiButton(2, k + 117, l + 20 + (20 * 2), 15, 15, "-")); - this.buttonList.add(new GuiButton(3, k + 117, l + 20 + (20 * 3), 15, 15, "--")); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40, + Color.WHITE.getRGB()); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.aesu.name"), 40, 10, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.storedEu) + " ", 10, 30, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerAesu.euChange) + " change", 10, 40, Color.WHITE.getRGB()); - } - - @Override - protected void actionPerformed(GuiButton button) throws IOException { - super.actionPerformed(button); - PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu)); - } + @Override + protected void actionPerformed(GuiButton button) throws IOException + { + super.actionPerformed(button); + PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu)); + } } diff --git a/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java b/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java index 23c105d8f..07ac3f977 100644 --- a/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java @@ -8,56 +8,58 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerAlloyFurnace; import techreborn.tiles.TileAlloyFurnace; -public class GuiAlloyFurnace extends GuiContainer { +public class GuiAlloyFurnace extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/alloy_furnace.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/alloy_furnace.png"); - TileAlloyFurnace alloyfurnace; + TileAlloyFurnace alloyfurnace; - ContainerAlloyFurnace containerAlloyFurnace; + ContainerAlloyFurnace containerAlloyFurnace; - public GuiAlloyFurnace(EntityPlayer player, - TileAlloyFurnace tileAlloyFurnace) { - super(new ContainerAlloyFurnace(tileAlloyFurnace, player)); - this.xSize = 176; - this.ySize = 167; - this.alloyfurnace = tileAlloyFurnace; - this.containerAlloyFurnace = (ContainerAlloyFurnace) this.inventorySlots; - } + public GuiAlloyFurnace(EntityPlayer player, TileAlloyFurnace tileAlloyFurnace) + { + super(new ContainerAlloyFurnace(tileAlloyFurnace, player)); + this.xSize = 176; + this.ySize = 167; + this.alloyfurnace = tileAlloyFurnace; + this.containerAlloyFurnace = (ContainerAlloyFurnace) this.inventorySlots; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - if (this.alloyfurnace.isBurning()) { - int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13); - this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); - i1 = this.alloyfurnace.getCookProgressScaled(24); - this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); - } - } + if (this.alloyfurnace.isBurning()) + { + int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); + i1 = this.alloyfurnace.getCookProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + } + } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.alloyfurnace.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - - } + } } diff --git a/src/main/java/techreborn/client/gui/GuiAlloySmelter.java b/src/main/java/techreborn/client/gui/GuiAlloySmelter.java index b6a6feb7f..9889fba1c 100644 --- a/src/main/java/techreborn/client/gui/GuiAlloySmelter.java +++ b/src/main/java/techreborn/client/gui/GuiAlloySmelter.java @@ -8,50 +8,60 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerAlloySmelter; import techreborn.tiles.TileAlloySmelter; -public class GuiAlloySmelter extends GuiContainer { +public class GuiAlloySmelter extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/electric_alloy_furnace.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/electric_alloy_furnace.png"); - TileAlloySmelter alloysmelter; + TileAlloySmelter alloysmelter; - public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) { - super(new ContainerAlloySmelter(tilealloysmelter, player)); - this.xSize = 176; - this.ySize = 167; - alloysmelter = tilealloysmelter; - } + public GuiAlloySmelter(EntityPlayer player, TileAlloySmelter tilealloysmelter) + { + super(new ContainerAlloySmelter(tilealloysmelter, player)); + this.xSize = 176; + this.ySize = 167; + alloysmelter = tilealloysmelter; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = alloysmelter.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16); - } + j = alloysmelter.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16); + } - j = alloysmelter.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = alloysmelter.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.alloysmelter.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java index e0e7ab450..7b6db4ceb 100644 --- a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java @@ -8,52 +8,62 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerAssemblingMachine; import techreborn.tiles.TileAssemblingMachine; -public class GuiAssemblingMachine extends GuiContainer { +public class GuiAssemblingMachine extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/assembling_machine.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/assembling_machine.png"); - TileAssemblingMachine assemblingmachine; - ContainerAssemblingMachine containerAssemblingMachine; + TileAssemblingMachine assemblingmachine; + ContainerAssemblingMachine containerAssemblingMachine; - public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) { - super(new ContainerAssemblingMachine(tileassemblinmachine, player)); - containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots; - this.xSize = 176; - this.ySize = 167; - assemblingmachine = tileassemblinmachine; - } + public GuiAssemblingMachine(EntityPlayer player, TileAssemblingMachine tileassemblinmachine) + { + super(new ContainerAssemblingMachine(tileassemblinmachine, player)); + containerAssemblingMachine = (ContainerAssemblingMachine) this.inventorySlots; + this.xSize = 176; + this.ySize = 167; + assemblingmachine = tileassemblinmachine; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = assemblingmachine.getProgressScaled(20); - if (j > 0) { - this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16); - } + j = assemblingmachine.getProgressScaled(20); + if (j > 0) + { + this.drawTexturedModalRect(k + 86, l + 34, 176, 14, j + 1, 16); + } - j = assemblingmachine.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = assemblingmachine.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 56, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.assemblinmachine.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiBatbox.java b/src/main/java/techreborn/client/gui/GuiBatbox.java index 4fdcd6dbb..04cc28e71 100644 --- a/src/main/java/techreborn/client/gui/GuiBatbox.java +++ b/src/main/java/techreborn/client/gui/GuiBatbox.java @@ -6,60 +6,69 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.translation.I18n; import reborncore.common.powerSystem.PowerSystem; import techreborn.client.container.ContainerBatbox; -import techreborn.client.container.ContainerGenerator; -import techreborn.tiles.generator.TileGenerator; import techreborn.tiles.storage.TileBatBox; -public class GuiBatbox extends GuiContainer { +public class GuiBatbox extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/batbox.png"); - TileBatBox generator; + TileBatBox generator; - ContainerBatbox containerGenerator; + ContainerBatbox containerGenerator; - public GuiBatbox(EntityPlayer player, TileBatBox generator) { - super(new ContainerBatbox(generator, player)); - this.xSize = 176; - this.ySize = 167; - this.generator = generator; - this.containerGenerator = (ContainerBatbox) this.inventorySlots; - } + public GuiBatbox(EntityPlayer player, TileBatBox generator) + { + super(new ContainerBatbox(generator, player)); + this.xSize = 176; + this.ySize = 167; + this.generator = generator; + this.containerGenerator = (ContainerBatbox) this.inventorySlots; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = generator.getEnergyScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); - } -// -// if (containerGenerator.burnTime != 0) -// { -// j = containerGenerator.getScaledBurnTime(13); -// this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1); -// } - } + j = generator.getEnergyScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); + } + // + // if (containerGenerator.burnTime != 0) + // { + // j = containerGenerator.getScaledBurnTime(13); + // this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, + // j + 1); + // } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.batbox.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.batbox.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize- 140, 4210752); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752); - } + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(generator.getMaxPower()), 25, this.ySize - 140, + 4210752); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150, + 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index 17af1866b..694079e3d 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -1,5 +1,7 @@ package techreborn.client.gui; +import java.io.IOException; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; @@ -17,84 +19,103 @@ import techreborn.init.ModBlocks; import techreborn.proxies.ClientProxy; import techreborn.tiles.TileBlastFurnace; -import java.io.IOException; +public class GuiBlastFurnace extends GuiContainer +{ + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_blast_furnace.png"); -public class GuiBlastFurnace extends GuiContainer { + TileBlastFurnace blastfurnace; - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_blast_furnace.png"); + ContainerBlastFurnace containerBlastFurnace; - TileBlastFurnace blastfurnace; - - ContainerBlastFurnace containerBlastFurnace; - - public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) { - super(new ContainerBlastFurnace(tileblastfurnace, player)); - this.xSize = 176; - this.ySize = 167; - blastfurnace = tileblastfurnace; - this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots; - } - - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, ""); - buttonList.add(button); - super.initGui(); - CoordTriplet coordinates = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2)); - if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0){ - ClientProxy.multiblockRenderEvent.setMultiblock(null); - button.displayString = "B"; - } else { - button.displayString = "A"; - } - } - - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - - if (containerBlastFurnace.heat == 0) { - GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); - this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); - } - - int j = 0; - this.mc.getTextureManager().bindTexture(texture); - j = blastfurnace.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16); - } - - j = blastfurnace.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - - } - - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_); - String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - if (containerBlastFurnace.heat != 0) { - this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752); - } - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + public GuiBlastFurnace(EntityPlayer player, TileBlastFurnace tileblastfurnace) + { + super(new ContainerBlastFurnace(tileblastfurnace, player)); + this.xSize = 176; + this.ySize = 167; + blastfurnace = tileblastfurnace; + this.containerBlastFurnace = (ContainerBlastFurnace) this.inventorySlots; + } @Override - public void actionPerformed(GuiButton button) throws IOException { + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, ""); + buttonList.add(button); + super.initGui(); + CoordTriplet coordinates = new CoordTriplet( + blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), + blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() + - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2)); + if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0) + { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } else + { + button.displayString = "A"; + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (containerBlastFurnace.heat == 0) + { + GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); + this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, + l + 52 + 12 - 0, -1); + } + + int j = 0; + this.mc.getTextureManager().bindTexture(texture); + j = blastfurnace.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 64, l + 37, 176, 14, j + 1, 16); + } + + j = blastfurnace.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 9, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + super.drawGuiContainerForegroundLayer(p_146979_1_, p_146979_2_); + String name = I18n.translateToLocal("tile.techreborn.blastfurnace.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + if (containerBlastFurnace.heat != 0) + { + this.fontRendererObj.drawString("Current Heat: " + containerBlastFurnace.heat, 40, 60, 4210752); + } + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } + + @Override + public void actionPerformed(GuiButton button) throws IOException + { super.actionPerformed(button); - if(button.id == 212){ - if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ - {//This code here makes a basic multiblock and then sets to the selected one. + if (button.id == 212) + { + if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) + { + {// This code here makes a basic multiblock and then sets to the + // selected one. Multiblock multiblock = new Multiblock(); multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0); @@ -105,7 +126,7 @@ public class GuiBlastFurnace extends GuiContainer { multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0); - + multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0); multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0); multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0); @@ -114,7 +135,7 @@ public class GuiBlastFurnace extends GuiContainer { multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0); - + multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0); multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0); multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0); @@ -133,14 +154,20 @@ public class GuiBlastFurnace extends GuiContainer { multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0); multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0); - + MultiblockSet set = new MultiblockSet(multiblock); ClientProxy.multiblockRenderEvent.setMultiblock(set); - ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(), blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld()); - ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2)); + ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(), + blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld()); + ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet( + blastfurnace.getPos().getX() + - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetX() * 2), + blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() + - (EnumFacing.getFront(blastfurnace.getFacingInt()).getFrontOffsetZ() * 2)); } button.displayString = "A"; - } else { + } else + { ClientProxy.multiblockRenderEvent.setMultiblock(null); button.displayString = "B"; } diff --git a/src/main/java/techreborn/client/gui/GuiCentrifuge.java b/src/main/java/techreborn/client/gui/GuiCentrifuge.java index 11f84130e..19f7f1cad 100644 --- a/src/main/java/techreborn/client/gui/GuiCentrifuge.java +++ b/src/main/java/techreborn/client/gui/GuiCentrifuge.java @@ -8,57 +8,66 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerCentrifuge; import techreborn.tiles.TileCentrifuge; -public class GuiCentrifuge extends GuiContainer { +public class GuiCentrifuge extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_centrifuge.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_centrifuge.png"); - TileCentrifuge centrifuge; + TileCentrifuge centrifuge; - public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) { - super(new ContainerCentrifuge(tileCentrifuge, player)); - this.xSize = 176; - this.ySize = 167; - centrifuge = tileCentrifuge; - } + public GuiCentrifuge(EntityPlayer player, TileCentrifuge tileCentrifuge) + { + super(new ContainerCentrifuge(tileCentrifuge, player)); + this.xSize = 176; + this.ySize = 167; + centrifuge = tileCentrifuge; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = centrifuge.getProgressScaled(11); - if (j > 0) { - this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j); - this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10); - this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j); - this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10); - } + j = centrifuge.getProgressScaled(11); + if (j > 0) + { + this.drawTexturedModalRect(k + 83, l + 23 + 10 - j, 177, 15 + 10 - j, 10, j); + this.drawTexturedModalRect(k + 98, l + 38, 177, 51, j, 10); + this.drawTexturedModalRect(k + 83, l + 53, 177, 39, 10, j); + this.drawTexturedModalRect(k + 68 + 10 - j, l + 38, 177 + 10 - j, 27, j, 10); + } - j = centrifuge.getEnergyScaled(12); + j = centrifuge.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + if (j > 0) + { + this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name"); - String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", ""); - this.fontRendererObj.drawString(namePt1, 98, 6, 4210752); - this.fontRendererObj.drawString(namePt2, 98, 14, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String namePt1 = I18n.translateToLocal("tile.techreborn.industrialBlock.name"); + String namePt2 = I18n.translateToLocal("tile.techreborn.centrifuge.name").replace(namePt1 + " ", ""); + this.fontRendererObj.drawString(namePt1, 98, 6, 4210752); + this.fontRendererObj.drawString(namePt2, 98, 14, 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiChargeBench.java b/src/main/java/techreborn/client/gui/GuiChargeBench.java index 471459415..022d60435 100644 --- a/src/main/java/techreborn/client/gui/GuiChargeBench.java +++ b/src/main/java/techreborn/client/gui/GuiChargeBench.java @@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerChargeBench; import techreborn.tiles.TileChargeBench; -public class GuiChargeBench extends GuiContainer { +public class GuiChargeBench extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chargebench.png"); - TileChargeBench chargebench; + TileChargeBench chargebench; - public GuiChargeBench(EntityPlayer player, TileChargeBench tile) { - super(new ContainerChargeBench(tile, player)); - this.xSize = 176; - this.ySize = 167; - chargebench = tile; - } + public GuiChargeBench(EntityPlayer player, TileChargeBench tile) + { + super(new ContainerChargeBench(tile, player)); + this.xSize = 176; + this.ySize = 167; + chargebench = tile; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = chargebench.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = chargebench.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 10, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.chargebench.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.chargebench.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java index 6e35ce35a..19e1f3740 100644 --- a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java +++ b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java @@ -8,53 +8,63 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerChemicalReactor; import techreborn.tiles.TileChemicalReactor; -public class GuiChemicalReactor extends GuiContainer { +public class GuiChemicalReactor extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/chemical_reactor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/chemical_reactor.png"); - TileChemicalReactor chemicalReactor; - ContainerChemicalReactor containerChemicalReactor; + TileChemicalReactor chemicalReactor; + ContainerChemicalReactor containerChemicalReactor; - public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) { - super(new ContainerChemicalReactor(tilechemicalReactor, player)); - containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots; - this.xSize = 176; - this.ySize = 167; - chemicalReactor = tilechemicalReactor; - } + public GuiChemicalReactor(EntityPlayer player, TileChemicalReactor tilechemicalReactor) + { + super(new ContainerChemicalReactor(tilechemicalReactor, player)); + containerChemicalReactor = (ContainerChemicalReactor) this.inventorySlots; + this.xSize = 176; + this.ySize = 167; + chemicalReactor = tilechemicalReactor; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = chemicalReactor.getProgressScaled(11); - if (j > 0) { - this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j); - } + j = chemicalReactor.getProgressScaled(11); + if (j > 0) + { + this.drawTexturedModalRect(k + 73, l + 39, 177, 15, 30, j); + } - j = chemicalReactor.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); - } + j = chemicalReactor.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 9, l + 32 + 12 - j, 176, 12 - j, 14, j + 2); + } - } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.chemicalreactor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiChunkLoader.java b/src/main/java/techreborn/client/gui/GuiChunkLoader.java index f05920c65..b18d58b22 100644 --- a/src/main/java/techreborn/client/gui/GuiChunkLoader.java +++ b/src/main/java/techreborn/client/gui/GuiChunkLoader.java @@ -9,59 +9,62 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerChunkloader; import techreborn.tiles.TileChunkLoader; -public class GuiChunkLoader extends GuiContainer { +public class GuiChunkLoader extends GuiContainer +{ - private GuiButton plusOneButton; - private GuiButton plusTenButton; - private GuiButton minusOneButton; - private GuiButton minusTenButton; + private GuiButton plusOneButton; + private GuiButton plusTenButton; + private GuiButton minusOneButton; + private GuiButton minusTenButton; - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/industrial_chunkloader.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_chunkloader.png"); - TileChunkLoader chunkloader; + TileChunkLoader chunkloader; - public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) { - super(new ContainerChunkloader(tilechunkloader, player)); - this.xSize = 176; - this.ySize = 167; - chunkloader = tilechunkloader; - } + public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader) + { + super(new ContainerChunkloader(tilechunkloader, player)); + this.xSize = 176; + this.ySize = 167; + chunkloader = tilechunkloader; + } - @Override - public void initGui() { - super.initGui(); - this.guiLeft = this.width / 2 - this.xSize / 2; - this.guiTop = this.height / 2 - this.ySize / 2; - plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1"); - plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10"); + @Override + public void initGui() + { + super.initGui(); + this.guiLeft = this.width / 2 - this.xSize / 2; + this.guiTop = this.height / 2 - this.ySize / 2; + plusOneButton = new GuiButton(0, guiLeft + 5, guiTop + 37, 40, 20, "+1"); + plusTenButton = new GuiButton(0, guiLeft + 45, guiTop + 37, 40, 20, "+10"); - minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1"); - minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10"); + minusOneButton = new GuiButton(0, guiLeft + 90, guiTop + 37, 40, 20, "-1"); + minusTenButton = new GuiButton(0, guiLeft + 130, guiTop + 37, 40, 20, "-10"); - buttonList.add(plusOneButton); - buttonList.add(plusTenButton); - buttonList.add(minusOneButton); - buttonList.add(minusTenButton); - } + buttonList.add(plusOneButton); + buttonList.add(plusTenButton); + buttonList.add(minusOneButton); + buttonList.add(minusTenButton); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.chunkloader.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.chunkloader.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiCompressor.java b/src/main/java/techreborn/client/gui/GuiCompressor.java index 385c1bac3..9a3c41382 100644 --- a/src/main/java/techreborn/client/gui/GuiCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiCompressor.java @@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerCompressor; import techreborn.tiles.teir1.TileCompressor; -public class GuiCompressor extends GuiContainer { +public class GuiCompressor extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); - TileCompressor compressor; - ContainerCompressor containerGrinder; + TileCompressor compressor; + ContainerCompressor containerGrinder; - public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) { - super(new ContainerCompressor(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - compressor = tilegrinder; - containerGrinder = (ContainerCompressor) this.inventorySlots; - } + public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) + { + super(new ContainerCompressor(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + compressor = tilegrinder; + containerGrinder = (ContainerCompressor) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = compressor.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); - } + j = compressor.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); + } - j = compressor.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = compressor.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.compressor.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.compressor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiDestructoPack.java b/src/main/java/techreborn/client/gui/GuiDestructoPack.java index a11b4ec5f..b3ef36381 100644 --- a/src/main/java/techreborn/client/gui/GuiDestructoPack.java +++ b/src/main/java/techreborn/client/gui/GuiDestructoPack.java @@ -7,30 +7,34 @@ import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.translation.I18n; -public class GuiDestructoPack extends GuiContainer { +public class GuiDestructoPack extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/destructopack.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/destructopack.png"); - public GuiDestructoPack(Container container) { - super(container); - this.xSize = 176; - this.ySize = 166; - } + public GuiDestructoPack(Container container) + { + super(container); + this.xSize = 176; + this.ySize = 166; + } - @Override - protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166); - } + @Override + protected void drawGuiContainerBackgroundLayer(float arg0, int arg1, int arg2) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, 176, 166); + } - @Override - protected void drawGuiContainerForegroundLayer(int arg0, int arg1) { - String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name"); - fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, - this.ySize - 96 + 2, 4210752); - super.drawGuiContainerForegroundLayer(arg0, arg1); - } + @Override + protected void drawGuiContainerForegroundLayer(int arg0, int arg1) + { + String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name"); + fontRendererObj.drawString(name, xSize / 2 - fontRendererObj.getStringWidth(name) / 2, 5, 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, + 4210752); + super.drawGuiContainerForegroundLayer(arg0, arg1); + } } diff --git a/src/main/java/techreborn/client/gui/GuiElectricFurnace.java b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java index 11b549a2b..27a600140 100644 --- a/src/main/java/techreborn/client/gui/GuiElectricFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java @@ -8,46 +8,54 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerElectricFurnace; import techreborn.tiles.teir1.TileElectricFurnace; -public class GuiElectricFurnace extends GuiContainer { +public class GuiElectricFurnace extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); - TileElectricFurnace furnace; - ContainerElectricFurnace containerGrinder; + TileElectricFurnace furnace; + ContainerElectricFurnace containerGrinder; - public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) { - super(new ContainerElectricFurnace(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - furnace = tilegrinder; - containerGrinder = (ContainerElectricFurnace) this.inventorySlots; - } + public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) + { + super(new ContainerElectricFurnace(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + furnace = tilegrinder; + containerGrinder = (ContainerElectricFurnace) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = furnace.gaugeProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16); - } + j = furnace.gaugeProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 34, 176, 14, j + 1, 16); + } - j = furnace.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = furnace.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.electricfurnace.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiExtractor.java b/src/main/java/techreborn/client/gui/GuiExtractor.java index da9031c0f..1fab87035 100644 --- a/src/main/java/techreborn/client/gui/GuiExtractor.java +++ b/src/main/java/techreborn/client/gui/GuiExtractor.java @@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerExtractor; import techreborn.tiles.teir1.TileExtractor; -public class GuiExtractor extends GuiContainer { +public class GuiExtractor extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); - TileExtractor extractor; - ContainerExtractor containerGrinder; + TileExtractor extractor; + ContainerExtractor containerGrinder; - public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder) { - super(new ContainerExtractor(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - extractor = tilegrinder; - containerGrinder = (ContainerExtractor) this.inventorySlots; - } + public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder) + { + super(new ContainerExtractor(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + extractor = tilegrinder; + containerGrinder = (ContainerExtractor) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = extractor.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); - } + j = extractor.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); + } - j = extractor.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = extractor.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.extractor.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.extractor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index fdc42c902..f4da4e551 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -1,5 +1,7 @@ package techreborn.client.gui; +import java.io.IOException; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; @@ -10,88 +12,110 @@ import reborncore.common.powerSystem.PowerSystem; import techreborn.client.container.ContainerFusionReactor; import techreborn.tiles.fusionReactor.TileEntityFusionController; -import java.io.IOException; +public class GuiFusionReactor extends GuiContainer +{ + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/fusion_reactor.png"); -public class GuiFusionReactor extends GuiContainer { + ContainerFusionReactor containerFusionReactor; + TileEntityFusionController fusionController; - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/fusion_reactor.png"); + public GuiFusionReactor(EntityPlayer player, TileEntityFusionController tileaesu) + { + super(new ContainerFusionReactor(tileaesu, player)); + containerFusionReactor = (ContainerFusionReactor) this.inventorySlots; + this.fusionController = tileaesu; + } - ContainerFusionReactor containerFusionReactor; - TileEntityFusionController fusionController; + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); + this.fontRendererObj.drawString(name, 87, 6, 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); - public GuiFusionReactor(EntityPlayer player, - TileEntityFusionController tileaesu) { - super(new ContainerFusionReactor(tileaesu, player)); - containerFusionReactor = (ContainerFusionReactor) this.inventorySlots; - this.fusionController = tileaesu; - } + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255); + this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, + 16448255); + if (containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1) + this.fontRendererObj.drawString( + "Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, + 24, 16448255); - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); - this.fontRendererObj.drawString(name, 87, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerFusionReactor.energy), 11, 8, 16448255); - this.fontRendererObj.drawString("Coils: " + (containerFusionReactor.coilStatus == 1 ? "Yes" : "No"), 11, 16, 16448255); - if(containerFusionReactor.neededEU > 1 && containerFusionReactor.tickTime < 1) - this.fontRendererObj.drawString("Start: " + percentage(containerFusionReactor.neededEU, containerFusionReactor.energy) + "%", 11, 24, 16448255); + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + // GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, + // 20, ""); + // buttonList.add(button); + super.initGui(); + // CoordTriplet coordinates = new + // CoordTriplet(fusionController.getPos().getX() - + // (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX() + // * 2), fusionController.getPos().getY() - 1, + // fusionController.getPos().getZ() - + // (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ() + // * 2)); + // if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ + // ClientProxy.multiblockRenderEvent.setMultiblock(null); + // button.displayString = "B"; + // } else { + // button.displayString = "A"; + // } + } - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - //GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, ""); - //buttonList.add(button); - super.initGui(); - // CoordTriplet coordinates = new CoordTriplet(fusionController.getPos().getX() - (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetX() * 2), fusionController.getPos().getY() - 1, fusionController.getPos().getZ() - (EnumFacing.getFront(fusionController.getFacingInt()).getFrontOffsetZ() * 2)); -// if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ -// ClientProxy.multiblockRenderEvent.setMultiblock(null); -// button.displayString = "B"; -// } else { -// button.displayString = "A"; -// } - } + drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14); - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + // progressBar + drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16); - drawTexturedModalRect(k + 88, l + 36, 176, 0, 14, 14); + } - //progressBar - drawTexturedModalRect(k + 111, l + 34, 176, 14, containerFusionReactor.getProgressScaled(), 16); + public int percentage(int MaxValue, int CurrentValue) + { + if (CurrentValue == 0) + return 0; + return (int) ((CurrentValue * 100.0f) / MaxValue); + } - } - - public int percentage(int MaxValue, int CurrentValue) { - if (CurrentValue == 0) - return 0; - return (int) ((CurrentValue * 100.0f) / MaxValue); - } - - @Override - public void actionPerformed(GuiButton button) throws IOException { - super.actionPerformed(button); -// if(button.id == 212){ -// if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ -// {//This code here makes a basic multiblock and then sets to the selected one. -// MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); -// ClientProxy.multiblockRenderEvent.setMultiblock(set); -// ClientProxy.multiblockRenderEvent.partent = new Location(fusionController.getPos().getX(), fusionController.getPos().getY(), fusionController.getPos().getZ(), fusionController.getWorld()); -// ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(fusionController.getPos().getX() , fusionController.getPos().getY() -1 , fusionController.getPos().getZ()); -// } -// button.displayString = "A"; -// } else { -// ClientProxy.multiblockRenderEvent.setMultiblock(null); -// button.displayString = "B"; -// } -// } - } + @Override + public void actionPerformed(GuiButton button) throws IOException + { + super.actionPerformed(button); + // if(button.id == 212){ + // if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ + // {//This code here makes a basic multiblock and then sets to the + // selected one. + // MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); + // ClientProxy.multiblockRenderEvent.setMultiblock(set); + // ClientProxy.multiblockRenderEvent.partent = new + // Location(fusionController.getPos().getX(), + // fusionController.getPos().getY(), fusionController.getPos().getZ(), + // fusionController.getWorld()); + // ClientProxy.multiblockRenderEvent.anchor = new + // CoordTriplet(fusionController.getPos().getX() , + // fusionController.getPos().getY() -1 , + // fusionController.getPos().getZ()); + // } + // button.displayString = "A"; + // } else { + // ClientProxy.multiblockRenderEvent.setMultiblock(null); + // button.displayString = "B"; + // } + // } + } } diff --git a/src/main/java/techreborn/client/gui/GuiGasTurbine.java b/src/main/java/techreborn/client/gui/GuiGasTurbine.java index 4538407bd..f4f156546 100644 --- a/src/main/java/techreborn/client/gui/GuiGasTurbine.java +++ b/src/main/java/techreborn/client/gui/GuiGasTurbine.java @@ -8,39 +8,41 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerGasTurbine; import techreborn.tiles.generator.TileGasTurbine; -public class GuiGasTurbine extends GuiContainer { +public class GuiGasTurbine extends GuiContainer +{ - //TODO: use semifluid generator texture - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/ThermalGenerator.png"); + // TODO: use semifluid generator texture + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/ThermalGenerator.png"); - TileGasTurbine tile; + TileGasTurbine tile; - public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) { - super(new ContainerGasTurbine(tile, player)); - this.xSize = 176; - this.ySize = 167; - this.tile = tile; - } + public GuiGasTurbine(EntityPlayer player, TileGasTurbine tile) + { + super(new ContainerGasTurbine(tile, player)); + this.xSize = 176; + this.ySize = 167; + this.tile = tile; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = "Gas Turbine"; - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); - this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, - 30, 16448255); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = "Gas Turbine"; + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255); + } } diff --git a/src/main/java/techreborn/client/gui/GuiGenerator.java b/src/main/java/techreborn/client/gui/GuiGenerator.java index 7f8a0d367..cb3a5432b 100644 --- a/src/main/java/techreborn/client/gui/GuiGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiGenerator.java @@ -8,55 +8,64 @@ import reborncore.common.powerSystem.PowerSystem; import techreborn.client.container.ContainerGenerator; import techreborn.tiles.generator.TileGenerator; -public class GuiGenerator extends GuiContainer { +public class GuiGenerator extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/generator.png"); - TileGenerator generator; + TileGenerator generator; - ContainerGenerator containerGenerator; + ContainerGenerator containerGenerator; - public GuiGenerator(EntityPlayer player, TileGenerator generator) { - super(new ContainerGenerator(generator, player)); - this.xSize = 176; - this.ySize = 167; - this.generator = generator; - this.containerGenerator = (ContainerGenerator) this.inventorySlots; - } + public GuiGenerator(EntityPlayer player, TileGenerator generator) + { + super(new ContainerGenerator(generator, player)); + this.xSize = 176; + this.ySize = 167; + this.generator = generator; + this.containerGenerator = (ContainerGenerator) this.inventorySlots; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = generator.getEnergyScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); - } + j = generator.getEnergyScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 109, l + 21 + 12, 176, 0, j + 1, 16); + } - if (containerGenerator.burnTime != 0) - { - j = containerGenerator.getScaledBurnTime(13); - this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1); - } - } + if (containerGenerator.burnTime != 0) + { + j = containerGenerator.getScaledBurnTime(13); + this.drawTexturedModalRect(k + 80, l + 38 + 12 - j, 176, 30 - j, 14, j + 1); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.generator.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.generator.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize- 150, 4210752); - } + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerGenerator.energy), 25, this.ySize - 150, + 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiGrinder.java b/src/main/java/techreborn/client/gui/GuiGrinder.java index 7ba5752f4..03cbe310e 100644 --- a/src/main/java/techreborn/client/gui/GuiGrinder.java +++ b/src/main/java/techreborn/client/gui/GuiGrinder.java @@ -8,46 +8,54 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerGrinder; import techreborn.tiles.teir1.TileGrinder; -public class GuiGrinder extends GuiContainer { +public class GuiGrinder extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/grinder.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/grinder.png"); - TileGrinder grinder; - ContainerGrinder containerGrinder; + TileGrinder grinder; + ContainerGrinder containerGrinder; - public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) { - super(new ContainerGrinder(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - grinder = tilegrinder; - containerGrinder = (ContainerGrinder) this.inventorySlots; - } + public GuiGrinder(EntityPlayer player, TileGrinder tilegrinder) + { + super(new ContainerGrinder(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + grinder = tilegrinder; + containerGrinder = (ContainerGrinder) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = grinder.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16); - } + j = grinder.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16); + } - j = grinder.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = grinder.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.grinder.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.grinder.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiIDSU.java b/src/main/java/techreborn/client/gui/GuiIDSU.java index ef4121ec8..2213b28ee 100644 --- a/src/main/java/techreborn/client/gui/GuiIDSU.java +++ b/src/main/java/techreborn/client/gui/GuiIDSU.java @@ -1,5 +1,8 @@ package techreborn.client.gui; +import java.awt.*; +import java.io.IOException; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; @@ -12,80 +15,90 @@ import techreborn.client.container.ContainerIDSU; import techreborn.packets.PacketIdsu; import techreborn.tiles.idsu.TileIDSU; -import java.awt.*; -import java.io.IOException; +public class GuiIDSU extends GuiContainer +{ -public class GuiIDSU extends GuiContainer { + private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png"); - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/aesu.png"); + TileIDSU idsu; + ContainerIDSU containerIDSU; - TileIDSU idsu; + public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) + { + super(new ContainerIDSU(tileIDSU, player)); + this.xSize = 176; + this.ySize = 165; + idsu = tileIDSU; + this.containerIDSU = (ContainerIDSU) this.inventorySlots; + } - ContainerIDSU containerIDSU; + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++")); + this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+")); + this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-")); + this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--")); + this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+")); + } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) { - super(new ContainerIDSU(tileIDSU, player)); - this.xSize = 176; - this.ySize = 165; - idsu = tileIDSU; - this.containerIDSU = (ContainerIDSU) this.inventorySlots; - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 40, 10, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40, + Color.WHITE.getRGB()); + } - @Override - public void initGui() { - super.initGui(); - this.buttonList.clear(); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.buttonList.add(new GuiButton(0, k + 128, l + 5, 15, 15, "++")); - this.buttonList.add(new GuiButton(1, k + 128, l + 5 + 20, 15, 15, "+")); - this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-")); - this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--")); - this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+")); - } + @Override + protected void actionPerformed(GuiButton button) throws IOException + { + super.actionPerformed(button); + PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu)); - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euOut) + "/tick", 10, 20, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.storedEu), 10, 30, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerIDSU.euChange) + " change", 10, 40, Color.WHITE.getRGB()); - } + public static boolean isInteger(String s) + { + return isInteger(s, 10); + } - @Override - protected void actionPerformed(GuiButton button) throws IOException { - super.actionPerformed(button); - PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu)); - - } - - public static boolean isInteger(String s) { - return isInteger(s, 10); - } - - public static boolean isInteger(String s, int radix) { - if (s.isEmpty()) return false; - for (int i = 0; i < s.length(); i++) { - if (i == 0 && s.charAt(i) == '-') { - if (s.length() == 1) return false; - else continue; - } - if (Character.digit(s.charAt(i), radix) < 0) return false; - } - return true; - } + public static boolean isInteger(String s, int radix) + { + if (s.isEmpty()) + return false; + for (int i = 0; i < s.length(); i++) + { + if (i == 0 && s.charAt(i) == '-') + { + if (s.length() == 1) + return false; + else + continue; + } + if (Character.digit(s.charAt(i), radix) < 0) + return false; + } + return true; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java index b36cadd05..2a9701059 100644 --- a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java @@ -8,58 +8,70 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerImplosionCompressor; import techreborn.tiles.TileImplosionCompressor; -public class GuiImplosionCompressor extends GuiContainer { +public class GuiImplosionCompressor extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/implosion_compressor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/implosion_compressor.png"); - TileImplosionCompressor compresser; - ContainerImplosionCompressor containerImplosionCompressor; + TileImplosionCompressor compresser; + ContainerImplosionCompressor containerImplosionCompressor; - public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser) { - super(new ContainerImplosionCompressor(tilecompresser, player)); - containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots; - this.xSize = 176; - this.ySize = 167; - compresser = tilecompresser; - } + public GuiImplosionCompressor(EntityPlayer player, TileImplosionCompressor tilecompresser) + { + super(new ContainerImplosionCompressor(tilecompresser, player)); + containerImplosionCompressor = (ContainerImplosionCompressor) this.inventorySlots; + this.xSize = 176; + this.ySize = 167; + compresser = tilecompresser; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - if (containerImplosionCompressor.multIBlockState == 0) { - // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); - this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); - } - - int j = 0; - this.mc.getTextureManager().bindTexture(texture); - j = compresser.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 60, l + 37, 176, 14, j + 1, 16); - } + if (containerImplosionCompressor.multIBlockState == 0) + { + // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); + this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, + l + 52 + 12 - 0, -1); + } - j = compresser.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + int j = 0; + this.mc.getTextureManager().bindTexture(texture); + j = compresser.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 60, l + 37, 176, 14, j + 1, 16); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + j = compresser.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 14, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.implosioncompressor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java b/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java index 2ec53585e..c605b050e 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java @@ -8,54 +8,63 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerIndustrialElectrolyzer; import techreborn.tiles.TileIndustrialElectrolyzer; -public class GuiIndustrialElectrolyzer extends GuiContainer { +public class GuiIndustrialElectrolyzer extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_electrolyzer.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_electrolyzer.png"); - TileIndustrialElectrolyzer eletrolyzer; + TileIndustrialElectrolyzer eletrolyzer; - ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer; + ContainerIndustrialElectrolyzer containerIndustrialElectrolyzer; - public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer) { - super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player)); - this.xSize = 176; - this.ySize = 167; - eletrolyzer = tileeletrolyzer; - containerIndustrialElectrolyzer = (ContainerIndustrialElectrolyzer) this.inventorySlots; - } + public GuiIndustrialElectrolyzer(EntityPlayer player, TileIndustrialElectrolyzer tileeletrolyzer) + { + super(new ContainerIndustrialElectrolyzer(tileeletrolyzer, player)); + this.xSize = 176; + this.ySize = 167; + eletrolyzer = tileeletrolyzer; + containerIndustrialElectrolyzer = (ContainerIndustrialElectrolyzer) this.inventorySlots; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = eletrolyzer.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16); - } + j = eletrolyzer.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 72, l + 38, 176, 14, j + 1, 16); + } - j = eletrolyzer.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 134, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = eletrolyzer.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 134, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name"); - this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name"); + this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2), 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java index de44c0558..424c4f3b9 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java @@ -8,71 +8,82 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerIndustrialGrinder; import techreborn.tiles.TileIndustrialGrinder; -public class GuiIndustrialGrinder extends GuiContainer { +public class GuiIndustrialGrinder extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/industrial_grinder.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_grinder.png"); - TileIndustrialGrinder grinder; - ContainerIndustrialGrinder containerGrinder; + TileIndustrialGrinder grinder; + ContainerIndustrialGrinder containerGrinder; - public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) { - super(new ContainerIndustrialGrinder(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - grinder = tilegrinder; - containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots; - } + public GuiIndustrialGrinder(EntityPlayer player, TileIndustrialGrinder tilegrinder) + { + super(new ContainerIndustrialGrinder(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + grinder = tilegrinder; + containerGrinder = (ContainerIndustrialGrinder) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = grinder.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16); - } + j = grinder.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16); + } - j = grinder.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2); - } + j = grinder.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 132, l + 63 + 12 - j, 176, 12 - j, 14, j + 2); + } - if (containerGrinder.connectionStatus != 1) { - // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10); - this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1); - } + if (containerGrinder.connectionStatus != 1) + { + // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10); + this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, + l + 52 + 12 - j, -1); + } - //TODO 1.8 nope -// if (grinder.tank.getFluidAmount() != 0) { -// IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon(); -// if (fluidIcon != null) { -// this.mc.renderEngine.bindTexture(texture); -// drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); -// -// this.mc.renderEngine -// .bindTexture(TextureMap.locationBlocksTexture); -// int liquidHeight = grinder.tank.getFluidAmount() * 47 -// / grinder.tank.getCapacity(); -// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 -// - liquidHeight, 12.0D, liquidHeight, this.zLevel); -// -// this.mc.renderEngine.bindTexture(texture); -// -// drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); -// } -// } - } + // TODO 1.8 nope + // if (grinder.tank.getFluidAmount() != 0) { + // IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon(); + // if (fluidIcon != null) { + // this.mc.renderEngine.bindTexture(texture); + // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); + // + // this.mc.renderEngine + // .bindTexture(TextureMap.locationBlocksTexture); + // int liquidHeight = grinder.tank.getFluidAmount() * 47 + // / grinder.tank.getCapacity(); + // GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 + // - liquidHeight, 12.0D, liquidHeight, this.zLevel); + // + // this.mc.renderEngine.bindTexture(texture); + // + // drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); + // } + // } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.industrialgrinder.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java index f961d3149..708c8cfc4 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java @@ -9,80 +9,86 @@ import reborncore.client.gui.GuiUtil; import techreborn.client.container.ContainerIndustrialSawmill; import techreborn.tiles.TileIndustrialSawmill; -public class GuiIndustrialSawmill extends GuiContainer { +public class GuiIndustrialSawmill extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/industrial_sawmill.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/industrial_sawmill.png"); - TileIndustrialSawmill sawmill; + TileIndustrialSawmill sawmill; - public GuiIndustrialSawmill(EntityPlayer player, - TileIndustrialSawmill tilesawmill) { - super(new ContainerIndustrialSawmill(tilesawmill, player)); - this.xSize = 176; - this.ySize = 167; - sawmill = tilesawmill; - } + public GuiIndustrialSawmill(EntityPlayer player, TileIndustrialSawmill tilesawmill) + { + super(new ContainerIndustrialSawmill(tilesawmill, player)); + this.xSize = 176; + this.ySize = 167; + sawmill = tilesawmill; + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - super.initGui(); - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + super.initGui(); + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = sawmill.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 56, l + 38, 176, 14, j - 1, 11); - } + j = sawmill.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 56, l + 38, 176, 14, j - 1, 11); + } + j = sawmill.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 33, l + 65 + 12 - j, 176, 12 - j, 14, j + 2); + } + // TODO 1.8 + // if (sawmill.tank.getFluidAmount() != 0) { + // IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon(); + // if (fluidIcon != null) { + // this.mc.renderEngine.bindTexture(texture); + // + // + // this.mc.renderEngine + // .bindTexture(TextureMap.locationBlocksTexture); + // int liquidHeight = sawmill.tank.getFluidAmount() * 47 + // / sawmill.tank.getCapacity(); + // GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 + // - liquidHeight, 12.0D, liquidHeight, this.zLevel); + // + // this.mc.renderEngine.bindTexture(texture); + // // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); + // } + // } + drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); + if (sawmill.getMutliBlock() != true) + { + GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); + this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, + l + 52 + 12 - 0, -1); + } - j = sawmill.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 33, l + 65 + 12 - j, 176, 12 - j, 14, j + 2); - } - //TODO 1.8 -// if (sawmill.tank.getFluidAmount() != 0) { -// IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon(); -// if (fluidIcon != null) { -// this.mc.renderEngine.bindTexture(texture); -// -// -// this.mc.renderEngine -// .bindTexture(TextureMap.locationBlocksTexture); -// int liquidHeight = sawmill.tank.getFluidAmount() * 47 -// / sawmill.tank.getCapacity(); -// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 -// - liquidHeight, 12.0D, liquidHeight, this.zLevel); -// -// this.mc.renderEngine.bindTexture(texture); -// // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); -// } -// } - drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); - if (sawmill.getMutliBlock() != true) { - GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); - this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); - } + } - } - - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.industrialsawmill.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 58, - this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.industrialsawmill.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 58, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiIronFurnace.java b/src/main/java/techreborn/client/gui/GuiIronFurnace.java index 98528fe99..4d0410d5e 100644 --- a/src/main/java/techreborn/client/gui/GuiIronFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiIronFurnace.java @@ -8,46 +8,55 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerIronFurnace; import techreborn.tiles.TileIronFurnace; -public class GuiIronFurnace extends GuiContainer { +public class GuiIronFurnace extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("minecraft", "textures/gui/container/furnace.png"); + public static final ResourceLocation texture = new ResourceLocation("minecraft", + "textures/gui/container/furnace.png"); - TileIronFurnace furnace; - ContainerIronFurnace containerGrinder; + TileIronFurnace furnace; + ContainerIronFurnace containerGrinder; - public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) { - super(new ContainerIronFurnace(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - furnace = tilegrinder; - containerGrinder = (ContainerIronFurnace) this.inventorySlots; - } + public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) + { + super(new ContainerIronFurnace(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + furnace = tilegrinder; + containerGrinder = (ContainerIronFurnace) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; + int j = 0; - j = furnace.gaugeProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); - } + j = furnace.gaugeProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); + } - j = furnace.gaugeFuelScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = furnace.gaugeFuelScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 57, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.ironfurnace.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiLesu.java b/src/main/java/techreborn/client/gui/GuiLesu.java index 00ccd00c3..acf8a5f7e 100644 --- a/src/main/java/techreborn/client/gui/GuiLesu.java +++ b/src/main/java/techreborn/client/gui/GuiLesu.java @@ -1,5 +1,7 @@ package techreborn.client.gui; +import java.awt.*; + import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; @@ -9,37 +11,47 @@ import reborncore.common.powerSystem.PowerSystem; import techreborn.client.container.ContainerLesu; import techreborn.tiles.lesu.TileLesu; -import java.awt.*; +public class GuiLesu extends GuiContainer +{ -public class GuiLesu extends GuiContainer { + private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png"); - private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/aesu.png"); - TileLesu aesu; - ContainerLesu containerLesu; + TileLesu aesu; - public GuiLesu(EntityPlayer player, TileLesu tileaesu) { - super(new ContainerLesu(tileaesu, player)); - this.xSize = 176; - this.ySize = 197; - aesu = tileaesu; - this.containerLesu = (ContainerLesu) this.inventorySlots; - } + ContainerLesu containerLesu; - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + public GuiLesu(EntityPlayer player, TileLesu tileaesu) + { + super(new ContainerLesu(tileaesu, player)); + this.xSize = 176; + this.ySize = 165; + aesu = tileaesu; + this.containerLesu = (ContainerLesu) this.inventorySlots; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40, + Color.WHITE.getRGB()); + this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB()); + this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60, + Color.WHITE.getRGB()); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - this.fontRendererObj.drawString(I18n.translateToLocal("tile.techreborn.lesu.name"), 40, 10, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.storedEu), 10, 30, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euChange) + " change", 10, 40, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(containerLesu.connectedBlocks + " blocks", 10, 50, Color.WHITE.getRGB()); - this.fontRendererObj.drawString(PowerSystem.getLocaliszedPower(containerLesu.euStorage) + " max", 10, 60, Color.WHITE.getRGB()); - } } diff --git a/src/main/java/techreborn/client/gui/GuiMatterFabricator.java b/src/main/java/techreborn/client/gui/GuiMatterFabricator.java index 44514d5f9..521ac1048 100644 --- a/src/main/java/techreborn/client/gui/GuiMatterFabricator.java +++ b/src/main/java/techreborn/client/gui/GuiMatterFabricator.java @@ -8,48 +8,51 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerMatterFabricator; import techreborn.tiles.TileMatterFabricator; -public class GuiMatterFabricator extends GuiContainer { +public class GuiMatterFabricator extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/matterfabricator.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/matterfabricator.png"); - TileMatterFabricator matterfab; + TileMatterFabricator matterfab; - ContainerMatterFabricator containerMatterFabricator; + ContainerMatterFabricator containerMatterFabricator; - public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab) { - super(new ContainerMatterFabricator(tilematterfab, player)); - this.xSize = 176; - this.ySize = 167; - matterfab = tilematterfab; - containerMatterFabricator = (ContainerMatterFabricator) this.inventorySlots; - } + public GuiMatterFabricator(EntityPlayer player, TileMatterFabricator tilematterfab) + { + super(new ContainerMatterFabricator(tilematterfab, player)); + this.xSize = 176; + this.ySize = 167; + matterfab = tilematterfab; + containerMatterFabricator = (ContainerMatterFabricator) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = containerMatterFabricator.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16); - } - } + int j = containerMatterFabricator.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, j + 1, 16); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + String name = I18n.translateToLocal("tile.techreborn.matterfabricator.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString(containerMatterFabricator.getProgressScaled(100) + "%", 80, 50, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiQuantumTank.java b/src/main/java/techreborn/client/gui/GuiQuantumTank.java index c764857f3..4d0317365 100644 --- a/src/main/java/techreborn/client/gui/GuiQuantumTank.java +++ b/src/main/java/techreborn/client/gui/GuiQuantumTank.java @@ -8,39 +8,40 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerQuantumTank; import techreborn.tiles.TileQuantumTank; -public class GuiQuantumTank extends GuiContainer { +public class GuiQuantumTank extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/thermal_generator.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/thermal_generator.png"); - TileQuantumTank tile; + TileQuantumTank tile; - public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) { - super(new ContainerQuantumTank(tile, player)); - this.xSize = 176; - this.ySize = 167; - this.tile = tile; - } + public GuiQuantumTank(EntityPlayer player, TileQuantumTank tile) + { + super(new ContainerQuantumTank(tile, player)); + this.xSize = 176; + this.ySize = 167; + this.tile = tile; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.quantumTank.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); - this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, - 30, 16448255); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.quantumTank.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255); + } } diff --git a/src/main/java/techreborn/client/gui/GuiRecycler.java b/src/main/java/techreborn/client/gui/GuiRecycler.java index 3969442df..41a6aa932 100644 --- a/src/main/java/techreborn/client/gui/GuiRecycler.java +++ b/src/main/java/techreborn/client/gui/GuiRecycler.java @@ -8,45 +8,53 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerRecycler; import techreborn.tiles.teir1.TileRecycler; -public class GuiRecycler extends GuiContainer { +public class GuiRecycler extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); - TileRecycler compressor; - ContainerRecycler containerGrinder; + TileRecycler compressor; + ContainerRecycler containerGrinder; - public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) { - super(new ContainerRecycler(tilegrinder, player)); - this.xSize = 176; - this.ySize = 167; - compressor = tilegrinder; - containerGrinder = (ContainerRecycler) this.inventorySlots; - } + public GuiRecycler(EntityPlayer player, TileRecycler tilegrinder) + { + super(new ContainerRecycler(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + compressor = tilegrinder; + containerGrinder = (ContainerRecycler) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; - - j = compressor.gaugeProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); - } + int j = 0; - j = compressor.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = compressor.gaugeProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.recycler.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + j = compressor.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.recycler.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiRollingMachine.java b/src/main/java/techreborn/client/gui/GuiRollingMachine.java index 24774525c..56ec84af5 100644 --- a/src/main/java/techreborn/client/gui/GuiRollingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiRollingMachine.java @@ -9,54 +9,59 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerRollingMachine; import techreborn.tiles.TileRollingMachine; -public class GuiRollingMachine extends GuiContainer { +public class GuiRollingMachine extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/rolling_machine.png"); - TileRollingMachine rollingMachine; - ContainerRollingMachine containerRollingMachine; + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/rolling_machine.png"); + TileRollingMachine rollingMachine; + ContainerRollingMachine containerRollingMachine; - public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) { - super(new ContainerRollingMachine(tileRollingmachine, player)); - this.xSize = 176; - this.ySize = 167; - rollingMachine = tileRollingmachine; - containerRollingMachine = (ContainerRollingMachine) this.inventorySlots; - } + public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine) + { + super(new ContainerRollingMachine(tileRollingmachine, player)); + this.xSize = 176; + this.ySize = 167; + rollingMachine = tileRollingmachine; + containerRollingMachine = (ContainerRollingMachine) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = this.containerRollingMachine.getBurnTimeRemainingScaled(24); - this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19); + int j = this.containerRollingMachine.getBurnTimeRemainingScaled(24); + this.drawTexturedModalRect(k + 91, l + 34, 176, 14, j + 1, 19); - j = this.rollingMachine.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 7, l + 33 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = this.rollingMachine.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 7, l + 33 + 12 - j, 176, 12 - j, 14, j + 2); + } + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.rollingmachine.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } - @Override - public void initGui() { - this.buttonList.clear(); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.buttonList.add(new GuiButton(0, k + 4, l + 4, 20, 20, "R")); - super.initGui(); - } + @Override + public void initGui() + { + this.buttonList.clear(); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.buttonList.add(new GuiButton(0, k + 4, l + 4, 20, 20, "R")); + super.initGui(); + } } diff --git a/src/main/java/techreborn/client/gui/GuiScrapboxinator.java b/src/main/java/techreborn/client/gui/GuiScrapboxinator.java index 03fa03681..c642c2948 100644 --- a/src/main/java/techreborn/client/gui/GuiScrapboxinator.java +++ b/src/main/java/techreborn/client/gui/GuiScrapboxinator.java @@ -8,46 +8,55 @@ import net.minecraft.util.ResourceLocation; import techreborn.client.container.ContainerScrapboxinator; import techreborn.tiles.TileScrapboxinator; -public class GuiScrapboxinator extends GuiContainer { +public class GuiScrapboxinator extends GuiContainer +{ - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/scrapboxinator.png"); + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/scrapboxinator.png"); - TileScrapboxinator tile; - ContainerScrapboxinator containerScrapboxinator; + TileScrapboxinator tile; + ContainerScrapboxinator containerScrapboxinator; - public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator) { - super(new ContainerScrapboxinator(tileScrapboxinator, player)); - this.xSize = 176; - this.ySize = 167; - tile = tileScrapboxinator; - containerScrapboxinator = (ContainerScrapboxinator) this.inventorySlots; - } + public GuiScrapboxinator(EntityPlayer player, TileScrapboxinator tileScrapboxinator) + { + super(new ContainerScrapboxinator(tileScrapboxinator, player)); + this.xSize = 176; + this.ySize = 167; + tile = tileScrapboxinator; + containerScrapboxinator = (ContainerScrapboxinator) this.inventorySlots; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int j = 0; - - j = tile.gaugeProgressScaled(24); -// System.out.println(compressor.gaugeProgressScaled(10)); - if (j > 0) { - this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); - } + int j = 0; - j = tile.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } - } + j = tile.gaugeProgressScaled(24); + // System.out.println(compressor.gaugeProgressScaled(10)); + if (j > 0) + { + this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } + j = tile.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn.scrapboxinator.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, + 4210752); + } } diff --git a/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java b/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java index ca101b271..a5b3ae896 100644 --- a/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java @@ -8,39 +8,41 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerSemifluidGenerator; import techreborn.tiles.generator.TileSemifluidGenerator; -public class GuiSemifluidGenerator extends GuiContainer { +public class GuiSemifluidGenerator extends GuiContainer +{ - //TODO: use semifluid generator texture - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/ThermalGenerator.png"); + // TODO: use semifluid generator texture + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/ThermalGenerator.png"); - TileSemifluidGenerator tile; + TileSemifluidGenerator tile; - public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile) { - super(new ContainerSemifluidGenerator(tile, player)); - this.xSize = 176; - this.ySize = 167; - this.tile = tile; - } + public GuiSemifluidGenerator(EntityPlayer player, TileSemifluidGenerator tile) + { + super(new ContainerSemifluidGenerator(tile, player)); + this.xSize = 176; + this.ySize = 167; + this.tile = tile; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = "Semifluid Generator"; - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); - this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, - 30, 16448255); - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = "Semifluid Generator"; + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255); + } } \ No newline at end of file diff --git a/src/main/java/techreborn/client/gui/GuiThermalGenerator.java b/src/main/java/techreborn/client/gui/GuiThermalGenerator.java index 74d605d15..bfc18b76e 100644 --- a/src/main/java/techreborn/client/gui/GuiThermalGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiThermalGenerator.java @@ -8,40 +8,42 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.container.ContainerThermalGenerator; import techreborn.tiles.generator.TileThermalGenerator; -public class GuiThermalGenerator extends GuiContainer { +public class GuiThermalGenerator extends GuiContainer +{ - private static final ResourceLocation texture = new ResourceLocation( - "techreborn", "textures/gui/thermal_generator.png"); + private static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/thermal_generator.png"); - TileThermalGenerator tile; + TileThermalGenerator tile; - public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile) { - super(new ContainerThermalGenerator(tile, player)); - this.xSize = 176; - this.ySize = 167; - this.tile = tile; - } + public GuiThermalGenerator(EntityPlayer player, TileThermalGenerator tile) + { + super(new ContainerThermalGenerator(tile, player)); + this.xSize = 176; + this.ySize = 167; + this.tile = tile; + } - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, - int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, - int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString( - I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, - this.ySize - 96 + 2, 4210752); - this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); - this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255); - this.fontRendererObj.drawString(tile.getEnergy() + "", 10, 40, 16448255); + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.thermalGenerator.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + this.fontRendererObj.drawString("Liquid Amount", 10, 20, 16448255); + this.fontRendererObj.drawString(tile.tank.getFluidAmount() + "", 10, 30, 16448255); + this.fontRendererObj.drawString(tile.getEnergy() + "", 10, 40, 16448255); - } + } } diff --git a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java index c68b120d8..710ebbf2b 100644 --- a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java +++ b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java @@ -1,5 +1,7 @@ package techreborn.client.gui; +import java.io.IOException; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; @@ -15,87 +17,107 @@ import techreborn.client.container.ContainerVacuumFreezer; import techreborn.proxies.ClientProxy; import techreborn.tiles.TileVacuumFreezer; -import java.io.IOException; +public class GuiVacuumFreezer extends GuiContainer +{ -public class GuiVacuumFreezer extends GuiContainer { + public static final ResourceLocation texture = new ResourceLocation("techreborn", + "textures/gui/vacuum_freezer.png"); - public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png"); + TileVacuumFreezer crafter; + ContainerVacuumFreezer containerVacuumFreezer; - TileVacuumFreezer crafter; - ContainerVacuumFreezer containerVacuumFreezer; + public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer tilealloysmelter) + { + super(new ContainerVacuumFreezer(tilealloysmelter, player)); + this.xSize = 176; + this.ySize = 167; + crafter = tilealloysmelter; + this.containerVacuumFreezer = (ContainerVacuumFreezer) this.inventorySlots; + } - public GuiVacuumFreezer(EntityPlayer player, TileVacuumFreezer tilealloysmelter) { - super(new ContainerVacuumFreezer(tilealloysmelter, player)); - this.xSize = 176; - this.ySize = 167; - crafter = tilealloysmelter; - this.containerVacuumFreezer = (ContainerVacuumFreezer) this.inventorySlots; - } + @Override + public void initGui() + { + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, ""); + buttonList.add(button); + super.initGui(); + CoordTriplet coordinates = new CoordTriplet(crafter.getPos().getX(), crafter.getPos().getY() - 5, + crafter.getPos().getZ()); + if (coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)) + { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } else + { + button.displayString = "A"; + } + } - @Override - public void initGui() { - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, ""); - buttonList.add(button); - super.initGui(); - CoordTriplet coordinates = new CoordTriplet(crafter.getPos().getX(), crafter.getPos().getY() - 5, crafter.getPos().getZ()); - if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ - ClientProxy.multiblockRenderEvent.setMultiblock(null); - button.displayString = "B"; - } else { - button.displayString = "A"; - } - } + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - @Override - protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(texture); - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + int j = 0; - int j = 0; + j = crafter.getProgressScaled(24); + if (j > 0) + { + this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16); + } - j = crafter.getProgressScaled(24); - if (j > 0) { - this.drawTexturedModalRect(k + 79, l + 37, 176, 14, j + 1, 16); - } + j = crafter.getEnergyScaled(12); + if (j > 0) + { + this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } - j = crafter.getEnergyScaled(12); - if (j > 0) { - this.drawTexturedModalRect(k + 26, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); - } + if (containerVacuumFreezer.machineStatus == 0) + { + GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); + this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, + l + 52 + 12 - 0, -1); + } + } - if (containerVacuumFreezer.machineStatus == 0) { - GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); - this.fontRendererObj.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); - } - } + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, + 4210752); + this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, + this.ySize - 96 + 2, 4210752); + } - protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { - String name = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name"); - this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); - this.fontRendererObj.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } - - @Override - public void actionPerformed(GuiButton button) throws IOException { - super.actionPerformed(button); - if(button.id == 212){ - if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ - {//This code here makes a basic multiblock and then sets to the selected one. - MultiblockSet set = new MultiblockSet(ClientMultiBlocks.frezzer); - ClientProxy.multiblockRenderEvent.setMultiblock(set); - ClientProxy.multiblockRenderEvent.partent = new Location(crafter.getPos().getX(), crafter.getPos().getY(), crafter.getPos().getZ(), crafter.getWorld()); - ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(crafter.getPos().getX() , crafter.getPos().getY() -5 , crafter.getPos().getZ()); - } - button.displayString = "A"; - } else { - ClientProxy.multiblockRenderEvent.setMultiblock(null); - button.displayString = "B"; - } - } - } + @Override + public void actionPerformed(GuiButton button) throws IOException + { + super.actionPerformed(button); + if (button.id == 212) + { + if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) + { + {// This code here makes a basic multiblock and then sets to the + // selected one. + MultiblockSet set = new MultiblockSet(ClientMultiBlocks.frezzer); + ClientProxy.multiblockRenderEvent.setMultiblock(set); + ClientProxy.multiblockRenderEvent.partent = new Location(crafter.getPos().getX(), + crafter.getPos().getY(), crafter.getPos().getZ(), crafter.getWorld()); + ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(crafter.getPos().getX(), + crafter.getPos().getY() - 5, crafter.getPos().getZ()); + } + button.displayString = "A"; + } else + { + ClientProxy.multiblockRenderEvent.setMultiblock(null); + button.displayString = "B"; + } + } + } } diff --git a/src/main/java/techreborn/client/hud/ChargeHud.java b/src/main/java/techreborn/client/hud/ChargeHud.java index c2b4c3d4a..3c140b42d 100644 --- a/src/main/java/techreborn/client/hud/ChargeHud.java +++ b/src/main/java/techreborn/client/hud/ChargeHud.java @@ -13,103 +13,119 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.opengl.GL11; + import reborncore.api.power.IEnergyInterfaceItem; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.Color; import techreborn.client.keybindings.KeyBindings; import techreborn.config.ConfigTechReborn; -public class ChargeHud { - public static final ChargeHud instance = new ChargeHud(); - private static Minecraft mc = Minecraft.getMinecraft(); - public static KeyBindings key; - public static boolean showHud = true; +public class ChargeHud +{ + public static final ChargeHud instance = new ChargeHud(); + private static Minecraft mc = Minecraft.getMinecraft(); + public static KeyBindings key; + public static boolean showHud = true; + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.LOW) + public void onRenderExperienceBar(RenderGameOverlayEvent event) + { + if (key.config.isPressed()) + { + showHud = !showHud; + } - @SideOnly(Side.CLIENT) - @SubscribeEvent(priority = EventPriority.LOW) - public void onRenderExperienceBar(RenderGameOverlayEvent event) { - if (key.config.isPressed()) { - showHud = !showHud; - } + if (event.isCancelable() || event.type != ElementType.ALL) + return; - if (event.isCancelable() || event.type != ElementType.ALL) - return; + if (mc.inGameHasFocus || (mc.currentScreen != null && mc.gameSettings.showDebugInfo)) + { + if (ConfigTechReborn.ShowChargeHud) + drawChargeHud(event.resolution); + } + } - if (mc.inGameHasFocus || (mc.currentScreen != null && mc.gameSettings.showDebugInfo)) { - if (ConfigTechReborn.ShowChargeHud) - drawChargeHud(event.resolution); - } - } + public void drawChargeHud(ScaledResolution res) + { + EntityPlayer player = mc.thePlayer; + ItemStack armorstack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); + ItemStack stack = mc.thePlayer.inventory.getCurrentItem(); - public void drawChargeHud(ScaledResolution res) { - EntityPlayer player = mc.thePlayer; - ItemStack armorstack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); - ItemStack stack = mc.thePlayer.inventory.getCurrentItem(); + int y = 5; - int y = 5; + if (armorstack != null && ConfigTechReborn.ShowChargeHud + && armorstack.getItem() instanceof IEnergyInterfaceItem) + { + double MaxCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getMaxPower(armorstack); + double CurrentCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getEnergy(armorstack); + Color color = Color.GREEN; + double quarter = MaxCharge / 4; + double half = MaxCharge / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + // Render the stack + renderItemStack(armorstack, 0, y - 5); + // Get the color depending on current charge + if (CurrentCharge <= half) + { + color = Color.YELLOW; + } + if (CurrentCharge <= quarter) + { + color = Color.DARK_RED; + } + mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0); + y += 20; + } - if (armorstack != null && ConfigTechReborn.ShowChargeHud && armorstack.getItem() instanceof IEnergyInterfaceItem) { - double MaxCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getMaxPower(armorstack); - double CurrentCharge = ((IEnergyInterfaceItem) armorstack.getItem()).getEnergy(armorstack); - Color color = Color.GREEN; - double quarter = MaxCharge / 4; - double half = MaxCharge / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(32826); - RenderHelper.enableStandardItemLighting(); - RenderHelper.enableGUIStandardItemLighting(); - //Render the stack - renderItemStack(armorstack, 0, y - 5); - //Get the color depending on current charge - if (CurrentCharge <= half) { - color = Color.YELLOW; - } - if (CurrentCharge <= quarter) { - color = Color.DARK_RED; - } - mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0); - y += 20; - } + if (showHud) + { + if (stack != null && stack.getItem() instanceof IEnergyInterfaceItem) + { + double MaxCharge = ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack); + double CurrentCharge = ((IEnergyInterfaceItem) stack.getItem()).getEnergy(stack); + Color color = Color.GREEN; + double quarter = MaxCharge / 4; + double half = MaxCharge / 2; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + renderItemStack(stack, 0, y - 5); + if (CurrentCharge <= half) + { + color = Color.YELLOW; + } + if (CurrentCharge <= quarter) + { + color = Color.DARK_RED; + } + mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0); + } + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } - if (showHud) { - if (stack != null && stack.getItem() instanceof IEnergyInterfaceItem) { - double MaxCharge = ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack); - double CurrentCharge = ((IEnergyInterfaceItem) stack.getItem()).getEnergy(stack); - Color color = Color.GREEN; - double quarter = MaxCharge / 4; - double half = MaxCharge / 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(32826); - RenderHelper.enableStandardItemLighting(); - RenderHelper.enableGUIStandardItemLighting(); - renderItemStack(stack, 0, y - 5); - if (CurrentCharge <= half) { - color = Color.YELLOW; - } - if (CurrentCharge <= quarter) { - color = Color.DARK_RED; - } - mc.fontRendererObj.drawString(color + PowerSystem.getLocaliszedPower(CurrentCharge) + "/" + PowerSystem.getLocaliszedPower(MaxCharge), 20, y, 0); - } - } - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } + public void renderItemStack(ItemStack stack, int x, int y) + { + if (stack != null) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + RenderHelper.enableGUIStandardItemLighting(); - public void renderItemStack(ItemStack stack, int x, int y) - { - if (stack != null) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - RenderHelper.enableGUIStandardItemLighting(); + RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); + itemRenderer.renderItemAndEffectIntoGUI(stack, x, y); - RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); - itemRenderer.renderItemAndEffectIntoGUI(stack, x, y); - - GL11.glDisable(GL11.GL_LIGHTING); - } - } + GL11.glDisable(GL11.GL_LIGHTING); + } + } } diff --git a/src/main/java/techreborn/client/keybindings/KeyBindings.java b/src/main/java/techreborn/client/keybindings/KeyBindings.java index 65eae60d0..07bfa8f66 100644 --- a/src/main/java/techreborn/client/keybindings/KeyBindings.java +++ b/src/main/java/techreborn/client/keybindings/KeyBindings.java @@ -1,12 +1,14 @@ package techreborn.client.keybindings; import net.minecraft.client.settings.KeyBinding; + import org.lwjgl.input.Keyboard; + import techreborn.lib.ModInfo; -public class KeyBindings { +public class KeyBindings +{ - public static KeyBinding config = new KeyBinding(ModInfo.Keys.CONFIG, - Keyboard.KEY_P, ModInfo.Keys.CATEGORY); + public static KeyBinding config = new KeyBinding(ModInfo.Keys.CONFIG, Keyboard.KEY_P, ModInfo.Keys.CATEGORY); } diff --git a/src/main/java/techreborn/client/keybindings/KeyInputEventHandler.java b/src/main/java/techreborn/client/keybindings/KeyInputEventHandler.java index d5fc2dd1c..061bdac43 100644 --- a/src/main/java/techreborn/client/keybindings/KeyInputEventHandler.java +++ b/src/main/java/techreborn/client/keybindings/KeyInputEventHandler.java @@ -5,18 +5,22 @@ import net.minecraftforge.fml.common.gameevent.InputEvent; import techreborn.Core; import techreborn.lib.Key; -public class KeyInputEventHandler { - private static Key getPressedKeybinding() { - if (KeyBindings.config.isPressed()) { - return Key.CONFIG; - } +public class KeyInputEventHandler +{ + private static Key getPressedKeybinding() + { + if (KeyBindings.config.isPressed()) + { + return Key.CONFIG; + } - return Key.UNKNOWN; - } + return Key.UNKNOWN; + } - @SubscribeEvent - public void handleKeyInputEvent(InputEvent.KeyInputEvent event) { - Core.logHelper.info(getPressedKeybinding()); - } + @SubscribeEvent + public void handleKeyInputEvent(InputEvent.KeyInputEvent event) + { + Core.logHelper.info(getPressedKeybinding()); + } } diff --git a/src/main/java/techreborn/client/render/entitys/RenderNukePrimed.java b/src/main/java/techreborn/client/render/entitys/RenderNukePrimed.java index e730d46be..b43423694 100644 --- a/src/main/java/techreborn/client/render/entitys/RenderNukePrimed.java +++ b/src/main/java/techreborn/client/render/entitys/RenderNukePrimed.java @@ -6,10 +6,8 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.init.Blocks; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; -import org.lwjgl.opengl.GL11; import techreborn.blocks.BlockNuke; import techreborn.entitys.EntityNukePrimed; import techreborn.init.ModBlocks; @@ -17,51 +15,59 @@ import techreborn.init.ModBlocks; /** * Created by Mark on 13/03/2016. */ -public class RenderNukePrimed extends Render { +public class RenderNukePrimed extends Render +{ - public RenderNukePrimed(RenderManager renderManager) { - super(renderManager); - this.shadowSize = 0.5F; - } + public RenderNukePrimed(RenderManager renderManager) + { + super(renderManager); + this.shadowSize = 0.5F; + } - @Override - public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) { - BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); - GlStateManager.pushMatrix(); - GlStateManager.translate((float) x, (float) y + 0.5F, (float) z); - if ((float) entity.fuse - partialTicks + 1.0F < 10.0F) { - float f = 1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 10.0F; - f = MathHelper.clamp_float(f, 0.0F, 1.0F); - f = f * f; - f = f * f; - float f1 = 1.0F + f * 0.3F; - GlStateManager.scale(f1, f1, f1); - } - float f2 = (1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(entity); - GlStateManager.translate(-0.5F, -0.5F, 0.5F); - blockrendererdispatcher.renderBlockBrightness(ModBlocks.nuke.getDefaultState(), entity.getBrightness(partialTicks)); - GlStateManager.translate(0.0F, 0.0F, 1.0F); - if (entity.fuse / 5 % 2 == 0) { - GlStateManager.disableLighting(); - GlStateManager.enableBlend(); - GlStateManager.blendFunc(770, 772); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1F); - GlStateManager.doPolygonOffset(-3.0F, -3.0F); - GlStateManager.enablePolygonOffset(); - blockrendererdispatcher.renderBlockBrightness(ModBlocks.nuke.getDefaultState().withProperty(BlockNuke.OVERLAY, true), 1.0F); - GlStateManager.doPolygonOffset(0.0F, 0.0F); - GlStateManager.disablePolygonOffset(); - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - GlStateManager.disableBlend(); - GlStateManager.enableLighting(); - } - GlStateManager.popMatrix(); - super.doRender(entity, x, y, z, entityYaw, partialTicks); - } + @Override + public void doRender(EntityNukePrimed entity, double x, double y, double z, float entityYaw, float partialTicks) + { + BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float) x, (float) y + 0.5F, (float) z); + if ((float) entity.fuse - partialTicks + 1.0F < 10.0F) + { + float f = 1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 10.0F; + f = MathHelper.clamp_float(f, 0.0F, 1.0F); + f = f * f; + f = f * f; + float f1 = 1.0F + f * 0.3F; + GlStateManager.scale(f1, f1, f1); + } + float f2 = (1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F; + this.bindEntityTexture(entity); + GlStateManager.translate(-0.5F, -0.5F, 0.5F); + blockrendererdispatcher.renderBlockBrightness(ModBlocks.nuke.getDefaultState(), + entity.getBrightness(partialTicks)); + GlStateManager.translate(0.0F, 0.0F, 1.0F); + if (entity.fuse / 5 % 2 == 0) + { + GlStateManager.disableLighting(); + GlStateManager.enableBlend(); + GlStateManager.blendFunc(770, 772); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1F); + GlStateManager.doPolygonOffset(-3.0F, -3.0F); + GlStateManager.enablePolygonOffset(); + blockrendererdispatcher.renderBlockBrightness( + ModBlocks.nuke.getDefaultState().withProperty(BlockNuke.OVERLAY, true), 1.0F); + GlStateManager.doPolygonOffset(0.0F, 0.0F); + GlStateManager.disablePolygonOffset(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableBlend(); + GlStateManager.enableLighting(); + } + GlStateManager.popMatrix(); + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } - @Override - protected ResourceLocation getEntityTexture(EntityNukePrimed entity) { - return TextureMap.locationBlocksTexture; - } + @Override + protected ResourceLocation getEntityTexture(EntityNukePrimed entity) + { + return TextureMap.locationBlocksTexture; + } } diff --git a/src/main/java/techreborn/client/render/parts/ClientPartLoader.java b/src/main/java/techreborn/client/render/parts/ClientPartLoader.java index 00acf3ff0..3a25e62ae 100644 --- a/src/main/java/techreborn/client/render/parts/ClientPartLoader.java +++ b/src/main/java/techreborn/client/render/parts/ClientPartLoader.java @@ -10,25 +10,30 @@ import techreborn.compat.ICompatModule; /** * Created by modmuss50 on 05/03/2016. */ -public class ClientPartLoader implements ICompatModule { +public class ClientPartLoader implements ICompatModule +{ - @Override - public void preInit(FMLPreInitializationEvent event) { - MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery()); - } + @Override + public void preInit(FMLPreInitializationEvent event) + { + MinecraftForge.EVENT_BUS.register(new ClientPartModelBakery()); + } - @Override - public void init(FMLInitializationEvent event) { + @Override + public void init(FMLInitializationEvent event) + { - } + } - @Override - public void postInit(FMLPostInitializationEvent event) { + @Override + public void postInit(FMLPostInitializationEvent event) + { - } + } - @Override - public void serverStarting(FMLServerStartingEvent event) { + @Override + public void serverStarting(FMLServerStartingEvent event) + { - } + } } diff --git a/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java b/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java index 4c1a59049..8cad7917a 100644 --- a/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java +++ b/src/main/java/techreborn/client/render/parts/ClientPartModelBakery.java @@ -13,23 +13,28 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 04/03/2016. */ -public class ClientPartModelBakery { - - @SideOnly(Side.CLIENT) - @SubscribeEvent(priority = EventPriority.LOWEST) - public void onModelBake(ModelBakeEvent event){ - for(EnumCableType type : EnumCableType.values()){ - event.getModelRegistry().putObject(new ModelResourceLocation("techreborn:cable#type=" + type.getName().toLowerCase()), new RenderCablePart(type)); - } - } - - @SubscribeEvent - public void textureStichEvent(TextureStitchEvent event){ - for(EnumCableType type : EnumCableType.values()){ - event.map.registerSprite(new ResourceLocation(type.textureName)); - } - } +public class ClientPartModelBakery +{ + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.LOWEST) + public void onModelBake(ModelBakeEvent event) + { + for (EnumCableType type : EnumCableType.values()) + { + event.getModelRegistry().putObject( + new ModelResourceLocation("techreborn:cable#type=" + type.getName().toLowerCase()), + new RenderCablePart(type)); + } + } + @SubscribeEvent + public void textureStichEvent(TextureStitchEvent event) + { + for (EnumCableType type : EnumCableType.values()) + { + event.map.registerSprite(new ResourceLocation(type.textureName)); + } + } } diff --git a/src/main/java/techreborn/client/render/parts/RenderCablePart.java b/src/main/java/techreborn/client/render/parts/RenderCablePart.java index 9e17774af..04b942017 100644 --- a/src/main/java/techreborn/client/render/parts/RenderCablePart.java +++ b/src/main/java/techreborn/client/render/parts/RenderCablePart.java @@ -1,106 +1,152 @@ package techreborn.client.render.parts; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.block.model.*; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.property.IExtendedBlockState; -import org.lwjgl.util.vector.Vector3f; -import reborncore.common.misc.vecmath.Vecs3dCube; -import techreborn.parts.CableMultipart; -import techreborn.parts.EnumCableType; - import java.util.ArrayList; import java.util.Collections; import java.util.List; -public class RenderCablePart implements IBakedModel { +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.util.EnumFacing; +import net.minecraftforge.common.property.IExtendedBlockState; - private FaceBakery faceBakery = new FaceBakery(); +import org.lwjgl.util.vector.Vector3f; - private TextureAtlasSprite texture; +import reborncore.common.misc.vecmath.Vecs3dCube; +import techreborn.parts.CableMultipart; +import techreborn.parts.EnumCableType; - EnumCableType type; +public class RenderCablePart implements IBakedModel +{ - public RenderCablePart(EnumCableType type) { - texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName); - this.type = type; - } + private FaceBakery faceBakery = new FaceBakery(); - public void addCubeToList(Vecs3dCube cube, ArrayList list, BlockPartFace face, ModelRotation modelRotation, TextureAtlasSprite cubeTexture) { - BlockFaceUV uv = new BlockFaceUV(new float[]{(float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMaxX(), (float) cube.getMaxY()}, 0); - face = new BlockPartFace(null, 0, "", uv); - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.DOWN, modelRotation, null, true, true));//down - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMinZ()), new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.UP, modelRotation, null, true, true));//up - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.NORTH, modelRotation, null, true, true));//north - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMaxZ()), new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.SOUTH, modelRotation, null, true, true));//south - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMinZ()), new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.EAST, modelRotation, null, true, true));//east - list.add(faceBakery.makeBakedQuad(new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, EnumFacing.WEST, modelRotation, null, true, true));//west - } + private TextureAtlasSprite texture; - @Override - public List getQuads(IBlockState blockState, EnumFacing side, long rand) { - ArrayList list = new ArrayList(); - BlockFaceUV uv = new BlockFaceUV(new float[]{0.0F, 0.0F, 16.0F, 16.0F}, 0); - BlockPartFace face = new BlockPartFace(null, 0, "", uv); - double thickness = type.cableThickness; - double lastThickness = 16 - thickness; - IExtendedBlockState state = (IExtendedBlockState) blockState; - if(side != null){ - return Collections.emptyList(); - } - addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture); - if (state != null) { - if (state.getValue(CableMultipart.UP)) { - addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness), list, face, ModelRotation.X0_Y0, texture); - } - if (state.getValue(CableMultipart.DOWN)) { - addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list, face, ModelRotation.X0_Y0, texture); - } - if (state.getValue(CableMultipart.NORTH)) { - addCubeToList(new Vecs3dCube(thickness, thickness, 0.0, lastThickness, lastThickness, thickness), list, face, ModelRotation.X0_Y0, texture); - } - if (state.getValue(CableMultipart.SOUTH)) { - addCubeToList(new Vecs3dCube(thickness, thickness, lastThickness, lastThickness, lastThickness, 16.0), list, face, ModelRotation.X0_Y0, texture); - } - if (state.getValue(CableMultipart.EAST)) { - addCubeToList(new Vecs3dCube(lastThickness, thickness, thickness, 16.0, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture); - } - if (state.getValue(CableMultipart.WEST)) { - addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list, face, ModelRotation.X0_Y0, texture); - } - } - return list; - } + EnumCableType type; - @Override - public boolean isAmbientOcclusion() { - return false; - } + public RenderCablePart(EnumCableType type) + { + texture = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(type.textureName); + this.type = type; + } - @Override - public boolean isGui3d() { - return true; - } + public void addCubeToList(Vecs3dCube cube, ArrayList list, BlockPartFace face, + ModelRotation modelRotation, TextureAtlasSprite cubeTexture) + { + BlockFaceUV uv = new BlockFaceUV(new float[] { (float) cube.getMinX(), (float) cube.getMinY(), + (float) cube.getMaxX(), (float) cube.getMaxY() }, 0); + face = new BlockPartFace(null, 0, "", uv); + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.DOWN, modelRotation, null, true, true));// down + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.UP, modelRotation, null, true, true));// up + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.NORTH, modelRotation, null, true, true));// north + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMaxZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.SOUTH, modelRotation, null, true, true));// south + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMaxX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMaxX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.EAST, modelRotation, null, true, true));// east + list.add(faceBakery.makeBakedQuad( + new Vector3f((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ()), + new Vector3f((float) cube.getMinX(), (float) cube.getMaxY(), (float) cube.getMaxZ()), face, cubeTexture, + EnumFacing.WEST, modelRotation, null, true, true));// west + } - @Override - public boolean isBuiltInRenderer() { - return false; - } + @Override + public List getQuads(IBlockState blockState, EnumFacing side, long rand) + { + ArrayList list = new ArrayList(); + BlockFaceUV uv = new BlockFaceUV(new float[] { 0.0F, 0.0F, 16.0F, 16.0F }, 0); + BlockPartFace face = new BlockPartFace(null, 0, "", uv); + double thickness = type.cableThickness; + double lastThickness = 16 - thickness; + IExtendedBlockState state = (IExtendedBlockState) blockState; + if (side != null) + { + return Collections.emptyList(); + } + addCubeToList(new Vecs3dCube(thickness, thickness, thickness, lastThickness, lastThickness, lastThickness), + list, face, ModelRotation.X0_Y0, texture); + if (state != null) + { + if (state.getValue(CableMultipart.UP)) + { + addCubeToList(new Vecs3dCube(thickness, lastThickness, thickness, lastThickness, 16.0, lastThickness), + list, face, ModelRotation.X0_Y0, texture); + } + if (state.getValue(CableMultipart.DOWN)) + { + addCubeToList(new Vecs3dCube(thickness, 0.0, thickness, lastThickness, thickness, lastThickness), list, + face, ModelRotation.X0_Y0, texture); + } + if (state.getValue(CableMultipart.NORTH)) + { + addCubeToList(new Vecs3dCube(thickness, thickness, 0.0, lastThickness, lastThickness, thickness), list, + face, ModelRotation.X0_Y0, texture); + } + if (state.getValue(CableMultipart.SOUTH)) + { + addCubeToList(new Vecs3dCube(thickness, thickness, lastThickness, lastThickness, lastThickness, 16.0), + list, face, ModelRotation.X0_Y0, texture); + } + if (state.getValue(CableMultipart.EAST)) + { + addCubeToList(new Vecs3dCube(lastThickness, thickness, thickness, 16.0, lastThickness, lastThickness), + list, face, ModelRotation.X0_Y0, texture); + } + if (state.getValue(CableMultipart.WEST)) + { + addCubeToList(new Vecs3dCube(0.0, thickness, thickness, thickness, lastThickness, lastThickness), list, + face, ModelRotation.X0_Y0, texture); + } + } + return list; + } - @Override - public TextureAtlasSprite getParticleTexture() { - return texture; - } + @Override + public boolean isAmbientOcclusion() + { + return false; + } - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return ItemCameraTransforms.DEFAULT; - } + @Override + public boolean isGui3d() + { + return true; + } - @Override - public ItemOverrideList getOverrides() { - return null; - } + @Override + public boolean isBuiltInRenderer() + { + return false; + } + + @Override + public TextureAtlasSprite getParticleTexture() + { + return texture; + } + + @Override + public ItemCameraTransforms getItemCameraTransforms() + { + return ItemCameraTransforms.DEFAULT; + } + + @Override + public ItemOverrideList getOverrides() + { + return null; + } } diff --git a/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java b/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java index 0a9acdc7c..4b9cbd73a 100644 --- a/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java +++ b/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java @@ -1,5 +1,10 @@ package techreborn.client.texture; +import java.awt.image.BufferedImage; +import java.io.IOException; + +import javax.imageio.ImageIO; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.IResource; @@ -9,129 +14,150 @@ import net.minecraft.util.ResourceLocation; import reborncore.client.texture.ConnectedTexture; import techreborn.lib.ModInfo; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.IOException; - //1.8 Nope -public class CasingConnectedTextureGenerator extends TextureAtlasSprite { +public class CasingConnectedTextureGenerator extends TextureAtlasSprite +{ - public BufferedImage output_image = null; - String type; - ConnectedTexture connectedTexture; + public BufferedImage output_image = null; + String type; + ConnectedTexture connectedTexture; - public CasingConnectedTextureGenerator(String name, String type, ConnectedTexture connectedTexture) { - super(name); - this.type = type; - this.connectedTexture = connectedTexture; - } + public CasingConnectedTextureGenerator(String name, String type, ConnectedTexture connectedTexture) + { + super(name); + this.type = type; + this.connectedTexture = connectedTexture; + } - public static String getDerivedName(String s2) { - return ModInfo.MOD_ID + ":machine/casing/" + s2; - } + public static String getDerivedName(String s2) + { + return ModInfo.MOD_ID + ":machine/casing/" + s2; + } - public static ResourceLocation getTypeResource(String type) { - return new ResourceLocation("techreborn", "textures/blocks/machine/casing" + type + ".png"); - } + public static ResourceLocation getTypeResource(String type) + { + return new ResourceLocation("techreborn", "textures/blocks/machine/casing" + type + ".png"); + } - private static int[] createTexture(int w, int[] type_data, int[] edge_data, ConnectedTexture connectedTexture) { - int[] new_data = type_data; - for (int i = 0; i < type_data.length; i += 1) { - int x = (i % w); - int y = (i - x) / w; - if (getAlpha(edge_data[i]) != 0) { - if (y <= 1 && connectedTexture.isUp()) { - new_data[i] = edge_data[i]; - } - if (y >= 14 && connectedTexture.isDown()) { - new_data[i] = edge_data[i]; - } - if (x <= 1 && connectedTexture.isRight()) { - new_data[i] = edge_data[i]; - } - if (x >= 14 && connectedTexture.isLeft()) { - new_data[i] = edge_data[i]; - } - } - } - return new_data; - } + private static int[] createTexture(int w, int[] type_data, int[] edge_data, ConnectedTexture connectedTexture) + { + int[] new_data = type_data; + for (int i = 0; i < type_data.length; i += 1) + { + int x = (i % w); + int y = (i - x) / w; + if (getAlpha(edge_data[i]) != 0) + { + if (y <= 1 && connectedTexture.isUp()) + { + new_data[i] = edge_data[i]; + } + if (y >= 14 && connectedTexture.isDown()) + { + new_data[i] = edge_data[i]; + } + if (x <= 1 && connectedTexture.isRight()) + { + new_data[i] = edge_data[i]; + } + if (x >= 14 && connectedTexture.isLeft()) + { + new_data[i] = edge_data[i]; + } + } + } + return new_data; + } - public static int makeCol(int red, int green, int blue, int alpha) { - return (alpha << 24) | (red << 16) | (green << 8) | blue; - } + public static int makeCol(int red, int green, int blue, int alpha) + { + return (alpha << 24) | (red << 16) | (green << 8) | blue; + } - public static int getAlpha(int col) { - return (col & 0xff000000) >> 24; - } + public static int getAlpha(int col) + { + return (col & 0xff000000) >> 24; + } - public static int getRed(int col) { - return (col & 0x00ff0000) >> 16; - } + public static int getRed(int col) + { + return (col & 0x00ff0000) >> 16; + } - public static int getGreen(int col) { - return (col & 0x0000ff00) >> 8; - } + public static int getGreen(int col) + { + return (col & 0x0000ff00) >> 8; + } - public static int getBlue(int col) { - return col & 0x000000ff; - } + public static int getBlue(int col) + { + return col & 0x000000ff; + } - @Override - public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) { - return true; - } + @Override + public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) + { + return true; + } - @Override - public boolean load(IResourceManager manager, ResourceLocation location) { - int mp = Minecraft.getMinecraft().gameSettings.mipmapLevels; - BufferedImage[] type_image = new BufferedImage[1 + mp]; - BufferedImage[] edge_image = new BufferedImage[1 + mp]; + @Override + public boolean load(IResourceManager manager, ResourceLocation location) + { + int mp = Minecraft.getMinecraft().gameSettings.mipmapLevels; + BufferedImage[] type_image = new BufferedImage[1 + mp]; + BufferedImage[] edge_image = new BufferedImage[1 + mp]; - AnimationMetadataSection animation = null; + AnimationMetadataSection animation = null; - try { - IResource typeResource = manager.getResource(getTypeResource(type)); - type_image[0] = ImageIO.read(typeResource.getInputStream()); - animation = (AnimationMetadataSection) typeResource.getMetadata("animation"); + try + { + IResource typeResource = manager.getResource(getTypeResource(type)); + type_image[0] = ImageIO.read(typeResource.getInputStream()); + animation = (AnimationMetadataSection) typeResource.getMetadata("animation"); - IResource edgeResource = manager.getResource(getTypeResource(type + "_edge")); - edge_image[0] = ImageIO.read(edgeResource.getInputStream()); - } catch (IOException e) { - e.printStackTrace(); - } - int w = type_image[0].getWidth(); - int h = type_image[0].getHeight(); + IResource edgeResource = manager.getResource(getTypeResource(type + "_edge")); + edge_image[0] = ImageIO.read(edgeResource.getInputStream()); + } catch (IOException e) + { + e.printStackTrace(); + } + int w = type_image[0].getWidth(); + int h = type_image[0].getHeight(); - output_image = new BufferedImage(w, h, 2); - int[] type_data = new int[w * w]; - int[] edge_data = new int[w * w]; + output_image = new BufferedImage(w, h, 2); + int[] type_data = new int[w * w]; + int[] edge_data = new int[w * w]; - for (int y = 0; y < h; y += w) { - type_image[0].getRGB(0, y, w, w, type_data, 0, w); - edge_image[0].getRGB(0, y, w, w, edge_data, 0, w); - int[] new_data = createTexture(w, type_data, edge_data, connectedTexture); - output_image.setRGB(0, y, w, w, new_data, 0, w); - } + for (int y = 0; y < h; y += w) + { + type_image[0].getRGB(0, y, w, w, type_data, 0, w); + edge_image[0].getRGB(0, y, w, w, edge_data, 0, w); + int[] new_data = createTexture(w, type_data, edge_data, connectedTexture); + output_image.setRGB(0, y, w, w, new_data, 0, w); + } - type_image[0] = output_image; - // this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); - return false; - } + type_image[0] = output_image; + // this.loadSprite(type_image, animation, (float) + // Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); + return false; + } -// @SideOnly(Side.CLIENT) -// public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta, String[] types) { -// if (iconRegister instanceof TextureMap) { -// TextureMap map = (TextureMap) iconRegister; -// String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum); -// TextureAtlasSprite texture = map.getTextureExtry(name); -// if (texture == null) { -// texture = new CasingConnectedTextureGenerator(name, types[meta], connectedTexture); -// map.setTextureEntry(name, texture); -// } -// return map.getTextureExtry(name); -// } else { -// return null; -// } -// } + // @SideOnly(Side.CLIENT) + // public static IIcon genIcon(ConnectedTexture connectedTexture, + // IIconRegister iconRegister, int texNum, int meta, String[] types) { + // if (iconRegister instanceof TextureMap) { + // TextureMap map = (TextureMap) iconRegister; + // String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + // + "." + texNum); + // TextureAtlasSprite texture = map.getTextureExtry(name); + // if (texture == null) { + // texture = new CasingConnectedTextureGenerator(name, types[meta], + // connectedTexture); + // map.setTextureEntry(name, texture); + // } + // return map.getTextureExtry(name); + // } else { + // return null; + // } + // } } diff --git a/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java b/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java index 5f9a3c3c3..a765b2637 100644 --- a/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java +++ b/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java @@ -1,5 +1,10 @@ package techreborn.client.texture; +import java.awt.image.BufferedImage; +import java.io.IOException; + +import javax.imageio.ImageIO; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.IResource; @@ -9,138 +14,160 @@ import net.minecraft.util.ResourceLocation; import reborncore.client.texture.ConnectedTexture; import techreborn.lib.ModInfo; -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.IOException; - - //TODO 1.8 nope -public class LesuConnectedTextureGenerator extends TextureAtlasSprite { +public class LesuConnectedTextureGenerator extends TextureAtlasSprite +{ - public BufferedImage output_image = null; - String type; - ConnectedTexture connectedTexture; + public BufferedImage output_image = null; + String type; + ConnectedTexture connectedTexture; - public LesuConnectedTextureGenerator(String name, String type, ConnectedTexture connectedTexture) { - super(name); - this.type = type; - this.connectedTexture = connectedTexture; - } + public LesuConnectedTextureGenerator(String name, String type, ConnectedTexture connectedTexture) + { + super(name); + this.type = type; + this.connectedTexture = connectedTexture; + } - public static String getDerivedName(String s2) { - return ModInfo.MOD_ID + ":machine/casing/" + s2; - } + public static String getDerivedName(String s2) + { + return ModInfo.MOD_ID + ":machine/casing/" + s2; + } - public static ResourceLocation getTypeResource(String type) { - return new ResourceLocation("techreborn", "textures/blocks/machine/" + type + ".png"); - } + public static ResourceLocation getTypeResource(String type) + { + return new ResourceLocation("techreborn", "textures/blocks/machine/" + type + ".png"); + } - public static ResourceLocation getLapisResource() { - return new ResourceLocation("minecraft", "textures/blocks/lapis_block.png"); - } + public static ResourceLocation getLapisResource() + { + return new ResourceLocation("minecraft", "textures/blocks/lapis_block.png"); + } + private static int[] createTexture(int w, int[] type_data, int[] edge_data, ConnectedTexture connectedTexture) + { + int[] new_data = type_data; + for (int i = 0; i < type_data.length; i += 1) + { + int x = (i % w); + int y = (i - x) / w; + if (getAlpha(edge_data[i]) != 0) + { + if (y <= 1 && connectedTexture.isUp()) + { + new_data[i] = edge_data[i]; + } + if (y >= 14 && connectedTexture.isDown()) + { + new_data[i] = edge_data[i]; + } + if (x <= 1 && connectedTexture.isRight()) + { + new_data[i] = edge_data[i]; + } + if (x >= 14 && connectedTexture.isLeft()) + { + new_data[i] = edge_data[i]; + } + } + } + return new_data; + } - private static int[] createTexture(int w, int[] type_data, int[] edge_data, ConnectedTexture connectedTexture) { - int[] new_data = type_data; - for (int i = 0; i < type_data.length; i += 1) { - int x = (i % w); - int y = (i - x) / w; - if (getAlpha(edge_data[i]) != 0) { - if (y <= 1 && connectedTexture.isUp()) { - new_data[i] = edge_data[i]; - } - if (y >= 14 && connectedTexture.isDown()) { - new_data[i] = edge_data[i]; - } - if (x <= 1 && connectedTexture.isRight()) { - new_data[i] = edge_data[i]; - } - if (x >= 14 && connectedTexture.isLeft()) { - new_data[i] = edge_data[i]; - } - } - } - return new_data; - } + public static int makeCol(int red, int green, int blue, int alpha) + { + return (alpha << 24) | (red << 16) | (green << 8) | blue; + } - public static int makeCol(int red, int green, int blue, int alpha) { - return (alpha << 24) | (red << 16) | (green << 8) | blue; - } + public static int getAlpha(int col) + { + return (col & 0xff000000) >> 24; + } - public static int getAlpha(int col) { - return (col & 0xff000000) >> 24; - } + public static int getRed(int col) + { + return (col & 0x00ff0000) >> 16; + } - public static int getRed(int col) { - return (col & 0x00ff0000) >> 16; - } + public static int getGreen(int col) + { + return (col & 0x0000ff00) >> 8; + } - public static int getGreen(int col) { - return (col & 0x0000ff00) >> 8; - } + public static int getBlue(int col) + { + return col & 0x000000ff; + } - public static int getBlue(int col) { - return col & 0x000000ff; - } + @Override + public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) + { + return true; + } - @Override - public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) { - return true; - } + @Override + public boolean load(IResourceManager manager, ResourceLocation location) + { + int mp = Minecraft.getMinecraft().gameSettings.mipmapLevels; + BufferedImage[] type_image = new BufferedImage[1 + mp]; + BufferedImage[] edge_image = new BufferedImage[1 + mp]; - @Override - public boolean load(IResourceManager manager, ResourceLocation location) { - int mp = Minecraft.getMinecraft().gameSettings.mipmapLevels; - BufferedImage[] type_image = new BufferedImage[1 + mp]; - BufferedImage[] edge_image = new BufferedImage[1 + mp]; + AnimationMetadataSection animation = null; - AnimationMetadataSection animation = null; + try + { + IResource typeResource = manager.getResource(getLapisResource()); + type_image[0] = ImageIO.read(typeResource.getInputStream()); + animation = (AnimationMetadataSection) typeResource.getMetadata("animation"); - try { - IResource typeResource = manager.getResource(getLapisResource()); - type_image[0] = ImageIO.read(typeResource.getInputStream()); - animation = (AnimationMetadataSection) typeResource.getMetadata("animation"); + IResource edgeResource = manager.getResource(getTypeResource("lesu_block")); + edge_image[0] = ImageIO.read(edgeResource.getInputStream()); + } catch (IOException e) + { + e.printStackTrace(); + } + int w = type_image[0].getWidth(); + int h = type_image[0].getHeight(); - IResource edgeResource = manager.getResource(getTypeResource("lesu_block")); - edge_image[0] = ImageIO.read(edgeResource.getInputStream()); - } catch (IOException e) { - e.printStackTrace(); - } - int w = type_image[0].getWidth(); - int h = type_image[0].getHeight(); + output_image = new BufferedImage(w, h, 2); + int[] type_data = new int[w * w]; + int[] edge_data = new int[w * w]; - output_image = new BufferedImage(w, h, 2); - int[] type_data = new int[w * w]; - int[] edge_data = new int[w * w]; + for (int y = 0; y < h; y += w) + { + try + { + type_image[0].getRGB(0, y, w, w, type_data, 0, w); + edge_image[0].getRGB(0, y, w, w, edge_data, 0, w); + } catch (Exception e) + { + e.fillInStackTrace(); + } + int[] new_data = createTexture(w, type_data, edge_data, connectedTexture); + output_image.setRGB(0, y, w, w, new_data, 0, w); + } - for (int y = 0; y < h; y += w) { - try { - type_image[0].getRGB(0, y, w, w, type_data, 0, w); - edge_image[0].getRGB(0, y, w, w, edge_data, 0, w); - } catch (Exception e) { - e.fillInStackTrace(); - } - int[] new_data = createTexture(w, type_data, edge_data, connectedTexture); - output_image.setRGB(0, y, w, w, new_data, 0, w); - } + type_image[0] = output_image; + // this.loadSprite(type_image, animation, (float) + // Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); + return false; + } - type_image[0] = output_image; - // this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); - return false; - } - -// public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) { -// if (iconRegister instanceof TextureMap) { -// TextureMap map = (TextureMap) iconRegister; -// String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + texNum); -// TextureAtlasSprite texture = map.getTextureExtry(name); -// if (texture == null) { -// texture = new LesuConnectedTextureGenerator(name, "lesu", connectedTexture); -// map.setTextureEntry(name, texture); -// } -// return map.getTextureExtry(name); -// } else { -// return null; -// } -// } + // public static IIcon genIcon(ConnectedTexture connectedTexture, + // IIconRegister iconRegister, int texNum, int meta) { + // if (iconRegister instanceof TextureMap) { + // TextureMap map = (TextureMap) iconRegister; + // String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + + // texNum); + // TextureAtlasSprite texture = map.getTextureExtry(name); + // if (texture == null) { + // texture = new LesuConnectedTextureGenerator(name, "lesu", + // connectedTexture); + // map.setTextureEntry(name, texture); + // } + // return map.getTextureExtry(name); + // } else { + // return null; + // } + // } } diff --git a/src/main/java/techreborn/command/TechRebornDevCommand.java b/src/main/java/techreborn/command/TechRebornDevCommand.java index 22dc50371..49d1cea16 100644 --- a/src/main/java/techreborn/command/TechRebornDevCommand.java +++ b/src/main/java/techreborn/command/TechRebornDevCommand.java @@ -1,5 +1,7 @@ package techreborn.command; +import java.util.ArrayList; +import java.util.List; import net.minecraft.block.Block; import net.minecraft.command.CommandBase; @@ -12,65 +14,77 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextComponentString; import net.minecraftforge.fluids.Fluid; import reborncore.api.fuel.FluidPowerManager; -import reborncore.common.explosion.RebornExplosion; import techreborn.api.recipe.RecipeHandler; -import java.util.ArrayList; -import java.util.List; +public class TechRebornDevCommand extends CommandBase +{ -public class TechRebornDevCommand extends CommandBase { + @Override + public String getCommandName() + { + return "trdev"; + } - @Override - public String getCommandName() { - return "trdev"; - } + @Override + public String getCommandUsage(ICommandSender icommandsender) + { + return "commands.forge.usage"; + } - @Override - public String getCommandUsage(ICommandSender icommandsender) { - return "commands.forge.usage"; - } + @Override + public int getRequiredPermissionLevel() + { + return 2; + } - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - if (args.length == 0) { - sender.addChatMessage(new TextComponentString("You need to use arguments, see /trdev help")); - } else if ("help".equals(args[0])) { - sender.addChatMessage(new TextComponentString("recipes - Shows size of the recipe array")); - sender.addChatMessage(new TextComponentString("fluid - Lists the fluid power values")); - } else if ("recipes".equals(args[0])) { - sender.addChatMessage(new TextComponentString(RecipeHandler.recipeList.size() + " recipes loaded")); - } else if ("fluid".equals(args[0])) { - for (Object object : FluidPowerManager.fluidPowerValues.keySet().toArray()) { - if (object instanceof Fluid) { - Fluid fluid = (Fluid) object; - sender.addChatMessage(new TextComponentString(fluid.getUnlocalizedName() + " : " + FluidPowerManager.fluidPowerValues.get(fluid))); - } else { - sender.addChatMessage(new TextComponentString("Found invalid fluid entry")); - } - } - } else if ("clear".equals(args[0])) { - EntityPlayerMP playerMP = (EntityPlayerMP) sender; - List blocksToRemove = new ArrayList<>(); - blocksToRemove.add(Blocks.grass); - blocksToRemove.add(Blocks.dirt); - blocksToRemove.add(Blocks.stone); - for (int x = 0; x < 25; x++) { - for (int z = 0; z < 25; z++) { - for (int y = 0; y < playerMP.posY; y++) { - BlockPos pos = new BlockPos(playerMP.posX + x, y, playerMP.posZ + z); - if (blocksToRemove.contains(playerMP.worldObj.getBlockState(pos).getBlock())) { - playerMP.worldObj.setBlockState(pos, Blocks.air.getDefaultState(), 2); - } - } - } - } - } - } + @Override + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException + { + if (args.length == 0) + { + sender.addChatMessage(new TextComponentString("You need to use arguments, see /trdev help")); + } else if ("help".equals(args[0])) + { + sender.addChatMessage(new TextComponentString("recipes - Shows size of the recipe array")); + sender.addChatMessage(new TextComponentString("fluid - Lists the fluid power values")); + } else if ("recipes".equals(args[0])) + { + sender.addChatMessage(new TextComponentString(RecipeHandler.recipeList.size() + " recipes loaded")); + } else if ("fluid".equals(args[0])) + { + for (Object object : FluidPowerManager.fluidPowerValues.keySet().toArray()) + { + if (object instanceof Fluid) + { + Fluid fluid = (Fluid) object; + sender.addChatMessage(new TextComponentString( + fluid.getUnlocalizedName() + " : " + FluidPowerManager.fluidPowerValues.get(fluid))); + } else + { + sender.addChatMessage(new TextComponentString("Found invalid fluid entry")); + } + } + } else if ("clear".equals(args[0])) + { + EntityPlayerMP playerMP = (EntityPlayerMP) sender; + List blocksToRemove = new ArrayList<>(); + blocksToRemove.add(Blocks.grass); + blocksToRemove.add(Blocks.dirt); + blocksToRemove.add(Blocks.stone); + for (int x = 0; x < 25; x++) + { + for (int z = 0; z < 25; z++) + { + for (int y = 0; y < playerMP.posY; y++) + { + BlockPos pos = new BlockPos(playerMP.posX + x, y, playerMP.posZ + z); + if (blocksToRemove.contains(playerMP.worldObj.getBlockState(pos).getBlock())) + { + playerMP.worldObj.setBlockState(pos, Blocks.air.getDefaultState(), 2); + } + } + } + } + } + } } - - diff --git a/src/main/java/techreborn/compat/CompatManager.java b/src/main/java/techreborn/compat/CompatManager.java index 1edbc0bd2..c01c33a93 100644 --- a/src/main/java/techreborn/compat/CompatManager.java +++ b/src/main/java/techreborn/compat/CompatManager.java @@ -1,5 +1,7 @@ package techreborn.compat; +import java.util.ArrayList; + import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.relauncher.Side; @@ -10,90 +12,115 @@ import techreborn.parts.StandalonePartCompact; import techreborn.parts.TechRebornParts; import techreborn.parts.walia.WailaMcMultiPartCompact; -import java.util.ArrayList; +public class CompatManager +{ -public class CompatManager { + public ArrayList compatModules = new ArrayList(); - public ArrayList compatModules = new ArrayList(); + public static CompatManager INSTANCE = new CompatManager(); - public static CompatManager INSTANCE = new CompatManager(); + public static boolean isIC2Loaded = false; + public static boolean isIC2ClassicLoaded = false; + public static boolean isClassicEnet = false; + public static boolean isGregTechLoaded = false; - public static boolean isIC2Loaded = false; - public static boolean isIC2ClassicLoaded = false; - public static boolean isClassicEnet = false; - public static boolean isGregTechLoaded = false; + public CompatManager() + { + isIC2Loaded = Loader.isModLoaded("IC2"); + isIC2ClassicLoaded = false; + if (isIC2ClassicLoaded) + { + isClassicEnet = true; + } + if (Loader.isModLoaded("Uncomplication")) + { + isClassicEnet = true; + } + if (Loader.isModLoaded("gregtech")) + { + isGregTechLoaded = true; + } + registerCompact(CompatModuleWaila.class, "Waila"); + // registerCompact(MinetweakerCompat.class, "MineTweaker3"); + // registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty"); + // registerCompact(RecipesBuildcraft.class, "BuildCraft|Builders"); + // registerCompact(RecipesThaumcraft.class, "Thaumcraft"); + registerCompact(TechRebornParts.class, "mcmultipart"); + registerCompact(ClientPartLoader.class, "mcmultipart", "@client"); + registerCompact(StandalonePartCompact.class, "!mcmultipart"); + registerCompact(WailaMcMultiPartCompact.class, "mcmultipart", "Waila"); + } - public CompatManager() { - isIC2Loaded = Loader.isModLoaded("IC2"); - isIC2ClassicLoaded = false; - if (isIC2ClassicLoaded) { - isClassicEnet = true; - } - if (Loader.isModLoaded("Uncomplication")) { - isClassicEnet = true; - } - if (Loader.isModLoaded("gregtech")) { - isGregTechLoaded = true; - } - registerCompact(CompatModuleWaila.class, "Waila"); -// registerCompact(MinetweakerCompat.class, "MineTweaker3"); -// registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty"); -// registerCompact(RecipesBuildcraft.class, "BuildCraft|Builders"); -// registerCompact(RecipesThaumcraft.class, "Thaumcraft"); - registerCompact(TechRebornParts.class, "mcmultipart"); - registerCompact(ClientPartLoader.class, "mcmultipart", "@client"); - registerCompact(StandalonePartCompact.class, "!mcmultipart"); - registerCompact(WailaMcMultiPartCompact.class, "mcmultipart", "Waila"); - } + public void registerCompact(Class moduleClass, Object... objs) + { + boolean shouldLoad = ConfigTechReborn.config + .get(ConfigTechReborn.CATEGORY_INTEGRATION, "Compat:" + moduleClass.getSimpleName(), true, + "Should the " + moduleClass.getSimpleName() + " be loaded?") + .getBoolean(true); + if (ConfigTechReborn.config.hasChanged()) + ConfigTechReborn.config.save(); + if (!shouldLoad) + { + return; + } + for (Object obj : objs) + { + if (obj instanceof String) + { + String modid = (String) obj; + if (modid.startsWith("@")) + { + if (modid.equals("@client")) + { + if (FMLCommonHandler.instance().getSide() != Side.CLIENT) + { + return; + } + } + } else if (modid.startsWith("!")) + { + if (Loader.isModLoaded(modid.replaceAll("!", ""))) + { + return; + } + } else + { + if (!Loader.isModLoaded(modid)) + { + return; + } + } + } else if (obj instanceof Boolean) + { + Boolean boo = (Boolean) obj; + if (boo == false) + { + } + return; + } + } + try + { + compatModules.add((ICompatModule) moduleClass.newInstance()); + } catch (InstantiationException e) + { + e.printStackTrace(); + } catch (IllegalAccessException e) + { + e.printStackTrace(); + } + } - public void registerCompact(Class moduleClass, Object... objs) { - boolean shouldLoad = ConfigTechReborn.config.get(ConfigTechReborn.CATEGORY_INTEGRATION, "Compat:" + moduleClass.getSimpleName(), true, "Should the " + moduleClass.getSimpleName() + " be loaded?").getBoolean(true); - if (ConfigTechReborn.config.hasChanged()) - ConfigTechReborn.config.save(); - if(!shouldLoad){ - return; - } - for (Object obj : objs) { - if (obj instanceof String) { - String modid = (String) obj; - if(modid.startsWith("@")){ - if(modid.equals("@client")){ - if(FMLCommonHandler.instance().getSide() != Side.CLIENT){ - return; - } - } - } else if (modid.startsWith("!")) { - if (Loader.isModLoaded(modid.replaceAll("!", ""))) { - return; - } - } else { - if (!Loader.isModLoaded(modid)) { - return; - } - } - } else if (obj instanceof Boolean) { - Boolean boo = (Boolean) obj; - if (boo == false) { - } - return; - } - } - try { - compatModules.add((ICompatModule) moduleClass.newInstance()); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } - } - - public boolean isForestry4() { - try { - Class.forName("forestry.api.arboriculture.EnumWoodType"); - return true; - } catch (ClassNotFoundException e) { - return false; - } - } + public boolean isForestry4() + { + try + { + Class.forName("forestry.api.arboriculture.EnumWoodType"); + return true; + } catch (ClassNotFoundException e) + { + return false; + } + } } diff --git a/src/main/java/techreborn/compat/ICompatModule.java b/src/main/java/techreborn/compat/ICompatModule.java index 69a180ca5..037e94ab3 100644 --- a/src/main/java/techreborn/compat/ICompatModule.java +++ b/src/main/java/techreborn/compat/ICompatModule.java @@ -5,13 +5,14 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; -public interface ICompatModule { +public interface ICompatModule +{ - public void preInit(FMLPreInitializationEvent event); + public void preInit(FMLPreInitializationEvent event); - public void init(FMLInitializationEvent event); + public void init(FMLInitializationEvent event); - public void postInit(FMLPostInitializationEvent event); + public void postInit(FMLPostInitializationEvent event); - public void serverStarting(FMLServerStartingEvent event); + public void serverStarting(FMLServerStartingEvent event); } diff --git a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java index 6697f9809..1917f5f48 100644 --- a/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/BaseRecipeWrapper.java @@ -1,52 +1,64 @@ package techreborn.compat.jei; -import mezz.jei.api.recipe.BlankRecipeWrapper; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import techreborn.api.recipe.BaseRecipe; - -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; -public abstract class BaseRecipeWrapper extends BlankRecipeWrapper { +import javax.annotation.Nonnull; + +import mezz.jei.api.recipe.BlankRecipeWrapper; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import techreborn.api.recipe.BaseRecipe; + +public abstract class BaseRecipeWrapper extends BlankRecipeWrapper +{ protected final T baseRecipe; @Nonnull private final List> inputs; - public BaseRecipeWrapper(T baseRecipe) { + public BaseRecipeWrapper(T baseRecipe) + { this.baseRecipe = baseRecipe; inputs = new ArrayList<>(); - for (ItemStack input : baseRecipe.getInputs()) { - if (baseRecipe.useOreDic()) { + for (ItemStack input : baseRecipe.getInputs()) + { + if (baseRecipe.useOreDic()) + { List oreDictInputs = expandOreDict(input); inputs.add(oreDictInputs); - } else { + } else + { inputs.add(Collections.singletonList(input)); } } } - private static List expandOreDict(ItemStack itemStack) { + private static List expandOreDict(ItemStack itemStack) + { int[] oreIds = OreDictionary.getOreIDs(itemStack); - if (oreIds.length == 0) { + if (oreIds.length == 0) + { return Collections.singletonList(itemStack); } Set itemStackSet = new HashSet<>(); - for (int oreId : oreIds) { + for (int oreId : oreIds) + { String oreName = OreDictionary.getOreName(oreId); List ores = OreDictionary.getOres(oreName); - for (ItemStack ore : ores) { - if (ore.stackSize != itemStack.stackSize) { + for (ItemStack ore : ores) + { + if (ore.stackSize != itemStack.stackSize) + { ItemStack oreCopy = ore.copy(); oreCopy.stackSize = itemStack.stackSize; itemStackSet.add(oreCopy); - } else { + } else + { itemStackSet.add(ore); } } @@ -56,13 +68,15 @@ public abstract class BaseRecipeWrapper extends BlankRecip @Nonnull @Override - public List> getInputs() { + public List> getInputs() + { return inputs; } @Nonnull @Override - public List getOutputs() { + public List getOutputs() + { return baseRecipe.getOutputs(); } } diff --git a/src/main/java/techreborn/compat/jei/RecipeCategoryUids.java b/src/main/java/techreborn/compat/jei/RecipeCategoryUids.java index ac0a7236b..9fad00206 100644 --- a/src/main/java/techreborn/compat/jei/RecipeCategoryUids.java +++ b/src/main/java/techreborn/compat/jei/RecipeCategoryUids.java @@ -1,7 +1,9 @@ package techreborn.compat.jei; -public class RecipeCategoryUids { - private RecipeCategoryUids() { +public class RecipeCategoryUids +{ + private RecipeCategoryUids() + { } public static final String ALLOY_SMELTER = "TechReborn.AlloySmelter"; diff --git a/src/main/java/techreborn/compat/jei/RecipeUtil.java b/src/main/java/techreborn/compat/jei/RecipeUtil.java index 60b25936b..59ece810e 100644 --- a/src/main/java/techreborn/compat/jei/RecipeUtil.java +++ b/src/main/java/techreborn/compat/jei/RecipeUtil.java @@ -1,5 +1,12 @@ package techreborn.compat.jei; +import java.awt.*; +import java.text.NumberFormat; +import java.util.List; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import mezz.jei.api.gui.IGuiFluidStackGroup; import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; @@ -9,19 +16,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.text.translation.I18n; import net.minecraftforge.fluids.FluidStack; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.awt.*; -import java.text.NumberFormat; -import java.util.List; - -public class RecipeUtil { +public class RecipeUtil +{ private static final int color = Color.darkGray.getRGB(); - private RecipeUtil() { + private RecipeUtil() + { } - public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double startCost, final double euPerTick, final int tickTime) { + public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double startCost, + final double euPerTick, final int tickTime) + { FontRenderer fontRendererObj = minecraft.fontRendererObj; int lineSpacing = fontRendererObj.FONT_HEIGHT + 1; @@ -34,7 +39,8 @@ public class RecipeUtil { drawInfo(minecraft, x, y, euPerTick, tickTime); } - public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime) { + public static void drawInfo(@Nonnull Minecraft minecraft, int x, int y, final double euPerTick, final int tickTime) + { FontRenderer fontRendererObj = minecraft.fontRendererObj; int lineSpacing = fontRendererObj.FONT_HEIGHT + 1; @@ -42,46 +48,59 @@ public class RecipeUtil { fontRendererObj.drawString(runningCostString, x, y, color); y += lineSpacing; - String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", tickTime); + String processingTimeString1 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.1", + tickTime); fontRendererObj.drawString(processingTimeString1, x, y, color); y += lineSpacing; int seconds = tickTime / 20; - String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", seconds); + String processingTimeString2 = I18n.translateToLocalFormatted("techreborn.jei.recipe.processing.time.2", + seconds); fontRendererObj.drawString(processingTimeString2, x + 10, y, color); } - public static void setRecipeItems(@Nonnull IRecipeLayout recipeLayout, @Nonnull BaseRecipeWrapper recipe, @Nullable int[] itemInputSlots, @Nullable int[] itemOutputSlots, @Nullable int[] fluidInputSlots, @Nullable int[] fluidOutputSlots) { + public static void setRecipeItems(@Nonnull IRecipeLayout recipeLayout, @Nonnull BaseRecipeWrapper recipe, + @Nullable int[] itemInputSlots, @Nullable int[] itemOutputSlots, @Nullable int[] fluidInputSlots, + @Nullable int[] fluidOutputSlots) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); - if (itemInputSlots != null) { + if (itemInputSlots != null) + { List> inputs = recipe.getInputs(); - for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) { + for (int i = 0; i < inputs.size() && i < itemInputSlots.length; i++) + { int inputSlot = itemInputSlots[i]; guiItemStacks.set(inputSlot, inputs.get(i)); } } - if (itemOutputSlots != null) { + if (itemOutputSlots != null) + { List outputs = recipe.getOutputs(); - for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) { + for (int i = 0; i < outputs.size() && i < itemOutputSlots.length; i++) + { int outputSlot = itemOutputSlots[i]; guiItemStacks.set(outputSlot, outputs.get(i)); } } - if (fluidInputSlots != null) { + if (fluidInputSlots != null) + { List fluidInputs = recipe.getFluidInputs(); - for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) { + for (int i = 0; i < fluidInputs.size() && i < fluidInputSlots.length; i++) + { int inputTank = fluidInputSlots[i]; guiFluidStacks.set(inputTank, fluidInputs.get(i)); } } - if (fluidOutputSlots != null) { + if (fluidOutputSlots != null) + { List fluidOutputs = recipe.getFluidOutputs(); - for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) { + for (int i = 0; i < fluidOutputs.size() && i < fluidOutputSlots.length; i++) + { int outputTank = fluidOutputSlots[i]; guiFluidStacks.set(outputTank, fluidOutputs.get(i)); } diff --git a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java index 9343f82dc..50f8e0211 100644 --- a/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java +++ b/src/main/java/techreborn/compat/jei/TechRebornJeiPlugin.java @@ -1,5 +1,10 @@ package techreborn.compat.jei; +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Nonnull; + import mezz.jei.api.BlankModPlugin; import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; @@ -88,137 +93,150 @@ import techreborn.config.ConfigTechReborn; import techreborn.init.ModItems; import techreborn.items.ItemParts; -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; - @mezz.jei.api.JEIPlugin -public class TechRebornJeiPlugin extends BlankModPlugin { - @Override - public void register(@Nonnull IModRegistry registry) { - IJeiHelpers jeiHelpers = registry.getJeiHelpers(); - IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); +public class TechRebornJeiPlugin extends BlankModPlugin +{ + @Override + public void register(@Nonnull IModRegistry registry) + { + IJeiHelpers jeiHelpers = registry.getJeiHelpers(); + IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); - registry.addRecipeCategories( - new AlloySmelterRecipeCategory(guiHelper), - new AssemblingMachineRecipeCategory(guiHelper), - new BlastFurnaceRecipeCategory(guiHelper), - new CentrifugeRecipeCategory(guiHelper), - new ChemicalReactorRecipeCategory(guiHelper), - new FusionReactorRecipeCategory(guiHelper), - new IndustrialGrinderRecipeCategory(guiHelper), - new ImplosionCompressorRecipeCategory(guiHelper), - new IndustrialElectrolyzerRecipeCategory(guiHelper), - new IndustrialSawmillRecipeCategory(guiHelper), - new RollingMachineRecipeCategory(guiHelper), - new VacuumFreezerRecipeCategory(guiHelper), - new GrinderRecipeCategory(guiHelper), - new ExtractorRecipeCategory(guiHelper), - new CompressorRecipeCategory(guiHelper), - new ScrapboxRecipeCategory(guiHelper), - new RecyclerRecipeCategory(guiHelper) - ); + registry.addRecipeCategories(new AlloySmelterRecipeCategory(guiHelper), + new AssemblingMachineRecipeCategory(guiHelper), new BlastFurnaceRecipeCategory(guiHelper), + new CentrifugeRecipeCategory(guiHelper), new ChemicalReactorRecipeCategory(guiHelper), + new FusionReactorRecipeCategory(guiHelper), new IndustrialGrinderRecipeCategory(guiHelper), + new ImplosionCompressorRecipeCategory(guiHelper), new IndustrialElectrolyzerRecipeCategory(guiHelper), + new IndustrialSawmillRecipeCategory(guiHelper), new RollingMachineRecipeCategory(guiHelper), + new VacuumFreezerRecipeCategory(guiHelper), new GrinderRecipeCategory(guiHelper), + new ExtractorRecipeCategory(guiHelper), new CompressorRecipeCategory(guiHelper), + new ScrapboxRecipeCategory(guiHelper), new RecyclerRecipeCategory(guiHelper)); - registry.addRecipeHandlers( - new AlloySmelterRecipeHandler(jeiHelpers), - new AssemblingMachineRecipeHandler(jeiHelpers), - new BlastFurnaceRecipeHandler(jeiHelpers), - new CentrifugeRecipeHandler(jeiHelpers), - new ChemicalReactorRecipeHandler(jeiHelpers), - new FusionReactorRecipeHandler(), - new IndustrialGrinderRecipeHandler(jeiHelpers), - new ImplosionCompressorRecipeHandler(jeiHelpers), - new IndustrialElectrolyzerRecipeHandler(jeiHelpers), - new IndustrialSawmillRecipeHandler(jeiHelpers), - new RollingMachineRecipeHandler(), - new VacuumFreezerRecipeHandler(jeiHelpers), - new GrinderRecipeHandler(jeiHelpers), - new ExtractorRecipeHandler(jeiHelpers), - new CompressorRecipeHandler(jeiHelpers), - new ScrapboxRecipeHandler(jeiHelpers), - new RecyclerRecipeHandler(jeiHelpers) - ); + registry.addRecipeHandlers(new AlloySmelterRecipeHandler(jeiHelpers), + new AssemblingMachineRecipeHandler(jeiHelpers), new BlastFurnaceRecipeHandler(jeiHelpers), + new CentrifugeRecipeHandler(jeiHelpers), new ChemicalReactorRecipeHandler(jeiHelpers), + new FusionReactorRecipeHandler(), new IndustrialGrinderRecipeHandler(jeiHelpers), + new ImplosionCompressorRecipeHandler(jeiHelpers), new IndustrialElectrolyzerRecipeHandler(jeiHelpers), + new IndustrialSawmillRecipeHandler(jeiHelpers), new RollingMachineRecipeHandler(), + new VacuumFreezerRecipeHandler(jeiHelpers), new GrinderRecipeHandler(jeiHelpers), + new ExtractorRecipeHandler(jeiHelpers), new CompressorRecipeHandler(jeiHelpers), + new ScrapboxRecipeHandler(jeiHelpers), new RecyclerRecipeHandler(jeiHelpers)); - registry.addRecipes(RecipeHandler.recipeList); - registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes); + registry.addRecipes(RecipeHandler.recipeList); + registry.addRecipes(FusionReactorRecipeHelper.reactorRecipes); - try { - registry.addRecipes(RollingMachineRecipeMaker.getRecipes()); - } catch (RuntimeException e) { - Core.logHelper.error("Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations."); - e.printStackTrace(); - } + try + { + registry.addRecipes(RollingMachineRecipeMaker.getRecipes()); + } catch (RuntimeException e) + { + Core.logHelper.error( + "Could not register rolling machine recipes. JEI may have changed its internal recipe wrapper locations."); + e.printStackTrace(); + } - if (mezz.jei.config.Config.isDebugModeEnabled()) { - addDebugRecipes(registry); - } + if (mezz.jei.config.Config.isDebugModeEnabled()) + { + addDebugRecipes(registry); + } - registry.addDescription(ItemParts.getPartByName("rubberSap"), I18n.translateToLocal("techreborn.desc.rubberSap")); - if(!ConfigTechReborn.scrapboxDispenser){ - registry.addDescription(new ItemStack(ModItems.scrapBox), I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser")); - } else { - registry.addDescription(new ItemStack(ModItems.scrapBox), I18n.translateToLocal("techreborn.desc.scrapBox")); - } - - registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER, VanillaRecipeCategoryUid.FUEL); - registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER); - registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE); - registry.addRecipeClickArea(GuiBlastFurnace.class, 63, 36, 24, 15, RecipeCategoryUids.BLAST_FURNACE); - registry.addRecipeClickArea(GuiCentrifuge.class, 98, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE); - registry.addRecipeClickArea(GuiCentrifuge.class, 68, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE); - registry.addRecipeClickArea(GuiCentrifuge.class, 83, 23, 12, 9, RecipeCategoryUids.CENTRIFUGE); - registry.addRecipeClickArea(GuiCentrifuge.class, 83, 53, 12, 9, RecipeCategoryUids.CENTRIFUGE); - registry.addRecipeClickArea(GuiChemicalReactor.class, 73, 39, 32, 12, RecipeCategoryUids.CHEMICAL_REACTOR); - registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR); - registry.addRecipeClickArea(GuiIndustrialGrinder.class, 50, 35, 25, 16, RecipeCategoryUids.INDUSTRIAL_GRINDER); - registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15, RecipeCategoryUids.IMPLOSION_COMPRESSOR); - registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14, RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); - registry.addRecipeClickArea(GuiIndustrialSawmill.class, 55, 36, 24, 16, RecipeCategoryUids.INDUSTRIAL_SAWMILL); - registry.addRecipeClickArea(GuiRollingMachine.class, 89, 32, 26, 25, RecipeCategoryUids.ROLLING_MACHINE); - registry.addRecipeClickArea(GuiVacuumFreezer.class, 78, 36, 24, 16, RecipeCategoryUids.VACUUM_FREEZER); - registry.addRecipeClickArea(GuiGrinder.class, 78, 36, 24, 16, RecipeCategoryUids.GRINDER); - registry.addRecipeClickArea(GuiExtractor.class, 78, 36, 24, 16, RecipeCategoryUids.EXTRACTOR); - registry.addRecipeClickArea(GuiCompressor.class, 78, 36, 24, 16, RecipeCategoryUids.COMPRESSOR); - registry.addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING, VanillaRecipeCategoryUid.FUEL); - registry.addRecipeClickArea(GuiElectricFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING, VanillaRecipeCategoryUid.FUEL); - registry.addRecipeClickArea(GuiRecycler.class, 78, 36, 24, 16, RecipeCategoryUids.RECYCLER); + registry.addDescription(ItemParts.getPartByName("rubberSap"), + I18n.translateToLocal("techreborn.desc.rubberSap")); + if (!ConfigTechReborn.scrapboxDispenser) + { + registry.addDescription(new ItemStack(ModItems.scrapBox), + I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser")); + } else + { + registry.addDescription(new ItemStack(ModItems.scrapBox), + I18n.translateToLocal("techreborn.desc.scrapBox")); + } + registry.addRecipeClickArea(GuiAlloyFurnace.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER, + VanillaRecipeCategoryUid.FUEL); + registry.addRecipeClickArea(GuiAlloySmelter.class, 80, 35, 26, 20, RecipeCategoryUids.ALLOY_SMELTER); + registry.addRecipeClickArea(GuiAssemblingMachine.class, 85, 34, 24, 20, RecipeCategoryUids.ASSEMBLING_MACHINE); + registry.addRecipeClickArea(GuiBlastFurnace.class, 63, 36, 24, 15, RecipeCategoryUids.BLAST_FURNACE); + registry.addRecipeClickArea(GuiCentrifuge.class, 98, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE); + registry.addRecipeClickArea(GuiCentrifuge.class, 68, 37, 9, 12, RecipeCategoryUids.CENTRIFUGE); + registry.addRecipeClickArea(GuiCentrifuge.class, 83, 23, 12, 9, RecipeCategoryUids.CENTRIFUGE); + registry.addRecipeClickArea(GuiCentrifuge.class, 83, 53, 12, 9, RecipeCategoryUids.CENTRIFUGE); + registry.addRecipeClickArea(GuiChemicalReactor.class, 73, 39, 32, 12, RecipeCategoryUids.CHEMICAL_REACTOR); + registry.addRecipeClickArea(GuiFusionReactor.class, 111, 34, 27, 19, RecipeCategoryUids.FUSION_REACTOR); + registry.addRecipeClickArea(GuiIndustrialGrinder.class, 50, 35, 25, 16, RecipeCategoryUids.INDUSTRIAL_GRINDER); + registry.addRecipeClickArea(GuiImplosionCompressor.class, 60, 37, 24, 15, + RecipeCategoryUids.IMPLOSION_COMPRESSOR); + registry.addRecipeClickArea(GuiIndustrialElectrolyzer.class, 72, 37, 33, 14, + RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER); + registry.addRecipeClickArea(GuiIndustrialSawmill.class, 55, 36, 24, 16, RecipeCategoryUids.INDUSTRIAL_SAWMILL); + registry.addRecipeClickArea(GuiRollingMachine.class, 89, 32, 26, 25, RecipeCategoryUids.ROLLING_MACHINE); + registry.addRecipeClickArea(GuiVacuumFreezer.class, 78, 36, 24, 16, RecipeCategoryUids.VACUUM_FREEZER); + registry.addRecipeClickArea(GuiGrinder.class, 78, 36, 24, 16, RecipeCategoryUids.GRINDER); + registry.addRecipeClickArea(GuiExtractor.class, 78, 36, 24, 16, RecipeCategoryUids.EXTRACTOR); + registry.addRecipeClickArea(GuiCompressor.class, 78, 36, 24, 16, RecipeCategoryUids.COMPRESSOR); + registry.addRecipeClickArea(GuiIronFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING, + VanillaRecipeCategoryUid.FUEL); + registry.addRecipeClickArea(GuiElectricFurnace.class, 78, 36, 24, 16, VanillaRecipeCategoryUid.SMELTING, + VanillaRecipeCategoryUid.FUEL); + registry.addRecipeClickArea(GuiRecycler.class, 78, 36, 24, 16, RecipeCategoryUids.RECYCLER); - IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry(); - recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 4, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, 0, 2, 8, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, 1, 4, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerAssemblingMachine.class, RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2, 8, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, 0, 2, 4, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, 11, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerChemicalReactor.class, RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, 0, 2, 3, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialGrinder.class, RecipeCategoryUids.GRINDER, 0, 2, 6, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerImplosionCompressor.class, RecipeCategoryUids.IMPLOSION_COMPRESSOR, 0, 2, 4, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialElectrolyzer.class, RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialSawmill.class, RecipeCategoryUids.INDUSTRIAL_SAWMILL, 0, 2, 5, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerRollingMachine.class, RecipeCategoryUids.ROLLING_MACHINE, 0, 9, 11, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, 0, 1, 2, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 1, 2, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerExtractor.class, RecipeCategoryUids.EXTRACTOR, 0, 1, 2, 36); - recipeTransferRegistry.addRecipeTransferHandler(ContainerCompressor.class, RecipeCategoryUids.COMPRESSOR, 0, 1, 2, 36); + IRecipeTransferRegistry recipeTransferRegistry = registry.getRecipeTransferRegistry(); + recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, RecipeCategoryUids.ALLOY_SMELTER, + 0, 2, 4, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloySmelter.class, RecipeCategoryUids.ALLOY_SMELTER, + 0, 2, 8, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerAlloyFurnace.class, VanillaRecipeCategoryUid.FUEL, 3, + 1, 4, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerAssemblingMachine.class, + RecipeCategoryUids.ASSEMBLING_MACHINE, 0, 2, 8, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerBlastFurnace.class, RecipeCategoryUids.BLAST_FURNACE, + 0, 2, 4, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerCentrifuge.class, RecipeCategoryUids.CENTRIFUGE, 0, 2, + 11, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerChemicalReactor.class, + RecipeCategoryUids.CHEMICAL_REACTOR, 0, 2, 8, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerFusionReactor.class, RecipeCategoryUids.FUSION_REACTOR, + 0, 2, 3, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialGrinder.class, RecipeCategoryUids.GRINDER, 0, + 2, 6, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerImplosionCompressor.class, + RecipeCategoryUids.IMPLOSION_COMPRESSOR, 0, 2, 4, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialElectrolyzer.class, + RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER, 0, 2, 7, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerIndustrialSawmill.class, + RecipeCategoryUids.INDUSTRIAL_SAWMILL, 0, 2, 5, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerRollingMachine.class, + RecipeCategoryUids.ROLLING_MACHINE, 0, 9, 11, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerVacuumFreezer.class, RecipeCategoryUids.VACUUM_FREEZER, + 0, 1, 2, 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerGrinder.class, RecipeCategoryUids.GRINDER, 0, 1, 2, + 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerExtractor.class, RecipeCategoryUids.EXTRACTOR, 0, 1, 2, + 36); + recipeTransferRegistry.addRecipeTransferHandler(ContainerCompressor.class, RecipeCategoryUids.COMPRESSOR, 0, 1, + 2, 36); - } + } - private static void addDebugRecipes(IModRegistry registry) { - ItemStack diamondBlock = new ItemStack(Blocks.diamond_block); - ItemStack dirtBlock = new ItemStack(Blocks.dirt); - List debugRecipes = new ArrayList<>(); - for (int i = 0; i < 10; i++) { - int time = (int) Math.round(200 + Math.random() * 100); - AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock, dirtBlock, time, 120); - debugRecipes.add(assemblingMachineRecipe); - } - for (int i = 0; i < 10; i++) { - int time = (int) Math.round(200 + Math.random() * 100); - ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock, dirtBlock, time, 120); - debugRecipes.add(recipe); - } - registry.addRecipes(debugRecipes); - } + private static void addDebugRecipes(IModRegistry registry) + { + ItemStack diamondBlock = new ItemStack(Blocks.diamond_block); + ItemStack dirtBlock = new ItemStack(Blocks.dirt); + List debugRecipes = new ArrayList<>(); + for (int i = 0; i < 10; i++) + { + int time = (int) Math.round(200 + Math.random() * 100); + AssemblingMachineRecipe assemblingMachineRecipe = new AssemblingMachineRecipe(diamondBlock, diamondBlock, + dirtBlock, time, 120); + debugRecipes.add(assemblingMachineRecipe); + } + for (int i = 0; i < 10; i++) + { + int time = (int) Math.round(200 + Math.random() * 100); + ImplosionCompressorRecipe recipe = new ImplosionCompressorRecipe(diamondBlock, diamondBlock, dirtBlock, + dirtBlock, time, 120); + debugRecipes.add(recipe); + } + registry.addRecipes(debugRecipes); + } } diff --git a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeCategory.java b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeCategory.java index 699d5e761..12f4310db 100644 --- a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.alloySmelter; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IDrawableAnimated; @@ -14,54 +16,61 @@ import techreborn.client.gui.GuiAlloySmelter; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class AlloySmelterRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2}; +public class AlloySmelterRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2 }; private final IDrawable background; private final IDrawableAnimated electricity; private final String title; - public AlloySmelterRecipeCategory(IGuiHelper guiHelper) { + public AlloySmelterRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiAlloySmelter.texture, 46, 16, 91, 54); IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 0, 14, 14); - electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, true); + electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, + true); title = I18n.translateToLocal("techreborn.jei.category.alloy.furnace"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.ALLOY_SMELTER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawAnimations(@Nonnull Minecraft minecraft) { + public void drawAnimations(@Nonnull Minecraft minecraft) + { electricity.draw(minecraft, 10, 20); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0); guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0); guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18); - if (recipeWrapper instanceof AlloySmelterRecipeWrapper) { + if (recipeWrapper instanceof AlloySmelterRecipeWrapper) + { AlloySmelterRecipeWrapper recipe = (AlloySmelterRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeHandler.java b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeHandler.java index dd0d8a822..1f2c691ff 100644 --- a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.alloySmelter; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.AlloySmelterRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class AlloySmelterRecipeHandler implements IRecipeHandler { +public class AlloySmelterRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public AlloySmelterRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public AlloySmelterRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return AlloySmelterRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.ALLOY_SMELTER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull AlloySmelterRecipe recipe) + { return new AlloySmelterRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe) { + public boolean isRecipeValid(@Nonnull AlloySmelterRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeWrapper.java b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeWrapper.java index d2958e95d..1cf21f57a 100644 --- a/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/alloySmelter/AlloySmelterRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.alloySmelter; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,20 +11,22 @@ import techreborn.api.recipe.machines.AlloySmelterRecipe; import techreborn.client.gui.GuiAlloySmelter; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper { +public class AlloySmelterRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated arrow; - public AlloySmelterRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AlloySmelterRecipe baseRecipe) { + public AlloySmelterRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AlloySmelterRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic arrowStatic = guiHelper.createDrawable(GuiAlloySmelter.texture, 176, 14, 24, 17); - this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false); + this.arrow = guiHelper.createAnimatedDrawable(arrowStatic, baseRecipe.tickTime(), + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); arrow.draw(minecraft, 33, 19); } diff --git a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeCategory.java b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeCategory.java index 2c6665993..5ce41de8d 100644 --- a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.assemblingMachine; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IDrawableAnimated; @@ -14,54 +16,61 @@ import techreborn.client.gui.GuiAssemblingMachine; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class AssemblingMachineRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2}; +public class AssemblingMachineRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2 }; private final IDrawable background; private final IDrawableAnimated electricity; private final String title; - public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) { + public AssemblingMachineRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiAssemblingMachine.texture, 46, 16, 91, 54); IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 0, 14, 14); - electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, true); + electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, + true); title = I18n.translateToLocal("tile.techreborn.assemblingmachine.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.ASSEMBLING_MACHINE; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawAnimations(@Nonnull Minecraft minecraft) { + public void drawAnimations(@Nonnull Minecraft minecraft) + { electricity.draw(minecraft, 10, 20); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0); guiItemStacks.init(INPUT_SLOTS[1], true, 18, 0); guiItemStacks.init(OUTPUT_SLOTS[0], false, 69, 18); - if (recipeWrapper instanceof AssemblingMachineRecipeWrapper) { + if (recipeWrapper instanceof AssemblingMachineRecipeWrapper) + { AssemblingMachineRecipeWrapper recipe = (AssemblingMachineRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeHandler.java b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeHandler.java index e80d2d400..cafe0652d 100644 --- a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.assemblingMachine; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.AssemblingMachineRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class AssemblingMachineRecipeHandler implements IRecipeHandler { +public class AssemblingMachineRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public AssemblingMachineRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public AssemblingMachineRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return AssemblingMachineRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.ASSEMBLING_MACHINE; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull AssemblingMachineRecipe recipe) + { return new AssemblingMachineRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe) { + public boolean isRecipeValid(@Nonnull AssemblingMachineRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeWrapper.java b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeWrapper.java index 0adb8c88b..75c91cdc8 100644 --- a/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/assemblingMachine/AssemblingMachineRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.assemblingMachine; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,20 +11,22 @@ import techreborn.api.recipe.machines.AssemblingMachineRecipe; import techreborn.client.gui.GuiAssemblingMachine; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper { +public class AssemblingMachineRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe) { + public AssemblingMachineRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull AssemblingMachineRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiAssemblingMachine.texture, 176, 14, 20, 18); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 40, 18); } diff --git a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeCategory.java b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeCategory.java index a9a277f90..db8a77ffd 100644 --- a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.blastFurnace; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,47 +13,52 @@ import techreborn.client.gui.GuiBlastFurnace; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class BlastFurnaceRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3}; +public class BlastFurnaceRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3 }; private final IDrawable background; private final String title; - public BlastFurnaceRecipeCategory(IGuiHelper guiHelper) { + public BlastFurnaceRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiBlastFurnace.texture, 39, 24, 100, 36); title = I18n.translateToLocal("tile.techreborn.blastfurnace.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.BLAST_FURNACE; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0); guiItemStacks.init(INPUT_SLOTS[1], true, 0, 18); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 10); guiItemStacks.init(OUTPUT_SLOTS[1], false, 78, 10); - if (recipeWrapper instanceof BlastFurnaceRecipeWrapper) { + if (recipeWrapper instanceof BlastFurnaceRecipeWrapper) + { BlastFurnaceRecipeWrapper recipe = (BlastFurnaceRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeHandler.java b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeHandler.java index ee2a9d05b..3269cf035 100644 --- a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.blastFurnace; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.BlastFurnaceRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class BlastFurnaceRecipeHandler implements IRecipeHandler { +public class BlastFurnaceRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public BlastFurnaceRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public BlastFurnaceRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return BlastFurnaceRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.BLAST_FURNACE; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull BlastFurnaceRecipe recipe) + { return new BlastFurnaceRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe) { + public boolean isRecipeValid(@Nonnull BlastFurnaceRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeWrapper.java b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeWrapper.java index 48e8dc0c5..18dc6df78 100644 --- a/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/blastFurnace/BlastFurnaceRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.blastFurnace; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,21 +11,23 @@ import techreborn.api.recipe.machines.BlastFurnaceRecipe; import techreborn.client.gui.GuiBlastFurnace; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper { +public class BlastFurnaceRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public BlastFurnaceRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull BlastFurnaceRecipe baseRecipe) { + public BlastFurnaceRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull BlastFurnaceRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiBlastFurnace.texture, 176, 14, 20, 11); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); - progress.draw(minecraft, 54-29, 13); + progress.draw(minecraft, 54 - 29, 13); } } diff --git a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeCategory.java b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeCategory.java index 79725bc19..c5486265a 100644 --- a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.centrifuge; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,40 +13,44 @@ import techreborn.client.gui.GuiCentrifuge; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class CentrifugeRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3, 4, 5}; +public class CentrifugeRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 }; private final IDrawable background; private final String title; - public CentrifugeRecipeCategory(IGuiHelper guiHelper) { + public CentrifugeRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiCentrifuge.texture, 49, 4, 78, 78); title = I18n.translateToLocal("tile.techreborn.centrifuge.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.CENTRIFUGE; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 30, 30); guiItemStacks.init(INPUT_SLOTS[1], true, 0, 0); @@ -54,7 +60,8 @@ public class CentrifugeRecipeCategory extends BlankRecipeCategory { guiItemStacks.init(OUTPUT_SLOTS[2], false, 30, 60); guiItemStacks.init(OUTPUT_SLOTS[3], false, 0, 30); - if (recipeWrapper instanceof CentrifugeRecipeWrapper) { + if (recipeWrapper instanceof CentrifugeRecipeWrapper) + { CentrifugeRecipeWrapper recipe = (CentrifugeRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeHandler.java b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeHandler.java index 46d30229f..fc71c6735 100644 --- a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.centrifuge; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.CentrifugeRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class CentrifugeRecipeHandler implements IRecipeHandler { +public class CentrifugeRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public CentrifugeRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public CentrifugeRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return CentrifugeRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.CENTRIFUGE; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull CentrifugeRecipe recipe) + { return new CentrifugeRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe) { + public boolean isRecipeValid(@Nonnull CentrifugeRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java index 17aa3469f..440aca33f 100644 --- a/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/centrifuge/CentrifugeRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.centrifuge; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,15 +11,15 @@ import techreborn.api.recipe.machines.CentrifugeRecipe; import techreborn.client.gui.GuiCentrifuge; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class CentrifugeRecipeWrapper extends BaseRecipeWrapper { +public class CentrifugeRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progressUp; private final IDrawableAnimated progressLeft; private final IDrawableAnimated progressDown; private final IDrawableAnimated progressRight; - public CentrifugeRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CentrifugeRecipe baseRecipe) { + public CentrifugeRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CentrifugeRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressUpStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 14, 12, 12); @@ -25,15 +27,21 @@ public class CentrifugeRecipeWrapper extends BaseRecipeWrapper IDrawableStatic progressDownStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 38, 12, 12); IDrawableStatic progressRightStatic = guiHelper.createDrawable(GuiCentrifuge.texture, 176, 50, 12, 12); - int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation a bit - this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle, IDrawableAnimated.StartDirection.BOTTOM, false); - this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle, IDrawableAnimated.StartDirection.RIGHT, false); - this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle, IDrawableAnimated.StartDirection.TOP, false); - this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + int ticksPerCycle = baseRecipe.tickTime() / 4; // speed up the animation + // a bit + this.progressUp = guiHelper.createAnimatedDrawable(progressUpStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.BOTTOM, false); + this.progressLeft = guiHelper.createAnimatedDrawable(progressLeftStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.RIGHT, false); + this.progressDown = guiHelper.createAnimatedDrawable(progressDownStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.TOP, false); + this.progressRight = guiHelper.createAnimatedDrawable(progressRightStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progressUp.draw(minecraft, 33, 18); progressLeft.draw(minecraft, 18, 33); diff --git a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeCategory.java b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeCategory.java index e914734be..ea0de6815 100644 --- a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.chemicalReactor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,47 +13,52 @@ import techreborn.client.gui.GuiChemicalReactor; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class ChemicalReactorRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2}; +public class ChemicalReactorRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2 }; private final IDrawable background; private final String title; - public ChemicalReactorRecipeCategory(IGuiHelper guiHelper) { + public ChemicalReactorRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiChemicalReactor.texture, 69, 20, 38, 48); title = I18n.translateToLocal("tile.techreborn.chemicalreactor.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.CHEMICAL_REACTOR; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 0); guiItemStacks.init(INPUT_SLOTS[1], true, 20, 0); guiItemStacks.init(OUTPUT_SLOTS[0], false, 10, 30); - if (recipeWrapper instanceof ChemicalReactorRecipeWrapper) { + if (recipeWrapper instanceof ChemicalReactorRecipeWrapper) + { ChemicalReactorRecipeWrapper recipe = (ChemicalReactorRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeHandler.java b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeHandler.java index 15ab89875..282681c20 100644 --- a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.chemicalReactor; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.ChemicalReactorRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class ChemicalReactorRecipeHandler implements IRecipeHandler { +public class ChemicalReactorRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public ChemicalReactorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public ChemicalReactorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return ChemicalReactorRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.CHEMICAL_REACTOR; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalReactorRecipe recipe) + { return new ChemicalReactorRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe) { + public boolean isRecipeValid(@Nonnull ChemicalReactorRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeWrapper.java index 1ef99da95..f5ce8efc0 100644 --- a/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/chemicalReactor/ChemicalReactorRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.chemicalReactor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.machines.ChemicalReactorRecipe; import techreborn.client.gui.GuiChemicalReactor; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper { +public class ChemicalReactorRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public ChemicalReactorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ChemicalReactorRecipe baseRecipe) { + public ChemicalReactorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ChemicalReactorRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiChemicalReactor.texture, 176, 14, 32, 12); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.TOP, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.TOP, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 3, 18); } diff --git a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeCategory.java b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeCategory.java index 71ec9f530..ac69b2ba2 100644 --- a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.compressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiCompressor; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class CompressorRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class CompressorRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public CompressorRecipeCategory(IGuiHelper guiHelper) { + public CompressorRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26); title = I18n.translateToLocal("tile.techreborn.compressor.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.COMPRESSOR; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof CompressorRecipeWrapper) { + if (recipeWrapper instanceof CompressorRecipeWrapper) + { CompressorRecipeWrapper recipe = (CompressorRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeHandler.java b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeHandler.java index 8ba644fc2..469897f5a 100644 --- a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.compressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.CompressorRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class CompressorRecipeHandler implements IRecipeHandler { +public class CompressorRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public CompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public CompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return CompressorRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.COMPRESSOR; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull CompressorRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull CompressorRecipe recipe) + { return new CompressorRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull CompressorRecipe recipe) { + public boolean isRecipeValid(@Nonnull CompressorRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeWrapper.java index 7c682af8c..63eab05c2 100644 --- a/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/compressor/CompressorRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.compressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.machines.CompressorRecipe; import techreborn.client.gui.GuiCompressor; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class CompressorRecipeWrapper extends BaseRecipeWrapper { +public class CompressorRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public CompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CompressorRecipe baseRecipe) { + public CompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull CompressorRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeCategory.java b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeCategory.java index dd04e247d..e56120a5a 100644 --- a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.extractor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiExtractor; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class ExtractorRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class ExtractorRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public ExtractorRecipeCategory(IGuiHelper guiHelper) { + public ExtractorRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiExtractor.texture, 55, 30, 82, 26); title = I18n.translateToLocal("tile.techreborn.extractor.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.EXTRACTOR; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof ExtractorRecipeWrapper) { + if (recipeWrapper instanceof ExtractorRecipeWrapper) + { ExtractorRecipeWrapper recipe = (ExtractorRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeHandler.java b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeHandler.java index c546fbb5f..ef343edf8 100644 --- a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.extractor; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.ExtractorRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class ExtractorRecipeHandler implements IRecipeHandler { +public class ExtractorRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public ExtractorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public ExtractorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return ExtractorRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.EXTRACTOR; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull ExtractorRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull ExtractorRecipe recipe) + { return new ExtractorRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull ExtractorRecipe recipe) { + public boolean isRecipeValid(@Nonnull ExtractorRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeWrapper.java index 69deece16..24d6deb39 100644 --- a/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/extractor/ExtractorRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.extractor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.machines.ExtractorRecipe; import techreborn.client.gui.GuiExtractor; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class ExtractorRecipeWrapper extends BaseRecipeWrapper { +public class ExtractorRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public ExtractorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ExtractorRecipe baseRecipe) { + public ExtractorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ExtractorRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiExtractor.texture, 176, 17, 22, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeCategory.java b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeCategory.java index 5ccbc1375..6703db449 100644 --- a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.fusionReactor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -10,55 +12,60 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.gui.GuiFusionReactor; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; +public class FusionReactorRecipeCategory extends BlankRecipeCategory +{ -public class FusionReactorRecipeCategory extends BlankRecipeCategory { + private static final int inputSlotTop = 0; + private static final int inputSlotBottom = 1; + private static final int outputSlot = 2; - private static final int inputSlotTop = 0; - private static final int inputSlotBottom = 1; - private static final int outputSlot = 2; + @Nonnull + private final IDrawable background; + @Nonnull + private final String title; - @Nonnull - private final IDrawable background; - @Nonnull - private final String title; + public FusionReactorRecipeCategory(IGuiHelper guiHelper) + { + background = guiHelper.createDrawable(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20); + title = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); + } - public FusionReactorRecipeCategory(IGuiHelper guiHelper) { - background = guiHelper.createDrawable(GuiFusionReactor.texture, 86, 16, 85, 64, 0, 40, 20, 20); - title = I18n.translateToLocal("tile.techreborn.fusioncontrolcomputer.name"); - } + @Nonnull + @Override + public String getUid() + { + return RecipeCategoryUids.FUSION_REACTOR; + } - @Nonnull - @Override - public String getUid() { - return RecipeCategoryUids.FUSION_REACTOR; - } + @Nonnull + @Override + public String getTitle() + { + return title; + } - @Nonnull - @Override - public String getTitle() { - return title; - } + @Nonnull + @Override + public IDrawable getBackground() + { + return background; + } - @Nonnull - @Override - public IDrawable getBackground() { - return background; - } + @Override + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { + IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); + itemStacks.init(inputSlotTop, true, 21, 0); + itemStacks.init(inputSlotBottom, true, 21, 36); + itemStacks.init(outputSlot, false, 81, 18); - @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { - IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks(); - itemStacks.init(inputSlotTop, true, 21, 0); - itemStacks.init(inputSlotBottom, true, 21, 36); - itemStacks.init(outputSlot, false, 81, 18); - - if (recipeWrapper instanceof FusionReactorRecipeWrapper) { - FusionReactorRecipeWrapper fusionRecipe = (FusionReactorRecipeWrapper) recipeWrapper; - itemStacks.set(inputSlotTop, fusionRecipe.getTopInput()); - itemStacks.set(inputSlotBottom, fusionRecipe.getBottomInput()); - itemStacks.set(outputSlot, fusionRecipe.getOutputs()); - } - } + if (recipeWrapper instanceof FusionReactorRecipeWrapper) + { + FusionReactorRecipeWrapper fusionRecipe = (FusionReactorRecipeWrapper) recipeWrapper; + itemStacks.set(inputSlotTop, fusionRecipe.getTopInput()); + itemStacks.set(inputSlotBottom, fusionRecipe.getBottomInput()); + itemStacks.set(outputSlot, fusionRecipe.getOutputs()); + } + } } diff --git a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeHandler.java b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeHandler.java index 0afe60fb8..d68ae15bc 100644 --- a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeHandler.java @@ -1,34 +1,39 @@ package techreborn.compat.jei.fusionReactor; +import javax.annotation.Nonnull; + import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.reactor.FusionReactorRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; +public class FusionReactorRecipeHandler implements IRecipeHandler +{ -public class FusionReactorRecipeHandler implements IRecipeHandler { + @Nonnull + @Override + public Class getRecipeClass() + { + return FusionReactorRecipe.class; + } - @Nonnull - @Override - public Class getRecipeClass() { - return FusionReactorRecipe.class; - } + @Nonnull + @Override + public String getRecipeCategoryUid() + { + return RecipeCategoryUids.FUSION_REACTOR; + } - @Nonnull - @Override - public String getRecipeCategoryUid() { - return RecipeCategoryUids.FUSION_REACTOR; - } + @Nonnull + @Override + public IRecipeWrapper getRecipeWrapper(@Nonnull FusionReactorRecipe recipe) + { + return new FusionReactorRecipeWrapper(recipe); + } - @Nonnull - @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull FusionReactorRecipe recipe) { - return new FusionReactorRecipeWrapper(recipe); - } - - @Override - public boolean isRecipeValid(@Nonnull FusionReactorRecipe recipe) { - return true; - } + @Override + public boolean isRecipeValid(@Nonnull FusionReactorRecipe recipe) + { + return true; + } } diff --git a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java index d68c532e7..e44b9c733 100644 --- a/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/fusionReactor/FusionReactorRecipeWrapper.java @@ -1,45 +1,54 @@ package techreborn.compat.jei.fusionReactor; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + import mezz.jei.api.recipe.BlankRecipeWrapper; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import techreborn.api.reactor.FusionReactorRecipe; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +public class FusionReactorRecipeWrapper extends BlankRecipeWrapper +{ + private final FusionReactorRecipe baseRecipe; -public class FusionReactorRecipeWrapper extends BlankRecipeWrapper { - private final FusionReactorRecipe baseRecipe; + public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) + { + this.baseRecipe = baseRecipe; + } - public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) { - this.baseRecipe = baseRecipe; - } + @Override + @Nonnull + public List getInputs() + { + return Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()); + } - @Override - @Nonnull - public List getInputs() { - return Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()); - } + @Override + @Nonnull + public List getOutputs() + { + return Collections.singletonList(baseRecipe.getOutput()); + } - @Override - @Nonnull - public List getOutputs() { - return Collections.singletonList(baseRecipe.getOutput()); - } + public ItemStack getTopInput() + { + return baseRecipe.getTopInput(); + } - public ItemStack getTopInput() { - return baseRecipe.getTopInput(); - } + public ItemStack getBottomInput() + { + return baseRecipe.getBottomInput(); + } - public ItemStack getBottomInput() { - return baseRecipe.getBottomInput(); - } - - @Override - public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { - RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime()); - } + @Override + public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) + { + RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), + baseRecipe.getTickTime()); + } } diff --git a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeCategory.java b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeCategory.java index b8a366dfa..56e6c92b1 100644 --- a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.grinder; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiGrinder; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class GrinderRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class GrinderRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public GrinderRecipeCategory(IGuiHelper guiHelper) { + public GrinderRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiGrinder.texture, 55, 30, 82, 26); title = I18n.translateToLocal("tile.techreborn.grinder.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.GRINDER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof GrinderRecipeWrapper) { + if (recipeWrapper instanceof GrinderRecipeWrapper) + { GrinderRecipeWrapper recipe = (GrinderRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeHandler.java b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeHandler.java index a393b33a8..0b360e00e 100644 --- a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.grinder; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.GrinderRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class GrinderRecipeHandler implements IRecipeHandler { +public class GrinderRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public GrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public GrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return GrinderRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.GRINDER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull GrinderRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull GrinderRecipe recipe) + { return new GrinderRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull GrinderRecipe recipe) { + public boolean isRecipeValid(@Nonnull GrinderRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeWrapper.java b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeWrapper.java index 8866440dd..1b8e032c6 100644 --- a/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/grinder/GrinderRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.grinder; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.machines.GrinderRecipe; import techreborn.client.gui.GuiGrinder; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class GrinderRecipeWrapper extends BaseRecipeWrapper { +public class GrinderRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public GrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull GrinderRecipe baseRecipe) { + public GrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull GrinderRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiGrinder.texture, 176, 14, 20, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeCategory.java b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeCategory.java index 8a2195ede..e9f859da8 100644 --- a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.implosionCompressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IDrawableAnimated; @@ -14,48 +16,54 @@ import techreborn.client.gui.GuiImplosionCompressor; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3}; +public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3 }; private final IDrawable background; private final IDrawable electricity; private final String title; - public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) { + public ImplosionCompressorRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiImplosionCompressor.texture, 16, 25, 116, 36); IDrawableStatic electricityDrawable = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 0, 14, 14); - electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, true); + electricity = guiHelper.createAnimatedDrawable(electricityDrawable, 300, IDrawableAnimated.StartDirection.TOP, + true); title = I18n.translateToLocal("tile.techreborn.implosioncompressor.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.IMPLOSION_COMPRESSOR; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawAnimations(@Nonnull Minecraft minecraft) { + public void drawAnimations(@Nonnull Minecraft minecraft) + { electricity.draw(minecraft, 0, 12); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 20, 0); guiItemStacks.init(INPUT_SLOTS[1], true, 20, 18); @@ -63,7 +71,8 @@ public class ImplosionCompressorRecipeCategory extends BlankRecipeCategory { guiItemStacks.init(OUTPUT_SLOTS[0], false, 76, 9); guiItemStacks.init(OUTPUT_SLOTS[1], false, 94, 9); - if (recipeWrapper instanceof ImplosionCompressorRecipeWrapper) { + if (recipeWrapper instanceof ImplosionCompressorRecipeWrapper) + { ImplosionCompressorRecipeWrapper recipe = (ImplosionCompressorRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeHandler.java b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeHandler.java index cb847090b..6aea87fff 100644 --- a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.implosionCompressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.ImplosionCompressorRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class ImplosionCompressorRecipeHandler implements IRecipeHandler { +public class ImplosionCompressorRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public ImplosionCompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public ImplosionCompressorRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return ImplosionCompressorRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.IMPLOSION_COMPRESSOR; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull ImplosionCompressorRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull ImplosionCompressorRecipe recipe) + { return new ImplosionCompressorRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull ImplosionCompressorRecipe recipe) { + public boolean isRecipeValid(@Nonnull ImplosionCompressorRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeWrapper.java b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeWrapper.java index 01c71d6bf..7687d0918 100644 --- a/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/implosionCompressor/ImplosionCompressorRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.implosionCompressor; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,20 +11,23 @@ import techreborn.api.recipe.machines.ImplosionCompressorRecipe; import techreborn.client.gui.GuiImplosionCompressor; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper { +public class ImplosionCompressorRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public ImplosionCompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ImplosionCompressorRecipe baseRecipe) { + public ImplosionCompressorRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, + @Nonnull ImplosionCompressorRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiImplosionCompressor.texture, 176, 14, 21, 11); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 44, 13); } diff --git a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeCategory.java b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeCategory.java index 35222b5a4..089c948f5 100644 --- a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.industrialElectrolyzer; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,40 +13,44 @@ import techreborn.client.gui.GuiIndustrialElectrolyzer; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3, 4, 5}; +public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 }; private final IDrawable background; private final String title; - public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) { + public IndustrialElectrolyzerRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 49, 18, 78, 50); title = I18n.translateToLocal("tile.techreborn.industrialelectrolyzer.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 30, 32); guiItemStacks.init(INPUT_SLOTS[1], true, 0, 32); @@ -53,7 +59,8 @@ public class IndustrialElectrolyzerRecipeCategory extends BlankRecipeCategory { guiItemStacks.init(OUTPUT_SLOTS[2], false, 40, 0); guiItemStacks.init(OUTPUT_SLOTS[3], false, 60, 0); - if (recipeWrapper instanceof IndustrialElectrolyzerRecipeWrapper) { + if (recipeWrapper instanceof IndustrialElectrolyzerRecipeWrapper) + { IndustrialElectrolyzerRecipeWrapper recipe = (IndustrialElectrolyzerRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeHandler.java b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeHandler.java index e8c7224cb..06b885692 100644 --- a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.industrialElectrolyzer; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class IndustrialElectrolyzerRecipeHandler implements IRecipeHandler { +public class IndustrialElectrolyzerRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public IndustrialElectrolyzerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public IndustrialElectrolyzerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return IndustrialElectrolyzerRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.INDUSTRIAL_ELECTROLYZER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialElectrolyzerRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialElectrolyzerRecipe recipe) + { return new IndustrialElectrolyzerRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull IndustrialElectrolyzerRecipe recipe) { + public boolean isRecipeValid(@Nonnull IndustrialElectrolyzerRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeWrapper.java b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeWrapper.java index fa557370a..0429cb2dc 100644 --- a/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/industrialElectrolyzer/IndustrialElectrolyzerRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.industrialElectrolyzer; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,20 +11,23 @@ import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe; import techreborn.client.gui.GuiIndustrialElectrolyzer; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper { +public class IndustrialElectrolyzerRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public IndustrialElectrolyzerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialElectrolyzerRecipe baseRecipe) { + public IndustrialElectrolyzerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, + @Nonnull IndustrialElectrolyzerRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialElectrolyzer.texture, 176, 14, 30, 10); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), IDrawableAnimated.StartDirection.BOTTOM, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, baseRecipe.tickTime(), + IDrawableAnimated.StartDirection.BOTTOM, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 24, 20); } diff --git a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeCategory.java b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeCategory.java index 363fa478d..3ffd76c96 100644 --- a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.industrialGrinder; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiFluidStackGroup; @@ -14,19 +16,20 @@ import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; import techreborn.tiles.TileIndustrialGrinder; -import javax.annotation.Nonnull; - -public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3, 4, 5}; - private static final int[] INPUT_TANKS = {0}; +public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3, 4, 5 }; + private static final int[] INPUT_TANKS = { 0 }; private final IDrawable background; - private final IDrawable blankArea; // for covering the lightning power symbol + private final IDrawable blankArea; // for covering the lightning power + // symbol private final IDrawable tankOverlay; private final String title; - public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) { + public IndustrialGrinderRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 7, 15, 141, 55); blankArea = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 50, 45, 6, 6); tankOverlay = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 86, 12, 47); @@ -35,29 +38,34 @@ public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory { @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.INDUSTRIAL_GRINDER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawExtras(@Nonnull Minecraft minecraft) { + public void drawExtras(@Nonnull Minecraft minecraft) + { blankArea.draw(minecraft, 129, 49); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10); guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28); @@ -70,7 +78,8 @@ public class IndustrialGrinderRecipeCategory extends BlankRecipeCategory { IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialGrinder.TANK_CAPACITY, true, tankOverlay); - if (recipeWrapper instanceof IndustrialGrinderRecipeWrapper) { + if (recipeWrapper instanceof IndustrialGrinderRecipeWrapper) + { IndustrialGrinderRecipeWrapper recipe = (IndustrialGrinderRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null); } diff --git a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeHandler.java b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeHandler.java index 430f84c37..cceef0a53 100644 --- a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.industrialGrinder; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.IndustrialGrinderRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class IndustrialGrinderRecipeHandler implements IRecipeHandler { +public class IndustrialGrinderRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public IndustrialGrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public IndustrialGrinderRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return IndustrialGrinderRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.INDUSTRIAL_GRINDER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialGrinderRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialGrinderRecipe recipe) + { return new IndustrialGrinderRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull IndustrialGrinderRecipe recipe) { + public boolean isRecipeValid(@Nonnull IndustrialGrinderRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeWrapper.java b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeWrapper.java index 16da76a38..71f5bc2a6 100644 --- a/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/industrialGrinder/IndustrialGrinderRecipeWrapper.java @@ -1,5 +1,10 @@ package techreborn.compat.jei.industrialGrinder; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -10,34 +15,37 @@ import techreborn.api.recipe.machines.IndustrialGrinderRecipe; import techreborn.client.gui.GuiIndustrialGrinder; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; -import java.util.Collections; -import java.util.List; - -public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper { +public class IndustrialGrinderRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public IndustrialGrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialGrinderRecipe baseRecipe) { + public IndustrialGrinderRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialGrinderRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialGrinder.texture, 176, 14, 24, 17); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override @Nonnull - public List getFluidInputs() { - if (baseRecipe.fluidStack != null) { + public List getFluidInputs() + { + if (baseRecipe.fluidStack != null) + { return Collections.singletonList(baseRecipe.fluidStack); - } else { + } else + { return Collections.emptyList(); } } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 44, 20); } diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java index 397eb7ace..aea931324 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.industrialSawmill; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiFluidStackGroup; @@ -14,19 +16,20 @@ import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; import techreborn.tiles.TileIndustrialSawmill; -import javax.annotation.Nonnull; - -public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1}; - private static final int[] OUTPUT_SLOTS = {2, 3, 4}; - private static final int[] INPUT_TANKS = {0}; +public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1 }; + private static final int[] OUTPUT_SLOTS = { 2, 3, 4 }; + private static final int[] INPUT_TANKS = { 0 }; private final IDrawable background; - private final IDrawable blankArea; // for covering the lightning power symbol + private final IDrawable blankArea; // for covering the lightning power + // symbol private final IDrawable tankOverlay; private final String title; - public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) { + public IndustrialSawmillRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 7, 15, 141, 55); blankArea = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 50, 45, 6, 6); tankOverlay = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 83, 12, 47); @@ -35,29 +38,34 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory { @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.INDUSTRIAL_SAWMILL; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawExtras(@Nonnull Minecraft minecraft) { + public void drawExtras(@Nonnull Minecraft minecraft) + { blankArea.draw(minecraft, 31, 51); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 24, 10); guiItemStacks.init(INPUT_SLOTS[1], true, 24, 28); @@ -69,7 +77,8 @@ public class IndustrialSawmillRecipeCategory extends BlankRecipeCategory { IGuiFluidStackGroup guiFluidStacks = recipeLayout.getFluidStacks(); guiFluidStacks.init(INPUT_TANKS[0], true, 4, 4, 12, 47, TileIndustrialSawmill.TANK_CAPACITY, true, tankOverlay); - if (recipeWrapper instanceof IndustrialSawmillRecipeWrapper) { + if (recipeWrapper instanceof IndustrialSawmillRecipeWrapper) + { IndustrialSawmillRecipeWrapper recipe = (IndustrialSawmillRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, INPUT_TANKS, null); } diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeHandler.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeHandler.java index d45ca254d..455edd21c 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.industrialSawmill; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.IndustrialSawmillRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class IndustrialSawmillRecipeHandler implements IRecipeHandler { +public class IndustrialSawmillRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public IndustrialSawmillRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return IndustrialSawmillRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.INDUSTRIAL_SAWMILL; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialSawmillRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull IndustrialSawmillRecipe recipe) + { return new IndustrialSawmillRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull IndustrialSawmillRecipe recipe) { + public boolean isRecipeValid(@Nonnull IndustrialSawmillRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java index 061526a6b..15ad86825 100644 --- a/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/industrialSawmill/IndustrialSawmillRecipeWrapper.java @@ -1,5 +1,10 @@ package techreborn.compat.jei.industrialSawmill; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -10,34 +15,37 @@ import techreborn.api.recipe.machines.IndustrialSawmillRecipe; import techreborn.client.gui.GuiIndustrialSawmill; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; -import java.util.Collections; -import java.util.List; - -public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper { +public class IndustrialSawmillRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public IndustrialSawmillRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialSawmillRecipe baseRecipe) { + public IndustrialSawmillRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull IndustrialSawmillRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiIndustrialSawmill.texture, 176, 14, 20, 12); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override @Nonnull - public List getFluidInputs() { - if (baseRecipe.fluidStack != null) { + public List getFluidInputs() + { + if (baseRecipe.fluidStack != null) + { return Collections.singletonList(baseRecipe.fluidStack); - } else { + } else + { return Collections.emptyList(); } } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 49, 23); } diff --git a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeCategory.java b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeCategory.java index a2568de44..b308d69d4 100644 --- a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.recycler; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiRecycler; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class RecyclerRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class RecyclerRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public RecyclerRecipeCategory(IGuiHelper guiHelper) { + public RecyclerRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiRecycler.texture, 55, 30, 82, 26); title = I18n.translateToLocal("tile.techreborn.recycler.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.RECYCLER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof RecyclerRecipeWrapper) { + if (recipeWrapper instanceof RecyclerRecipeWrapper) + { RecyclerRecipeWrapper recipe = (RecyclerRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeHandler.java b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeHandler.java index a65acd0f1..564bfd868 100644 --- a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.recycler; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.RecyclerRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class RecyclerRecipeHandler implements IRecipeHandler { +public class RecyclerRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public RecyclerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public RecyclerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return RecyclerRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.RECYCLER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RecyclerRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull RecyclerRecipe recipe) + { return new RecyclerRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull RecyclerRecipe recipe) { + public boolean isRecipeValid(@Nonnull RecyclerRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeWrapper.java b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeWrapper.java index c4a7fb1fc..7421ceacf 100644 --- a/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/recycler/RecyclerRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.recycler; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.RecyclerRecipe; import techreborn.client.gui.GuiRecycler; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class RecyclerRecipeWrapper extends BaseRecipeWrapper { +public class RecyclerRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public RecyclerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull RecyclerRecipe baseRecipe) { + public RecyclerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull RecyclerRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiRecycler.texture, 176, 14, 20, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeCategory.java b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeCategory.java index e73454684..b3eb5b987 100644 --- a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.rollingMachine; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.ICraftingGridHelper; import mezz.jei.api.gui.IDrawable; @@ -14,18 +16,18 @@ import net.minecraft.util.text.translation.I18n; import techreborn.client.gui.GuiRollingMachine; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class RollingMachineRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - private static final int[] OUTPUT_SLOTS = {10}; +public class RollingMachineRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + private static final int[] OUTPUT_SLOTS = { 10 }; private final IDrawable background; private final IDrawableAnimated progress; private final ICraftingGridHelper craftingGridHelper; private final String title; - public RollingMachineRecipeCategory(IGuiHelper guiHelper) { + public RollingMachineRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiRollingMachine.texture, 29, 16, 116, 54); title = I18n.translateToLocal("tile.techreborn.rollingmachine.name"); @@ -37,32 +39,39 @@ public class RollingMachineRecipeCategory extends BlankRecipeCategory { @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.ROLLING_MACHINE; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void drawAnimations(@Nonnull Minecraft minecraft) { + public void drawAnimations(@Nonnull Minecraft minecraft) + { progress.draw(minecraft, 62, 18); } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); - for (int l = 0; l < 3; l++) { - for (int k1 = 0; k1 < 3; k1++) { + for (int l = 0; l < 3; l++) + { + for (int k1 = 0; k1 < 3; k1++) + { int i = k1 + l * 3; guiItemStacks.init(INPUT_SLOTS[i], true, k1 * 18, l * 18); } @@ -70,7 +79,8 @@ public class RollingMachineRecipeCategory extends BlankRecipeCategory { guiItemStacks.init(OUTPUT_SLOTS[0], false, 94, 18); - if (recipeWrapper instanceof RollingMachineRecipeWrapper) { + if (recipeWrapper instanceof RollingMachineRecipeWrapper) + { RollingMachineRecipeWrapper recipe = (RollingMachineRecipeWrapper) recipeWrapper; craftingGridHelper.setInput(guiItemStacks, recipe.getInputs()); craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs()); diff --git a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeHandler.java b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeHandler.java index 0abcfd970..83a1b3523 100644 --- a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeHandler.java @@ -1,32 +1,37 @@ package techreborn.compat.jei.rollingMachine; +import javax.annotation.Nonnull; + import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class RollingMachineRecipeHandler implements IRecipeHandler { +public class RollingMachineRecipeHandler implements IRecipeHandler +{ @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return RollingMachineRecipeWrapper.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.ROLLING_MACHINE; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull RollingMachineRecipeWrapper recipe) + { return recipe; } @Override - public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe) { + public boolean isRecipeValid(@Nonnull RollingMachineRecipeWrapper recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeMaker.java b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeMaker.java index 11d6d44b3..72d8a0d8b 100644 --- a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeMaker.java +++ b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeMaker.java @@ -1,21 +1,26 @@ package techreborn.compat.jei.rollingMachine; -import net.minecraft.item.crafting.IRecipe; -import techreborn.api.RollingMachineRecipe; - import java.util.ArrayList; import java.util.List; -public class RollingMachineRecipeMaker { - private RollingMachineRecipeMaker() { +import net.minecraft.item.crafting.IRecipe; +import techreborn.api.RollingMachineRecipe; + +public class RollingMachineRecipeMaker +{ + private RollingMachineRecipeMaker() + { } - public static List getRecipes() { + public static List getRecipes() + { List recipes = new ArrayList<>(); - for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) { + for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) + { RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(recipe); - if (recipeWrapper != null) { + if (recipeWrapper != null) + { recipes.add(recipeWrapper); } } diff --git a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeWrapper.java b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeWrapper.java index 657aad614..b9337b565 100644 --- a/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/rollingMachine/RollingMachineRecipeWrapper.java @@ -1,5 +1,10 @@ package techreborn.compat.jei.rollingMachine; +import java.util.List; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + import mezz.jei.api.recipe.BlankRecipeWrapper; import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper; import mezz.jei.plugins.vanilla.crafting.ShapedOreRecipeWrapper; @@ -13,44 +18,50 @@ import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.List; - -public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper { +public class RollingMachineRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper +{ private final ICraftingRecipeWrapper baseRecipe; @Nullable - public static RollingMachineRecipeWrapper create(IRecipe baseRecipe) { + public static RollingMachineRecipeWrapper create(IRecipe baseRecipe) + { ICraftingRecipeWrapper recipeWrapper; - if (baseRecipe instanceof ShapelessRecipes) { + if (baseRecipe instanceof ShapelessRecipes) + { recipeWrapper = new ShapelessRecipesWrapper((ShapelessRecipes) baseRecipe); - } else if (baseRecipe instanceof ShapedRecipes) { + } else if (baseRecipe instanceof ShapedRecipes) + { recipeWrapper = new ShapedRecipesWrapper((ShapedRecipes) baseRecipe); - } else if (baseRecipe instanceof ShapedOreRecipe) { + } else if (baseRecipe instanceof ShapedOreRecipe) + { recipeWrapper = new ShapedOreRecipeWrapper((ShapedOreRecipe) baseRecipe); - } else if (baseRecipe instanceof ShapelessOreRecipe) { + } else if (baseRecipe instanceof ShapelessOreRecipe) + { recipeWrapper = new ShapelessOreRecipeWrapper((ShapelessOreRecipe) baseRecipe); - } else { + } else + { return null; } return new RollingMachineRecipeWrapper(recipeWrapper); } - public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) { + public RollingMachineRecipeWrapper(ICraftingRecipeWrapper baseRecipe) + { this.baseRecipe = baseRecipe; } @Override @Nonnull - public List getInputs() { + public List getInputs() + { return baseRecipe.getInputs(); } @Override @Nonnull - public List getOutputs() { + public List getOutputs() + { return baseRecipe.getOutputs(); } } diff --git a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeCategory.java b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeCategory.java index 72eae55f0..0c52b87e3 100644 --- a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.scrapbox; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiCompressor; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class ScrapboxRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class ScrapboxRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public ScrapboxRecipeCategory(IGuiHelper guiHelper) { + public ScrapboxRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiCompressor.texture, 55, 30, 82, 26); title = I18n.translateToLocal("jei.techreborn.scrapbox.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.SCRAPBOX; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof ScrapboxRecipeWrapper) { + if (recipeWrapper instanceof ScrapboxRecipeWrapper) + { ScrapboxRecipeWrapper recipe = (ScrapboxRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeHandler.java b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeHandler.java index 3eceb5213..c16e14b4f 100644 --- a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.scrapbox; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.ScrapboxRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class ScrapboxRecipeHandler implements IRecipeHandler { +public class ScrapboxRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public ScrapboxRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public ScrapboxRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return ScrapboxRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.SCRAPBOX; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull ScrapboxRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull ScrapboxRecipe recipe) + { return new ScrapboxRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull ScrapboxRecipe recipe) { + public boolean isRecipeValid(@Nonnull ScrapboxRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeWrapper.java b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeWrapper.java index c14639ca0..9331d6fef 100644 --- a/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/scrapbox/ScrapboxRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.scrapbox; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.ScrapboxRecipe; import techreborn.client.gui.GuiCompressor; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class ScrapboxRecipeWrapper extends BaseRecipeWrapper { +public class ScrapboxRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe) { + public ScrapboxRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull ScrapboxRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiCompressor.texture, 176, 14, 20, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeCategory.java b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeCategory.java index a7de4af11..994ecc9a4 100644 --- a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeCategory.java +++ b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeCategory.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.vacuumFreezer; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.gui.IDrawable; import mezz.jei.api.gui.IGuiItemStackGroup; @@ -11,46 +13,51 @@ import techreborn.client.gui.GuiVacuumFreezer; import techreborn.compat.jei.RecipeCategoryUids; import techreborn.compat.jei.RecipeUtil; -import javax.annotation.Nonnull; - -public class VacuumFreezerRecipeCategory extends BlankRecipeCategory { - private static final int[] INPUT_SLOTS = {0}; - private static final int[] OUTPUT_SLOTS = {1}; +public class VacuumFreezerRecipeCategory extends BlankRecipeCategory +{ + private static final int[] INPUT_SLOTS = { 0 }; + private static final int[] OUTPUT_SLOTS = { 1 }; private final IDrawable background; private final String title; - public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) { + public VacuumFreezerRecipeCategory(IGuiHelper guiHelper) + { background = guiHelper.createDrawable(GuiVacuumFreezer.texture, 55, 30, 82, 26); title = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name"); } @Nonnull @Override - public String getUid() { + public String getUid() + { return RecipeCategoryUids.VACUUM_FREEZER; } @Nonnull @Override - public String getTitle() { + public String getTitle() + { return title; } @Nonnull @Override - public IDrawable getBackground() { + public IDrawable getBackground() + { return background; } @Override - public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) { + public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper) + { IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks(); guiItemStacks.init(INPUT_SLOTS[0], true, 0, 3); guiItemStacks.init(OUTPUT_SLOTS[0], false, 60, 4); - if (recipeWrapper instanceof VacuumFreezerRecipeWrapper) { + if (recipeWrapper instanceof VacuumFreezerRecipeWrapper) + { VacuumFreezerRecipeWrapper recipe = (VacuumFreezerRecipeWrapper) recipeWrapper; RecipeUtil.setRecipeItems(recipeLayout, recipe, INPUT_SLOTS, OUTPUT_SLOTS, null, null); } diff --git a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeHandler.java b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeHandler.java index 42e38d13b..8adea0654 100644 --- a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeHandler.java +++ b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeHandler.java @@ -1,41 +1,47 @@ package techreborn.compat.jei.vacuumFreezer; +import javax.annotation.Nonnull; + import mezz.jei.api.IJeiHelpers; import mezz.jei.api.recipe.IRecipeHandler; import mezz.jei.api.recipe.IRecipeWrapper; import techreborn.api.recipe.machines.VacuumFreezerRecipe; import techreborn.compat.jei.RecipeCategoryUids; -import javax.annotation.Nonnull; - -public class VacuumFreezerRecipeHandler implements IRecipeHandler { +public class VacuumFreezerRecipeHandler implements IRecipeHandler +{ @Nonnull private final IJeiHelpers jeiHelpers; - public VacuumFreezerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) { + public VacuumFreezerRecipeHandler(@Nonnull IJeiHelpers jeiHelpers) + { this.jeiHelpers = jeiHelpers; } @Nonnull @Override - public Class getRecipeClass() { + public Class getRecipeClass() + { return VacuumFreezerRecipe.class; } @Nonnull @Override - public String getRecipeCategoryUid() { + public String getRecipeCategoryUid() + { return RecipeCategoryUids.VACUUM_FREEZER; } @Nonnull @Override - public IRecipeWrapper getRecipeWrapper(@Nonnull VacuumFreezerRecipe recipe) { + public IRecipeWrapper getRecipeWrapper(@Nonnull VacuumFreezerRecipe recipe) + { return new VacuumFreezerRecipeWrapper(jeiHelpers, recipe); } @Override - public boolean isRecipeValid(@Nonnull VacuumFreezerRecipe recipe) { + public boolean isRecipeValid(@Nonnull VacuumFreezerRecipe recipe) + { return true; } } diff --git a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java index 1aea773a9..c6e284292 100644 --- a/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java +++ b/src/main/java/techreborn/compat/jei/vacuumFreezer/VacuumFreezerRecipeWrapper.java @@ -1,5 +1,7 @@ package techreborn.compat.jei.vacuumFreezer; +import javax.annotation.Nonnull; + import mezz.jei.api.IGuiHelper; import mezz.jei.api.IJeiHelpers; import mezz.jei.api.gui.IDrawableAnimated; @@ -9,22 +11,24 @@ import techreborn.api.recipe.machines.VacuumFreezerRecipe; import techreborn.client.gui.GuiVacuumFreezer; import techreborn.compat.jei.BaseRecipeWrapper; -import javax.annotation.Nonnull; - -public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper { +public class VacuumFreezerRecipeWrapper extends BaseRecipeWrapper +{ private final IDrawableAnimated progress; - public VacuumFreezerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull VacuumFreezerRecipe baseRecipe) { + public VacuumFreezerRecipeWrapper(@Nonnull IJeiHelpers jeiHelpers, @Nonnull VacuumFreezerRecipe baseRecipe) + { super(baseRecipe); IGuiHelper guiHelper = jeiHelpers.getGuiHelper(); IDrawableStatic progressStatic = guiHelper.createDrawable(GuiVacuumFreezer.texture, 176, 14, 20, 11); int ticksPerCycle = baseRecipe.tickTime(); - this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, IDrawableAnimated.StartDirection.LEFT, false); + this.progress = guiHelper.createAnimatedDrawable(progressStatic, ticksPerCycle, + IDrawableAnimated.StartDirection.LEFT, false); } @Override - public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) { + public void drawAnimations(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight) + { super.drawAnimations(minecraft, recipeWidth, recipeHeight); progress.draw(minecraft, 25, 7); } diff --git a/src/main/java/techreborn/compat/waila/CompatModuleWaila.java b/src/main/java/techreborn/compat/waila/CompatModuleWaila.java index ff6606060..4655e6f1c 100644 --- a/src/main/java/techreborn/compat/waila/CompatModuleWaila.java +++ b/src/main/java/techreborn/compat/waila/CompatModuleWaila.java @@ -9,30 +9,34 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import reborncore.common.tile.TileMachineBase; import techreborn.compat.ICompatModule; -public class CompatModuleWaila implements ICompatModule { +public class CompatModuleWaila implements ICompatModule +{ - @Override - public void preInit(FMLPreInitializationEvent event) { + @Override + public void preInit(FMLPreInitializationEvent event) + { - } + } - public void init(FMLInitializationEvent event) { - FMLInterModComms.sendMessage("Waila", "register", getClass().getName() - + ".callbackRegister"); - } + public void init(FMLInitializationEvent event) + { + FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister"); + } - @Override - public void postInit(FMLPostInitializationEvent event) { + @Override + public void postInit(FMLPostInitializationEvent event) + { - } + } - @Override - public void serverStarting(FMLServerStartingEvent event) { + @Override + public void serverStarting(FMLServerStartingEvent event) + { - } + } - public static void callbackRegister(IWailaRegistrar registrar) { - registrar.registerBodyProvider(new WailaProviderMachines(), - TileMachineBase.class); - } + public static void callbackRegister(IWailaRegistrar registrar) + { + registrar.registerBodyProvider(new WailaProviderMachines(), TileMachineBase.class); + } } diff --git a/src/main/java/techreborn/compat/waila/WailaProviderMachines.java b/src/main/java/techreborn/compat/waila/WailaProviderMachines.java index b952f2661..2aa267a6c 100644 --- a/src/main/java/techreborn/compat/waila/WailaProviderMachines.java +++ b/src/main/java/techreborn/compat/waila/WailaProviderMachines.java @@ -14,38 +14,48 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import reborncore.api.IListInfoProvider; -public class WailaProviderMachines implements IWailaDataProvider { +public class WailaProviderMachines implements IWailaDataProvider +{ - private List info = new ArrayList(); + private List info = new ArrayList(); - @Override - public List getWailaBody(ItemStack item, List tip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - if (accessor.getTileEntity() instanceof IListInfoProvider) { - ((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true); - } - tip.addAll(info); - info.clear(); + @Override + public List getWailaBody(ItemStack item, List tip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + if (accessor.getTileEntity() instanceof IListInfoProvider) + { + ((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true); + } + tip.addAll(info); + info.clear(); - return tip; - } + return tip; + } - @Override - public List getWailaHead(ItemStack item, List tip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return tip; - } + @Override + public List getWailaHead(ItemStack item, List tip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + return tip; + } - @Override - public List getWailaTail(ItemStack item, List tip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return tip; - } + @Override + public List getWailaTail(ItemStack item, List tip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + return tip; + } - @Override - public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { - return null; - } + @Override + public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) + { + return null; + } - @Override - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) { - return tag; - } + @Override + public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) + { + return tag; + } } diff --git a/src/main/java/techreborn/config/ConfigTechReborn.java b/src/main/java/techreborn/config/ConfigTechReborn.java index d24b85f15..392551faf 100644 --- a/src/main/java/techreborn/config/ConfigTechReborn.java +++ b/src/main/java/techreborn/config/ConfigTechReborn.java @@ -1,10 +1,11 @@ package techreborn.config; -import net.minecraftforge.common.config.Configuration; - import java.io.File; -public class ConfigTechReborn { +import net.minecraftforge.common.config.Configuration; + +public class ConfigTechReborn +{ private static ConfigTechReborn instance = null; public static String CATEGORY_WORLD = "world"; public static String CATEGORY_POWER = "power"; @@ -137,7 +138,8 @@ public class ConfigTechReborn { public static Configuration config; - private ConfigTechReborn(File configFile) { + private ConfigTechReborn(File configFile) + { config = new Configuration(configFile); config.load(); @@ -147,7 +149,8 @@ public class ConfigTechReborn { } - public static ConfigTechReborn initialize(File configFile) { + public static ConfigTechReborn initialize(File configFile) + { if (instance == null) instance = new ConfigTechReborn(configFile); @@ -157,15 +160,18 @@ public class ConfigTechReborn { return instance; } - public static ConfigTechReborn instance() { - if (instance == null) { + public static ConfigTechReborn instance() + { + if (instance == null) + { throw new IllegalStateException("Instance of TechReborn Config requested before initialization"); } return instance; } - public static void Configs() { + public static void Configs() + { RubberSaplingLoot = config .get(CATEGORY_WORLD, "Rubber Sapling Loot", true, "Allow Rubber Saplings to generate in loot chests") .getBoolean(true); @@ -207,16 +213,14 @@ public class ConfigTechReborn { aesuMaxStorage = config.get(CATEGORY_POWER, "AESU Max Storage", 30, "Set the max Storage for the AESU") .getInt(); - // Charge IronDrillCharge = config - .get(CATEGORY_POWER, "IronDrill MaxCharge", 10000, "Set the max charge for the iron drill") - .getInt(); - + .get(CATEGORY_POWER, "IronDrill MaxCharge", 10000, "Set the max charge for the iron drill").getInt(); + DiamondDrillCharge = config .get(CATEGORY_POWER, "DiamondDrill MaxCharge", 100000, "Set the max charge for the diamond drill") .getInt(); - + AdvancedDrillCharge = config .get(CATEGORY_POWER, "AdvancedDrill MaxCharge", 1000000, "Set the max charge for the advanced drill") .getInt(); @@ -224,26 +228,23 @@ public class ConfigTechReborn { IronChainsawCharge = config .get(CATEGORY_POWER, "IronChainsaw MaxCharge", 10000, "Set the max charge for the iron chainsaw") .getInt(); - + DiamondChainsawCharge = config .get(CATEGORY_POWER, "DiamondChainsaw MaxCharge", 100000, "Set the max charge for the diamond chainsaw") .getInt(); - - AdvancedChainsawCharge = config - .get(CATEGORY_POWER, "AdvancedChainsaw MaxCharge", 1000000, "Set the max charge for the advanced chainsaw") - .getInt(); + + AdvancedChainsawCharge = config.get(CATEGORY_POWER, "AdvancedChainsaw MaxCharge", 1000000, + "Set the max charge for the advanced chainsaw").getInt(); IronJackhammerCharge = config .get(CATEGORY_POWER, "IronJackhammer MaxCharge", 10000, "Set the max charge for the iron jackhammer") .getInt(); - - SteelJackhammerCharge = config - .get(CATEGORY_POWER, "AdvancedJackhammer MaxCharge", 20000, "Set the max charge for the advanced jackhammer") - .getInt(); - - DiamondJackhammerCharge = config - .get(CATEGORY_POWER, "DiamondJackhammer MaxCharge", 100000, "Set the max charge for the diamond jackhammer") - .getInt(); + + SteelJackhammerCharge = config.get(CATEGORY_POWER, "AdvancedJackhammer MaxCharge", 20000, + "Set the max charge for the advanced jackhammer").getInt(); + + DiamondJackhammerCharge = config.get(CATEGORY_POWER, "DiamondJackhammer MaxCharge", 100000, + "Set the max charge for the diamond jackhammer").getInt(); LapotronPackCharge = config .get(CATEGORY_POWER, "LapotronPack MaxCharge", 100000000, "Set the max charge for the LapotronPack") @@ -287,32 +288,31 @@ public class ConfigTechReborn { farmEu = config.get(CATEGORY_POWER, "farmeu", 32, "").getInt(); // Tier - IronDrillTier = config.get(CATEGORY_POWER, "IronDrill Tier", 2, "Set the Tier of the iron drill") - .getInt(); - + IronDrillTier = config.get(CATEGORY_POWER, "IronDrill Tier", 2, "Set the Tier of the iron drill").getInt(); + DiamondDrillTier = config.get(CATEGORY_POWER, "DiamondDrill Tier", 2, "Set the Tier of the diamond drill") .getInt(); - + AdvancedDrillTier = config.get(CATEGORY_POWER, "AdvancedDrill Tier", 2, "Set the Tier of the advanced drill") .getInt(); IronChainsawTier = config.get(CATEGORY_POWER, "IronChainsaw Tier", 2, "Set the Tier of the iron chainsaw") .getInt(); - - DiamondChainsawTier = config.get(CATEGORY_POWER, "DiamondChainsaw Tier", 2, "Set the Tier of the diamond chainsaw") - .getInt(); - - AdvancedChainsawTier = config.get(CATEGORY_POWER, "AdvancedChainsaw Tier", 2, "Set the Tier of the advanced chainsaw") - .getInt(); + + DiamondChainsawTier = config + .get(CATEGORY_POWER, "DiamondChainsaw Tier", 2, "Set the Tier of the diamond chainsaw").getInt(); + + AdvancedChainsawTier = config + .get(CATEGORY_POWER, "AdvancedChainsaw Tier", 2, "Set the Tier of the advanced chainsaw").getInt(); IronJackhammerTier = config.get(CATEGORY_POWER, "IronJackhammer Tier", 2, "Set the Tier of the iron jackhammer") .getInt(); - - DiamondJackhammerTier = config.get(CATEGORY_POWER, "DiamondJackhammer Tier", 2, "Set the Tier of the diamond jackhammer") - .getInt(); - - SteelJackhammerTier = config.get(CATEGORY_POWER, "AdvancedJackhammer Tier", 2, "Set the Tier of the advanced jackhammer") - .getInt(); + + DiamondJackhammerTier = config + .get(CATEGORY_POWER, "DiamondJackhammer Tier", 2, "Set the Tier of the diamond jackhammer").getInt(); + + SteelJackhammerTier = config + .get(CATEGORY_POWER, "AdvancedJackhammer Tier", 2, "Set the Tier of the advanced jackhammer").getInt(); LapotronPackTier = config.get(CATEGORY_POWER, "LapotronPack Tier", 2, "Set the Tier of the LapotronPack") .getInt(); @@ -496,16 +496,12 @@ public class ConfigTechReborn { oreUnifer = config.get(CATEGORY_INTEGRATION, "OreUnifer", false, "change all ores int TechReborn Ores") .getBoolean(false); - - UninsulatedElectocutionDamage = config - .get(CATEGORY_WORLD, "Uninsulated Electocution Damage", true, "Damage entities on contact with uninsulated cables") - .getBoolean(true); - UninsulatedElectocutionSound = config - .get(CATEGORY_WORLD, "Uninsulated Electocution Sound", true, "Play sound on contact with uninsulated cables") - .getBoolean(true); - UninsulatedElectocutionParticle = config - .get(CATEGORY_WORLD, "Uninsulated Electocution Particle", true, "Spawn particles on contact with uninsulated cables") - .getBoolean(true); + UninsulatedElectocutionDamage = config.get(CATEGORY_WORLD, "Uninsulated Electocution Damage", true, + "Damage entities on contact with uninsulated cables").getBoolean(true); + UninsulatedElectocutionSound = config.get(CATEGORY_WORLD, "Uninsulated Electocution Sound", true, + "Play sound on contact with uninsulated cables").getBoolean(true); + UninsulatedElectocutionParticle = config.get(CATEGORY_WORLD, "Uninsulated Electocution Particle", true, + "Spawn particles on contact with uninsulated cables").getBoolean(true); scrapboxDispenser = config .get(CATEGORY_WORLD, "Scrapboxes in Dispenser", true, "Allow scrapbox to be opened via dispenser") @@ -515,7 +511,6 @@ public class ConfigTechReborn { .get(CATEGORY_CRAFTING, "Expensive Watermill", true, "Allow TechReborn to change the Watermill recipe") .getBoolean(true); - // Integration AllowBOPRecipes = config.get(CATEGORY_INTEGRATION, "Allow Bop Recipes", true, "Add BOP suport") .getBoolean(true); @@ -526,7 +521,8 @@ public class ConfigTechReborn { AllowNaturaRecipes = config.get(CATEGORY_INTEGRATION, "Allow Natura Recipes", true, "Add Natura suport") .getBoolean(true); - if (config.hasChanged()) { + if (config.hasChanged()) + { config.save(); } } diff --git a/src/main/java/techreborn/config/TechRebornConfigGui.java b/src/main/java/techreborn/config/TechRebornConfigGui.java index dddbbef69..aa1916a58 100644 --- a/src/main/java/techreborn/config/TechRebornConfigGui.java +++ b/src/main/java/techreborn/config/TechRebornConfigGui.java @@ -1,5 +1,8 @@ package techreborn.config; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.text.translation.I18n; import net.minecraftforge.common.config.ConfigElement; @@ -10,198 +13,182 @@ import net.minecraftforge.fml.client.config.GuiConfigEntries; import net.minecraftforge.fml.client.config.GuiConfigEntries.CategoryEntry; import net.minecraftforge.fml.client.config.IConfigElement; -import java.util.ArrayList; -import java.util.List; +public class TechRebornConfigGui extends GuiConfig +{ + public TechRebornConfigGui(GuiScreen top) + { + super(top, getConfigCategories(), "TechReborn", false, false, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } -public class TechRebornConfigGui extends GuiConfig { - public TechRebornConfigGui(GuiScreen top) { - super(top, getConfigCategories(), "TechReborn", false, false, GuiConfig - .getAbridgedConfigPath(ConfigTechReborn.config.toString())); - } + private static List getConfigCategories() + { + List list = new ArrayList(); + list.add( + new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.techreborn.category.general"), + "tr.configgui.category.trGeneral", TRGeneral.class)); + list.add(new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.techreborn.category.world"), + "tr.configgui.category.trWorld", TRWORLD.class)); + list.add(new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.techreborn.category.power"), + "tr.configgui.category.trPower", TRPOWER.class)); + list.add(new DummyConfigElement.DummyCategoryElement( + I18n.translateToLocal("config.techreborn.category.crafting"), "tr.configgui.category.trCrafting", + TRCRAFTING.class)); + list.add(new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.techreborn.category.uu"), + "tr.configgui.category.truu", TRUU.class)); + list.add(new DummyConfigElement.DummyCategoryElement(I18n.translateToLocal("config.techreborn.category.emc"), + "tr.configgui.category.tremc", TREMC.class)); + list.add(new DummyConfigElement.DummyCategoryElement( + I18n.translateToLocal("config.techreborn.category.integration"), "tr.configgui.category.treinter", + TRINT.class)); - private static List getConfigCategories() { - List list = new ArrayList(); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.general"), - "tr.configgui.category.trGeneral", TRGeneral.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.world"), - "tr.configgui.category.trWorld", TRWORLD.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.power"), - "tr.configgui.category.trPower", TRPOWER.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.crafting"), - "tr.configgui.category.trCrafting", TRCRAFTING.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.uu"), - "tr.configgui.category.truu", TRUU.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.emc"), - "tr.configgui.category.tremc", TREMC.class)); - list.add(new DummyConfigElement.DummyCategoryElement(I18n - .translateToLocal("config.techreborn.category.integration"), - "tr.configgui.category.treinter", TRINT.class)); + return list; + } - return list; - } + public static class TRGeneral extends CategoryEntry + { - public static class TRGeneral extends CategoryEntry { + public TRGeneral(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - public TRGeneral(GuiConfig owningScreen, - GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(Configuration.CATEGORY_GENERAL))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(Configuration.CATEGORY_GENERAL))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // World + public static class TRWORLD extends CategoryEntry + { + public TRWORLD(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - // World - public static class TRWORLD extends CategoryEntry { - public TRWORLD(GuiConfig owningScreen, - GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_WORLD))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_WORLD))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // Power + public static class TRPOWER extends CategoryEntry + { + public TRPOWER(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - // Power - public static class TRPOWER extends CategoryEntry { - public TRPOWER(GuiConfig owningScreen, - GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_POWER))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_POWER))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // Crafting + public static class TRCRAFTING extends CategoryEntry + { + public TRCRAFTING(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - // Crafting - public static class TRCRAFTING extends CategoryEntry { - public TRCRAFTING(GuiConfig owningScreen, - GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_CRAFTING))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_CRAFTING))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // Crafting + public static class TRUU extends CategoryEntry + { + public TRUU(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - // Crafting - public static class TRUU extends CategoryEntry { - public TRUU(GuiConfig owningScreen, - GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_UU))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_UU))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // Emc + public static class TREMC extends CategoryEntry + { + public TREMC(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - // Emc - public static class TREMC extends CategoryEntry { - public TREMC(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_EMC))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_EMC))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + // Mod Integration + public static class TRINT extends CategoryEntry + { + public TRINT(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + { + super(owningScreen, owningEntryList, configElement); + } - //Mod Integration - public static class TRINT extends CategoryEntry { - public TRINT(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { - super(owningScreen, owningEntryList, configElement); - } - - @Override - protected GuiScreen buildChildScreen() { - return new GuiConfig(this.owningScreen, - (new ConfigElement(ConfigTechReborn.config - .getCategory(ConfigTechReborn.CATEGORY_INTEGRATION))) - .getChildElements(), this.owningScreen.modID, - Configuration.CATEGORY_GENERAL, - this.configElement.requiresWorldRestart() - || this.owningScreen.allRequireWorldRestart, - this.configElement.requiresMcRestart() - || this.owningScreen.allRequireMcRestart, - GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config - .toString())); - } - } + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(this.owningScreen, + (new ConfigElement(ConfigTechReborn.config.getCategory(ConfigTechReborn.CATEGORY_INTEGRATION))) + .getChildElements(), + this.owningScreen.modID, Configuration.CATEGORY_GENERAL, + this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart, + this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, + GuiConfig.getAbridgedConfigPath(ConfigTechReborn.config.toString())); + } + } } diff --git a/src/main/java/techreborn/config/TechRebornGUIFactory.java b/src/main/java/techreborn/config/TechRebornGUIFactory.java index db9b0e1f5..0a769a37a 100644 --- a/src/main/java/techreborn/config/TechRebornGUIFactory.java +++ b/src/main/java/techreborn/config/TechRebornGUIFactory.java @@ -1,31 +1,35 @@ package techreborn.config; +import java.util.Set; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.fml.client.IModGuiFactory; -import java.util.Set; +public class TechRebornGUIFactory implements IModGuiFactory +{ + @Override + public void initialize(Minecraft minecraftInstance) + { -public class TechRebornGUIFactory implements IModGuiFactory { - @Override - public void initialize(Minecraft minecraftInstance) { + } - } + @Override + public Class mainConfigGuiClass() + { + return TechRebornConfigGui.class; + } - @Override - public Class mainConfigGuiClass() { - return TechRebornConfigGui.class; - } + @Override + public Set runtimeGuiCategories() + { + return null; + } - @Override - public Set runtimeGuiCategories() { - return null; - } - - @Override - public RuntimeOptionGuiHandler getHandlerFor( - RuntimeOptionCategoryElement element) { - return null; - } + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) + { + return null; + } } diff --git a/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java b/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java index 7e0256053..f4ffb2d2f 100644 --- a/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java +++ b/src/main/java/techreborn/dispenser/BehaviorDispenseScrapbox.java @@ -8,10 +8,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import techreborn.api.ScrapboxList; -public class BehaviorDispenseScrapbox extends BehaviorDefaultDispenseItem { +public class BehaviorDispenseScrapbox extends BehaviorDefaultDispenseItem +{ @Override - protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) { + protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) + { int random = source.getWorld().rand.nextInt(ScrapboxList.stacks.size()); ItemStack out = ScrapboxList.stacks.get(random).copy(); float xOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; diff --git a/src/main/java/techreborn/entitys/EntityNukePrimed.java b/src/main/java/techreborn/entitys/EntityNukePrimed.java index d1778eb43..a5a53f275 100644 --- a/src/main/java/techreborn/entitys/EntityNukePrimed.java +++ b/src/main/java/techreborn/entitys/EntityNukePrimed.java @@ -10,50 +10,60 @@ import reborncore.common.explosion.RebornExplosion; /** * Created by Mark on 13/03/2016. */ -public class EntityNukePrimed extends EntityTNTPrimed { +public class EntityNukePrimed extends EntityTNTPrimed +{ - public int fuse = 400; + public int fuse = 400; - public EntityNukePrimed(World world) { - super(world); - } + public EntityNukePrimed(World world) + { + super(world); + } - public EntityNukePrimed(World world, double x, double y, double z, EntityLivingBase tntPlacedBy) { - super(world, x, y, z, tntPlacedBy); - } + public EntityNukePrimed(World world, double x, double y, double z, EntityLivingBase tntPlacedBy) + { + super(world, x, y, z, tntPlacedBy); + } - @Override - public void onUpdate() { + @Override + public void onUpdate() + { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - if (this.fuse-- <= 0) { - this.setDead(); - if (!this.worldObj.isRemote) { - this.explodeNuke(); - } - } else { - this.handleWaterMovement(); - this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]); - } - } - - public void explodeNuke() { - RebornExplosion nukeExplosion = new RebornExplosion(new BlockPos(this.posX, this.posY, this.posZ), worldObj, 40); - nukeExplosion.setLivingBase(getTntPlacedBy()); - nukeExplosion.explode(); - } + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9800000190734863D; + this.motionY *= 0.9800000190734863D; + this.motionZ *= 0.9800000190734863D; + if (this.onGround) + { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + if (this.fuse-- <= 0) + { + this.setDead(); + if (!this.worldObj.isRemote) + { + this.explodeNuke(); + } + } else + { + this.handleWaterMovement(); + this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, + 0.0D, 0.0D, new int[0]); + } + } + public void explodeNuke() + { + RebornExplosion nukeExplosion = new RebornExplosion(new BlockPos(this.posX, this.posY, this.posZ), worldObj, + 40); + nukeExplosion.setLivingBase(getTntPlacedBy()); + nukeExplosion.explode(); + } } diff --git a/src/main/java/techreborn/events/OreUnifier.java b/src/main/java/techreborn/events/OreUnifier.java index 5e0c28a53..8a477a6ce 100644 --- a/src/main/java/techreborn/events/OreUnifier.java +++ b/src/main/java/techreborn/events/OreUnifier.java @@ -1,5 +1,7 @@ package techreborn.events; +import java.util.HashMap; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -10,44 +12,55 @@ import net.minecraftforge.oredict.OreDictionary; import reborncore.common.util.ItemUtils; import techreborn.config.ConfigTechReborn; -import java.util.HashMap; +public class OreUnifier +{ -public class OreUnifier { + public static HashMap oreHash = new HashMap(); - public static HashMap oreHash = new HashMap(); + @SubscribeEvent + public void itemTick(TickEvent.PlayerTickEvent event) + { + if (ConfigTechReborn.oreUnifer && !event.player.worldObj.isRemote + && event.player.worldObj.getTotalWorldTime() % 10 == 0) + { + if (event.player.getHeldItem(EnumHand.MAIN_HAND) != null) + { + int[] oreIds = OreDictionary.getOreIDs(event.player.getHeldItem(EnumHand.MAIN_HAND)); + for (int id : oreIds) + { + String oreName = OreDictionary.getOreName(id); + if (oreHash.containsKey(oreName)) + { + if (ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND), oreHash.get(oreName), + true, true, true) + && !ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND), + oreHash.get(oreName), true, true, false)) + { + ItemStack stack = oreHash.get(oreName).copy(); + stack.stackSize = event.player.getHeldItem(EnumHand.MAIN_HAND).stackSize; + stack.setTagCompound(event.player.getHeldItem(EnumHand.MAIN_HAND).getTagCompound()); + event.player.inventory.setInventorySlotContents(event.player.inventory.currentItem, stack); + } + } + } + } + } + } - @SubscribeEvent - public void itemTick(TickEvent.PlayerTickEvent event) { - if(ConfigTechReborn.oreUnifer && !event.player.worldObj.isRemote && event.player.worldObj.getTotalWorldTime() % 10 == 0){ - if(event.player.getHeldItem(EnumHand.MAIN_HAND) != null){ - int[] oreIds = OreDictionary.getOreIDs(event.player.getHeldItem(EnumHand.MAIN_HAND)); - for(int id : oreIds){ - String oreName = OreDictionary.getOreName(id); - if(oreHash.containsKey(oreName)){ - if(ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND), oreHash.get(oreName), true, true, true) && !ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND), oreHash.get(oreName), true, true, false)){ - ItemStack stack = oreHash.get(oreName).copy(); - stack.stackSize = event.player.getHeldItem(EnumHand.MAIN_HAND).stackSize; - stack.setTagCompound(event.player.getHeldItem(EnumHand.MAIN_HAND).getTagCompound()); - event.player.inventory.setInventorySlotContents(event.player.inventory.currentItem, stack); - } - } - } - } - } - } + public static void registerOre(String name, ItemStack ore) + { + oreHash.put(name, ore); + OreDictionary.registerOre(name, ore); + } - public static void registerOre(String name, ItemStack ore) { - oreHash.put(name, ore); - OreDictionary.registerOre(name, ore); - } - - public static void registerOre(String name, Item ore) { - registerOre(name, new ItemStack(ore)); - } - - public static void registerOre(String name, Block ore) { - registerOre(name, new ItemStack(ore)); - } + public static void registerOre(String name, Item ore) + { + registerOre(name, new ItemStack(ore)); + } + public static void registerOre(String name, Block ore) + { + registerOre(name, new ItemStack(ore)); + } } diff --git a/src/main/java/techreborn/events/TRTickHandler.java b/src/main/java/techreborn/events/TRTickHandler.java index 5e07b0dcf..bd0eb184e 100644 --- a/src/main/java/techreborn/events/TRTickHandler.java +++ b/src/main/java/techreborn/events/TRTickHandler.java @@ -11,28 +11,35 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import techreborn.init.ModItems; import techreborn.power.PowerTickEvent; -public class TRTickHandler { +public class TRTickHandler +{ - public Item previouslyWearing; + public Item previouslyWearing; - @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) - public void onPlayerTick(TickEvent.PlayerTickEvent e) { - EntityPlayer player = e.player; - Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null ? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null; + @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) + public void onPlayerTick(TickEvent.PlayerTickEvent e) + { + EntityPlayer player = e.player; + Item chestslot = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null + ? player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() : null; - if (previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible() && !player.isPotionActive(MobEffects.invisibility)) { - player.setInvisible(false); - } + if (previouslyWearing != chestslot && previouslyWearing == ModItems.cloakingDevice && player.isInvisible() + && !player.isPotionActive(MobEffects.invisibility)) + { + player.setInvisible(false); + } - previouslyWearing = chestslot; - } + previouslyWearing = chestslot; + } - @SubscribeEvent - public void worldTick(TickEvent.WorldTickEvent e) { - if(e.world.isRemote){ - return; - } - MinecraftForge.EVENT_BUS.post(new PowerTickEvent()); - } + @SubscribeEvent + public void worldTick(TickEvent.WorldTickEvent e) + { + if (e.world.isRemote) + { + return; + } + MinecraftForge.EVENT_BUS.post(new PowerTickEvent()); + } } diff --git a/src/main/java/techreborn/init/ModBlocks.java b/src/main/java/techreborn/init/ModBlocks.java index a6dc27104..9d0cb09d3 100644 --- a/src/main/java/techreborn/init/ModBlocks.java +++ b/src/main/java/techreborn/init/ModBlocks.java @@ -8,433 +8,540 @@ import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; import reborncore.common.tile.TileMachineBase; import techreborn.Core; -import techreborn.blocks.*; -import techreborn.blocks.advanced_machine.*; -import techreborn.blocks.generator.*; +import techreborn.blocks.BlockComputerCube; +import techreborn.blocks.BlockDigitalChest; +import techreborn.blocks.BlockElectricCraftingTable; +import techreborn.blocks.BlockFusionCoil; +import techreborn.blocks.BlockFusionControlComputer; +import techreborn.blocks.BlockHighlyAdvancedMachine; +import techreborn.blocks.BlockIronFence; +import techreborn.blocks.BlockMachineCasing; +import techreborn.blocks.BlockMachineFrame; +import techreborn.blocks.BlockNuke; +import techreborn.blocks.BlockOre; +import techreborn.blocks.BlockOre2; +import techreborn.blocks.BlockPlayerDetector; +import techreborn.blocks.BlockQuantumChest; +import techreborn.blocks.BlockQuantumTank; +import techreborn.blocks.BlockReinforcedGlass; +import techreborn.blocks.BlockRubberLeaves; +import techreborn.blocks.BlockRubberLog; +import techreborn.blocks.BlockRubberPlank; +import techreborn.blocks.BlockRubberSapling; +import techreborn.blocks.BlockStorage; +import techreborn.blocks.BlockStorage2; +import techreborn.blocks.BlockSupercondensator; +import techreborn.blocks.advanced_machine.BlockBlastFurnace; +import techreborn.blocks.advanced_machine.BlockCentrifuge; +import techreborn.blocks.advanced_machine.BlockDistillationTower; +import techreborn.blocks.advanced_machine.BlockImplosionCompressor; +import techreborn.blocks.advanced_machine.BlockIndustrialElectrolyzer; +import techreborn.blocks.advanced_machine.BlockIndustrialGrinder; +import techreborn.blocks.advanced_machine.BlockIndustrialSawmill; +import techreborn.blocks.generator.BlockDieselGenerator; +import techreborn.blocks.generator.BlockDragonEggSiphoner; +import techreborn.blocks.generator.BlockGasTurbine; +import techreborn.blocks.generator.BlockGenerator; +import techreborn.blocks.generator.BlockHeatGenerator; +import techreborn.blocks.generator.BlockLightningRod; +import techreborn.blocks.generator.BlockMagicEnergyAbsorber; +import techreborn.blocks.generator.BlockMagicEnergyConverter; +import techreborn.blocks.generator.BlockPlasmaGenerator; +import techreborn.blocks.generator.BlockSemiFluidGenerator; +import techreborn.blocks.generator.BlockSolarPanel; +import techreborn.blocks.generator.BlockThermalGenerator; +import techreborn.blocks.generator.BlockWaterMill; +import techreborn.blocks.generator.BlockWindMill; import techreborn.blocks.iron_machines.BlockAlloyFurnace; import techreborn.blocks.iron_machines.BlockIronFurnace; -import techreborn.blocks.machine.*; -import techreborn.blocks.storage.*; -import techreborn.blocks.tier1.*; +import techreborn.blocks.machine.BlockAssemblingMachine; +import techreborn.blocks.machine.BlockChargeBench; +import techreborn.blocks.machine.BlockChemicalReactor; +import techreborn.blocks.machine.BlockChunkLoader; +import techreborn.blocks.machine.BlockMatterFabricator; +import techreborn.blocks.machine.BlockRollingMachine; +import techreborn.blocks.machine.BlockScrapboxinator; +import techreborn.blocks.machine.BlockVacuumFreezer; +import techreborn.blocks.storage.BlockAESU; +import techreborn.blocks.storage.BlockBatBox; +import techreborn.blocks.storage.BlockIDSU; +import techreborn.blocks.storage.BlockLESU; +import techreborn.blocks.storage.BlockLESUStorage; +import techreborn.blocks.storage.BlockMFE; +import techreborn.blocks.storage.BlockMFSU; +import techreborn.blocks.tier1.BlockAlloySmelter; +import techreborn.blocks.tier1.BlockCompressor; +import techreborn.blocks.tier1.BlockElectricFurnace; +import techreborn.blocks.tier1.BlockExtractor; +import techreborn.blocks.tier1.BlockGrinder; +import techreborn.blocks.tier1.BlockRecycler; import techreborn.blocks.transformers.BlockHVTransformer; import techreborn.blocks.transformers.BlockLVTransformer; import techreborn.blocks.transformers.BlockMVTransformer; -import techreborn.itemblocks.*; -import techreborn.tiles.*; +import techreborn.itemblocks.ItemBlockAesu; +import techreborn.itemblocks.ItemBlockDigitalChest; +import techreborn.itemblocks.ItemBlockMachineCasing; +import techreborn.itemblocks.ItemBlockMachineFrame; +import techreborn.itemblocks.ItemBlockOre; +import techreborn.itemblocks.ItemBlockOre2; +import techreborn.itemblocks.ItemBlockPlayerDetector; +import techreborn.itemblocks.ItemBlockQuantumChest; +import techreborn.itemblocks.ItemBlockQuantumTank; +import techreborn.itemblocks.ItemBlockRubberSapling; +import techreborn.itemblocks.ItemBlockStorage; +import techreborn.itemblocks.ItemBlockStorage2; +import techreborn.tiles.TileAesu; +import techreborn.tiles.TileAlloyFurnace; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileAssemblingMachine; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileCentrifuge; +import techreborn.tiles.TileChargeBench; +import techreborn.tiles.TileChemicalReactor; +import techreborn.tiles.TileChunkLoader; +import techreborn.tiles.TileDigitalChest; +import techreborn.tiles.TileImplosionCompressor; +import techreborn.tiles.TileIndustrialElectrolyzer; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.TileIndustrialSawmill; +import techreborn.tiles.TileIronFurnace; +import techreborn.tiles.TileMachineCasing; +import techreborn.tiles.TileMatterFabricator; +import techreborn.tiles.TilePlayerDectector; +import techreborn.tiles.TileQuantumChest; +import techreborn.tiles.TileQuantumTank; +import techreborn.tiles.TileRollingMachine; +import techreborn.tiles.TileScrapboxinator; +import techreborn.tiles.TileVacuumFreezer; import techreborn.tiles.fusionReactor.TileEntityFusionController; -import techreborn.tiles.generator.*; +import techreborn.tiles.generator.TileDieselGenerator; +import techreborn.tiles.generator.TileDragonEggSiphoner; +import techreborn.tiles.generator.TileGasTurbine; +import techreborn.tiles.generator.TileGenerator; +import techreborn.tiles.generator.TileHeatGenerator; +import techreborn.tiles.generator.TileSemifluidGenerator; +import techreborn.tiles.generator.TileSolarPanel; +import techreborn.tiles.generator.TileThermalGenerator; +import techreborn.tiles.generator.TileWaterMill; +import techreborn.tiles.generator.TileWindMill; import techreborn.tiles.idsu.TileIDSU; import techreborn.tiles.lesu.TileLesu; import techreborn.tiles.lesu.TileLesuStorage; import techreborn.tiles.storage.TileBatBox; import techreborn.tiles.storage.TileMFE; import techreborn.tiles.storage.TileMFSU; -import techreborn.tiles.teir1.*; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; +import techreborn.tiles.teir1.TileRecycler; import techreborn.tiles.transformers.TileHVTransformer; import techreborn.tiles.transformers.TileLVTransformer; import techreborn.tiles.transformers.TileMVTransformer; -public class ModBlocks { - - public static Block thermalGenerator; - public static Block quantumTank; - public static Block quantumChest; - public static Block digitalChest; - public static Block centrifuge; - public static Block RollingMachine; - public static Block MachineCasing; - public static Block BlastFurnace; - public static Block AlloySmelter; - public static Block IndustrialGrinder; - public static Block ImplosionCompressor; - public static Block MatterFabricator; - public static Block ChunkLoader; - public static Block HighAdvancedMachineBlock; - public static Block Dragoneggenergysiphoner; - public static Block Magicenergeyconverter; - public static Block AssemblyMachine; - public static Block DieselGenerator; - public static Block IndustrialElectrolyzer; - public static Block MagicalAbsorber; - public static Block Semifluidgenerator; - public static Block Gasturbine; - public static Block AlloyFurnace; - public static Block ChemicalReactor; - public static Block Idsu; - public static Block Aesu; - public static Block Lesu; - public static Block Supercondensator; - public static Block LesuStorage; - public static Block Distillationtower; - public static Block ElectricCraftingTable; - public static Block VacuumFreezer; - public static Block PlasmaGenerator; - public static Block FusionControlComputer; - public static Block ComputerCube; - public static Block FusionCoil; - public static Block LightningRod; - public static Block heatGenerator; - public static Block industrialSawmill; - public static Block chargeBench; - public static Block playerDetector; - public static Block Grinder; - public static Block Generator; - public static Block Compressor; - public static Block Extractor; - public static Block ElectricFurnace; - public static Block solarPanel; - public static Block waterMill; - public static Block windMill; - public static Block recycler; - public static Block batBox; - public static Block mfe; - public static Block mfsu; - public static Block scrapboxinator; - public static Block lvt; - public static Block mvt; - public static Block hvt; - - public static BlockOre ore; - public static BlockOre2 ore2; - public static Block storage; - public static Block storage2; - public static Block machineframe; - public static Block reinforcedglass; - public static Block ironFurnace; - public static Block nuke; - - public static Block rubberLog; - public static Block rubberLeaves; - public static Block rubberSapling; - public static Block rubberPlanks; - - public static Block ironFence; - - public static void init() { - thermalGenerator = new BlockThermalGenerator(); - GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator"); - GameRegistry.registerTileEntity(TileThermalGenerator.class, "TileThermalGeneratorTR"); - - quantumTank = new BlockQuantumTank(); - GameRegistry.registerBlock(quantumTank, ItemBlockQuantumTank.class, "techreborn.quantumTank"); - GameRegistry.registerTileEntity(TileQuantumTank.class, "TileQuantumTankTR"); - - quantumChest = new BlockQuantumChest(); - GameRegistry.registerBlock(quantumChest, ItemBlockQuantumChest.class, "techreborn.quantumChest"); - GameRegistry.registerTileEntity(TileQuantumChest.class, "TileQuantumChestTR"); - - digitalChest = new BlockDigitalChest(); - GameRegistry.registerBlock(digitalChest, ItemBlockDigitalChest.class, "techreborn.digitalChest"); - GameRegistry.registerTileEntity(TileDigitalChest.class, "TileDigitalChestTR"); - - centrifuge = new BlockCentrifuge(); - GameRegistry.registerBlock(centrifuge, "techreborn.centrifuge"); - GameRegistry.registerTileEntity(TileCentrifuge.class, "TileCentrifugeTR"); - - RollingMachine = new BlockRollingMachine(Material.rock); - GameRegistry.registerBlock(RollingMachine, "rollingmachine"); - GameRegistry.registerTileEntity(TileRollingMachine.class, "TileRollingMachineTR"); - - BlastFurnace = new BlockBlastFurnace(Material.rock); - GameRegistry.registerBlock(BlastFurnace, "blastFurnace"); - GameRegistry.registerTileEntity(TileBlastFurnace.class, "TileBlastFurnaceTR"); - - AlloySmelter = new BlockAlloySmelter(Material.rock); - GameRegistry.registerBlock(AlloySmelter, "alloySmelter"); - GameRegistry.registerTileEntity(TileAlloySmelter.class, "TileAlloySmalterTR"); - - IndustrialGrinder = new BlockIndustrialGrinder(Material.rock); - GameRegistry.registerBlock(IndustrialGrinder, "grinder"); - GameRegistry.registerTileEntity(TileIndustrialGrinder.class, "TileIndustrialGrinderTR"); - - ImplosionCompressor = new BlockImplosionCompressor(Material.rock); - GameRegistry.registerBlock(ImplosionCompressor, "implosioncompressor"); - GameRegistry.registerTileEntity(TileImplosionCompressor.class, "TileImplosionCompressorTR"); - - MatterFabricator = new BlockMatterFabricator(Material.rock); - GameRegistry.registerBlock(MatterFabricator, "matterfabricator"); - GameRegistry.registerTileEntity(TileMatterFabricator.class, "TileMatterFabricatorTR"); - - ChunkLoader = new BlockChunkLoader(Material.rock); - GameRegistry.registerBlock(ChunkLoader, "chunkloader"); - GameRegistry.registerTileEntity(TileChunkLoader.class, "TileChunkLoaderTR"); - - chargeBench = new BlockChargeBench(Material.rock); - GameRegistry.registerBlock(chargeBench, "chargebench"); - GameRegistry.registerTileEntity(TileChargeBench.class, "TileChargeBench"); - - playerDetector = new BlockPlayerDetector(); - GameRegistry.registerBlock(playerDetector, ItemBlockPlayerDetector.class, "playerDetector"); - GameRegistry.registerTileEntity(TilePlayerDectector.class, "TilePlayerDectectorTR"); - - MachineCasing = new BlockMachineCasing(Material.rock); - GameRegistry.registerBlock(MachineCasing, ItemBlockMachineCasing.class, "machinecasing"); - GameRegistry.registerTileEntity(TileMachineCasing.class, "TileMachineCasingTR"); - - ore = new BlockOre(Material.rock); - GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore"); - - ore2 = new BlockOre2(Material.rock); - GameRegistry.registerBlock(ore2, ItemBlockOre2.class, "techreborn.ore2"); - - storage = new BlockStorage(Material.iron); - GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage"); - - storage2 = new BlockStorage2(Material.iron); - GameRegistry.registerBlock(storage2, ItemBlockStorage2.class, "techreborn.storage2"); - - HighAdvancedMachineBlock = new BlockHighlyAdvancedMachine(Material.rock); - GameRegistry.registerBlock(HighAdvancedMachineBlock, "highlyadvancedmachine"); - - Dragoneggenergysiphoner = new BlockDragonEggSiphoner(Material.rock); - GameRegistry.registerBlock(Dragoneggenergysiphoner, "dragoneggenergsiphon"); - GameRegistry.registerTileEntity(TileDragonEggSiphoner.class, "TileDragonEggSiphonerTR"); - - Magicenergeyconverter = new BlockMagicEnergyConverter(Material.rock); - GameRegistry.registerBlock(Magicenergeyconverter, "magicenergyconverter"); - - AssemblyMachine = new BlockAssemblingMachine(Material.rock); - GameRegistry.registerBlock(AssemblyMachine, "assemblymachine"); - GameRegistry.registerTileEntity(TileAssemblingMachine.class, "TileAssemblyMachineTR"); - - DieselGenerator = new BlockDieselGenerator(Material.rock); - GameRegistry.registerBlock(DieselGenerator, "dieselgenerator"); - GameRegistry.registerTileEntity(TileDieselGenerator.class, "TileDieselGeneratorTR"); - - IndustrialElectrolyzer = new BlockIndustrialElectrolyzer(Material.rock); - GameRegistry.registerBlock(IndustrialElectrolyzer, "industrialelectrolyzer"); - GameRegistry.registerTileEntity(TileIndustrialElectrolyzer.class, "TileIndustrialElectrolyzerTR"); - - MagicalAbsorber = new BlockMagicEnergyAbsorber(Material.rock); - GameRegistry.registerBlock(MagicalAbsorber, "magicrnergyabsorber"); - - Semifluidgenerator = new BlockSemiFluidGenerator(Material.rock); - GameRegistry.registerBlock(Semifluidgenerator, "semifluidgenerator"); - GameRegistry.registerTileEntity(TileSemifluidGenerator.class, "TileSemifluidGeneratorTR"); - - Gasturbine = new BlockGasTurbine(Material.rock); - GameRegistry.registerBlock(Gasturbine, "gasturbine"); - GameRegistry.registerTileEntity(TileGasTurbine.class, "TileGassTurbineTR"); - - AlloyFurnace = new BlockAlloyFurnace(Material.rock); - GameRegistry.registerBlock(AlloyFurnace, "alloyfurnace"); - GameRegistry.registerTileEntity(TileAlloyFurnace.class, "TileAlloyFurnaceTR"); - - ChemicalReactor = new BlockChemicalReactor(Material.rock); - GameRegistry.registerBlock(ChemicalReactor, "chemicalreactor"); - GameRegistry.registerTileEntity(TileChemicalReactor.class, "TileChemicalReactorTR"); - - Idsu = new BlockIDSU(Material.rock); - GameRegistry.registerBlock(Idsu, "idsu"); - GameRegistry.registerTileEntity(TileIDSU.class, "TileIDSUTR"); - - Aesu = new BlockAESU(Material.rock); - GameRegistry.registerBlock(Aesu, ItemBlockAesu.class, "aesu"); - GameRegistry.registerTileEntity(TileAesu.class, "TileAesuTR"); - - Lesu = new BlockLESU(Material.rock); - GameRegistry.registerBlock(Lesu, "lesu"); - GameRegistry.registerTileEntity(TileLesu.class, "TileLesuTR"); - - Supercondensator = new BlockSupercondensator(Material.rock); - GameRegistry.registerBlock(Supercondensator, "supercondensator"); - - LesuStorage = new BlockLESUStorage(Material.rock); - GameRegistry.registerBlock(LesuStorage, "lesustorage"); - GameRegistry.registerTileEntity(TileLesuStorage.class, "TileLesuStorageTR"); - - Distillationtower = new BlockDistillationTower(Material.rock); - GameRegistry.registerBlock(Distillationtower, "distillationtower"); - - ElectricCraftingTable = new BlockElectricCraftingTable(Material.rock); - GameRegistry.registerBlock(ElectricCraftingTable, "electriccraftingtable"); - - VacuumFreezer = new BlockVacuumFreezer(Material.rock); - GameRegistry.registerBlock(VacuumFreezer, "vacuumfreezer"); - GameRegistry.registerTileEntity(TileVacuumFreezer.class, "TileVacuumFreezerTR"); - - PlasmaGenerator = new BlockPlasmaGenerator(Material.rock); - GameRegistry.registerBlock(PlasmaGenerator, "plasmagenerator"); - - ComputerCube = new BlockComputerCube(Material.rock); - GameRegistry.registerBlock(ComputerCube, "computercube"); - - FusionControlComputer = new BlockFusionControlComputer(Material.rock); - GameRegistry.registerBlock(FusionControlComputer, "fusioncontrolcomputer"); - GameRegistry.registerTileEntity(TileEntityFusionController.class, "TileEntityFustionControllerTR"); - - FusionCoil = new BlockFusionCoil(Material.rock); - GameRegistry.registerBlock(FusionCoil, "fusioncoil"); - - LightningRod = new BlockLightningRod(Material.rock); - GameRegistry.registerBlock(LightningRod, "lightningrod"); - - heatGenerator = new BlockHeatGenerator(Material.rock); - GameRegistry.registerBlock(heatGenerator, "heatgenerator"); - GameRegistry.registerTileEntity(TileHeatGenerator.class, "TileHeatGeneratorTR"); - - industrialSawmill = new BlockIndustrialSawmill(Material.rock); - GameRegistry.registerBlock(industrialSawmill, "industrialSawmill"); - GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmillTR"); - - machineframe = new BlockMachineFrame(Material.iron); - GameRegistry.registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame"); - - Grinder = new BlockGrinder(Material.iron); - GameRegistry.registerBlock(Grinder, "techreborn.grinder"); - GameRegistry.registerTileEntity(TileGrinder.class, "TileGrinderTR"); - - Generator = new BlockGenerator(); - GameRegistry.registerBlock(Generator, "techreborn.generator"); - GameRegistry.registerTileEntity(TileGenerator.class, "TileGeneratorTR"); - - Extractor = new BlockExtractor(Material.iron); - GameRegistry.registerBlock(Extractor, "techreborn.extractor"); - GameRegistry.registerTileEntity(TileExtractor.class, "TileExtractorTR"); - - Compressor = new BlockCompressor(Material.iron); - GameRegistry.registerBlock(Compressor, "techreborn.compressor"); - GameRegistry.registerTileEntity(TileCompressor.class, "TileCompressorTR"); - - ElectricFurnace = new BlockElectricFurnace(Material.iron); - GameRegistry.registerBlock(ElectricFurnace, "techreborn.electricfurnace"); - GameRegistry.registerTileEntity(TileElectricFurnace.class, "TileElectricFurnaceTR"); - - solarPanel = new BlockSolarPanel(); - GameRegistry.registerBlock(solarPanel, "techreborn.solarpanel"); - GameRegistry.registerTileEntity(TileSolarPanel.class, "TileSolarPanel"); - - waterMill = new BlockWaterMill(); - GameRegistry.registerBlock(waterMill, "techreborn.watermill"); - GameRegistry.registerTileEntity(TileWaterMill.class, "TileWaterMill"); - - windMill = new BlockWindMill(); - GameRegistry.registerBlock(windMill, "techreborn.windmill"); - GameRegistry.registerTileEntity(TileWindMill.class, "TileWindMill"); - - GameRegistry.registerTileEntity(TileMachineBase.class, "TileMachineBaseTR"); - - rubberLog = new BlockRubberLog(); - GameRegistry.registerBlock(rubberLog, "rubberLog"); - - rubberPlanks = new BlockRubberPlank(); - GameRegistry.registerBlock(rubberPlanks, "rubberPlanks"); - - rubberLeaves = new BlockRubberLeaves(); - GameRegistry.registerBlock(rubberLeaves, "rubberLeaves"); - - rubberSapling = new BlockRubberSapling(); - GameRegistry.registerBlock(rubberSapling, ItemBlockRubberSapling.class, "rubberSapling"); - - ironFence = new BlockIronFence(); - GameRegistry.registerBlock(ironFence, "ironFence"); - - reinforcedglass = new BlockReinforcedGlass(Material.glass); - GameRegistry.registerBlock(reinforcedglass, "reinforcedglass"); - - recycler = new BlockRecycler(Material.iron); - GameRegistry.registerBlock(recycler, "recycler"); - GameRegistry.registerTileEntity(TileRecycler.class, "TileRecyclerTR"); - - batBox = new BlockBatBox(); - GameRegistry.registerBlock(batBox, "batBox"); - GameRegistry.registerTileEntity(TileBatBox.class, "TileBatBox"); - - mfe = new BlockMFE(); - GameRegistry.registerBlock(mfe, "mfe"); - GameRegistry.registerTileEntity(TileMFE.class, "TileMFE"); - - mfsu = new BlockMFSU(); - GameRegistry.registerBlock(mfsu, "mfsu"); - GameRegistry.registerTileEntity(TileMFSU.class, "TileMFSU"); - - lvt = new BlockLVTransformer(); - GameRegistry.registerBlock(lvt, "lvt"); - GameRegistry.registerTileEntity(TileLVTransformer.class, "TileLVTransformer"); - - mvt = new BlockMVTransformer(); - GameRegistry.registerBlock(mvt, "mvt"); - GameRegistry.registerTileEntity(TileMVTransformer.class, "TileMVTransformer"); - - hvt = new BlockHVTransformer(); - GameRegistry.registerBlock(hvt, "hvt"); - GameRegistry.registerTileEntity(TileHVTransformer.class, "TileHVTransformer"); - - ironFurnace = new BlockIronFurnace(); - GameRegistry.registerBlock(ironFurnace, "ironfurnace"); - GameRegistry.registerTileEntity(TileIronFurnace.class, "TileIronFurnaceTR"); - - nuke = new BlockNuke(); - GameRegistry.registerBlock(nuke, "nuke"); - - scrapboxinator = new BlockScrapboxinator(Material.iron); - GameRegistry.registerBlock(scrapboxinator, "scrapboxinator"); - GameRegistry.registerTileEntity(TileScrapboxinator.class, "TileScrapboxinatorTR"); - - registerOreDict(); - Core.logHelper.info("TechReborns Blocks Loaded"); - } - - public static void registerOreDict() { - OreDictionary.registerOre("oreGalena", new ItemStack(ore, 1, 0)); - OreDictionary.registerOre("oreIridium", new ItemStack(ore, 1, 1)); - OreDictionary.registerOre("oreRuby", new ItemStack(ore, 1, 2)); - OreDictionary.registerOre("oreSapphire", new ItemStack(ore, 1, 3)); - OreDictionary.registerOre("oreBauxite", new ItemStack(ore, 1, 4)); - OreDictionary.registerOre("orePyrite", new ItemStack(ore, 1, 5)); - OreDictionary.registerOre("oreCinnabar", new ItemStack(ore, 1, 6)); - OreDictionary.registerOre("oreSphalerite", new ItemStack(ore, 1, 7)); - OreDictionary.registerOre("oreTungsten", new ItemStack(ore, 1, 8)); - OreDictionary.registerOre("oreSheldonite", new ItemStack(ore, 1, 9)); - OreDictionary.registerOre("orePlatinum", new ItemStack(ore, 1, 9)); - OreDictionary.registerOre("orePeridot", new ItemStack(ore, 1, 10)); - OreDictionary.registerOre("oreSodalite", new ItemStack(ore, 1, 11)); - OreDictionary.registerOre("oreTetrahedrite", new ItemStack(ore, 1, 12)); - OreDictionary.registerOre("oreTin", new ItemStack(ore, 1, 13)); - OreDictionary.registerOre("oreLead", new ItemStack(ore, 1, 14)); - OreDictionary.registerOre("oreSilver", new ItemStack(ore, 1, 15)); - - OreDictionary.registerOre("blockSilver", new ItemStack(storage, 1, 0)); - OreDictionary.registerOre("blockAluminum", new ItemStack(storage, 1, 1)); - OreDictionary.registerOre("blockTitanium", new ItemStack(storage, 1, 2)); - OreDictionary.registerOre("blockChrome", new ItemStack(storage, 1, 3)); - OreDictionary.registerOre("blockSteel", new ItemStack(storage, 1, 4)); - OreDictionary.registerOre("blockBrass", new ItemStack(storage, 1, 5)); - OreDictionary.registerOre("blockLead", new ItemStack(storage, 1, 6)); - OreDictionary.registerOre("blockElectrum", new ItemStack(storage, 1, 7)); - OreDictionary.registerOre("blockZinc", new ItemStack(storage, 1, 8)); - OreDictionary.registerOre("blockPlatinum", new ItemStack(storage, 1, 9)); - OreDictionary.registerOre("blockTungsten", new ItemStack(storage, 1, 10)); - OreDictionary.registerOre("blockNickel", new ItemStack(storage, 1, 11)); - OreDictionary.registerOre("blockInvar", new ItemStack(storage, 1, 12)); - OreDictionary.registerOre("blockOsmium", new ItemStack(storage, 1, 13)); - OreDictionary.registerOre("blockIridium", new ItemStack(storage, 1, 14)); - - OreDictionary.registerOre("blockTungstensteel", new ItemStack(storage2, 1, 0)); - OreDictionary.registerOre("blockLodestone", new ItemStack(storage2, 1, 1)); - OreDictionary.registerOre("blockTellurium", new ItemStack(storage2, 1, 2)); - OreDictionary.registerOre("blockRuby", new ItemStack(storage2, 1, 5)); - OreDictionary.registerOre("blockSapphire", new ItemStack(storage2, 1, 6)); - OreDictionary.registerOre("blockPeridot", new ItemStack(storage2, 1, 7)); - OreDictionary.registerOre("blockYellowGarnet", new ItemStack(storage2, 1, 8)); - OreDictionary.registerOre("blockRedGarnet", new ItemStack(storage2, 1, 9)); - - - OreDictionary.registerOre("craftingPiston", Blocks.piston); - OreDictionary.registerOre("craftingPiston", Blocks.sticky_piston); - OreDictionary.registerOre("crafterWood", Blocks.crafting_table); - OreDictionary.registerOre("machineBasic", new ItemStack(machineframe, 1)); - - OreDictionary.registerOre("treeSapling", rubberSapling); - OreDictionary.registerOre("saplingRubber", rubberSapling); - OreDictionary.registerOre("logWood", new ItemStack(rubberLog, 1 , OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("logRubber", new ItemStack(rubberLog, 1 , OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("plankWood", new ItemStack(rubberPlanks, 1 , OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("plankRubber", new ItemStack(rubberPlanks, 1 , OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("treeLeaves", new ItemStack(rubberLeaves, 1 , OreDictionary.WILDCARD_VALUE)); - OreDictionary.registerOre("leavesRubber", new ItemStack(rubberLeaves, 1 , OreDictionary.WILDCARD_VALUE)); - - OreDictionary.registerOre("fenceIron", ironFence); - } +public class ModBlocks +{ + + public static Block thermalGenerator; + public static Block quantumTank; + public static Block quantumChest; + public static Block digitalChest; + public static Block centrifuge; + public static Block RollingMachine; + public static Block MachineCasing; + public static Block BlastFurnace; + public static Block AlloySmelter; + public static Block IndustrialGrinder; + public static Block ImplosionCompressor; + public static Block MatterFabricator; + public static Block ChunkLoader; + public static Block HighAdvancedMachineBlock; + public static Block Dragoneggenergysiphoner; + public static Block Magicenergeyconverter; + public static Block AssemblyMachine; + public static Block DieselGenerator; + public static Block IndustrialElectrolyzer; + public static Block MagicalAbsorber; + public static Block Semifluidgenerator; + public static Block Gasturbine; + public static Block AlloyFurnace; + public static Block ChemicalReactor; + public static Block Idsu; + public static Block Aesu; + public static Block Lesu; + public static Block Supercondensator; + public static Block LesuStorage; + public static Block Distillationtower; + public static Block ElectricCraftingTable; + public static Block VacuumFreezer; + public static Block PlasmaGenerator; + public static Block FusionControlComputer; + public static Block ComputerCube; + public static Block FusionCoil; + public static Block LightningRod; + public static Block heatGenerator; + public static Block industrialSawmill; + public static Block chargeBench; + public static Block playerDetector; + public static Block Grinder; + public static Block Generator; + public static Block Compressor; + public static Block Extractor; + public static Block ElectricFurnace; + public static Block solarPanel; + public static Block waterMill; + public static Block windMill; + public static Block recycler; + public static Block batBox; + public static Block mfe; + public static Block mfsu; + public static Block scrapboxinator; + public static Block lvt; + public static Block mvt; + public static Block hvt; + + public static BlockOre ore; + public static BlockOre2 ore2; + public static Block storage; + public static Block storage2; + public static Block machineframe; + public static Block reinforcedglass; + public static Block ironFurnace; + public static Block nuke; + + public static Block rubberLog; + public static Block rubberLeaves; + public static Block rubberSapling; + public static Block rubberPlanks; + + public static Block ironFence; + + public static void init() + { + thermalGenerator = new BlockThermalGenerator(); + GameRegistry.registerBlock(thermalGenerator, "techreborn.thermalGenerator"); + GameRegistry.registerTileEntity(TileThermalGenerator.class, "TileThermalGeneratorTR"); + + quantumTank = new BlockQuantumTank(); + GameRegistry.registerBlock(quantumTank, ItemBlockQuantumTank.class, "techreborn.quantumTank"); + GameRegistry.registerTileEntity(TileQuantumTank.class, "TileQuantumTankTR"); + + quantumChest = new BlockQuantumChest(); + GameRegistry.registerBlock(quantumChest, ItemBlockQuantumChest.class, "techreborn.quantumChest"); + GameRegistry.registerTileEntity(TileQuantumChest.class, "TileQuantumChestTR"); + + digitalChest = new BlockDigitalChest(); + GameRegistry.registerBlock(digitalChest, ItemBlockDigitalChest.class, "techreborn.digitalChest"); + GameRegistry.registerTileEntity(TileDigitalChest.class, "TileDigitalChestTR"); + + centrifuge = new BlockCentrifuge(); + GameRegistry.registerBlock(centrifuge, "techreborn.centrifuge"); + GameRegistry.registerTileEntity(TileCentrifuge.class, "TileCentrifugeTR"); + + RollingMachine = new BlockRollingMachine(Material.rock); + GameRegistry.registerBlock(RollingMachine, "rollingmachine"); + GameRegistry.registerTileEntity(TileRollingMachine.class, "TileRollingMachineTR"); + + BlastFurnace = new BlockBlastFurnace(Material.rock); + GameRegistry.registerBlock(BlastFurnace, "blastFurnace"); + GameRegistry.registerTileEntity(TileBlastFurnace.class, "TileBlastFurnaceTR"); + + AlloySmelter = new BlockAlloySmelter(Material.rock); + GameRegistry.registerBlock(AlloySmelter, "alloySmelter"); + GameRegistry.registerTileEntity(TileAlloySmelter.class, "TileAlloySmalterTR"); + + IndustrialGrinder = new BlockIndustrialGrinder(Material.rock); + GameRegistry.registerBlock(IndustrialGrinder, "grinder"); + GameRegistry.registerTileEntity(TileIndustrialGrinder.class, "TileIndustrialGrinderTR"); + + ImplosionCompressor = new BlockImplosionCompressor(Material.rock); + GameRegistry.registerBlock(ImplosionCompressor, "implosioncompressor"); + GameRegistry.registerTileEntity(TileImplosionCompressor.class, "TileImplosionCompressorTR"); + + MatterFabricator = new BlockMatterFabricator(Material.rock); + GameRegistry.registerBlock(MatterFabricator, "matterfabricator"); + GameRegistry.registerTileEntity(TileMatterFabricator.class, "TileMatterFabricatorTR"); + + ChunkLoader = new BlockChunkLoader(Material.rock); + GameRegistry.registerBlock(ChunkLoader, "chunkloader"); + GameRegistry.registerTileEntity(TileChunkLoader.class, "TileChunkLoaderTR"); + + chargeBench = new BlockChargeBench(Material.rock); + GameRegistry.registerBlock(chargeBench, "chargebench"); + GameRegistry.registerTileEntity(TileChargeBench.class, "TileChargeBench"); + + playerDetector = new BlockPlayerDetector(); + GameRegistry.registerBlock(playerDetector, ItemBlockPlayerDetector.class, "playerDetector"); + GameRegistry.registerTileEntity(TilePlayerDectector.class, "TilePlayerDectectorTR"); + + MachineCasing = new BlockMachineCasing(Material.rock); + GameRegistry.registerBlock(MachineCasing, ItemBlockMachineCasing.class, "machinecasing"); + GameRegistry.registerTileEntity(TileMachineCasing.class, "TileMachineCasingTR"); + + ore = new BlockOre(Material.rock); + GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore"); + + ore2 = new BlockOre2(Material.rock); + GameRegistry.registerBlock(ore2, ItemBlockOre2.class, "techreborn.ore2"); + + storage = new BlockStorage(Material.iron); + GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage"); + + storage2 = new BlockStorage2(Material.iron); + GameRegistry.registerBlock(storage2, ItemBlockStorage2.class, "techreborn.storage2"); + + HighAdvancedMachineBlock = new BlockHighlyAdvancedMachine(Material.rock); + GameRegistry.registerBlock(HighAdvancedMachineBlock, "highlyadvancedmachine"); + + Dragoneggenergysiphoner = new BlockDragonEggSiphoner(Material.rock); + GameRegistry.registerBlock(Dragoneggenergysiphoner, "dragoneggenergsiphon"); + GameRegistry.registerTileEntity(TileDragonEggSiphoner.class, "TileDragonEggSiphonerTR"); + + Magicenergeyconverter = new BlockMagicEnergyConverter(Material.rock); + GameRegistry.registerBlock(Magicenergeyconverter, "magicenergyconverter"); + + AssemblyMachine = new BlockAssemblingMachine(Material.rock); + GameRegistry.registerBlock(AssemblyMachine, "assemblymachine"); + GameRegistry.registerTileEntity(TileAssemblingMachine.class, "TileAssemblyMachineTR"); + + DieselGenerator = new BlockDieselGenerator(Material.rock); + GameRegistry.registerBlock(DieselGenerator, "dieselgenerator"); + GameRegistry.registerTileEntity(TileDieselGenerator.class, "TileDieselGeneratorTR"); + + IndustrialElectrolyzer = new BlockIndustrialElectrolyzer(Material.rock); + GameRegistry.registerBlock(IndustrialElectrolyzer, "industrialelectrolyzer"); + GameRegistry.registerTileEntity(TileIndustrialElectrolyzer.class, "TileIndustrialElectrolyzerTR"); + + MagicalAbsorber = new BlockMagicEnergyAbsorber(Material.rock); + GameRegistry.registerBlock(MagicalAbsorber, "magicrnergyabsorber"); + + Semifluidgenerator = new BlockSemiFluidGenerator(Material.rock); + GameRegistry.registerBlock(Semifluidgenerator, "semifluidgenerator"); + GameRegistry.registerTileEntity(TileSemifluidGenerator.class, "TileSemifluidGeneratorTR"); + + Gasturbine = new BlockGasTurbine(Material.rock); + GameRegistry.registerBlock(Gasturbine, "gasturbine"); + GameRegistry.registerTileEntity(TileGasTurbine.class, "TileGassTurbineTR"); + + AlloyFurnace = new BlockAlloyFurnace(Material.rock); + GameRegistry.registerBlock(AlloyFurnace, "alloyfurnace"); + GameRegistry.registerTileEntity(TileAlloyFurnace.class, "TileAlloyFurnaceTR"); + + ChemicalReactor = new BlockChemicalReactor(Material.rock); + GameRegistry.registerBlock(ChemicalReactor, "chemicalreactor"); + GameRegistry.registerTileEntity(TileChemicalReactor.class, "TileChemicalReactorTR"); + + Idsu = new BlockIDSU(Material.rock); + GameRegistry.registerBlock(Idsu, "idsu"); + GameRegistry.registerTileEntity(TileIDSU.class, "TileIDSUTR"); + + Aesu = new BlockAESU(Material.rock); + GameRegistry.registerBlock(Aesu, ItemBlockAesu.class, "aesu"); + GameRegistry.registerTileEntity(TileAesu.class, "TileAesuTR"); + + Lesu = new BlockLESU(Material.rock); + GameRegistry.registerBlock(Lesu, "lesu"); + GameRegistry.registerTileEntity(TileLesu.class, "TileLesuTR"); + + Supercondensator = new BlockSupercondensator(Material.rock); + GameRegistry.registerBlock(Supercondensator, "supercondensator"); + + LesuStorage = new BlockLESUStorage(Material.rock); + GameRegistry.registerBlock(LesuStorage, "lesustorage"); + GameRegistry.registerTileEntity(TileLesuStorage.class, "TileLesuStorageTR"); + + Distillationtower = new BlockDistillationTower(Material.rock); + GameRegistry.registerBlock(Distillationtower, "distillationtower"); + + ElectricCraftingTable = new BlockElectricCraftingTable(Material.rock); + GameRegistry.registerBlock(ElectricCraftingTable, "electriccraftingtable"); + + VacuumFreezer = new BlockVacuumFreezer(Material.rock); + GameRegistry.registerBlock(VacuumFreezer, "vacuumfreezer"); + GameRegistry.registerTileEntity(TileVacuumFreezer.class, "TileVacuumFreezerTR"); + + PlasmaGenerator = new BlockPlasmaGenerator(Material.rock); + GameRegistry.registerBlock(PlasmaGenerator, "plasmagenerator"); + + ComputerCube = new BlockComputerCube(Material.rock); + GameRegistry.registerBlock(ComputerCube, "computercube"); + + FusionControlComputer = new BlockFusionControlComputer(Material.rock); + GameRegistry.registerBlock(FusionControlComputer, "fusioncontrolcomputer"); + GameRegistry.registerTileEntity(TileEntityFusionController.class, "TileEntityFustionControllerTR"); + + FusionCoil = new BlockFusionCoil(Material.rock); + GameRegistry.registerBlock(FusionCoil, "fusioncoil"); + + LightningRod = new BlockLightningRod(Material.rock); + GameRegistry.registerBlock(LightningRod, "lightningrod"); + + heatGenerator = new BlockHeatGenerator(Material.rock); + GameRegistry.registerBlock(heatGenerator, "heatgenerator"); + GameRegistry.registerTileEntity(TileHeatGenerator.class, "TileHeatGeneratorTR"); + + industrialSawmill = new BlockIndustrialSawmill(Material.rock); + GameRegistry.registerBlock(industrialSawmill, "industrialSawmill"); + GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmillTR"); + + machineframe = new BlockMachineFrame(Material.iron); + GameRegistry.registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame"); + + Grinder = new BlockGrinder(Material.iron); + GameRegistry.registerBlock(Grinder, "techreborn.grinder"); + GameRegistry.registerTileEntity(TileGrinder.class, "TileGrinderTR"); + + Generator = new BlockGenerator(); + GameRegistry.registerBlock(Generator, "techreborn.generator"); + GameRegistry.registerTileEntity(TileGenerator.class, "TileGeneratorTR"); + + Extractor = new BlockExtractor(Material.iron); + GameRegistry.registerBlock(Extractor, "techreborn.extractor"); + GameRegistry.registerTileEntity(TileExtractor.class, "TileExtractorTR"); + + Compressor = new BlockCompressor(Material.iron); + GameRegistry.registerBlock(Compressor, "techreborn.compressor"); + GameRegistry.registerTileEntity(TileCompressor.class, "TileCompressorTR"); + + ElectricFurnace = new BlockElectricFurnace(Material.iron); + GameRegistry.registerBlock(ElectricFurnace, "techreborn.electricfurnace"); + GameRegistry.registerTileEntity(TileElectricFurnace.class, "TileElectricFurnaceTR"); + + solarPanel = new BlockSolarPanel(); + GameRegistry.registerBlock(solarPanel, "techreborn.solarpanel"); + GameRegistry.registerTileEntity(TileSolarPanel.class, "TileSolarPanel"); + + waterMill = new BlockWaterMill(); + GameRegistry.registerBlock(waterMill, "techreborn.watermill"); + GameRegistry.registerTileEntity(TileWaterMill.class, "TileWaterMill"); + + windMill = new BlockWindMill(); + GameRegistry.registerBlock(windMill, "techreborn.windmill"); + GameRegistry.registerTileEntity(TileWindMill.class, "TileWindMill"); + + GameRegistry.registerTileEntity(TileMachineBase.class, "TileMachineBaseTR"); + + rubberLog = new BlockRubberLog(); + GameRegistry.registerBlock(rubberLog, "rubberLog"); + + rubberPlanks = new BlockRubberPlank(); + GameRegistry.registerBlock(rubberPlanks, "rubberPlanks"); + + rubberLeaves = new BlockRubberLeaves(); + GameRegistry.registerBlock(rubberLeaves, "rubberLeaves"); + + rubberSapling = new BlockRubberSapling(); + GameRegistry.registerBlock(rubberSapling, ItemBlockRubberSapling.class, "rubberSapling"); + + ironFence = new BlockIronFence(); + GameRegistry.registerBlock(ironFence, "ironFence"); + + reinforcedglass = new BlockReinforcedGlass(Material.glass); + GameRegistry.registerBlock(reinforcedglass, "reinforcedglass"); + + recycler = new BlockRecycler(Material.iron); + GameRegistry.registerBlock(recycler, "recycler"); + GameRegistry.registerTileEntity(TileRecycler.class, "TileRecyclerTR"); + + batBox = new BlockBatBox(); + GameRegistry.registerBlock(batBox, "batBox"); + GameRegistry.registerTileEntity(TileBatBox.class, "TileBatBox"); + + mfe = new BlockMFE(); + GameRegistry.registerBlock(mfe, "mfe"); + GameRegistry.registerTileEntity(TileMFE.class, "TileMFE"); + + mfsu = new BlockMFSU(); + GameRegistry.registerBlock(mfsu, "mfsu"); + GameRegistry.registerTileEntity(TileMFSU.class, "TileMFSU"); + + lvt = new BlockLVTransformer(); + GameRegistry.registerBlock(lvt, "lvt"); + GameRegistry.registerTileEntity(TileLVTransformer.class, "TileLVTransformer"); + + mvt = new BlockMVTransformer(); + GameRegistry.registerBlock(mvt, "mvt"); + GameRegistry.registerTileEntity(TileMVTransformer.class, "TileMVTransformer"); + + hvt = new BlockHVTransformer(); + GameRegistry.registerBlock(hvt, "hvt"); + GameRegistry.registerTileEntity(TileHVTransformer.class, "TileHVTransformer"); + + ironFurnace = new BlockIronFurnace(); + GameRegistry.registerBlock(ironFurnace, "ironfurnace"); + GameRegistry.registerTileEntity(TileIronFurnace.class, "TileIronFurnaceTR"); + + nuke = new BlockNuke(); + GameRegistry.registerBlock(nuke, "nuke"); + + scrapboxinator = new BlockScrapboxinator(Material.iron); + GameRegistry.registerBlock(scrapboxinator, "scrapboxinator"); + GameRegistry.registerTileEntity(TileScrapboxinator.class, "TileScrapboxinatorTR"); + + registerOreDict(); + Core.logHelper.info("TechReborns Blocks Loaded"); + } + + public static void registerOreDict() + { + OreDictionary.registerOre("oreGalena", new ItemStack(ore, 1, 0)); + OreDictionary.registerOre("oreIridium", new ItemStack(ore, 1, 1)); + OreDictionary.registerOre("oreRuby", new ItemStack(ore, 1, 2)); + OreDictionary.registerOre("oreSapphire", new ItemStack(ore, 1, 3)); + OreDictionary.registerOre("oreBauxite", new ItemStack(ore, 1, 4)); + OreDictionary.registerOre("orePyrite", new ItemStack(ore, 1, 5)); + OreDictionary.registerOre("oreCinnabar", new ItemStack(ore, 1, 6)); + OreDictionary.registerOre("oreSphalerite", new ItemStack(ore, 1, 7)); + OreDictionary.registerOre("oreTungsten", new ItemStack(ore, 1, 8)); + OreDictionary.registerOre("oreSheldonite", new ItemStack(ore, 1, 9)); + OreDictionary.registerOre("orePlatinum", new ItemStack(ore, 1, 9)); + OreDictionary.registerOre("orePeridot", new ItemStack(ore, 1, 10)); + OreDictionary.registerOre("oreSodalite", new ItemStack(ore, 1, 11)); + OreDictionary.registerOre("oreTetrahedrite", new ItemStack(ore, 1, 12)); + OreDictionary.registerOre("oreTin", new ItemStack(ore, 1, 13)); + OreDictionary.registerOre("oreLead", new ItemStack(ore, 1, 14)); + OreDictionary.registerOre("oreSilver", new ItemStack(ore, 1, 15)); + + OreDictionary.registerOre("blockSilver", new ItemStack(storage, 1, 0)); + OreDictionary.registerOre("blockAluminum", new ItemStack(storage, 1, 1)); + OreDictionary.registerOre("blockTitanium", new ItemStack(storage, 1, 2)); + OreDictionary.registerOre("blockChrome", new ItemStack(storage, 1, 3)); + OreDictionary.registerOre("blockSteel", new ItemStack(storage, 1, 4)); + OreDictionary.registerOre("blockBrass", new ItemStack(storage, 1, 5)); + OreDictionary.registerOre("blockLead", new ItemStack(storage, 1, 6)); + OreDictionary.registerOre("blockElectrum", new ItemStack(storage, 1, 7)); + OreDictionary.registerOre("blockZinc", new ItemStack(storage, 1, 8)); + OreDictionary.registerOre("blockPlatinum", new ItemStack(storage, 1, 9)); + OreDictionary.registerOre("blockTungsten", new ItemStack(storage, 1, 10)); + OreDictionary.registerOre("blockNickel", new ItemStack(storage, 1, 11)); + OreDictionary.registerOre("blockInvar", new ItemStack(storage, 1, 12)); + OreDictionary.registerOre("blockOsmium", new ItemStack(storage, 1, 13)); + OreDictionary.registerOre("blockIridium", new ItemStack(storage, 1, 14)); + + OreDictionary.registerOre("blockTungstensteel", new ItemStack(storage2, 1, 0)); + OreDictionary.registerOre("blockLodestone", new ItemStack(storage2, 1, 1)); + OreDictionary.registerOre("blockTellurium", new ItemStack(storage2, 1, 2)); + OreDictionary.registerOre("blockRuby", new ItemStack(storage2, 1, 5)); + OreDictionary.registerOre("blockSapphire", new ItemStack(storage2, 1, 6)); + OreDictionary.registerOre("blockPeridot", new ItemStack(storage2, 1, 7)); + OreDictionary.registerOre("blockYellowGarnet", new ItemStack(storage2, 1, 8)); + OreDictionary.registerOre("blockRedGarnet", new ItemStack(storage2, 1, 9)); + + OreDictionary.registerOre("craftingPiston", Blocks.piston); + OreDictionary.registerOre("craftingPiston", Blocks.sticky_piston); + OreDictionary.registerOre("crafterWood", Blocks.crafting_table); + OreDictionary.registerOre("machineBasic", new ItemStack(machineframe, 1)); + + OreDictionary.registerOre("treeSapling", rubberSapling); + OreDictionary.registerOre("saplingRubber", rubberSapling); + OreDictionary.registerOre("logWood", new ItemStack(rubberLog, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("logRubber", new ItemStack(rubberLog, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("plankWood", new ItemStack(rubberPlanks, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("plankRubber", new ItemStack(rubberPlanks, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("treeLeaves", new ItemStack(rubberLeaves, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("leavesRubber", new ItemStack(rubberLeaves, 1, OreDictionary.WILDCARD_VALUE)); + + OreDictionary.registerOre("fenceIron", ironFence); + } } diff --git a/src/main/java/techreborn/init/ModFluids.java b/src/main/java/techreborn/init/ModFluids.java index 2f69f1f9e..2d98a18b0 100644 --- a/src/main/java/techreborn/init/ModFluids.java +++ b/src/main/java/techreborn/init/ModFluids.java @@ -10,193 +10,222 @@ import techreborn.blocks.fluid.BlockFluidTechReborn; import techreborn.blocks.fluid.TechRebornFluid; import techreborn.lib.ModInfo; -public class ModFluids { +public class ModFluids +{ - public static Fluid fluidberylium = new TechRebornFluid("fluidberylium"); - public static BlockFluidBase BlockFluidBerylium; + public static Fluid fluidberylium = new TechRebornFluid("fluidberylium"); + public static BlockFluidBase BlockFluidBerylium; - public static Fluid fluidcalcium = new TechRebornFluid("fluidcalcium"); - public static BlockFluidBase BlockFluidCalcium; + public static Fluid fluidcalcium = new TechRebornFluid("fluidcalcium"); + public static BlockFluidBase BlockFluidCalcium; - public static Fluid fluidcalciumcarbonate = new TechRebornFluid("fluidcalciumcarbonate"); - public static BlockFluidBase BlockFluidCalciumCarbonate; + public static Fluid fluidcalciumcarbonate = new TechRebornFluid("fluidcalciumcarbonate"); + public static BlockFluidBase BlockFluidCalciumCarbonate; - public static Fluid fluidChlorite = new TechRebornFluid("fluidchlorite"); - public static BlockFluidBase BlockFluidChlorite; + public static Fluid fluidChlorite = new TechRebornFluid("fluidchlorite"); + public static BlockFluidBase BlockFluidChlorite; - public static Fluid fluidDeuterium = new TechRebornFluid("fluiddeuterium"); - public static BlockFluidBase BlockFluidDeuterium; + public static Fluid fluidDeuterium = new TechRebornFluid("fluiddeuterium"); + public static BlockFluidBase BlockFluidDeuterium; - public static Fluid fluidGlyceryl = new TechRebornFluid("fluidglyceryl"); - public static BlockFluidBase BlockFluidGlyceryl; + public static Fluid fluidGlyceryl = new TechRebornFluid("fluidglyceryl"); + public static BlockFluidBase BlockFluidGlyceryl; - public static Fluid fluidHelium = new TechRebornFluid("fluidhelium"); - public static BlockFluidBase BlockFluidHelium; + public static Fluid fluidHelium = new TechRebornFluid("fluidhelium"); + public static BlockFluidBase BlockFluidHelium; - public static Fluid fluidHelium3 = new TechRebornFluid("fluidhelium3"); - public static BlockFluidBase BlockFluidHelium3; + public static Fluid fluidHelium3 = new TechRebornFluid("fluidhelium3"); + public static BlockFluidBase BlockFluidHelium3; - public static Fluid fluidHeliumplasma = new TechRebornFluid("fluidheliumplasma"); - public static BlockFluidBase BlockFluidHeliumplasma; + public static Fluid fluidHeliumplasma = new TechRebornFluid("fluidheliumplasma"); + public static BlockFluidBase BlockFluidHeliumplasma; - public static Fluid fluidHydrogen = new TechRebornFluid("fluidhydrogen"); - public static BlockFluidBase BlockFluidHydrogen; + public static Fluid fluidHydrogen = new TechRebornFluid("fluidhydrogen"); + public static BlockFluidBase BlockFluidHydrogen; - public static Fluid fluidLithium = new TechRebornFluid("fluidlithium"); - public static BlockFluidBase BlockFluidLithium; + public static Fluid fluidLithium = new TechRebornFluid("fluidlithium"); + public static BlockFluidBase BlockFluidLithium; - public static Fluid fluidMercury = new TechRebornFluid("fluidmercury"); - public static BlockFluidBase BlockFluidMercury; + public static Fluid fluidMercury = new TechRebornFluid("fluidmercury"); + public static BlockFluidBase BlockFluidMercury; - public static Fluid fluidMethane = new TechRebornFluid("fluidmethane"); - public static BlockFluidBase BlockFluidMethane; + public static Fluid fluidMethane = new TechRebornFluid("fluidmethane"); + public static BlockFluidBase BlockFluidMethane; - public static Fluid fluidNitrocoalfuel = new TechRebornFluid("fluidnitrocoalfuel"); - public static BlockFluidBase BlockFluidNitrocoalfuel; + public static Fluid fluidNitrocoalfuel = new TechRebornFluid("fluidnitrocoalfuel"); + public static BlockFluidBase BlockFluidNitrocoalfuel; - public static Fluid fluidNitrofuel = new TechRebornFluid("fluidnitrofuel"); - public static BlockFluidBase BlockFluidNitrofuel; + public static Fluid fluidNitrofuel = new TechRebornFluid("fluidnitrofuel"); + public static BlockFluidBase BlockFluidNitrofuel; - public static Fluid fluidNitrogen = new TechRebornFluid("fluidnitrogen"); - public static BlockFluidBase BlockFluidNitrogen; + public static Fluid fluidNitrogen = new TechRebornFluid("fluidnitrogen"); + public static BlockFluidBase BlockFluidNitrogen; - public static Fluid fluidNitrogendioxide = new TechRebornFluid("fluidnitrogendioxide"); - public static BlockFluidBase BlockFluidNitrogendioxide; + public static Fluid fluidNitrogendioxide = new TechRebornFluid("fluidnitrogendioxide"); + public static BlockFluidBase BlockFluidNitrogendioxide; - public static Fluid fluidPotassium = new TechRebornFluid("fluidpotassium"); - public static BlockFluidBase BlockFluidPotassium; + public static Fluid fluidPotassium = new TechRebornFluid("fluidpotassium"); + public static BlockFluidBase BlockFluidPotassium; - public static Fluid fluidSilicon = new TechRebornFluid("fluidsilicon"); - public static BlockFluidBase BlockFluidSilicon; + public static Fluid fluidSilicon = new TechRebornFluid("fluidsilicon"); + public static BlockFluidBase BlockFluidSilicon; - public static Fluid fluidSodium = new TechRebornFluid("fluidsodium"); - public static BlockFluidBase BlockFluidSodium; + public static Fluid fluidSodium = new TechRebornFluid("fluidsodium"); + public static BlockFluidBase BlockFluidSodium; - public static Fluid fluidSodiumpersulfate = new TechRebornFluid("fluidsodiumpersulfate"); - public static BlockFluidBase BlockFluidSodiumpersulfate; + public static Fluid fluidSodiumpersulfate = new TechRebornFluid("fluidsodiumpersulfate"); + public static BlockFluidBase BlockFluidSodiumpersulfate; - public static Fluid fluidTritium = new TechRebornFluid("fluidtritium"); - public static BlockFluidBase BlockFluidTritium; + public static Fluid fluidTritium = new TechRebornFluid("fluidtritium"); + public static BlockFluidBase BlockFluidTritium; - public static Fluid fluidWolframium = new TechRebornFluid("fluidwolframium"); - public static BlockFluidBase BlockFluidWolframium; + public static Fluid fluidWolframium = new TechRebornFluid("fluidwolframium"); + public static BlockFluidBase BlockFluidWolframium; - public static void init() { - FluidRegistry.registerFluid(fluidberylium); - BlockFluidBerylium = new BlockFluidTechReborn(fluidberylium, Material.water, "techreborn.berylium"); - GameRegistry.registerBlock(BlockFluidBerylium, ModInfo.MOD_ID + "_" + BlockFluidBerylium.getUnlocalizedName().substring(5)); - fluidberylium.setUnlocalizedName(BlockFluidBerylium.getUnlocalizedName()); + public static void init() + { + FluidRegistry.registerFluid(fluidberylium); + BlockFluidBerylium = new BlockFluidTechReborn(fluidberylium, Material.water, "techreborn.berylium"); + GameRegistry.registerBlock(BlockFluidBerylium, + ModInfo.MOD_ID + "_" + BlockFluidBerylium.getUnlocalizedName().substring(5)); + fluidberylium.setUnlocalizedName(BlockFluidBerylium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidcalcium); - BlockFluidCalcium = new BlockFluidTechReborn(fluidcalcium, Material.water, "techreborn.calcium"); - GameRegistry.registerBlock(BlockFluidCalcium, ModInfo.MOD_ID + "_" + BlockFluidCalcium.getUnlocalizedName().substring(5)); - fluidcalcium.setUnlocalizedName(BlockFluidCalcium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidcalcium); + BlockFluidCalcium = new BlockFluidTechReborn(fluidcalcium, Material.water, "techreborn.calcium"); + GameRegistry.registerBlock(BlockFluidCalcium, + ModInfo.MOD_ID + "_" + BlockFluidCalcium.getUnlocalizedName().substring(5)); + fluidcalcium.setUnlocalizedName(BlockFluidCalcium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidcalciumcarbonate); - BlockFluidCalciumCarbonate = new BlockFluidTechReborn(fluidcalciumcarbonate, Material.water, "techreborn.calciumcarbonate"); - GameRegistry.registerBlock(BlockFluidCalciumCarbonate, ModInfo.MOD_ID + "_" + BlockFluidCalciumCarbonate.getUnlocalizedName().substring(5)); - fluidcalcium.setUnlocalizedName(BlockFluidCalciumCarbonate.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidcalciumcarbonate); + BlockFluidCalciumCarbonate = new BlockFluidTechReborn(fluidcalciumcarbonate, Material.water, + "techreborn.calciumcarbonate"); + GameRegistry.registerBlock(BlockFluidCalciumCarbonate, + ModInfo.MOD_ID + "_" + BlockFluidCalciumCarbonate.getUnlocalizedName().substring(5)); + fluidcalcium.setUnlocalizedName(BlockFluidCalciumCarbonate.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidChlorite); - BlockFluidChlorite = new BlockFluidTechReborn(fluidChlorite, Material.water, "techreborn.chlorite"); - GameRegistry.registerBlock(BlockFluidChlorite, ModInfo.MOD_ID + "_" + BlockFluidChlorite.getUnlocalizedName().substring(5)); - fluidChlorite.setUnlocalizedName(BlockFluidChlorite.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidChlorite); + BlockFluidChlorite = new BlockFluidTechReborn(fluidChlorite, Material.water, "techreborn.chlorite"); + GameRegistry.registerBlock(BlockFluidChlorite, + ModInfo.MOD_ID + "_" + BlockFluidChlorite.getUnlocalizedName().substring(5)); + fluidChlorite.setUnlocalizedName(BlockFluidChlorite.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidDeuterium); - BlockFluidDeuterium = new BlockFluidTechReborn(fluidDeuterium, Material.water, "techreborn.deuterium"); - GameRegistry.registerBlock(BlockFluidDeuterium, ModInfo.MOD_ID + "_" + BlockFluidDeuterium.getUnlocalizedName().substring(5)); - fluidDeuterium.setUnlocalizedName(BlockFluidDeuterium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidDeuterium); + BlockFluidDeuterium = new BlockFluidTechReborn(fluidDeuterium, Material.water, "techreborn.deuterium"); + GameRegistry.registerBlock(BlockFluidDeuterium, + ModInfo.MOD_ID + "_" + BlockFluidDeuterium.getUnlocalizedName().substring(5)); + fluidDeuterium.setUnlocalizedName(BlockFluidDeuterium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidGlyceryl); - BlockFluidGlyceryl = new BlockFluidTechReborn(fluidGlyceryl, Material.water, "techreborn.glyceryl"); - GameRegistry.registerBlock(BlockFluidGlyceryl, ModInfo.MOD_ID + "_" + BlockFluidGlyceryl.getUnlocalizedName().substring(5)); - fluidGlyceryl.setUnlocalizedName(BlockFluidGlyceryl.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidGlyceryl); + BlockFluidGlyceryl = new BlockFluidTechReborn(fluidGlyceryl, Material.water, "techreborn.glyceryl"); + GameRegistry.registerBlock(BlockFluidGlyceryl, + ModInfo.MOD_ID + "_" + BlockFluidGlyceryl.getUnlocalizedName().substring(5)); + fluidGlyceryl.setUnlocalizedName(BlockFluidGlyceryl.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidHelium); - BlockFluidHelium = new BlockFluidTechReborn(fluidHelium, Material.water, "techreborn.helium"); - GameRegistry.registerBlock(BlockFluidHelium, ModInfo.MOD_ID + "_" + BlockFluidHelium.getUnlocalizedName().substring(5)); - fluidHelium.setUnlocalizedName(BlockFluidHelium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidHelium); + BlockFluidHelium = new BlockFluidTechReborn(fluidHelium, Material.water, "techreborn.helium"); + GameRegistry.registerBlock(BlockFluidHelium, + ModInfo.MOD_ID + "_" + BlockFluidHelium.getUnlocalizedName().substring(5)); + fluidHelium.setUnlocalizedName(BlockFluidHelium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidHelium3); - BlockFluidHelium3 = new BlockFluidTechReborn(fluidHelium3, Material.water, "techreborn.helium3"); - GameRegistry.registerBlock(BlockFluidHelium3, ModInfo.MOD_ID + "_" + BlockFluidHelium3.getUnlocalizedName().substring(5)); - fluidHelium3.setUnlocalizedName(BlockFluidHelium3.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidHelium3); + BlockFluidHelium3 = new BlockFluidTechReborn(fluidHelium3, Material.water, "techreborn.helium3"); + GameRegistry.registerBlock(BlockFluidHelium3, + ModInfo.MOD_ID + "_" + BlockFluidHelium3.getUnlocalizedName().substring(5)); + fluidHelium3.setUnlocalizedName(BlockFluidHelium3.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidHeliumplasma); - BlockFluidHeliumplasma = new BlockFluidTechReborn(fluidHeliumplasma, Material.water, "techreborn.heliumplasma"); - GameRegistry.registerBlock(BlockFluidHeliumplasma, ModInfo.MOD_ID + "_" + BlockFluidHeliumplasma.getUnlocalizedName().substring(5)); - fluidHeliumplasma.setUnlocalizedName(fluidHeliumplasma.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidHeliumplasma); + BlockFluidHeliumplasma = new BlockFluidTechReborn(fluidHeliumplasma, Material.water, "techreborn.heliumplasma"); + GameRegistry.registerBlock(BlockFluidHeliumplasma, + ModInfo.MOD_ID + "_" + BlockFluidHeliumplasma.getUnlocalizedName().substring(5)); + fluidHeliumplasma.setUnlocalizedName(fluidHeliumplasma.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidHydrogen); - BlockFluidHydrogen = new BlockFluidTechReborn(fluidHydrogen, Material.water, "techreborn.hydrogen"); - GameRegistry.registerBlock(BlockFluidHydrogen, ModInfo.MOD_ID + "_" + BlockFluidHydrogen.getUnlocalizedName().substring(5)); - fluidHydrogen.setUnlocalizedName(fluidHydrogen.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidHydrogen); + BlockFluidHydrogen = new BlockFluidTechReborn(fluidHydrogen, Material.water, "techreborn.hydrogen"); + GameRegistry.registerBlock(BlockFluidHydrogen, + ModInfo.MOD_ID + "_" + BlockFluidHydrogen.getUnlocalizedName().substring(5)); + fluidHydrogen.setUnlocalizedName(fluidHydrogen.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidLithium); - BlockFluidLithium = new BlockFluidTechReborn(fluidLithium, Material.water, "techreborn.lithium"); - GameRegistry.registerBlock(BlockFluidLithium, ModInfo.MOD_ID + "_" + BlockFluidLithium.getUnlocalizedName().substring(5)); - fluidLithium.setUnlocalizedName(fluidLithium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidLithium); + BlockFluidLithium = new BlockFluidTechReborn(fluidLithium, Material.water, "techreborn.lithium"); + GameRegistry.registerBlock(BlockFluidLithium, + ModInfo.MOD_ID + "_" + BlockFluidLithium.getUnlocalizedName().substring(5)); + fluidLithium.setUnlocalizedName(fluidLithium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidMercury); - BlockFluidMercury = new BlockFluidTechReborn(fluidMercury, Material.water, "techreborn.mercury"); - GameRegistry.registerBlock(BlockFluidMercury, ModInfo.MOD_ID + "_" + BlockFluidMercury.getUnlocalizedName().substring(5)); - fluidMercury.setUnlocalizedName(fluidMercury.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidMercury); + BlockFluidMercury = new BlockFluidTechReborn(fluidMercury, Material.water, "techreborn.mercury"); + GameRegistry.registerBlock(BlockFluidMercury, + ModInfo.MOD_ID + "_" + BlockFluidMercury.getUnlocalizedName().substring(5)); + fluidMercury.setUnlocalizedName(fluidMercury.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidMethane); - BlockFluidMethane = new BlockFluidTechReborn(fluidMethane, Material.water, "techreborn.methane"); - GameRegistry.registerBlock(BlockFluidMethane, ModInfo.MOD_ID + "_" + BlockFluidMethane.getUnlocalizedName().substring(5)); - fluidMethane.setUnlocalizedName(fluidMethane.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidMethane); + BlockFluidMethane = new BlockFluidTechReborn(fluidMethane, Material.water, "techreborn.methane"); + GameRegistry.registerBlock(BlockFluidMethane, + ModInfo.MOD_ID + "_" + BlockFluidMethane.getUnlocalizedName().substring(5)); + fluidMethane.setUnlocalizedName(fluidMethane.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidNitrocoalfuel); - BlockFluidNitrocoalfuel = new BlockFluidTechReborn(fluidNitrocoalfuel, Material.water, "techreborn.nitrocoalfuel"); - GameRegistry.registerBlock(BlockFluidNitrocoalfuel, ModInfo.MOD_ID + "_" + BlockFluidNitrocoalfuel.getUnlocalizedName().substring(5)); - fluidNitrocoalfuel.setUnlocalizedName(fluidNitrocoalfuel.getUnlocalizedName()); - FluidPowerManager.fluidPowerValues.put(fluidNitrocoalfuel, 48.0); + FluidRegistry.registerFluid(fluidNitrocoalfuel); + BlockFluidNitrocoalfuel = new BlockFluidTechReborn(fluidNitrocoalfuel, Material.water, + "techreborn.nitrocoalfuel"); + GameRegistry.registerBlock(BlockFluidNitrocoalfuel, + ModInfo.MOD_ID + "_" + BlockFluidNitrocoalfuel.getUnlocalizedName().substring(5)); + fluidNitrocoalfuel.setUnlocalizedName(fluidNitrocoalfuel.getUnlocalizedName()); + FluidPowerManager.fluidPowerValues.put(fluidNitrocoalfuel, 48.0); - FluidRegistry.registerFluid(fluidNitrofuel); - BlockFluidNitrofuel = new BlockFluidTechReborn(fluidNitrofuel, Material.water, "techreborn.nitrofuel"); - GameRegistry.registerBlock(BlockFluidNitrofuel, ModInfo.MOD_ID + "_" + BlockFluidNitrofuel.getUnlocalizedName().substring(5)); - fluidNitrofuel.setUnlocalizedName(fluidNitrofuel.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidNitrofuel); + BlockFluidNitrofuel = new BlockFluidTechReborn(fluidNitrofuel, Material.water, "techreborn.nitrofuel"); + GameRegistry.registerBlock(BlockFluidNitrofuel, + ModInfo.MOD_ID + "_" + BlockFluidNitrofuel.getUnlocalizedName().substring(5)); + fluidNitrofuel.setUnlocalizedName(fluidNitrofuel.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidNitrogen); - BlockFluidNitrogen = new BlockFluidTechReborn(fluidNitrogen, Material.water, "techreborn.nitrogen"); - GameRegistry.registerBlock(BlockFluidNitrogen, ModInfo.MOD_ID + "_" + BlockFluidNitrogen.getUnlocalizedName().substring(5)); - fluidNitrogen.setUnlocalizedName(fluidNitrogen.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidNitrogen); + BlockFluidNitrogen = new BlockFluidTechReborn(fluidNitrogen, Material.water, "techreborn.nitrogen"); + GameRegistry.registerBlock(BlockFluidNitrogen, + ModInfo.MOD_ID + "_" + BlockFluidNitrogen.getUnlocalizedName().substring(5)); + fluidNitrogen.setUnlocalizedName(fluidNitrogen.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidNitrogendioxide); - BlockFluidNitrogendioxide = new BlockFluidTechReborn(fluidNitrogendioxide, Material.water, "techreborn.nitrogendioxide"); - GameRegistry.registerBlock(BlockFluidNitrogendioxide, ModInfo.MOD_ID + "_" + BlockFluidNitrogendioxide.getUnlocalizedName().substring(5)); - fluidNitrogendioxide.setUnlocalizedName(fluidNitrogendioxide.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidNitrogendioxide); + BlockFluidNitrogendioxide = new BlockFluidTechReborn(fluidNitrogendioxide, Material.water, + "techreborn.nitrogendioxide"); + GameRegistry.registerBlock(BlockFluidNitrogendioxide, + ModInfo.MOD_ID + "_" + BlockFluidNitrogendioxide.getUnlocalizedName().substring(5)); + fluidNitrogendioxide.setUnlocalizedName(fluidNitrogendioxide.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidPotassium); - BlockFluidPotassium = new BlockFluidTechReborn(fluidPotassium, Material.water, "techreborn.potassium"); - GameRegistry.registerBlock(BlockFluidPotassium, ModInfo.MOD_ID + "_" + BlockFluidPotassium.getUnlocalizedName().substring(5)); - fluidPotassium.setUnlocalizedName(fluidPotassium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidPotassium); + BlockFluidPotassium = new BlockFluidTechReborn(fluidPotassium, Material.water, "techreborn.potassium"); + GameRegistry.registerBlock(BlockFluidPotassium, + ModInfo.MOD_ID + "_" + BlockFluidPotassium.getUnlocalizedName().substring(5)); + fluidPotassium.setUnlocalizedName(fluidPotassium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidSilicon); - BlockFluidSilicon = new BlockFluidTechReborn(fluidSilicon, Material.water, "techreborn.silicon"); - GameRegistry.registerBlock(BlockFluidSilicon, ModInfo.MOD_ID + "_" + BlockFluidSilicon.getUnlocalizedName().substring(5)); - fluidSilicon.setUnlocalizedName(fluidSilicon.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidSilicon); + BlockFluidSilicon = new BlockFluidTechReborn(fluidSilicon, Material.water, "techreborn.silicon"); + GameRegistry.registerBlock(BlockFluidSilicon, + ModInfo.MOD_ID + "_" + BlockFluidSilicon.getUnlocalizedName().substring(5)); + fluidSilicon.setUnlocalizedName(fluidSilicon.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidSodium); - BlockFluidSodium = new BlockFluidTechReborn(fluidSodium, Material.water, "techreborn.sodium"); - GameRegistry.registerBlock(BlockFluidSodium, ModInfo.MOD_ID + "_" + BlockFluidSodium.getUnlocalizedName().substring(5)); - fluidSodium.setUnlocalizedName(fluidSodium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidSodium); + BlockFluidSodium = new BlockFluidTechReborn(fluidSodium, Material.water, "techreborn.sodium"); + GameRegistry.registerBlock(BlockFluidSodium, + ModInfo.MOD_ID + "_" + BlockFluidSodium.getUnlocalizedName().substring(5)); + fluidSodium.setUnlocalizedName(fluidSodium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidSodiumpersulfate); - BlockFluidSodiumpersulfate = new BlockFluidTechReborn(fluidSodiumpersulfate, Material.water, "techreborn.sodiumpersulfate"); - GameRegistry.registerBlock(BlockFluidSodiumpersulfate, ModInfo.MOD_ID + "_" + BlockFluidSodiumpersulfate.getUnlocalizedName().substring(5)); - fluidSodiumpersulfate.setUnlocalizedName(fluidSodiumpersulfate.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidSodiumpersulfate); + BlockFluidSodiumpersulfate = new BlockFluidTechReborn(fluidSodiumpersulfate, Material.water, + "techreborn.sodiumpersulfate"); + GameRegistry.registerBlock(BlockFluidSodiumpersulfate, + ModInfo.MOD_ID + "_" + BlockFluidSodiumpersulfate.getUnlocalizedName().substring(5)); + fluidSodiumpersulfate.setUnlocalizedName(fluidSodiumpersulfate.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidTritium); - BlockFluidTritium = new BlockFluidTechReborn(fluidTritium, Material.water, "techreborn.tritium"); - GameRegistry.registerBlock(BlockFluidTritium, ModInfo.MOD_ID + "_" + BlockFluidTritium.getUnlocalizedName().substring(5)); - fluidTritium.setUnlocalizedName(fluidTritium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidTritium); + BlockFluidTritium = new BlockFluidTechReborn(fluidTritium, Material.water, "techreborn.tritium"); + GameRegistry.registerBlock(BlockFluidTritium, + ModInfo.MOD_ID + "_" + BlockFluidTritium.getUnlocalizedName().substring(5)); + fluidTritium.setUnlocalizedName(fluidTritium.getUnlocalizedName()); - FluidRegistry.registerFluid(fluidWolframium); - BlockFluidWolframium = new BlockFluidTechReborn(fluidWolframium, Material.water, "techreborn.wolframium"); - GameRegistry.registerBlock(BlockFluidWolframium, ModInfo.MOD_ID + "_" + BlockFluidWolframium.getUnlocalizedName().substring(5)); - fluidWolframium.setUnlocalizedName(fluidWolframium.getUnlocalizedName()); + FluidRegistry.registerFluid(fluidWolframium); + BlockFluidWolframium = new BlockFluidTechReborn(fluidWolframium, Material.water, "techreborn.wolframium"); + GameRegistry.registerBlock(BlockFluidWolframium, + ModInfo.MOD_ID + "_" + BlockFluidWolframium.getUnlocalizedName().substring(5)); + fluidWolframium.setUnlocalizedName(fluidWolframium.getUnlocalizedName()); - } + } } diff --git a/src/main/java/techreborn/init/ModItems.java b/src/main/java/techreborn/init/ModItems.java index ea22a5416..427004db7 100644 --- a/src/main/java/techreborn/init/ModItems.java +++ b/src/main/java/techreborn/init/ModItems.java @@ -13,678 +13,782 @@ import reborncore.common.util.BucketHandler; import techreborn.Core; import techreborn.blocks.BlockMachineFrame; import techreborn.events.OreUnifier; -import techreborn.items.*; +import techreborn.items.ItemCells; +import techreborn.items.ItemCrushedOre; +import techreborn.items.ItemDusts; +import techreborn.items.ItemDustsSmall; +import techreborn.items.ItemEnergyCrystal; +import techreborn.items.ItemGems; +import techreborn.items.ItemIngots; +import techreborn.items.ItemLapotronCrystal; +import techreborn.items.ItemLapotronicOrb; +import techreborn.items.ItemLithiumBattery; +import techreborn.items.ItemMissingRecipe; +import techreborn.items.ItemNuggets; +import techreborn.items.ItemParts; +import techreborn.items.ItemPlates; +import techreborn.items.ItemReBattery; +import techreborn.items.ItemScrapBox; +import techreborn.items.ItemUUmatter; import techreborn.items.armor.ItemLapotronPack; import techreborn.items.armor.ItemLithiumBatpack; -import techreborn.items.tools.*; +import techreborn.items.tools.ItemAdvancedChainsaw; +import techreborn.items.tools.ItemAdvancedDrill; +import techreborn.items.tools.ItemCloakingDevice; +import techreborn.items.tools.ItemDebugTool; +import techreborn.items.tools.ItemDiamondChainsaw; +import techreborn.items.tools.ItemDiamondDrill; +import techreborn.items.tools.ItemDiamondJackhammer; +import techreborn.items.tools.ItemFluidbucket; +import techreborn.items.tools.ItemHammer; +import techreborn.items.tools.ItemIronChainsaw; +import techreborn.items.tools.ItemIronDrill; +import techreborn.items.tools.ItemIronJackhammer; +import techreborn.items.tools.ItemNanosaber; +import techreborn.items.tools.ItemOmniTool; +import techreborn.items.tools.ItemRockCutter; +import techreborn.items.tools.ItemSteelJackhammer; +import techreborn.items.tools.ItemTechManual; +import techreborn.items.tools.ItemTreeTap; +import techreborn.items.tools.ItemWrench; -public class ModItems { +public class ModItems +{ + // This are deprected to stop people using them in the recipes. + @Deprecated + public static Item gems; + @Deprecated + public static Item ingots; + @Deprecated + public static Item nuggets; + @Deprecated + public static Item dusts; + @Deprecated + public static Item smallDusts; + @Deprecated + public static Item parts; + @Deprecated + public static Item cells; + public static Item rockCutter; + public static Item lithiumBatpack; + public static Item lapotronpack; + public static Item lithiumBattery; + public static Item omniTool; + public static Item lapotronicOrb; + public static Item manual; + public static Item uuMatter; + public static Item plate; + public static Item crushedOre; + public static Item purifiedCrushedOre; + public static Item cloakingDevice; - //This are deprected to stop people using them in the recipes. - @Deprecated - public static Item gems; - @Deprecated - public static Item ingots; - @Deprecated - public static Item nuggets; - @Deprecated - public static Item dusts; - @Deprecated - public static Item smallDusts; - @Deprecated - public static Item parts; - @Deprecated - public static Item cells; - public static Item rockCutter; - public static Item lithiumBatpack; - public static Item lapotronpack; - public static Item lithiumBattery; - public static Item omniTool; - public static Item lapotronicOrb; - public static Item manual; - public static Item uuMatter; - public static Item plate; - public static Item crushedOre; - public static Item purifiedCrushedOre; - public static Item cloakingDevice; + public static Item bucketBerylium; + public static Item bucketcalcium; + public static Item bucketcalciumcarbonate; + public static Item bucketChlorite; + public static Item bucketDeuterium; + public static Item bucketGlyceryl; + public static Item bucketHelium; + public static Item bucketHelium3; + public static Item bucketHeliumplasma; + public static Item bucketHydrogen; + public static Item bucketLithium; + public static Item bucketMercury; + public static Item bucketMethane; + public static Item bucketNitrocoalfuel; + public static Item bucketNitrofuel; + public static Item bucketNitrogen; + public static Item bucketNitrogendioxide; + public static Item bucketPotassium; + public static Item bucketSilicon; + public static Item bucketSodium; + public static Item bucketSodiumpersulfate; + public static Item bucketTritium; + public static Item bucketWolframium; + public static Item reBattery; + public static Item treeTap; + public static Item ironDrill; + public static Item diamondDrill; + public static Item advancedDrill; + public static Item ironChainsaw; + public static Item diamondChainsaw; + public static Item advancedChainsaw; + public static Item ironJackhammer; + public static Item steelJackhammer; + public static Item diamondJackhammer; + public static Item nanosaber; + public static Item hammer; + public static Item wrench; + public static Item lapotronCrystal; + public static Item energyCrystal; + public static Item scrapBox; - public static Item bucketBerylium; - public static Item bucketcalcium; - public static Item bucketcalciumcarbonate; - public static Item bucketChlorite; - public static Item bucketDeuterium; - public static Item bucketGlyceryl; - public static Item bucketHelium; - public static Item bucketHelium3; - public static Item bucketHeliumplasma; - public static Item bucketHydrogen; - public static Item bucketLithium; - public static Item bucketMercury; - public static Item bucketMethane; - public static Item bucketNitrocoalfuel; - public static Item bucketNitrofuel; - public static Item bucketNitrogen; - public static Item bucketNitrogendioxide; - public static Item bucketPotassium; - public static Item bucketSilicon; - public static Item bucketSodium; - public static Item bucketSodiumpersulfate; - public static Item bucketTritium; - public static Item bucketWolframium; - public static Item reBattery; - public static Item treeTap; - public static Item ironDrill; - public static Item diamondDrill; - public static Item advancedDrill; - public static Item ironChainsaw; - public static Item diamondChainsaw; - public static Item advancedChainsaw; - public static Item ironJackhammer; - public static Item steelJackhammer; - public static Item diamondJackhammer; - public static Item nanosaber; - public static Item hammer; - public static Item wrench; - public static Item lapotronCrystal; - public static Item energyCrystal; - public static Item scrapBox; + public static Item upgrades; - public static Item upgrades; + public static Item missingRecipe; + public static Item debug; - public static Item missingRecipe; - public static Item debug; + public static void init() throws InstantiationException, IllegalAccessException + { + gems = new ItemGems(); + GameRegistry.registerItem(gems, "gem"); + ingots = new ItemIngots(); + GameRegistry.registerItem(ingots, "ingot"); + dusts = new ItemDusts(); + GameRegistry.registerItem(dusts, "dust"); + smallDusts = new ItemDustsSmall(); + GameRegistry.registerItem(smallDusts, "smallDust"); + plate = new ItemPlates(); + GameRegistry.registerItem(plate, "plates"); + nuggets = new ItemNuggets(); + GameRegistry.registerItem(nuggets, "nuggets"); + crushedOre = new ItemCrushedOre(); + GameRegistry.registerItem(crushedOre, "crushedore"); + // purifiedCrushedOre = new ItemPurifiedCrushedOre(); + // GameRegistry.registerItem(purifiedCrushedOre, "purifiedCrushedOre"); + parts = new ItemParts(); + GameRegistry.registerItem(parts, "part"); + cells = new ItemCells(); + GameRegistry.registerItem(cells, "cell"); + for (int i = 0; i < ItemCells.types.length; i++) + { + if (FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()) != null) + { + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()), + ItemCells.getCellByName(ItemCells.types[i])); + } + } + rockCutter = PoweredItem.createItem(ItemRockCutter.class); + GameRegistry.registerItem(rockCutter, "rockCutter"); + lithiumBatpack = PoweredItem.createItem(ItemLithiumBatpack.class); + GameRegistry.registerItem(lithiumBatpack, "lithiumBatpack"); + lapotronpack = PoweredItem.createItem(ItemLapotronPack.class); + GameRegistry.registerItem(lapotronpack, "lapotronPack"); + lithiumBattery = PoweredItem.createItem(ItemLithiumBattery.class); + GameRegistry.registerItem(lithiumBattery, "lithiumBattery"); + lapotronicOrb = PoweredItem.createItem(ItemLapotronicOrb.class); + GameRegistry.registerItem(lapotronicOrb, "lapotronicOrb"); + omniTool = PoweredItem.createItem(ItemOmniTool.class); + GameRegistry.registerItem(omniTool, "omniTool"); + energyCrystal = PoweredItem.createItem(ItemEnergyCrystal.class); + GameRegistry.registerItem(energyCrystal, "energycrystal"); + lapotronCrystal = PoweredItem.createItem(ItemLapotronCrystal.class); + GameRegistry.registerItem(lapotronCrystal, "lapotroncrystal"); + manual = new ItemTechManual(); + GameRegistry.registerItem(manual, "techmanuel"); + uuMatter = new ItemUUmatter(); + GameRegistry.registerItem(uuMatter, "uumatter"); + reBattery = PoweredItem.createItem(ItemReBattery.class); + GameRegistry.registerItem(reBattery, "rebattery"); + treeTap = new ItemTreeTap(); + GameRegistry.registerItem(treeTap, "treetap"); - public static void init() throws InstantiationException, IllegalAccessException { - gems = new ItemGems(); - GameRegistry.registerItem(gems, "gem"); - ingots = new ItemIngots(); - GameRegistry.registerItem(ingots, "ingot"); - dusts = new ItemDusts(); - GameRegistry.registerItem(dusts, "dust"); - smallDusts = new ItemDustsSmall(); - GameRegistry.registerItem(smallDusts, "smallDust"); - plate = new ItemPlates(); - GameRegistry.registerItem(plate, "plates"); - nuggets = new ItemNuggets(); - GameRegistry.registerItem(nuggets, "nuggets"); - crushedOre = new ItemCrushedOre(); - GameRegistry.registerItem(crushedOre, "crushedore"); - //purifiedCrushedOre = new ItemPurifiedCrushedOre(); - //GameRegistry.registerItem(purifiedCrushedOre, "purifiedCrushedOre"); - parts = new ItemParts(); - GameRegistry.registerItem(parts, "part"); - cells = new ItemCells(); - GameRegistry.registerItem(cells, "cell"); - for (int i = 0; i < ItemCells.types.length; i++) { - if(FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()) != null){ - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid("fluid" + ItemCells.types[i].toLowerCase()), ItemCells.getCellByName(ItemCells.types[i])); - } - } - rockCutter = PoweredItem.createItem(ItemRockCutter.class); - GameRegistry.registerItem(rockCutter, "rockCutter"); - lithiumBatpack = PoweredItem.createItem(ItemLithiumBatpack.class); - GameRegistry.registerItem(lithiumBatpack, "lithiumBatpack"); - lapotronpack = PoweredItem.createItem(ItemLapotronPack.class); - GameRegistry.registerItem(lapotronpack, "lapotronPack"); - lithiumBattery = PoweredItem.createItem(ItemLithiumBattery.class); - GameRegistry.registerItem(lithiumBattery, "lithiumBattery"); - lapotronicOrb = PoweredItem.createItem(ItemLapotronicOrb.class); - GameRegistry.registerItem(lapotronicOrb, "lapotronicOrb"); - omniTool = PoweredItem.createItem(ItemOmniTool.class); - GameRegistry.registerItem(omniTool, "omniTool"); - energyCrystal = PoweredItem.createItem(ItemEnergyCrystal.class); - GameRegistry.registerItem(energyCrystal, "energycrystal"); - lapotronCrystal = PoweredItem.createItem(ItemLapotronCrystal.class); - GameRegistry.registerItem(lapotronCrystal, "lapotroncrystal"); - + ironDrill = PoweredItem.createItem(ItemIronDrill.class); + GameRegistry.registerItem(ironDrill, "irondrill"); + diamondDrill = PoweredItem.createItem(ItemDiamondDrill.class); + GameRegistry.registerItem(diamondDrill, "diamonddrill"); + advancedDrill = PoweredItem.createItem(ItemAdvancedDrill.class); + GameRegistry.registerItem(advancedDrill, "advanceddrill"); - manual = new ItemTechManual(); - GameRegistry.registerItem(manual, "techmanuel"); - uuMatter = new ItemUUmatter(); - GameRegistry.registerItem(uuMatter, "uumatter"); - reBattery = PoweredItem.createItem(ItemReBattery.class); - GameRegistry.registerItem(reBattery, "rebattery"); - treeTap = new ItemTreeTap(); - GameRegistry.registerItem(treeTap, "treetap"); - - ironDrill = PoweredItem.createItem(ItemIronDrill.class); - GameRegistry.registerItem(ironDrill, "irondrill"); - diamondDrill = PoweredItem.createItem(ItemDiamondDrill.class); - GameRegistry.registerItem(diamondDrill, "diamonddrill"); - advancedDrill = PoweredItem.createItem(ItemAdvancedDrill.class); - GameRegistry.registerItem(advancedDrill, "advanceddrill"); - - ironChainsaw = PoweredItem.createItem(ItemIronChainsaw.class); - GameRegistry.registerItem(ironChainsaw, "ironchainsaw"); - diamondChainsaw = PoweredItem.createItem(ItemDiamondChainsaw.class); - GameRegistry.registerItem(diamondChainsaw, "diamondchainsaw"); - advancedChainsaw = PoweredItem.createItem(ItemAdvancedChainsaw.class); - GameRegistry.registerItem(advancedChainsaw, "advancedchainsaw"); - - ironJackhammer = PoweredItem.createItem(ItemIronJackhammer.class); - GameRegistry.registerItem(ironJackhammer, "ironjackhammer"); - steelJackhammer = PoweredItem.createItem(ItemSteelJackhammer.class); - GameRegistry.registerItem(steelJackhammer, "steeljackhammer"); - diamondJackhammer = PoweredItem.createItem(ItemDiamondJackhammer.class); - GameRegistry.registerItem(diamondJackhammer, "diamondjackhammer"); - - hammer = new ItemHammer(100); - GameRegistry.registerItem(hammer, "hammer"); + ironChainsaw = PoweredItem.createItem(ItemIronChainsaw.class); + GameRegistry.registerItem(ironChainsaw, "ironchainsaw"); + diamondChainsaw = PoweredItem.createItem(ItemDiamondChainsaw.class); + GameRegistry.registerItem(diamondChainsaw, "diamondchainsaw"); + advancedChainsaw = PoweredItem.createItem(ItemAdvancedChainsaw.class); + GameRegistry.registerItem(advancedChainsaw, "advancedchainsaw"); - wrench = new ItemWrench(); - GameRegistry.registerItem(wrench, "wrench"); + ironJackhammer = PoweredItem.createItem(ItemIronJackhammer.class); + GameRegistry.registerItem(ironJackhammer, "ironjackhammer"); + steelJackhammer = PoweredItem.createItem(ItemSteelJackhammer.class); + GameRegistry.registerItem(steelJackhammer, "steeljackhammer"); + diamondJackhammer = PoweredItem.createItem(ItemDiamondJackhammer.class); + GameRegistry.registerItem(diamondJackhammer, "diamondjackhammer"); - nanosaber = new ItemNanosaber(); - GameRegistry.registerItem(nanosaber, "nanosaber"); - - scrapBox = new ItemScrapBox(); - GameRegistry.registerItem(scrapBox, "scrapbox"); + hammer = new ItemHammer(100); + GameRegistry.registerItem(hammer, "hammer"); -// upgrades = new ItemUpgrade(); -// GameRegistry.registerItem(upgrades, "upgrades"); + wrench = new ItemWrench(); + GameRegistry.registerItem(wrench, "wrench"); - cloakingDevice = PoweredItem.createItem(ItemCloakingDevice.class); - GameRegistry.registerItem(cloakingDevice, "cloakingdevice"); + nanosaber = new ItemNanosaber(); + GameRegistry.registerItem(nanosaber, "nanosaber"); - // buckets - bucketBerylium = new ItemFluidbucket(ModFluids.BlockFluidBerylium); - bucketBerylium.setUnlocalizedName("bucketberylium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketBerylium, "bucketberylium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidberylium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketBerylium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidBerylium.getDefaultState(), bucketBerylium); + scrapBox = new ItemScrapBox(); + GameRegistry.registerItem(scrapBox, "scrapbox"); - bucketcalcium = new ItemFluidbucket(ModFluids.BlockFluidCalcium); - bucketcalcium.setUnlocalizedName("bucketcalcium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketcalcium, "bucketcalcium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidcalcium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketcalcium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalcium.getDefaultState(), bucketcalcium); + // upgrades = new ItemUpgrade(); + // GameRegistry.registerItem(upgrades, "upgrades"); - bucketcalciumcarbonate = new ItemFluidbucket(ModFluids.BlockFluidCalciumCarbonate); - bucketcalciumcarbonate.setUnlocalizedName("bucketcalciumcarbonate").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketcalciumcarbonate, "bucketcalciumcarbonate"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidcalciumcarbonate", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalciumCarbonate.getDefaultState(), bucketcalciumcarbonate); + cloakingDevice = PoweredItem.createItem(ItemCloakingDevice.class); + GameRegistry.registerItem(cloakingDevice, "cloakingdevice"); - bucketChlorite = new ItemFluidbucket(ModFluids.BlockFluidChlorite); - bucketChlorite.setUnlocalizedName("bucketchlorite").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketChlorite, "bucketcalchlorite"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidchlorite", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidChlorite.getDefaultState(), bucketChlorite); + // buckets + bucketBerylium = new ItemFluidbucket(ModFluids.BlockFluidBerylium); + bucketBerylium.setUnlocalizedName("bucketberylium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketBerylium, "bucketberylium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidberylium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketBerylium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidBerylium.getDefaultState(), bucketBerylium); - bucketDeuterium = new ItemFluidbucket(ModFluids.BlockFluidDeuterium); - bucketDeuterium.setUnlocalizedName("bucketdeuterium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketDeuterium, "bucketdeuterium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluiddeuterium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketDeuterium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidDeuterium.getDefaultState(), bucketDeuterium); + bucketcalcium = new ItemFluidbucket(ModFluids.BlockFluidCalcium); + bucketcalcium.setUnlocalizedName("bucketcalcium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketcalcium, "bucketcalcium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidcalcium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketcalcium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalcium.getDefaultState(), bucketcalcium); - bucketGlyceryl = new ItemFluidbucket(ModFluids.BlockFluidGlyceryl); - bucketGlyceryl.setUnlocalizedName("bucketglyceryl").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketGlyceryl, "bucketglyceryl"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidglyceryl", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketGlyceryl), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidGlyceryl.getDefaultState(), bucketGlyceryl); + bucketcalciumcarbonate = new ItemFluidbucket(ModFluids.BlockFluidCalciumCarbonate); + bucketcalciumcarbonate.setUnlocalizedName("bucketcalciumcarbonate").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketcalciumcarbonate, "bucketcalciumcarbonate"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidcalciumcarbonate", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidCalciumCarbonate.getDefaultState(), + bucketcalciumcarbonate); - bucketHelium = new ItemFluidbucket(ModFluids.BlockFluidHelium); - bucketHelium.setUnlocalizedName("buckethelium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketHelium, "buckethelium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidhelium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketHelium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium.getDefaultState(), bucketHelium); + bucketChlorite = new ItemFluidbucket(ModFluids.BlockFluidChlorite); + bucketChlorite.setUnlocalizedName("bucketchlorite").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketChlorite, "bucketcalchlorite"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidchlorite", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketcalciumcarbonate), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidChlorite.getDefaultState(), bucketChlorite); - bucketHelium3 = new ItemFluidbucket(ModFluids.BlockFluidHelium3); - bucketHelium3.setUnlocalizedName("buckethelium3").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketHelium3, "buckethelium3"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidhelium3", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketHelium3), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium3.getDefaultState(), bucketHelium3); + bucketDeuterium = new ItemFluidbucket(ModFluids.BlockFluidDeuterium); + bucketDeuterium.setUnlocalizedName("bucketdeuterium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketDeuterium, "bucketdeuterium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluiddeuterium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketDeuterium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidDeuterium.getDefaultState(), bucketDeuterium); - bucketHeliumplasma = new ItemFluidbucket(ModFluids.BlockFluidHeliumplasma); - bucketHeliumplasma.setUnlocalizedName("bucketheliumplasma").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketHeliumplasma, "bucketheliumplasma"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidheliumplasma", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketHeliumplasma), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHeliumplasma.getDefaultState(), bucketHeliumplasma); + bucketGlyceryl = new ItemFluidbucket(ModFluids.BlockFluidGlyceryl); + bucketGlyceryl.setUnlocalizedName("bucketglyceryl").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketGlyceryl, "bucketglyceryl"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidglyceryl", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketGlyceryl), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidGlyceryl.getDefaultState(), bucketGlyceryl); - bucketHydrogen = new ItemFluidbucket(ModFluids.BlockFluidHydrogen); - bucketHydrogen.setUnlocalizedName("buckethydrogen").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketHydrogen, "buckethydrogen"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidhydrogen", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketHydrogen), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHydrogen.getDefaultState(), bucketHydrogen); + bucketHelium = new ItemFluidbucket(ModFluids.BlockFluidHelium); + bucketHelium.setUnlocalizedName("buckethelium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketHelium, "buckethelium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidhelium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketHelium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium.getDefaultState(), bucketHelium); - bucketLithium = new ItemFluidbucket(ModFluids.BlockFluidLithium); - bucketLithium.setUnlocalizedName("bucketlithium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketLithium, "bucketlithium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidlithium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketLithium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidLithium.getDefaultState(), bucketLithium); + bucketHelium3 = new ItemFluidbucket(ModFluids.BlockFluidHelium3); + bucketHelium3.setUnlocalizedName("buckethelium3").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketHelium3, "buckethelium3"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidhelium3", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketHelium3), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHelium3.getDefaultState(), bucketHelium3); - bucketMercury = new ItemFluidbucket(ModFluids.BlockFluidMercury); - bucketMercury.setUnlocalizedName("bucketmercury").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketMercury, "bucketmercury"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidmercury", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketMercury), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMercury.getDefaultState(), bucketMercury); + bucketHeliumplasma = new ItemFluidbucket(ModFluids.BlockFluidHeliumplasma); + bucketHeliumplasma.setUnlocalizedName("bucketheliumplasma").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketHeliumplasma, "bucketheliumplasma"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidheliumplasma", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketHeliumplasma), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHeliumplasma.getDefaultState(), bucketHeliumplasma); - bucketMethane = new ItemFluidbucket(ModFluids.BlockFluidMethane); - bucketMethane.setUnlocalizedName("bucketmethane").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketMethane, "bucketmethane"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidmethane", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketMethane), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMethane.getDefaultState(), bucketMethane); + bucketHydrogen = new ItemFluidbucket(ModFluids.BlockFluidHydrogen); + bucketHydrogen.setUnlocalizedName("buckethydrogen").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketHydrogen, "buckethydrogen"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidhydrogen", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketHydrogen), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidHydrogen.getDefaultState(), bucketHydrogen); - bucketNitrocoalfuel = new ItemFluidbucket(ModFluids.BlockFluidNitrocoalfuel); - bucketNitrocoalfuel.setUnlocalizedName("bucketnitrocoalfuel").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketNitrocoalfuel, "bucketnitrocoalfuel"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidnitrocoalfuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketNitrocoalfuel), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrocoalfuel.getDefaultState(), bucketNitrocoalfuel); + bucketLithium = new ItemFluidbucket(ModFluids.BlockFluidLithium); + bucketLithium.setUnlocalizedName("bucketlithium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketLithium, "bucketlithium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidlithium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketLithium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidLithium.getDefaultState(), bucketLithium); - bucketNitrofuel = new ItemFluidbucket(ModFluids.BlockFluidNitrofuel); - bucketNitrofuel.setUnlocalizedName("bucketnitrofuel").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketNitrofuel, "bucketnitrofuel"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidnitrofuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketNitrofuel), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrofuel.getDefaultState(), bucketNitrofuel); + bucketMercury = new ItemFluidbucket(ModFluids.BlockFluidMercury); + bucketMercury.setUnlocalizedName("bucketmercury").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketMercury, "bucketmercury"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidmercury", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketMercury), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMercury.getDefaultState(), bucketMercury); - bucketNitrogen = new ItemFluidbucket(ModFluids.BlockFluidNitrogen); - bucketNitrogen.setUnlocalizedName("bucketnitrogen").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketNitrogen, "bucketnitrogen"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidnitrogen", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketNitrogen), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogen.getDefaultState(), bucketNitrogen); + bucketMethane = new ItemFluidbucket(ModFluids.BlockFluidMethane); + bucketMethane.setUnlocalizedName("bucketmethane").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketMethane, "bucketmethane"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidmethane", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketMethane), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidMethane.getDefaultState(), bucketMethane); - bucketNitrogendioxide = new ItemFluidbucket(ModFluids.BlockFluidNitrogendioxide); - bucketNitrogendioxide.setUnlocalizedName("bucketnitrogendioxide").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketNitrogendioxide, "bucketnitrogendioxide"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidnitrogendioxide", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketNitrogendioxide), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogendioxide.getDefaultState(), bucketNitrogendioxide); + bucketNitrocoalfuel = new ItemFluidbucket(ModFluids.BlockFluidNitrocoalfuel); + bucketNitrocoalfuel.setUnlocalizedName("bucketnitrocoalfuel").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketNitrocoalfuel, "bucketnitrocoalfuel"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidnitrocoalfuel", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketNitrocoalfuel), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrocoalfuel.getDefaultState(), bucketNitrocoalfuel); - bucketPotassium = new ItemFluidbucket(ModFluids.BlockFluidPotassium); - bucketPotassium.setUnlocalizedName("bucketpotassium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketPotassium, "bucketpotassium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidpotassium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketPotassium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidPotassium.getDefaultState(), bucketPotassium); + bucketNitrofuel = new ItemFluidbucket(ModFluids.BlockFluidNitrofuel); + bucketNitrofuel.setUnlocalizedName("bucketnitrofuel").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketNitrofuel, "bucketnitrofuel"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidnitrofuel", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketNitrofuel), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrofuel.getDefaultState(), bucketNitrofuel); - bucketSilicon = new ItemFluidbucket(ModFluids.BlockFluidSilicon); - bucketSilicon.setUnlocalizedName("bucketsilicon").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketSilicon, "bucketsilicon"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidsilicon", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketSilicon), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSilicon.getDefaultState(), bucketSilicon); + bucketNitrogen = new ItemFluidbucket(ModFluids.BlockFluidNitrogen); + bucketNitrogen.setUnlocalizedName("bucketnitrogen").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketNitrogen, "bucketnitrogen"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidnitrogen", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketNitrogen), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogen.getDefaultState(), bucketNitrogen); - bucketSodium = new ItemFluidbucket(ModFluids.BlockFluidSodium); - bucketSodium.setUnlocalizedName("bucketsodium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketSodium, "bucketsodium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidsodium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketSodium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodium.getDefaultState(), bucketSodium); + bucketNitrogendioxide = new ItemFluidbucket(ModFluids.BlockFluidNitrogendioxide); + bucketNitrogendioxide.setUnlocalizedName("bucketnitrogendioxide").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketNitrogendioxide, "bucketnitrogendioxide"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidnitrogendioxide", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketNitrogendioxide), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidNitrogendioxide.getDefaultState(), + bucketNitrogendioxide); - bucketSodiumpersulfate = new ItemFluidbucket(ModFluids.BlockFluidSodiumpersulfate); - bucketSodiumpersulfate.setUnlocalizedName("bucketsodiumpersulfate").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketSodiumpersulfate, "bucketsodiumpersulfate"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidsodiumpersulfate", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketSodiumpersulfate), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodiumpersulfate.getDefaultState(), bucketSodiumpersulfate); + bucketPotassium = new ItemFluidbucket(ModFluids.BlockFluidPotassium); + bucketPotassium.setUnlocalizedName("bucketpotassium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketPotassium, "bucketpotassium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidpotassium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketPotassium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidPotassium.getDefaultState(), bucketPotassium); - bucketTritium = new ItemFluidbucket(ModFluids.BlockFluidTritium); - bucketTritium.setUnlocalizedName("buckettritium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketTritium, "buckettritium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidtritium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketTritium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidTritium.getDefaultState(), bucketTritium); + bucketSilicon = new ItemFluidbucket(ModFluids.BlockFluidSilicon); + bucketSilicon.setUnlocalizedName("bucketsilicon").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketSilicon, "bucketsilicon"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidsilicon", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketSilicon), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSilicon.getDefaultState(), bucketSilicon); - bucketWolframium = new ItemFluidbucket(ModFluids.BlockFluidWolframium); - bucketWolframium.setUnlocalizedName("bucketwolframium").setContainerItem(Items.bucket); - GameRegistry.registerItem(bucketWolframium, "bucketwolframium"); - FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fluidwolframium", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketWolframium), new ItemStack(Items.bucket)); - BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidWolframium.getDefaultState(), bucketWolframium); + bucketSodium = new ItemFluidbucket(ModFluids.BlockFluidSodium); + bucketSodium.setUnlocalizedName("bucketsodium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketSodium, "bucketsodium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidsodium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketSodium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodium.getDefaultState(), bucketSodium); - missingRecipe = new ItemMissingRecipe().setUnlocalizedName("missingRecipe"); - GameRegistry.registerItem(missingRecipe, "mssingRecipe"); + bucketSodiumpersulfate = new ItemFluidbucket(ModFluids.BlockFluidSodiumpersulfate); + bucketSodiumpersulfate.setUnlocalizedName("bucketsodiumpersulfate").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketSodiumpersulfate, "bucketsodiumpersulfate"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidsodiumpersulfate", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketSodiumpersulfate), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidSodiumpersulfate.getDefaultState(), + bucketSodiumpersulfate); - debug = new ItemDebugTool(); - GameRegistry.registerItem(debug, "debug"); + bucketTritium = new ItemFluidbucket(ModFluids.BlockFluidTritium); + bucketTritium.setUnlocalizedName("buckettritium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketTritium, "buckettritium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidtritium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketTritium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidTritium.getDefaultState(), bucketTritium); - MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); + bucketWolframium = new ItemFluidbucket(ModFluids.BlockFluidWolframium); + bucketWolframium.setUnlocalizedName("bucketwolframium").setContainerItem(Items.bucket); + GameRegistry.registerItem(bucketWolframium, "bucketwolframium"); + FluidContainerRegistry.registerFluidContainer( + FluidRegistry.getFluidStack("fluidwolframium", FluidContainerRegistry.BUCKET_VOLUME), + new ItemStack(bucketWolframium), new ItemStack(Items.bucket)); + BucketHandler.INSTANCE.buckets.put(ModFluids.BlockFluidWolframium.getDefaultState(), bucketWolframium); - Core.logHelper.info("TechReborns Items Loaded"); + missingRecipe = new ItemMissingRecipe().setUnlocalizedName("missingRecipe"); + GameRegistry.registerItem(missingRecipe, "mssingRecipe"); - registerOreDict(); + debug = new ItemDebugTool(); + GameRegistry.registerItem(debug, "debug"); - BlockMachineBase.advancedMachineStack = BlockMachineFrame.getFrameByName("advancedMachine", 1); - BlockMachineBase.machineStack = BlockMachineFrame.getFrameByName("machine", 1); - } + MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE); - public static void registerOreDict() { + Core.logHelper.info("TechReborns Items Loaded"); - OreUnifier.registerOre("gemRuby", ItemGems.getGemByName("ruby")); - OreUnifier.registerOre("gemSapphire", ItemGems.getGemByName("sapphire")); - OreUnifier.registerOre("gemPeridot", ItemGems.getGemByName("peridot")); - OreUnifier.registerOre("gemRedGarnet", ItemGems.getGemByName("redGarnet")); - OreUnifier.registerOre("gemYellowGarnet", ItemGems.getGemByName("yellowGarnet")); + registerOreDict(); - // Dusts - OreUnifier.registerOre("dustAlmandine", ItemDusts.getDustByName("almandine")); - OreUnifier.registerOre("dustAluminumBrass", ItemDusts.getDustByName("aluminumBrass")); - OreUnifier.registerOre("dustAluminum", ItemDusts.getDustByName("aluminum")); - OreUnifier.registerOre("dustAluminium", ItemDusts.getDustByName("aluminum")); - OreUnifier.registerOre("dustAlumite", ItemDusts.getDustByName("alumite")); - OreUnifier.registerOre("dustAndradite", ItemDusts.getDustByName("andradite")); - OreUnifier.registerOre("dustAntimony", ItemDusts.getDustByName("antimony")); - OreUnifier.registerOre("dustArdite", ItemDusts.getDustByName("ardite")); - OreUnifier.registerOre("dustAsh", ItemDusts.getDustByName("ashes")); - OreUnifier.registerOre("dustBasalt", ItemDusts.getDustByName("basalt")); - OreUnifier.registerOre("dustBauxite", ItemDusts.getDustByName("bauxite")); - OreUnifier.registerOre("dustBiotite", ItemDusts.getDustByName("biotite")); - OreUnifier.registerOre("dustBrass", ItemDusts.getDustByName("brass")); - OreUnifier.registerOre("dustBronze", ItemDusts.getDustByName("bronze")); - OreUnifier.registerOre("dustCadmium", ItemDusts.getDustByName("cadmium")); - OreUnifier.registerOre("dustCalcite", ItemDusts.getDustByName("calcite")); - OreUnifier.registerOre("dustCharcoal", ItemDusts.getDustByName("charcoal")); - OreUnifier.registerOre("dustChrome", ItemDusts.getDustByName("chrome")); - OreUnifier.registerOre("dustCinnabar", ItemDusts.getDustByName("cinnabar")); - OreUnifier.registerOre("dustClay", ItemDusts.getDustByName("clay")); - OreUnifier.registerOre("dustCoal", ItemDusts.getDustByName("coal")); - OreUnifier.registerOre("dustCobalt", ItemDusts.getDustByName("cobalt")); - OreUnifier.registerOre("dustCopper", ItemDusts.getDustByName("copper")); - OreUnifier.registerOre("dustCupronickel", ItemDusts.getDustByName("cupronickel")); - OreUnifier.registerOre("dustDarkAsh", ItemDusts.getDustByName("darkAshes")); - OreUnifier.registerOre("dustDarkIron", ItemDusts.getDustByName("darkIron")); - OreUnifier.registerOre("dustDiamond", ItemDusts.getDustByName("diamond")); - OreUnifier.registerOre("dustElectrum", ItemDusts.getDustByName("electrum")); - OreUnifier.registerOre("dustEmerald", ItemDusts.getDustByName("emerald")); - OreUnifier.registerOre("dustEnderEye", ItemDusts.getDustByName("enderEye")); - OreUnifier.registerOre("dustEnderPearl", ItemDusts.getDustByName("enderPearl")); - OreUnifier.registerOre("dustEndstone", ItemDusts.getDustByName("endstone")); - OreUnifier.registerOre("dustFlint", ItemDusts.getDustByName("flint")); - OreUnifier.registerOre("dustGalena", ItemDusts.getDustByName("galena")); - OreUnifier.registerOre("dustGold", ItemDusts.getDustByName("gold")); - OreUnifier.registerOre("dustGraphite", ItemDusts.getDustByName("graphite")); - OreUnifier.registerOre("dustGrossular", ItemDusts.getDustByName("grossular")); - OreUnifier.registerOre("dustIndium", ItemDusts.getDustByName("indium")); - OreUnifier.registerOre("dustInvar", ItemDusts.getDustByName("invar")); - OreUnifier.registerOre("dustIridium", ItemDusts.getDustByName("iridium")); - OreUnifier.registerOre("dustIron", ItemDusts.getDustByName("iron")); - OreUnifier.registerOre("dustKanthal", ItemDusts.getDustByName("kanthal")); - OreUnifier.registerOre("dustLapis", ItemDusts.getDustByName("lapis")); - OreUnifier.registerOre("dustLazurite", ItemDusts.getDustByName("lazurite")); - OreUnifier.registerOre("dustLead", ItemDusts.getDustByName("lead")); - OreUnifier.registerOre("dustLimestone", ItemDusts.getDustByName("limestone")); - OreUnifier.registerOre("dustLodestone", ItemDusts.getDustByName("lodestone")); - OreUnifier.registerOre("dustMagnesium", ItemDusts.getDustByName("magnesium")); - OreUnifier.registerOre("dustMagnetite", ItemDusts.getDustByName("magnetite")); - OreUnifier.registerOre("dustManganese", ItemDusts.getDustByName("manganese")); - OreUnifier.registerOre("dustManyullyn", ItemDusts.getDustByName("manyullyn")); - OreUnifier.registerOre("dustMarble", ItemDusts.getDustByName("marble")); - OreUnifier.registerOre("dustMithril", ItemDusts.getDustByName("mithril")); - OreUnifier.registerOre("dustNetherrack", ItemDusts.getDustByName("netherrack")); - OreUnifier.registerOre("dustNichrome", ItemDusts.getDustByName("nichrome")); - OreUnifier.registerOre("dustNickel", ItemDusts.getDustByName("nickel")); - OreUnifier.registerOre("dustObsidian", ItemDusts.getDustByName("obsidian")); - OreUnifier.registerOre("dustOsmium", ItemDusts.getDustByName("osmium")); - OreUnifier.registerOre("dustPeridot", ItemDusts.getDustByName("peridot")); - OreUnifier.registerOre("dustPhosphorous", ItemDusts.getDustByName("phosphorous")); - OreUnifier.registerOre("dustPlatinum", ItemDusts.getDustByName("platinum")); - OreUnifier.registerOre("dustPotassiumFeldspar", ItemDusts.getDustByName("potassiumFeldspar")); - OreUnifier.registerOre("dustPyrite", ItemDusts.getDustByName("pyrite")); - OreUnifier.registerOre("dustPyrope", ItemDusts.getDustByName("pyrope")); - OreUnifier.registerOre("dustRedGarnet", ItemDusts.getDustByName("redGarnet")); - OreUnifier.registerOre("dustRedrock", ItemDusts.getDustByName("redrock")); - OreUnifier.registerOre("dustRuby", ItemDusts.getDustByName("ruby")); - OreUnifier.registerOre("dustSaltpeter", ItemDusts.getDustByName("saltpeter")); - OreUnifier.registerOre("dustSapphire", ItemDusts.getDustByName("sapphire")); - OreUnifier.registerOre("dustSilver", ItemDusts.getDustByName("silver")); - OreUnifier.registerOre("dustSilicon", ItemDusts.getDustByName("silicon")); - OreUnifier.registerOre("dustSodalite", ItemDusts.getDustByName("sodalite")); - OreUnifier.registerOre("dustSpessartine", ItemDusts.getDustByName("spessartine")); - OreUnifier.registerOre("dustSphalerite", ItemDusts.getDustByName("sphalerite")); - OreUnifier.registerOre("dustSteel", ItemDusts.getDustByName("steel")); - OreUnifier.registerOre("dustSulfur", ItemDusts.getDustByName("sulfur")); - OreUnifier.registerOre("dustTellurium", ItemDusts.getDustByName("tellurium")); - OreUnifier.registerOre("dustTeslatite", ItemDusts.getDustByName("teslatite")); - OreUnifier.registerOre("dustTetrahedrite", ItemDusts.getDustByName("tetrahedrite")); - OreUnifier.registerOre("dustCopper", ItemDusts.getDustByName("copper")); - OreUnifier.registerOre("dustTin", ItemDusts.getDustByName("tin")); - OreUnifier.registerOre("dustTitanium", ItemDusts.getDustByName("titanium")); - OreUnifier.registerOre("dustTungsten", ItemDusts.getDustByName("tungsten")); - OreUnifier.registerOre("dustUvarovite", ItemDusts.getDustByName("uvarovite")); - OreUnifier.registerOre("dustVinteum", ItemDusts.getDustByName("vinteum")); - OreUnifier.registerOre("dustVoidstone", ItemDusts.getDustByName("voidstone")); - OreUnifier.registerOre("dustYellowGarnet", ItemDusts.getDustByName("yellowGarnet")); - OreUnifier.registerOre("dustZinc", ItemDusts.getDustByName("zinc")); - OreUnifier.registerOre("dustOlivine", ItemDusts.getDustByName("olivine")); - OreUnifier.registerOre("pulpWood", ItemDusts.getDustByName("sawDust")); + BlockMachineBase.advancedMachineStack = BlockMachineFrame.getFrameByName("advancedMachine", 1); + BlockMachineBase.machineStack = BlockMachineFrame.getFrameByName("machine", 1); + } + public static void registerOreDict() + { - // Small Dusts - OreUnifier.registerOre("dustSmallAlmandine", ItemDustsSmall.getSmallDustByName("Almandine")); - OreUnifier.registerOre("dustSmallAluminumBrass", ItemDustsSmall.getSmallDustByName("AluminumBrass")); - OreUnifier.registerOre("dustSmallAluminum", ItemDustsSmall.getSmallDustByName("Aluminum")); - OreUnifier.registerOre("dustSmallAluminium", ItemDustsSmall.getSmallDustByName("Aluminum")); - OreUnifier.registerOre("dustSmallAlumite", ItemDustsSmall.getSmallDustByName("Alumite")); - OreUnifier.registerOre("dustSmallAndradite", ItemDustsSmall.getSmallDustByName("Andradite")); - OreUnifier.registerOre("dustSmallAntimony", ItemDustsSmall.getSmallDustByName("Antimony")); - OreUnifier.registerOre("dustSmallArdite", ItemDustsSmall.getSmallDustByName("Ardite")); - OreUnifier.registerOre("dustSmallAsh", ItemDustsSmall.getSmallDustByName("Ashes")); - OreUnifier.registerOre("dustSmallBasalt", ItemDustsSmall.getSmallDustByName("Basalt")); - OreUnifier.registerOre("dustSmallBauxite", ItemDustsSmall.getSmallDustByName("Bauxite")); - OreUnifier.registerOre("dustSmallBiotite", ItemDustsSmall.getSmallDustByName("Biotite")); - OreUnifier.registerOre("dustSmallBrass", ItemDustsSmall.getSmallDustByName("Brass")); - OreUnifier.registerOre("dustSmallBronze", ItemDustsSmall.getSmallDustByName("Bronze")); - OreUnifier.registerOre("dustSmallCadmium", ItemDustsSmall.getSmallDustByName("Cadmium")); - OreUnifier.registerOre("dustSmallCalcite", ItemDustsSmall.getSmallDustByName("Calcite")); - OreUnifier.registerOre("dustSmallCharcoal", ItemDustsSmall.getSmallDustByName("Charcoal")); - OreUnifier.registerOre("dustSmallChrome", ItemDustsSmall.getSmallDustByName("Chrome")); - OreUnifier.registerOre("dustSmallCinnabar", ItemDustsSmall.getSmallDustByName("Cinnabar")); - OreUnifier.registerOre("dustSmallClay", ItemDustsSmall.getSmallDustByName("Clay")); - OreUnifier.registerOre("dustSmallCoal", ItemDustsSmall.getSmallDustByName("Coal")); - OreUnifier.registerOre("dustSmallCobalt", ItemDustsSmall.getSmallDustByName("Cobalt")); - OreUnifier.registerOre("dustSmallCopper", ItemDustsSmall.getSmallDustByName("Copper")); - OreUnifier.registerOre("dustSmallCupronickel", ItemDustsSmall.getSmallDustByName("Cupronickel")); - OreUnifier.registerOre("dustSmallDarkAsh", ItemDustsSmall.getSmallDustByName("DarkAshes")); - OreUnifier.registerOre("dustSmallDarkIron", ItemDustsSmall.getSmallDustByName("DarkIron")); - OreUnifier.registerOre("dustSmallDiamond", ItemDustsSmall.getSmallDustByName("Diamond")); - OreUnifier.registerOre("dustSmallElectrum", ItemDustsSmall.getSmallDustByName("Electrum")); - OreUnifier.registerOre("dustSmallEmerald", ItemDustsSmall.getSmallDustByName("Emerald")); - OreUnifier.registerOre("dustSmallEnderEye", ItemDustsSmall.getSmallDustByName("EnderEye")); - OreUnifier.registerOre("dustSmallEnderPearl", ItemDustsSmall.getSmallDustByName("EnderPearl")); - OreUnifier.registerOre("dustSmallEndstone", ItemDustsSmall.getSmallDustByName("Endstone")); - OreUnifier.registerOre("dustSmallFlint", ItemDustsSmall.getSmallDustByName("Flint")); - OreUnifier.registerOre("dustSmallGalena", ItemDustsSmall.getSmallDustByName("Galena")); - OreUnifier.registerOre("dustSmallGlowstone", ItemDustsSmall.getSmallDustByName("Glowstone")); - OreUnifier.registerOre("dustSmallGold", ItemDustsSmall.getSmallDustByName("Gold")); - OreUnifier.registerOre("dustSmallGraphite", ItemDustsSmall.getSmallDustByName("Graphite")); - OreUnifier.registerOre("dustSmallGrossular", ItemDustsSmall.getSmallDustByName("Grossular")); - OreUnifier.registerOre("dustSmallGunpowder", ItemDustsSmall.getSmallDustByName("Gunpowder")); - OreUnifier.registerOre("dustSmallIndium", ItemDustsSmall.getSmallDustByName("Indium")); - OreUnifier.registerOre("dustSmallInvar", ItemDustsSmall.getSmallDustByName("Invar")); - OreUnifier.registerOre("dustSmallIridium", ItemDustsSmall.getSmallDustByName("Iridium")); - OreUnifier.registerOre("dustSmallIron", ItemDustsSmall.getSmallDustByName("Iron")); - OreUnifier.registerOre("dustSmallKanthal", ItemDustsSmall.getSmallDustByName("Kanthal")); - OreUnifier.registerOre("dustSmallLapis", ItemDustsSmall.getSmallDustByName("Lapis")); - OreUnifier.registerOre("dustSmallLazurite", ItemDustsSmall.getSmallDustByName("Lazurite")); - OreUnifier.registerOre("dustSmallLead", ItemDustsSmall.getSmallDustByName("Lead")); - OreUnifier.registerOre("dustSmallLimestone", ItemDustsSmall.getSmallDustByName("Limestone")); - OreUnifier.registerOre("dustSmallLodestone", ItemDustsSmall.getSmallDustByName("Lodestone")); - OreUnifier.registerOre("dustSmallMagnesium", ItemDustsSmall.getSmallDustByName("Magnesium")); - OreUnifier.registerOre("dustSmallMagnetite", ItemDustsSmall.getSmallDustByName("Magnetite")); - OreUnifier.registerOre("dustSmallManganese", ItemDustsSmall.getSmallDustByName("Manganese")); - OreUnifier.registerOre("dustSmallManyullyn", ItemDustsSmall.getSmallDustByName("Manyullyn")); - OreUnifier.registerOre("dustSmallMarble", ItemDustsSmall.getSmallDustByName("Marble")); - OreUnifier.registerOre("dustSmallMithril", ItemDustsSmall.getSmallDustByName("Mithril")); - OreUnifier.registerOre("dustSmallNetherrack", ItemDustsSmall.getSmallDustByName("Netherrack")); - OreUnifier.registerOre("dustSmallNichrome", ItemDustsSmall.getSmallDustByName("Nichrome")); - OreUnifier.registerOre("dustSmallNickel", ItemDustsSmall.getSmallDustByName("Nickel")); - OreUnifier.registerOre("dustSmallObsidian", ItemDustsSmall.getSmallDustByName("Obsidian")); - OreUnifier.registerOre("dustSmallOsmium", ItemDustsSmall.getSmallDustByName("Osmium")); - OreUnifier.registerOre("dustSmallPeridot", ItemDustsSmall.getSmallDustByName("Peridot")); - OreUnifier.registerOre("dustSmallPhosphorous", ItemDustsSmall.getSmallDustByName("Phosphorous")); - OreUnifier.registerOre("dustSmallPlatinum", ItemDustsSmall.getSmallDustByName("Platinum")); - OreUnifier.registerOre("dustSmallPotassiumFeldspar", ItemDustsSmall.getSmallDustByName("PotassiumFeldspar")); - OreUnifier.registerOre("dustSmallPyrite", ItemDustsSmall.getSmallDustByName("Pyrite")); - OreUnifier.registerOre("dustSmallPyrope", ItemDustsSmall.getSmallDustByName("Pyrope")); - OreUnifier.registerOre("dustSmallRedGarnet", ItemDustsSmall.getSmallDustByName("RedGarnet")); - OreUnifier.registerOre("dustSmallRedrock", ItemDustsSmall.getSmallDustByName("Redrock")); - OreUnifier.registerOre("dustSmallRedstone", ItemDustsSmall.getSmallDustByName("Redstone")); - OreUnifier.registerOre("dustSmallRuby", ItemDustsSmall.getSmallDustByName("Ruby")); - OreUnifier.registerOre("dustSmallSaltpeter", ItemDustsSmall.getSmallDustByName("Saltpeter")); - OreUnifier.registerOre("dustSmallSapphire", ItemDustsSmall.getSmallDustByName("Sapphire")); - OreUnifier.registerOre("dustSmallSilver", ItemDustsSmall.getSmallDustByName("Silver")); - OreUnifier.registerOre("dustSmallSilicon", ItemDustsSmall.getSmallDustByName("Silicon")); - OreUnifier.registerOre("dustSmallSodalite", ItemDustsSmall.getSmallDustByName("Sodalite")); - OreUnifier.registerOre("dustSmallSpessartine", ItemDustsSmall.getSmallDustByName("Spessartine")); - OreUnifier.registerOre("dustSmallSphalerite", ItemDustsSmall.getSmallDustByName("Sphalerite")); - OreUnifier.registerOre("dustSmallSteel", ItemDustsSmall.getSmallDustByName("Steel")); - OreUnifier.registerOre("dustSmallSulfur", ItemDustsSmall.getSmallDustByName("Sulfur")); - OreUnifier.registerOre("dustSmallTellurium", ItemDustsSmall.getSmallDustByName("Tellurium")); - OreUnifier.registerOre("dustSmallTeslatite", ItemDustsSmall.getSmallDustByName("Teslatite")); - OreUnifier.registerOre("dustSmallTetrahedrite", ItemDustsSmall.getSmallDustByName("Tetrahedrite")); - OreUnifier.registerOre("dustSmallCopper", ItemDustsSmall.getSmallDustByName("Copper")); - OreUnifier.registerOre("dustSmallTin", ItemDustsSmall.getSmallDustByName("Tin")); - OreUnifier.registerOre("dustSmallTitanium", ItemDustsSmall.getSmallDustByName("Titanium")); - OreUnifier.registerOre("dustSmallTungsten", ItemDustsSmall.getSmallDustByName("Tungsten")); - OreUnifier.registerOre("dustSmallUvarovite", ItemDustsSmall.getSmallDustByName("Uvarovite")); - OreUnifier.registerOre("dustSmallVinteum", ItemDustsSmall.getSmallDustByName("Vinteum")); - OreUnifier.registerOre("dustSmallVoidstone", ItemDustsSmall.getSmallDustByName("Voidstone")); - OreUnifier.registerOre("dustSmallYellowGarnet", ItemDustsSmall.getSmallDustByName("YellowGarnet")); - OreUnifier.registerOre("dustSmallOlivine", ItemDustsSmall.getSmallDustByName("Olivine")); - OreUnifier.registerOre("dustSmallZinc", ItemDustsSmall.getSmallDustByName("Zinc")); + OreUnifier.registerOre("gemRuby", ItemGems.getGemByName("ruby")); + OreUnifier.registerOre("gemSapphire", ItemGems.getGemByName("sapphire")); + OreUnifier.registerOre("gemPeridot", ItemGems.getGemByName("peridot")); + OreUnifier.registerOre("gemRedGarnet", ItemGems.getGemByName("redGarnet")); + OreUnifier.registerOre("gemYellowGarnet", ItemGems.getGemByName("yellowGarnet")); - // Ingots - OreUnifier.registerOre("ingotAluminum", ItemIngots.getIngotByName("aluminum")); - OreUnifier.registerOre("ingotAluminium", ItemIngots.getIngotByName("aluminum")); - OreUnifier.registerOre("ingotAntimony", ItemIngots.getIngotByName("antimony")); - OreUnifier.registerOre("ingotBatteryAlloy", ItemIngots.getIngotByName("batteryAlloy")); - OreUnifier.registerOre("ingotBlueAlloy", ItemIngots.getIngotByName("blueAlloy")); - OreUnifier.registerOre("ingotBrass", ItemIngots.getIngotByName("brass")); - OreUnifier.registerOre("ingotBronze", ItemIngots.getIngotByName("bronze")); - OreUnifier.registerOre("ingotCadmium", ItemIngots.getIngotByName("cadmium")); - OreUnifier.registerOre("ingotChrome", ItemIngots.getIngotByName("chrome")); - OreUnifier.registerOre("ingotCopper", ItemIngots.getIngotByName("copper")); - OreUnifier.registerOre("ingotCupronickel", ItemIngots.getIngotByName("cupronickel")); - OreUnifier.registerOre("ingotElectrum", ItemIngots.getIngotByName("electrum")); - OreUnifier.registerOre("ingotIndium", ItemIngots.getIngotByName("indium")); - OreUnifier.registerOre("ingotInvar", ItemIngots.getIngotByName("invar")); - OreUnifier.registerOre("ingotIridium", ItemIngots.getIngotByName("iridium")); - OreUnifier.registerOre("ingotKanthal", ItemIngots.getIngotByName("kanthal")); - OreUnifier.registerOre("ingotLead", ItemIngots.getIngotByName("lead")); - OreUnifier.registerOre("ingotLodestone", ItemIngots.getIngotByName("lodestone")); - OreUnifier.registerOre("ingotMagnalium", ItemIngots.getIngotByName("magnalium")); - OreUnifier.registerOre("ingotNichrome", ItemIngots.getIngotByName("nichrome")); - OreUnifier.registerOre("ingotNickel", ItemIngots.getIngotByName("nickel")); - OreUnifier.registerOre("ingotOsmium", ItemIngots.getIngotByName("osmium")); - OreUnifier.registerOre("ingotPlatinum", ItemIngots.getIngotByName("platinum")); - OreUnifier.registerOre("ingotRedAlloy", ItemIngots.getIngotByName("redAlloy")); - OreUnifier.registerOre("ingotSilver", ItemIngots.getIngotByName("silver")); - OreUnifier.registerOre("ingotSteel", ItemIngots.getIngotByName("steel")); - OreUnifier.registerOre("ingotTellurium", ItemIngots.getIngotByName("tellurium")); - OreUnifier.registerOre("ingotTin", ItemIngots.getIngotByName("tin")); - OreUnifier.registerOre("ingotTitanium", ItemIngots.getIngotByName("titanium")); - OreUnifier.registerOre("ingotTungsten", ItemIngots.getIngotByName("tungsten")); - OreUnifier.registerOre("ingotTungstensteel", ItemIngots.getIngotByName("tungstensteel")); - OreUnifier.registerOre("ingotHotTungstenSteel", ItemIngots.getIngotByName("hotTungstensteel")); - OreUnifier.registerOre("ingotZinc", ItemIngots.getIngotByName("zinc")); + // Dusts + OreUnifier.registerOre("dustAlmandine", ItemDusts.getDustByName("almandine")); + OreUnifier.registerOre("dustAluminumBrass", ItemDusts.getDustByName("aluminumBrass")); + OreUnifier.registerOre("dustAluminum", ItemDusts.getDustByName("aluminum")); + OreUnifier.registerOre("dustAluminium", ItemDusts.getDustByName("aluminum")); + OreUnifier.registerOre("dustAlumite", ItemDusts.getDustByName("alumite")); + OreUnifier.registerOre("dustAndradite", ItemDusts.getDustByName("andradite")); + OreUnifier.registerOre("dustAntimony", ItemDusts.getDustByName("antimony")); + OreUnifier.registerOre("dustArdite", ItemDusts.getDustByName("ardite")); + OreUnifier.registerOre("dustAsh", ItemDusts.getDustByName("ashes")); + OreUnifier.registerOre("dustBasalt", ItemDusts.getDustByName("basalt")); + OreUnifier.registerOre("dustBauxite", ItemDusts.getDustByName("bauxite")); + OreUnifier.registerOre("dustBiotite", ItemDusts.getDustByName("biotite")); + OreUnifier.registerOre("dustBrass", ItemDusts.getDustByName("brass")); + OreUnifier.registerOre("dustBronze", ItemDusts.getDustByName("bronze")); + OreUnifier.registerOre("dustCadmium", ItemDusts.getDustByName("cadmium")); + OreUnifier.registerOre("dustCalcite", ItemDusts.getDustByName("calcite")); + OreUnifier.registerOre("dustCharcoal", ItemDusts.getDustByName("charcoal")); + OreUnifier.registerOre("dustChrome", ItemDusts.getDustByName("chrome")); + OreUnifier.registerOre("dustCinnabar", ItemDusts.getDustByName("cinnabar")); + OreUnifier.registerOre("dustClay", ItemDusts.getDustByName("clay")); + OreUnifier.registerOre("dustCoal", ItemDusts.getDustByName("coal")); + OreUnifier.registerOre("dustCobalt", ItemDusts.getDustByName("cobalt")); + OreUnifier.registerOre("dustCopper", ItemDusts.getDustByName("copper")); + OreUnifier.registerOre("dustCupronickel", ItemDusts.getDustByName("cupronickel")); + OreUnifier.registerOre("dustDarkAsh", ItemDusts.getDustByName("darkAshes")); + OreUnifier.registerOre("dustDarkIron", ItemDusts.getDustByName("darkIron")); + OreUnifier.registerOre("dustDiamond", ItemDusts.getDustByName("diamond")); + OreUnifier.registerOre("dustElectrum", ItemDusts.getDustByName("electrum")); + OreUnifier.registerOre("dustEmerald", ItemDusts.getDustByName("emerald")); + OreUnifier.registerOre("dustEnderEye", ItemDusts.getDustByName("enderEye")); + OreUnifier.registerOre("dustEnderPearl", ItemDusts.getDustByName("enderPearl")); + OreUnifier.registerOre("dustEndstone", ItemDusts.getDustByName("endstone")); + OreUnifier.registerOre("dustFlint", ItemDusts.getDustByName("flint")); + OreUnifier.registerOre("dustGalena", ItemDusts.getDustByName("galena")); + OreUnifier.registerOre("dustGold", ItemDusts.getDustByName("gold")); + OreUnifier.registerOre("dustGraphite", ItemDusts.getDustByName("graphite")); + OreUnifier.registerOre("dustGrossular", ItemDusts.getDustByName("grossular")); + OreUnifier.registerOre("dustIndium", ItemDusts.getDustByName("indium")); + OreUnifier.registerOre("dustInvar", ItemDusts.getDustByName("invar")); + OreUnifier.registerOre("dustIridium", ItemDusts.getDustByName("iridium")); + OreUnifier.registerOre("dustIron", ItemDusts.getDustByName("iron")); + OreUnifier.registerOre("dustKanthal", ItemDusts.getDustByName("kanthal")); + OreUnifier.registerOre("dustLapis", ItemDusts.getDustByName("lapis")); + OreUnifier.registerOre("dustLazurite", ItemDusts.getDustByName("lazurite")); + OreUnifier.registerOre("dustLead", ItemDusts.getDustByName("lead")); + OreUnifier.registerOre("dustLimestone", ItemDusts.getDustByName("limestone")); + OreUnifier.registerOre("dustLodestone", ItemDusts.getDustByName("lodestone")); + OreUnifier.registerOre("dustMagnesium", ItemDusts.getDustByName("magnesium")); + OreUnifier.registerOre("dustMagnetite", ItemDusts.getDustByName("magnetite")); + OreUnifier.registerOre("dustManganese", ItemDusts.getDustByName("manganese")); + OreUnifier.registerOre("dustManyullyn", ItemDusts.getDustByName("manyullyn")); + OreUnifier.registerOre("dustMarble", ItemDusts.getDustByName("marble")); + OreUnifier.registerOre("dustMithril", ItemDusts.getDustByName("mithril")); + OreUnifier.registerOre("dustNetherrack", ItemDusts.getDustByName("netherrack")); + OreUnifier.registerOre("dustNichrome", ItemDusts.getDustByName("nichrome")); + OreUnifier.registerOre("dustNickel", ItemDusts.getDustByName("nickel")); + OreUnifier.registerOre("dustObsidian", ItemDusts.getDustByName("obsidian")); + OreUnifier.registerOre("dustOsmium", ItemDusts.getDustByName("osmium")); + OreUnifier.registerOre("dustPeridot", ItemDusts.getDustByName("peridot")); + OreUnifier.registerOre("dustPhosphorous", ItemDusts.getDustByName("phosphorous")); + OreUnifier.registerOre("dustPlatinum", ItemDusts.getDustByName("platinum")); + OreUnifier.registerOre("dustPotassiumFeldspar", ItemDusts.getDustByName("potassiumFeldspar")); + OreUnifier.registerOre("dustPyrite", ItemDusts.getDustByName("pyrite")); + OreUnifier.registerOre("dustPyrope", ItemDusts.getDustByName("pyrope")); + OreUnifier.registerOre("dustRedGarnet", ItemDusts.getDustByName("redGarnet")); + OreUnifier.registerOre("dustRedrock", ItemDusts.getDustByName("redrock")); + OreUnifier.registerOre("dustRuby", ItemDusts.getDustByName("ruby")); + OreUnifier.registerOre("dustSaltpeter", ItemDusts.getDustByName("saltpeter")); + OreUnifier.registerOre("dustSapphire", ItemDusts.getDustByName("sapphire")); + OreUnifier.registerOre("dustSilver", ItemDusts.getDustByName("silver")); + OreUnifier.registerOre("dustSilicon", ItemDusts.getDustByName("silicon")); + OreUnifier.registerOre("dustSodalite", ItemDusts.getDustByName("sodalite")); + OreUnifier.registerOre("dustSpessartine", ItemDusts.getDustByName("spessartine")); + OreUnifier.registerOre("dustSphalerite", ItemDusts.getDustByName("sphalerite")); + OreUnifier.registerOre("dustSteel", ItemDusts.getDustByName("steel")); + OreUnifier.registerOre("dustSulfur", ItemDusts.getDustByName("sulfur")); + OreUnifier.registerOre("dustTellurium", ItemDusts.getDustByName("tellurium")); + OreUnifier.registerOre("dustTeslatite", ItemDusts.getDustByName("teslatite")); + OreUnifier.registerOre("dustTetrahedrite", ItemDusts.getDustByName("tetrahedrite")); + OreUnifier.registerOre("dustCopper", ItemDusts.getDustByName("copper")); + OreUnifier.registerOre("dustTin", ItemDusts.getDustByName("tin")); + OreUnifier.registerOre("dustTitanium", ItemDusts.getDustByName("titanium")); + OreUnifier.registerOre("dustTungsten", ItemDusts.getDustByName("tungsten")); + OreUnifier.registerOre("dustUvarovite", ItemDusts.getDustByName("uvarovite")); + OreUnifier.registerOre("dustVinteum", ItemDusts.getDustByName("vinteum")); + OreUnifier.registerOre("dustVoidstone", ItemDusts.getDustByName("voidstone")); + OreUnifier.registerOre("dustYellowGarnet", ItemDusts.getDustByName("yellowGarnet")); + OreUnifier.registerOre("dustZinc", ItemDusts.getDustByName("zinc")); + OreUnifier.registerOre("dustOlivine", ItemDusts.getDustByName("olivine")); + OreUnifier.registerOre("pulpWood", ItemDusts.getDustByName("sawDust")); - // Nuggets - OreUnifier.registerOre("nuggetAluminum", ItemNuggets.getNuggetByName("aluminum")); - OreUnifier.registerOre("nuggetAluminium", ItemNuggets.getNuggetByName("aluminum")); - OreUnifier.registerOre("nuggetAntimony", ItemNuggets.getNuggetByName("antimony")); - OreUnifier.registerOre("nuggetBrass", ItemNuggets.getNuggetByName("brass")); - OreUnifier.registerOre("nuggetBronze", ItemNuggets.getNuggetByName("bronze")); - OreUnifier.registerOre("nuggetChrome", ItemNuggets.getNuggetByName("chrome")); - OreUnifier.registerOre("nuggetCopper", ItemNuggets.getNuggetByName("copper")); - OreUnifier.registerOre("nuggetElectrum", ItemNuggets.getNuggetByName("electrum")); - OreUnifier.registerOre("nuggetInvar", ItemNuggets.getNuggetByName("invar")); - OreUnifier.registerOre("nuggetIridium", ItemNuggets.getNuggetByName("iridium")); - OreUnifier.registerOre("nuggetIron", ItemNuggets.getNuggetByName("iron")); - OreUnifier.registerOre("nuggetLead", ItemNuggets.getNuggetByName("lead")); - OreUnifier.registerOre("nuggetNickel", ItemNuggets.getNuggetByName("nickel")); - OreUnifier.registerOre("nuggetOsmium", ItemNuggets.getNuggetByName("osmium")); - OreUnifier.registerOre("nuggetPlatinum", ItemNuggets.getNuggetByName("platinum")); - OreUnifier.registerOre("nuggetSilver", ItemNuggets.getNuggetByName("silver")); - OreUnifier.registerOre("nuggetSteel", ItemNuggets.getNuggetByName("steel")); - OreUnifier.registerOre("nuggetTin", ItemNuggets.getNuggetByName("tin")); - OreUnifier.registerOre("nuggetTitanium", ItemNuggets.getNuggetByName("titanium")); - OreUnifier.registerOre("nuggetTungsten", ItemNuggets.getNuggetByName("tungsten")); - OreUnifier.registerOre("nuggetZinc", ItemNuggets.getNuggetByName("zinc")); + // Small Dusts + OreUnifier.registerOre("dustSmallAlmandine", ItemDustsSmall.getSmallDustByName("Almandine")); + OreUnifier.registerOre("dustSmallAluminumBrass", ItemDustsSmall.getSmallDustByName("AluminumBrass")); + OreUnifier.registerOre("dustSmallAluminum", ItemDustsSmall.getSmallDustByName("Aluminum")); + OreUnifier.registerOre("dustSmallAluminium", ItemDustsSmall.getSmallDustByName("Aluminum")); + OreUnifier.registerOre("dustSmallAlumite", ItemDustsSmall.getSmallDustByName("Alumite")); + OreUnifier.registerOre("dustSmallAndradite", ItemDustsSmall.getSmallDustByName("Andradite")); + OreUnifier.registerOre("dustSmallAntimony", ItemDustsSmall.getSmallDustByName("Antimony")); + OreUnifier.registerOre("dustSmallArdite", ItemDustsSmall.getSmallDustByName("Ardite")); + OreUnifier.registerOre("dustSmallAsh", ItemDustsSmall.getSmallDustByName("Ashes")); + OreUnifier.registerOre("dustSmallBasalt", ItemDustsSmall.getSmallDustByName("Basalt")); + OreUnifier.registerOre("dustSmallBauxite", ItemDustsSmall.getSmallDustByName("Bauxite")); + OreUnifier.registerOre("dustSmallBiotite", ItemDustsSmall.getSmallDustByName("Biotite")); + OreUnifier.registerOre("dustSmallBrass", ItemDustsSmall.getSmallDustByName("Brass")); + OreUnifier.registerOre("dustSmallBronze", ItemDustsSmall.getSmallDustByName("Bronze")); + OreUnifier.registerOre("dustSmallCadmium", ItemDustsSmall.getSmallDustByName("Cadmium")); + OreUnifier.registerOre("dustSmallCalcite", ItemDustsSmall.getSmallDustByName("Calcite")); + OreUnifier.registerOre("dustSmallCharcoal", ItemDustsSmall.getSmallDustByName("Charcoal")); + OreUnifier.registerOre("dustSmallChrome", ItemDustsSmall.getSmallDustByName("Chrome")); + OreUnifier.registerOre("dustSmallCinnabar", ItemDustsSmall.getSmallDustByName("Cinnabar")); + OreUnifier.registerOre("dustSmallClay", ItemDustsSmall.getSmallDustByName("Clay")); + OreUnifier.registerOre("dustSmallCoal", ItemDustsSmall.getSmallDustByName("Coal")); + OreUnifier.registerOre("dustSmallCobalt", ItemDustsSmall.getSmallDustByName("Cobalt")); + OreUnifier.registerOre("dustSmallCopper", ItemDustsSmall.getSmallDustByName("Copper")); + OreUnifier.registerOre("dustSmallCupronickel", ItemDustsSmall.getSmallDustByName("Cupronickel")); + OreUnifier.registerOre("dustSmallDarkAsh", ItemDustsSmall.getSmallDustByName("DarkAshes")); + OreUnifier.registerOre("dustSmallDarkIron", ItemDustsSmall.getSmallDustByName("DarkIron")); + OreUnifier.registerOre("dustSmallDiamond", ItemDustsSmall.getSmallDustByName("Diamond")); + OreUnifier.registerOre("dustSmallElectrum", ItemDustsSmall.getSmallDustByName("Electrum")); + OreUnifier.registerOre("dustSmallEmerald", ItemDustsSmall.getSmallDustByName("Emerald")); + OreUnifier.registerOre("dustSmallEnderEye", ItemDustsSmall.getSmallDustByName("EnderEye")); + OreUnifier.registerOre("dustSmallEnderPearl", ItemDustsSmall.getSmallDustByName("EnderPearl")); + OreUnifier.registerOre("dustSmallEndstone", ItemDustsSmall.getSmallDustByName("Endstone")); + OreUnifier.registerOre("dustSmallFlint", ItemDustsSmall.getSmallDustByName("Flint")); + OreUnifier.registerOre("dustSmallGalena", ItemDustsSmall.getSmallDustByName("Galena")); + OreUnifier.registerOre("dustSmallGlowstone", ItemDustsSmall.getSmallDustByName("Glowstone")); + OreUnifier.registerOre("dustSmallGold", ItemDustsSmall.getSmallDustByName("Gold")); + OreUnifier.registerOre("dustSmallGraphite", ItemDustsSmall.getSmallDustByName("Graphite")); + OreUnifier.registerOre("dustSmallGrossular", ItemDustsSmall.getSmallDustByName("Grossular")); + OreUnifier.registerOre("dustSmallGunpowder", ItemDustsSmall.getSmallDustByName("Gunpowder")); + OreUnifier.registerOre("dustSmallIndium", ItemDustsSmall.getSmallDustByName("Indium")); + OreUnifier.registerOre("dustSmallInvar", ItemDustsSmall.getSmallDustByName("Invar")); + OreUnifier.registerOre("dustSmallIridium", ItemDustsSmall.getSmallDustByName("Iridium")); + OreUnifier.registerOre("dustSmallIron", ItemDustsSmall.getSmallDustByName("Iron")); + OreUnifier.registerOre("dustSmallKanthal", ItemDustsSmall.getSmallDustByName("Kanthal")); + OreUnifier.registerOre("dustSmallLapis", ItemDustsSmall.getSmallDustByName("Lapis")); + OreUnifier.registerOre("dustSmallLazurite", ItemDustsSmall.getSmallDustByName("Lazurite")); + OreUnifier.registerOre("dustSmallLead", ItemDustsSmall.getSmallDustByName("Lead")); + OreUnifier.registerOre("dustSmallLimestone", ItemDustsSmall.getSmallDustByName("Limestone")); + OreUnifier.registerOre("dustSmallLodestone", ItemDustsSmall.getSmallDustByName("Lodestone")); + OreUnifier.registerOre("dustSmallMagnesium", ItemDustsSmall.getSmallDustByName("Magnesium")); + OreUnifier.registerOre("dustSmallMagnetite", ItemDustsSmall.getSmallDustByName("Magnetite")); + OreUnifier.registerOre("dustSmallManganese", ItemDustsSmall.getSmallDustByName("Manganese")); + OreUnifier.registerOre("dustSmallManyullyn", ItemDustsSmall.getSmallDustByName("Manyullyn")); + OreUnifier.registerOre("dustSmallMarble", ItemDustsSmall.getSmallDustByName("Marble")); + OreUnifier.registerOre("dustSmallMithril", ItemDustsSmall.getSmallDustByName("Mithril")); + OreUnifier.registerOre("dustSmallNetherrack", ItemDustsSmall.getSmallDustByName("Netherrack")); + OreUnifier.registerOre("dustSmallNichrome", ItemDustsSmall.getSmallDustByName("Nichrome")); + OreUnifier.registerOre("dustSmallNickel", ItemDustsSmall.getSmallDustByName("Nickel")); + OreUnifier.registerOre("dustSmallObsidian", ItemDustsSmall.getSmallDustByName("Obsidian")); + OreUnifier.registerOre("dustSmallOsmium", ItemDustsSmall.getSmallDustByName("Osmium")); + OreUnifier.registerOre("dustSmallPeridot", ItemDustsSmall.getSmallDustByName("Peridot")); + OreUnifier.registerOre("dustSmallPhosphorous", ItemDustsSmall.getSmallDustByName("Phosphorous")); + OreUnifier.registerOre("dustSmallPlatinum", ItemDustsSmall.getSmallDustByName("Platinum")); + OreUnifier.registerOre("dustSmallPotassiumFeldspar", ItemDustsSmall.getSmallDustByName("PotassiumFeldspar")); + OreUnifier.registerOre("dustSmallPyrite", ItemDustsSmall.getSmallDustByName("Pyrite")); + OreUnifier.registerOre("dustSmallPyrope", ItemDustsSmall.getSmallDustByName("Pyrope")); + OreUnifier.registerOre("dustSmallRedGarnet", ItemDustsSmall.getSmallDustByName("RedGarnet")); + OreUnifier.registerOre("dustSmallRedrock", ItemDustsSmall.getSmallDustByName("Redrock")); + OreUnifier.registerOre("dustSmallRedstone", ItemDustsSmall.getSmallDustByName("Redstone")); + OreUnifier.registerOre("dustSmallRuby", ItemDustsSmall.getSmallDustByName("Ruby")); + OreUnifier.registerOre("dustSmallSaltpeter", ItemDustsSmall.getSmallDustByName("Saltpeter")); + OreUnifier.registerOre("dustSmallSapphire", ItemDustsSmall.getSmallDustByName("Sapphire")); + OreUnifier.registerOre("dustSmallSilver", ItemDustsSmall.getSmallDustByName("Silver")); + OreUnifier.registerOre("dustSmallSilicon", ItemDustsSmall.getSmallDustByName("Silicon")); + OreUnifier.registerOre("dustSmallSodalite", ItemDustsSmall.getSmallDustByName("Sodalite")); + OreUnifier.registerOre("dustSmallSpessartine", ItemDustsSmall.getSmallDustByName("Spessartine")); + OreUnifier.registerOre("dustSmallSphalerite", ItemDustsSmall.getSmallDustByName("Sphalerite")); + OreUnifier.registerOre("dustSmallSteel", ItemDustsSmall.getSmallDustByName("Steel")); + OreUnifier.registerOre("dustSmallSulfur", ItemDustsSmall.getSmallDustByName("Sulfur")); + OreUnifier.registerOre("dustSmallTellurium", ItemDustsSmall.getSmallDustByName("Tellurium")); + OreUnifier.registerOre("dustSmallTeslatite", ItemDustsSmall.getSmallDustByName("Teslatite")); + OreUnifier.registerOre("dustSmallTetrahedrite", ItemDustsSmall.getSmallDustByName("Tetrahedrite")); + OreUnifier.registerOre("dustSmallCopper", ItemDustsSmall.getSmallDustByName("Copper")); + OreUnifier.registerOre("dustSmallTin", ItemDustsSmall.getSmallDustByName("Tin")); + OreUnifier.registerOre("dustSmallTitanium", ItemDustsSmall.getSmallDustByName("Titanium")); + OreUnifier.registerOre("dustSmallTungsten", ItemDustsSmall.getSmallDustByName("Tungsten")); + OreUnifier.registerOre("dustSmallUvarovite", ItemDustsSmall.getSmallDustByName("Uvarovite")); + OreUnifier.registerOre("dustSmallVinteum", ItemDustsSmall.getSmallDustByName("Vinteum")); + OreUnifier.registerOre("dustSmallVoidstone", ItemDustsSmall.getSmallDustByName("Voidstone")); + OreUnifier.registerOre("dustSmallYellowGarnet", ItemDustsSmall.getSmallDustByName("YellowGarnet")); + OreUnifier.registerOre("dustSmallOlivine", ItemDustsSmall.getSmallDustByName("Olivine")); + OreUnifier.registerOre("dustSmallZinc", ItemDustsSmall.getSmallDustByName("Zinc")); - // Plates - OreUnifier.registerOre("plateAluminum", ItemPlates.getPlateByName("aluminum")); - OreUnifier.registerOre("plateAluminium", ItemPlates.getPlateByName("aluminum")); - OreUnifier.registerOre("plateBatteryAlloy", ItemPlates.getPlateByName("batteryAlloy")); - OreUnifier.registerOre("plateBrass", ItemPlates.getPlateByName("brass")); - OreUnifier.registerOre("plateBronze", ItemPlates.getPlateByName("bronze")); - OreUnifier.registerOre("plateCoal", ItemPlates.getPlateByName("coal")); - OreUnifier.registerOre("plateChrome", ItemPlates.getPlateByName("chrome")); - OreUnifier.registerOre("plateCopper", ItemPlates.getPlateByName("copper")); - OreUnifier.registerOre("plateDiamond", ItemPlates.getPlateByName("diamond")); - OreUnifier.registerOre("plateElectrum", ItemPlates.getPlateByName("electrum")); - OreUnifier.registerOre("plateEmerald", ItemPlates.getPlateByName("emerald")); - OreUnifier.registerOre("plateGold", ItemPlates.getPlateByName("gold")); - OreUnifier.registerOre("plateInvar", ItemPlates.getPlateByName("invar")); - OreUnifier.registerOre("plateIridium", ItemPlates.getPlateByName("iridium")); - OreUnifier.registerOre("plateIron", ItemPlates.getPlateByName("iron")); - OreUnifier.registerOre("plateLapis", ItemPlates.getPlateByName("lapis")); - OreUnifier.registerOre("plateLead", ItemPlates.getPlateByName("lead")); - OreUnifier.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium")); - OreUnifier.registerOre("plateNickel", ItemPlates.getPlateByName("nickel")); - OreUnifier.registerOre("plateObsidian", ItemPlates.getPlateByName("obsidian")); - OreUnifier.registerOre("plateOsmium", ItemPlates.getPlateByName("osmium")); - OreUnifier.registerOre("platePeridot", ItemPlates.getPlateByName("peridot")); - OreUnifier.registerOre("platePlatinum", ItemPlates.getPlateByName("platinum")); - OreUnifier.registerOre("plateRedGarnet", ItemPlates.getPlateByName("redGarnet")); - OreUnifier.registerOre("plateRedstone", ItemPlates.getPlateByName("redstone")); - OreUnifier.registerOre("plateRedstoneAlloy", ItemPlates.getPlateByName("redstone")); - OreUnifier.registerOre("plateRuby", ItemPlates.getPlateByName("ruby")); - OreUnifier.registerOre("plateSapphire", ItemPlates.getPlateByName("sapphire")); - OreUnifier.registerOre("plateSilicon", ItemPlates.getPlateByName("silicon")); - OreUnifier.registerOre("plateSilver", ItemPlates.getPlateByName("silver")); - OreUnifier.registerOre("plateSteel", ItemPlates.getPlateByName("steel")); - OreUnifier.registerOre("plateTeslatite", ItemPlates.getPlateByName("teslatite")); - OreUnifier.registerOre("plateTin", ItemPlates.getPlateByName("tin")); - OreUnifier.registerOre("plateTitanium", ItemPlates.getPlateByName("titanium")); - OreUnifier.registerOre("plateTungsten", ItemPlates.getPlateByName("tungsten")); - OreUnifier.registerOre("plateTungstensteel", ItemPlates.getPlateByName("tungstensteel")); - OreUnifier.registerOre("plateYellowGarnet", ItemPlates.getPlateByName("yellowGarnet")); - OreUnifier.registerOre("plateZinc", ItemPlates.getPlateByName("zinc")); + // Ingots + OreUnifier.registerOre("ingotAluminum", ItemIngots.getIngotByName("aluminum")); + OreUnifier.registerOre("ingotAluminium", ItemIngots.getIngotByName("aluminum")); + OreUnifier.registerOre("ingotAntimony", ItemIngots.getIngotByName("antimony")); + OreUnifier.registerOre("ingotBatteryAlloy", ItemIngots.getIngotByName("batteryAlloy")); + OreUnifier.registerOre("ingotBlueAlloy", ItemIngots.getIngotByName("blueAlloy")); + OreUnifier.registerOre("ingotBrass", ItemIngots.getIngotByName("brass")); + OreUnifier.registerOre("ingotBronze", ItemIngots.getIngotByName("bronze")); + OreUnifier.registerOre("ingotCadmium", ItemIngots.getIngotByName("cadmium")); + OreUnifier.registerOre("ingotChrome", ItemIngots.getIngotByName("chrome")); + OreUnifier.registerOre("ingotCopper", ItemIngots.getIngotByName("copper")); + OreUnifier.registerOre("ingotCupronickel", ItemIngots.getIngotByName("cupronickel")); + OreUnifier.registerOre("ingotElectrum", ItemIngots.getIngotByName("electrum")); + OreUnifier.registerOre("ingotIndium", ItemIngots.getIngotByName("indium")); + OreUnifier.registerOre("ingotInvar", ItemIngots.getIngotByName("invar")); + OreUnifier.registerOre("ingotIridium", ItemIngots.getIngotByName("iridium")); + OreUnifier.registerOre("ingotKanthal", ItemIngots.getIngotByName("kanthal")); + OreUnifier.registerOre("ingotLead", ItemIngots.getIngotByName("lead")); + OreUnifier.registerOre("ingotLodestone", ItemIngots.getIngotByName("lodestone")); + OreUnifier.registerOre("ingotMagnalium", ItemIngots.getIngotByName("magnalium")); + OreUnifier.registerOre("ingotNichrome", ItemIngots.getIngotByName("nichrome")); + OreUnifier.registerOre("ingotNickel", ItemIngots.getIngotByName("nickel")); + OreUnifier.registerOre("ingotOsmium", ItemIngots.getIngotByName("osmium")); + OreUnifier.registerOre("ingotPlatinum", ItemIngots.getIngotByName("platinum")); + OreUnifier.registerOre("ingotRedAlloy", ItemIngots.getIngotByName("redAlloy")); + OreUnifier.registerOre("ingotSilver", ItemIngots.getIngotByName("silver")); + OreUnifier.registerOre("ingotSteel", ItemIngots.getIngotByName("steel")); + OreUnifier.registerOre("ingotTellurium", ItemIngots.getIngotByName("tellurium")); + OreUnifier.registerOre("ingotTin", ItemIngots.getIngotByName("tin")); + OreUnifier.registerOre("ingotTitanium", ItemIngots.getIngotByName("titanium")); + OreUnifier.registerOre("ingotTungsten", ItemIngots.getIngotByName("tungsten")); + OreUnifier.registerOre("ingotTungstensteel", ItemIngots.getIngotByName("tungstensteel")); + OreUnifier.registerOre("ingotHotTungstenSteel", ItemIngots.getIngotByName("hotTungstensteel")); + OreUnifier.registerOre("ingotZinc", ItemIngots.getIngotByName("zinc")); - // Crushed Ore - OreUnifier.registerOre("crushedAluminum", ItemCrushedOre.getCrushedOreByName("Aluminum")); - OreUnifier.registerOre("crushedAluminium", ItemCrushedOre.getCrushedOreByName("Aluminum")); - OreUnifier.registerOre("crushedArdite", ItemCrushedOre.getCrushedOreByName("Ardite")); - OreUnifier.registerOre("crushedBauxite", ItemCrushedOre.getCrushedOreByName("Bauxite")); - OreUnifier.registerOre("crushedCadmium", ItemCrushedOre.getCrushedOreByName("Cadmium")); - OreUnifier.registerOre("crushedCinnabar", ItemCrushedOre.getCrushedOreByName("Cinnabar")); - OreUnifier.registerOre("crushedCobalt", ItemCrushedOre.getCrushedOreByName("Cobalt")); - OreUnifier.registerOre("crushedDarkIron", ItemCrushedOre.getCrushedOreByName("DarkIron")); - OreUnifier.registerOre("crushedGalena", ItemCrushedOre.getCrushedOreByName("Galena")); - OreUnifier.registerOre("crushedIndium", ItemCrushedOre.getCrushedOreByName("Indium")); - OreUnifier.registerOre("crushedIridium", ItemCrushedOre.getCrushedOreByName("Iridium")); - OreUnifier.registerOre("crushedNickel", ItemCrushedOre.getCrushedOreByName("Nickel")); - OreUnifier.registerOre("crushedOsmium", ItemCrushedOre.getCrushedOreByName("Osmium")); - OreUnifier.registerOre("crushedPlatinum", ItemCrushedOre.getCrushedOreByName("Platinum")); - OreUnifier.registerOre("crushedPyrite", ItemCrushedOre.getCrushedOreByName("Pyrite")); - OreUnifier.registerOre("crushedSphalerite", ItemCrushedOre.getCrushedOreByName("Sphalerite")); - OreUnifier.registerOre("crushedTetrahedrite", ItemCrushedOre.getCrushedOreByName("Tetrahedrite")); - OreUnifier.registerOre("crushedTungsten", ItemCrushedOre.getCrushedOreByName("Tungsten")); + // Nuggets + OreUnifier.registerOre("nuggetAluminum", ItemNuggets.getNuggetByName("aluminum")); + OreUnifier.registerOre("nuggetAluminium", ItemNuggets.getNuggetByName("aluminum")); + OreUnifier.registerOre("nuggetAntimony", ItemNuggets.getNuggetByName("antimony")); + OreUnifier.registerOre("nuggetBrass", ItemNuggets.getNuggetByName("brass")); + OreUnifier.registerOre("nuggetBronze", ItemNuggets.getNuggetByName("bronze")); + OreUnifier.registerOre("nuggetChrome", ItemNuggets.getNuggetByName("chrome")); + OreUnifier.registerOre("nuggetCopper", ItemNuggets.getNuggetByName("copper")); + OreUnifier.registerOre("nuggetElectrum", ItemNuggets.getNuggetByName("electrum")); + OreUnifier.registerOre("nuggetInvar", ItemNuggets.getNuggetByName("invar")); + OreUnifier.registerOre("nuggetIridium", ItemNuggets.getNuggetByName("iridium")); + OreUnifier.registerOre("nuggetIron", ItemNuggets.getNuggetByName("iron")); + OreUnifier.registerOre("nuggetLead", ItemNuggets.getNuggetByName("lead")); + OreUnifier.registerOre("nuggetNickel", ItemNuggets.getNuggetByName("nickel")); + OreUnifier.registerOre("nuggetOsmium", ItemNuggets.getNuggetByName("osmium")); + OreUnifier.registerOre("nuggetPlatinum", ItemNuggets.getNuggetByName("platinum")); + OreUnifier.registerOre("nuggetSilver", ItemNuggets.getNuggetByName("silver")); + OreUnifier.registerOre("nuggetSteel", ItemNuggets.getNuggetByName("steel")); + OreUnifier.registerOre("nuggetTin", ItemNuggets.getNuggetByName("tin")); + OreUnifier.registerOre("nuggetTitanium", ItemNuggets.getNuggetByName("titanium")); + OreUnifier.registerOre("nuggetTungsten", ItemNuggets.getNuggetByName("tungsten")); + OreUnifier.registerOre("nuggetZinc", ItemNuggets.getNuggetByName("zinc")); - // Purified Crushed Ore -// OreUnifier.registerOre("crushedPurifiedAluminum", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Aluminum")); -// OreUnifier.registerOre("crushedPurifiedAluminium", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Aluminum")); -// OreUnifier.registerOre("crushedPurifiedArdite", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Ardite")); -// OreUnifier.registerOre("crushedPurifiedBauxite", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Bauxite")); -// OreUnifier.registerOre("crushedPurifiedCadmium", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cadmium")); -// OreUnifier.registerOre("crushedPurifiedCinnabar", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cinnabar")); -// OreUnifier.registerOre("crushedPurifiedCobalt", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cobalt")); -// OreUnifier.registerOre("crushedPurifiedDarkIron", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("DarkIron")); -// OreUnifier.registerOre("crushedPurifiedGalena", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Galena")); -// OreUnifier.registerOre("crushedPurifiedIndium", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Indium")); -// OreUnifier.registerOre("crushedPurifiedIridium", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Iridium")); -// OreUnifier.registerOre("crushedPurifiedNickel", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Nickel")); -// OreUnifier.registerOre("crushedPurifiedOsmium", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Osmium")); -// OreUnifier.registerOre("crushedPurifiedPlatinum", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Platinum")); -// OreUnifier.registerOre("crushedPurifiedPyrite", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Pyrite")); -// OreUnifier.registerOre("crushedPurifiedSphalerite", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Sphalerite")); -// OreUnifier.registerOre("crushedPurifiedTetrahedrite", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Tetrahedrite")); -// OreUnifier.registerOre("crushedPurifiedTungsten", ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Tungsten")); + // Plates + OreUnifier.registerOre("plateAluminum", ItemPlates.getPlateByName("aluminum")); + OreUnifier.registerOre("plateAluminium", ItemPlates.getPlateByName("aluminum")); + OreUnifier.registerOre("plateBatteryAlloy", ItemPlates.getPlateByName("batteryAlloy")); + OreUnifier.registerOre("plateBrass", ItemPlates.getPlateByName("brass")); + OreUnifier.registerOre("plateBronze", ItemPlates.getPlateByName("bronze")); + OreUnifier.registerOre("plateCoal", ItemPlates.getPlateByName("coal")); + OreUnifier.registerOre("plateChrome", ItemPlates.getPlateByName("chrome")); + OreUnifier.registerOre("plateCopper", ItemPlates.getPlateByName("copper")); + OreUnifier.registerOre("plateDiamond", ItemPlates.getPlateByName("diamond")); + OreUnifier.registerOre("plateElectrum", ItemPlates.getPlateByName("electrum")); + OreUnifier.registerOre("plateEmerald", ItemPlates.getPlateByName("emerald")); + OreUnifier.registerOre("plateGold", ItemPlates.getPlateByName("gold")); + OreUnifier.registerOre("plateInvar", ItemPlates.getPlateByName("invar")); + OreUnifier.registerOre("plateIridium", ItemPlates.getPlateByName("iridium")); + OreUnifier.registerOre("plateIron", ItemPlates.getPlateByName("iron")); + OreUnifier.registerOre("plateLapis", ItemPlates.getPlateByName("lapis")); + OreUnifier.registerOre("plateLead", ItemPlates.getPlateByName("lead")); + OreUnifier.registerOre("plateMagnalium", ItemPlates.getPlateByName("magnalium")); + OreUnifier.registerOre("plateNickel", ItemPlates.getPlateByName("nickel")); + OreUnifier.registerOre("plateObsidian", ItemPlates.getPlateByName("obsidian")); + OreUnifier.registerOre("plateOsmium", ItemPlates.getPlateByName("osmium")); + OreUnifier.registerOre("platePeridot", ItemPlates.getPlateByName("peridot")); + OreUnifier.registerOre("platePlatinum", ItemPlates.getPlateByName("platinum")); + OreUnifier.registerOre("plateRedGarnet", ItemPlates.getPlateByName("redGarnet")); + OreUnifier.registerOre("plateRedstone", ItemPlates.getPlateByName("redstone")); + OreUnifier.registerOre("plateRedstoneAlloy", ItemPlates.getPlateByName("redstone")); + OreUnifier.registerOre("plateRuby", ItemPlates.getPlateByName("ruby")); + OreUnifier.registerOre("plateSapphire", ItemPlates.getPlateByName("sapphire")); + OreUnifier.registerOre("plateSilicon", ItemPlates.getPlateByName("silicon")); + OreUnifier.registerOre("plateSilver", ItemPlates.getPlateByName("silver")); + OreUnifier.registerOre("plateSteel", ItemPlates.getPlateByName("steel")); + OreUnifier.registerOre("plateTeslatite", ItemPlates.getPlateByName("teslatite")); + OreUnifier.registerOre("plateTin", ItemPlates.getPlateByName("tin")); + OreUnifier.registerOre("plateTitanium", ItemPlates.getPlateByName("titanium")); + OreUnifier.registerOre("plateTungsten", ItemPlates.getPlateByName("tungsten")); + OreUnifier.registerOre("plateTungstensteel", ItemPlates.getPlateByName("tungstensteel")); + OreUnifier.registerOre("plateYellowGarnet", ItemPlates.getPlateByName("yellowGarnet")); + OreUnifier.registerOre("plateZinc", ItemPlates.getPlateByName("zinc")); - OreUnifier.registerOre("craftingGrinder", ItemParts.getPartByName("diamondGrindingHead")); - OreUnifier.registerOre("craftingGrinder", ItemParts.getPartByName("tungstenGrindingHead")); - OreUnifier.registerOre("circuitMaster", ItemParts.getPartByName("energyFlowCircuit")); - OreUnifier.registerOre("circuitElite", ItemParts.getPartByName("dataControlCircuit")); - OreUnifier.registerOre("circuitData", ItemParts.getPartByName("dataStorageCircuit")); - OreUnifier.registerOre("craftingSuperconductor", ItemParts.getPartByName("superconductor")); - OreUnifier.registerOre("batteryUltimate", ItemParts.getPartByName("diamondGrindingHead")); - OreUnifier.registerOre("blockLapis", ItemParts.getPartByName("lazuriteChunk")); + // Crushed Ore + OreUnifier.registerOre("crushedAluminum", ItemCrushedOre.getCrushedOreByName("Aluminum")); + OreUnifier.registerOre("crushedAluminium", ItemCrushedOre.getCrushedOreByName("Aluminum")); + OreUnifier.registerOre("crushedArdite", ItemCrushedOre.getCrushedOreByName("Ardite")); + OreUnifier.registerOre("crushedBauxite", ItemCrushedOre.getCrushedOreByName("Bauxite")); + OreUnifier.registerOre("crushedCadmium", ItemCrushedOre.getCrushedOreByName("Cadmium")); + OreUnifier.registerOre("crushedCinnabar", ItemCrushedOre.getCrushedOreByName("Cinnabar")); + OreUnifier.registerOre("crushedCobalt", ItemCrushedOre.getCrushedOreByName("Cobalt")); + OreUnifier.registerOre("crushedDarkIron", ItemCrushedOre.getCrushedOreByName("DarkIron")); + OreUnifier.registerOre("crushedGalena", ItemCrushedOre.getCrushedOreByName("Galena")); + OreUnifier.registerOre("crushedIndium", ItemCrushedOre.getCrushedOreByName("Indium")); + OreUnifier.registerOre("crushedIridium", ItemCrushedOre.getCrushedOreByName("Iridium")); + OreUnifier.registerOre("crushedNickel", ItemCrushedOre.getCrushedOreByName("Nickel")); + OreUnifier.registerOre("crushedOsmium", ItemCrushedOre.getCrushedOreByName("Osmium")); + OreUnifier.registerOre("crushedPlatinum", ItemCrushedOre.getCrushedOreByName("Platinum")); + OreUnifier.registerOre("crushedPyrite", ItemCrushedOre.getCrushedOreByName("Pyrite")); + OreUnifier.registerOre("crushedSphalerite", ItemCrushedOre.getCrushedOreByName("Sphalerite")); + OreUnifier.registerOre("crushedTetrahedrite", ItemCrushedOre.getCrushedOreByName("Tetrahedrite")); + OreUnifier.registerOre("crushedTungsten", ItemCrushedOre.getCrushedOreByName("Tungsten")); - } + // Purified Crushed Ore + // OreUnifier.registerOre("crushedPurifiedAluminum", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Aluminum")); + // OreUnifier.registerOre("crushedPurifiedAluminium", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Aluminum")); + // OreUnifier.registerOre("crushedPurifiedArdite", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Ardite")); + // OreUnifier.registerOre("crushedPurifiedBauxite", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Bauxite")); + // OreUnifier.registerOre("crushedPurifiedCadmium", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cadmium")); + // OreUnifier.registerOre("crushedPurifiedCinnabar", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cinnabar")); + // OreUnifier.registerOre("crushedPurifiedCobalt", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Cobalt")); + // OreUnifier.registerOre("crushedPurifiedDarkIron", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("DarkIron")); + // OreUnifier.registerOre("crushedPurifiedGalena", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Galena")); + // OreUnifier.registerOre("crushedPurifiedIndium", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Indium")); + // OreUnifier.registerOre("crushedPurifiedIridium", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Iridium")); + // OreUnifier.registerOre("crushedPurifiedNickel", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Nickel")); + // OreUnifier.registerOre("crushedPurifiedOsmium", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Osmium")); + // OreUnifier.registerOre("crushedPurifiedPlatinum", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Platinum")); + // OreUnifier.registerOre("crushedPurifiedPyrite", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Pyrite")); + // OreUnifier.registerOre("crushedPurifiedSphalerite", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Sphalerite")); + // OreUnifier.registerOre("crushedPurifiedTetrahedrite", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Tetrahedrite")); + // OreUnifier.registerOre("crushedPurifiedTungsten", + // ItemPurifiedCrushedOre.getPurifiedCrushedOreByName("Tungsten")); + + OreUnifier.registerOre("craftingGrinder", ItemParts.getPartByName("diamondGrindingHead")); + OreUnifier.registerOre("craftingGrinder", ItemParts.getPartByName("tungstenGrindingHead")); + OreUnifier.registerOre("circuitMaster", ItemParts.getPartByName("energyFlowCircuit")); + OreUnifier.registerOre("circuitElite", ItemParts.getPartByName("dataControlCircuit")); + OreUnifier.registerOre("circuitData", ItemParts.getPartByName("dataStorageCircuit")); + OreUnifier.registerOre("craftingSuperconductor", ItemParts.getPartByName("superconductor")); + OreUnifier.registerOre("batteryUltimate", ItemParts.getPartByName("diamondGrindingHead")); + OreUnifier.registerOre("blockLapis", ItemParts.getPartByName("lazuriteChunk")); + + } } diff --git a/src/main/java/techreborn/init/ModLoot.java b/src/main/java/techreborn/init/ModLoot.java index e46aa6405..24acf23f4 100644 --- a/src/main/java/techreborn/init/ModLoot.java +++ b/src/main/java/techreborn/init/ModLoot.java @@ -3,30 +3,47 @@ package techreborn.init; import net.minecraft.util.WeightedRandomChestContent; //TODO 1.9 nope -public class ModLoot { -// -// public static WeightedRandomChestContent rubberSaplingLoot = new WeightedRandomChestContent(new ItemStack(ModBlocks.rubberSapling), 1, 3, 25); -// public static WeightedRandomChestContent copperIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("copper"), 1, 4, 20); -// public static WeightedRandomChestContent tinIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("tin"), 1, 4, 20); -// public static WeightedRandomChestContent steelIngotLoot = new WeightedRandomChestContent(ItemIngots.getIngotByName("steel"), 1, 3, 5); - - public static void init(){ -// if(ConfigTechReborn.RubberSaplingLoot){ -// generate(rubberSaplingLoot); -// } -// if(ConfigTechReborn.CopperIngotsLoot){ -// generate(copperIngotLoot); -// } -// if(ConfigTechReborn.TinIngotsLoot){ -// generate(tinIngotLoot); -// } -// if(ConfigTechReborn.SteelIngotsLoot){ -// generate(steelIngotLoot); -// } +public class ModLoot +{ + // + // public static WeightedRandomChestContent rubberSaplingLoot = new + // WeightedRandomChestContent(new ItemStack(ModBlocks.rubberSapling), 1, 3, + // 25); + // public static WeightedRandomChestContent copperIngotLoot = new + // WeightedRandomChestContent(ItemIngots.getIngotByName("copper"), 1, 4, + // 20); + // public static WeightedRandomChestContent tinIngotLoot = new + // WeightedRandomChestContent(ItemIngots.getIngotByName("tin"), 1, 4, 20); + // public static WeightedRandomChestContent steelIngotLoot = new + // WeightedRandomChestContent(ItemIngots.getIngotByName("steel"), 1, 3, 5); + + public static void init() + { + // if(ConfigTechReborn.RubberSaplingLoot){ + // generate(rubberSaplingLoot); + // } + // if(ConfigTechReborn.CopperIngotsLoot){ + // generate(copperIngotLoot); + // } + // if(ConfigTechReborn.TinIngotsLoot){ + // generate(tinIngotLoot); + // } + // if(ConfigTechReborn.SteelIngotsLoot){ + // generate(steelIngotLoot); + // } + } + + public static void generate(WeightedRandomChestContent chestContent) + { + // for (String category : + // Arrays.asList(ChestGenHooks.VILLAGE_BLACKSMITH, + // ChestGenHooks.MINESHAFT_CORRIDOR, ChestGenHooks.PYRAMID_DESERT_CHEST, + // ChestGenHooks.PYRAMID_JUNGLE_CHEST, + // ChestGenHooks.PYRAMID_JUNGLE_DISPENSER, + // ChestGenHooks.STRONGHOLD_CORRIDOR, ChestGenHooks.STRONGHOLD_LIBRARY, + // ChestGenHooks.STRONGHOLD_CROSSING, ChestGenHooks.BONUS_CHEST, + // ChestGenHooks.DUNGEON_CHEST)) { + // ChestGenHooks.addItem(category, chestContent); + // } } - public static void generate(WeightedRandomChestContent chestContent) { -// for (String category : Arrays.asList(ChestGenHooks.VILLAGE_BLACKSMITH, ChestGenHooks.MINESHAFT_CORRIDOR, ChestGenHooks.PYRAMID_DESERT_CHEST, ChestGenHooks.PYRAMID_JUNGLE_CHEST, ChestGenHooks.PYRAMID_JUNGLE_DISPENSER, ChestGenHooks.STRONGHOLD_CORRIDOR, ChestGenHooks.STRONGHOLD_LIBRARY, ChestGenHooks.STRONGHOLD_CROSSING, ChestGenHooks.BONUS_CHEST, ChestGenHooks.DUNGEON_CHEST)) { -// ChestGenHooks.addItem(category, chestContent); -// } - } } diff --git a/src/main/java/techreborn/init/ModParts.java b/src/main/java/techreborn/init/ModParts.java index 6044e1c63..9db7e5f3f 100644 --- a/src/main/java/techreborn/init/ModParts.java +++ b/src/main/java/techreborn/init/ModParts.java @@ -1,29 +1,32 @@ package techreborn.init; -import net.minecraft.item.ItemStack; - import java.util.HashMap; -public class ModParts { +import net.minecraft.item.ItemStack; - public static HashMap stackCable = new HashMap(); +public class ModParts +{ - public static void init() { //TODO 1.8 -// if (Loader.isModLoaded("IC2")) { -// for (int i = 0; i < 11; i++) { -// CablePart part = new CablePart(); -// part.setType(i); -// ModPartRegistry.registerPart(part); -// } -// } -// ModPartRegistry.addProvider("techreborn.partSystem.fmp.FMPFactory", -// "ForgeMultipart"); -// ModPartRegistry.addProvider("techreborn.partSystem.QLib.QModPartFactory", "qmunitylib"); -// ModPartRegistry.addAllPartsToSystems(); -// for (IPartProvider provider : ModPartRegistry.providers) { -// if (provider.modID().equals("ForgeMultipart")) { -// ModPartRegistry.masterProvider = provider; -// } -// } - } + public static HashMap stackCable = new HashMap(); + + public static void init() + { // TODO 1.8 + // if (Loader.isModLoaded("IC2")) { + // for (int i = 0; i < 11; i++) { + // CablePart part = new CablePart(); + // part.setType(i); + // ModPartRegistry.registerPart(part); + // } + // } + // ModPartRegistry.addProvider("techreborn.partSystem.fmp.FMPFactory", + // "ForgeMultipart"); + // ModPartRegistry.addProvider("techreborn.partSystem.QLib.QModPartFactory", + // "qmunitylib"); + // ModPartRegistry.addAllPartsToSystems(); + // for (IPartProvider provider : ModPartRegistry.providers) { + // if (provider.modID().equals("ForgeMultipart")) { + // ModPartRegistry.masterProvider = provider; + // } + // } + } } diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 2a2939946..6e521a31b 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -1,7 +1,8 @@ package techreborn.init; +import java.security.InvalidParameterException; + import net.minecraft.block.Block; -import net.minecraft.block.BlockFrostedIce; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -10,7 +11,9 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; + import org.apache.commons.lang3.ArrayUtils; + import reborncore.common.util.CraftingHelper; import reborncore.common.util.OreUtil; import techreborn.Core; @@ -21,2700 +24,3096 @@ import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.api.recipe.RecipeHandler; import techreborn.api.recipe.RecyclerRecipe; import techreborn.api.recipe.ScrapboxRecipe; -import techreborn.api.recipe.machines.*; -import techreborn.blocks.*; +import techreborn.api.recipe.machines.AlloySmelterRecipe; +import techreborn.api.recipe.machines.BlastFurnaceRecipe; +import techreborn.api.recipe.machines.CentrifugeRecipe; +import techreborn.api.recipe.machines.ChemicalReactorRecipe; +import techreborn.api.recipe.machines.CompressorRecipe; +import techreborn.api.recipe.machines.ExtractorRecipe; +import techreborn.api.recipe.machines.GrinderRecipe; +import techreborn.api.recipe.machines.ImplosionCompressorRecipe; +import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe; +import techreborn.api.recipe.machines.IndustrialGrinderRecipe; +import techreborn.api.recipe.machines.IndustrialSawmillRecipe; +import techreborn.api.recipe.machines.PlateCuttingMachineRecipe; +import techreborn.api.recipe.machines.VacuumFreezerRecipe; +import techreborn.blocks.BlockMachineFrame; +import techreborn.blocks.BlockOre; +import techreborn.blocks.BlockOre2; +import techreborn.blocks.BlockStorage; +import techreborn.blocks.BlockStorage2; import techreborn.config.ConfigTechReborn; -import techreborn.items.*; +import techreborn.items.ItemCells; +import techreborn.items.ItemDusts; +import techreborn.items.ItemDustsSmall; +import techreborn.items.ItemGems; +import techreborn.items.ItemIngots; +import techreborn.items.ItemNuggets; +import techreborn.items.ItemParts; +import techreborn.items.ItemPlates; import techreborn.parts.ItemStandaloneCables; import techreborn.utils.RecipeUtils; -import java.security.InvalidParameterException; +public class ModRecipes +{ + public static ConfigTechReborn config; -public class ModRecipes { - public static ConfigTechReborn config; + public static void init() + { + addShapelessRecipes(); + addGeneralShapedRecipes(); + addMachineRecipes(); - public static void init() { - addShapelessRecipes(); - addGeneralShapedRecipes(); - addMachineRecipes(); + addSmeltingRecipes(); + addUUrecipes(); - addSmeltingRecipes(); - addUUrecipes(); + addAlloySmelterRecipes(); + addPlateCuttingMachineRecipes(); + addIndustrialCentrifugeRecipes(); + addChemicalReactorRecipes(); + addIndustrialElectrolyzerRecipes(); - addAlloySmelterRecipes(); - addPlateCuttingMachineRecipes(); - addIndustrialCentrifugeRecipes(); - addChemicalReactorRecipes(); - addIndustrialElectrolyzerRecipes(); + addIndustrialSawmillRecipes(); + addBlastFurnaceRecipes(); + addIndustrialGrinderRecipes(); + addImplosionCompressorRecipes(); + addReactorRecipes(); + addIc2Recipes(); + addGrinderRecipes(); + addHammerRecipes(); + addIc2ReplacementReicpes(); + addExtractorRecipes(); + addCompressorRecipes(); + addWireRecipes(); + addScrapBoxloot(); + } - addIndustrialSawmillRecipes(); - addBlastFurnaceRecipes(); - addIndustrialGrinderRecipes(); - addImplosionCompressorRecipes(); - addReactorRecipes(); - addIc2Recipes(); - addGrinderRecipes(); - addHammerRecipes(); - addIc2ReplacementReicpes(); - addExtractorRecipes(); - addCompressorRecipes(); - addWireRecipes(); - addScrapBoxloot(); - } + static void addScrapBoxloot() + { + ScrapboxList.addItemStackToList(new ItemStack(Items.diamond)); + ScrapboxList.addItemStackToList(new ItemStack(Items.stick)); + ScrapboxList.addItemStackToList(new ItemStack(Items.coal)); + ScrapboxList.addItemStackToList(new ItemStack(Items.apple)); + ScrapboxList.addItemStackToList(new ItemStack(Items.baked_potato)); + ScrapboxList.addItemStackToList(new ItemStack(Items.blaze_powder)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wheat)); + ScrapboxList.addItemStackToList(new ItemStack(Items.carrot)); + ScrapboxList.addItemStackToList(new ItemStack(Items.boat)); + ScrapboxList.addItemStackToList(new ItemStack(Items.blaze_rod)); + ScrapboxList.addItemStackToList(new ItemStack(Items.compass)); + ScrapboxList.addItemStackToList(new ItemStack(Items.map)); + ScrapboxList.addItemStackToList(new ItemStack(Items.leather_leggings)); + ScrapboxList.addItemStackToList(new ItemStack(Items.bow)); + ScrapboxList.addItemStackToList(new ItemStack(Items.cooked_chicken)); + ScrapboxList.addItemStackToList(new ItemStack(Items.paper)); + ScrapboxList.addItemStackToList(new ItemStack(Items.book)); + ScrapboxList.addItemStackToList(new ItemStack(Items.cake)); + ScrapboxList.addItemStackToList(new ItemStack(Items.acacia_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.dark_oak_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.birch_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.jungle_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.oak_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.spruce_door)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_axe)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_hoe)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_pickaxe)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_shovel)); + ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_sword)); + ScrapboxList.addItemStackToList(new ItemStack(Items.bed)); + ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 2)); + ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 4)); + ScrapboxList.addItemStackToList(new ItemStack(Items.dye, 1, 3)); + ScrapboxList.addItemStackToList(new ItemStack(Items.glowstone_dust)); + ScrapboxList.addItemStackToList(new ItemStack(Items.string)); + ScrapboxList.addItemStackToList(new ItemStack(Items.minecart)); + ScrapboxList.addItemStackToList(new ItemStack(Items.chest_minecart)); + ScrapboxList.addItemStackToList(new ItemStack(Items.hopper_minecart)); + ScrapboxList.addItemStackToList(new ItemStack(Items.prismarine_shard)); + ScrapboxList.addItemStackToList(new ItemStack(Items.shears)); + ScrapboxList.addItemStackToList(new ItemStack(Items.experience_bottle)); + ScrapboxList.addItemStackToList(new ItemStack(Items.bone)); + ScrapboxList.addItemStackToList(new ItemStack(Items.bowl)); + ScrapboxList.addItemStackToList(new ItemStack(Items.brick)); + ScrapboxList.addItemStackToList(new ItemStack(Items.fishing_rod)); + ScrapboxList.addItemStackToList(new ItemStack(Items.paper)); + ScrapboxList.addItemStackToList(new ItemStack(Items.sugar)); + ScrapboxList.addItemStackToList(new ItemStack(Items.reeds)); + ScrapboxList.addItemStackToList(new ItemStack(Items.spider_eye)); + ScrapboxList.addItemStackToList(new ItemStack(Items.slime_ball)); + ScrapboxList.addItemStackToList(new ItemStack(Items.rotten_flesh)); + ScrapboxList.addItemStackToList(new ItemStack(Items.sign)); + ScrapboxList.addItemStackToList(new ItemStack(Items.writable_book)); + ScrapboxList.addItemStackToList(new ItemStack(Items.cooked_beef)); + ScrapboxList.addItemStackToList(new ItemStack(Items.name_tag)); + ScrapboxList.addItemStackToList(new ItemStack(Items.saddle)); + ScrapboxList.addItemStackToList(new ItemStack(Items.redstone)); + ScrapboxList.addItemStackToList(new ItemStack(Items.gunpowder)); + ScrapboxList.addItemStackToList(new ItemStack(Items.rabbit_hide)); + ScrapboxList.addItemStackToList(new ItemStack(Items.rabbit_foot)); + ScrapboxList.addItemStackToList(new ItemStack(Items.apple)); - static void addScrapBoxloot() { - ScrapboxList.addItemStackToList(new ItemStack(Items.diamond)); - ScrapboxList.addItemStackToList(new ItemStack(Items.stick)); - ScrapboxList.addItemStackToList(new ItemStack(Items.coal)); - ScrapboxList.addItemStackToList(new ItemStack(Items.apple)); - ScrapboxList.addItemStackToList(new ItemStack(Items.baked_potato)); - ScrapboxList.addItemStackToList(new ItemStack(Items.blaze_powder)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wheat)); - ScrapboxList.addItemStackToList(new ItemStack(Items.carrot)); - ScrapboxList.addItemStackToList(new ItemStack(Items.boat)); - ScrapboxList.addItemStackToList(new ItemStack(Items.blaze_rod)); - ScrapboxList.addItemStackToList(new ItemStack(Items.compass)); - ScrapboxList.addItemStackToList(new ItemStack(Items.map)); - ScrapboxList.addItemStackToList(new ItemStack(Items.leather_leggings)); - ScrapboxList.addItemStackToList(new ItemStack(Items.bow)); - ScrapboxList.addItemStackToList(new ItemStack(Items.cooked_chicken)); - ScrapboxList.addItemStackToList(new ItemStack(Items.paper)); - ScrapboxList.addItemStackToList(new ItemStack(Items.book)); - ScrapboxList.addItemStackToList(new ItemStack(Items.cake)); - ScrapboxList.addItemStackToList(new ItemStack(Items.acacia_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.dark_oak_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.birch_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.jungle_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.oak_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.spruce_door)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_axe)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_hoe)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_pickaxe)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_shovel)); - ScrapboxList.addItemStackToList(new ItemStack(Items.wooden_sword)); - ScrapboxList.addItemStackToList(new ItemStack(Items.bed)); - ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 2)); - ScrapboxList.addItemStackToList(new ItemStack(Items.skull, 1, 4)); - ScrapboxList.addItemStackToList(new ItemStack(Items.dye, 1, 3)); - ScrapboxList.addItemStackToList(new ItemStack(Items.glowstone_dust)); - ScrapboxList.addItemStackToList(new ItemStack(Items.string)); - ScrapboxList.addItemStackToList(new ItemStack(Items.minecart)); - ScrapboxList.addItemStackToList(new ItemStack(Items.chest_minecart)); - ScrapboxList.addItemStackToList(new ItemStack(Items.hopper_minecart)); - ScrapboxList.addItemStackToList(new ItemStack(Items.prismarine_shard)); - ScrapboxList.addItemStackToList(new ItemStack(Items.shears)); - ScrapboxList.addItemStackToList(new ItemStack(Items.experience_bottle)); - ScrapboxList.addItemStackToList(new ItemStack(Items.bone)); - ScrapboxList.addItemStackToList(new ItemStack(Items.bowl)); - ScrapboxList.addItemStackToList(new ItemStack(Items.brick)); - ScrapboxList.addItemStackToList(new ItemStack(Items.fishing_rod)); - ScrapboxList.addItemStackToList(new ItemStack(Items.paper)); - ScrapboxList.addItemStackToList(new ItemStack(Items.sugar)); - ScrapboxList.addItemStackToList(new ItemStack(Items.reeds)); - ScrapboxList.addItemStackToList(new ItemStack(Items.spider_eye)); - ScrapboxList.addItemStackToList(new ItemStack(Items.slime_ball)); - ScrapboxList.addItemStackToList(new ItemStack(Items.rotten_flesh)); - ScrapboxList.addItemStackToList(new ItemStack(Items.sign)); - ScrapboxList.addItemStackToList(new ItemStack(Items.writable_book)); - ScrapboxList.addItemStackToList(new ItemStack(Items.cooked_beef)); - ScrapboxList.addItemStackToList(new ItemStack(Items.name_tag)); - ScrapboxList.addItemStackToList(new ItemStack(Items.saddle)); - ScrapboxList.addItemStackToList(new ItemStack(Items.redstone)); - ScrapboxList.addItemStackToList(new ItemStack(Items.gunpowder)); - ScrapboxList.addItemStackToList(new ItemStack(Items.rabbit_hide)); - ScrapboxList.addItemStackToList(new ItemStack(Items.rabbit_foot)); - ScrapboxList.addItemStackToList(new ItemStack(Items.apple)); - - ScrapboxList.addItemStackToList(ItemCells.getCellByName("empty")); - ScrapboxList.addItemStackToList(ItemCells.getCellByName("water")); - ScrapboxList.addItemStackToList(ItemParts.getPartByName("scrap")); - ScrapboxList.addItemStackToList(ItemParts.getPartByName("rubber")); + ScrapboxList.addItemStackToList(ItemCells.getCellByName("empty")); + ScrapboxList.addItemStackToList(ItemCells.getCellByName("water")); + ScrapboxList.addItemStackToList(ItemParts.getPartByName("scrap")); + ScrapboxList.addItemStackToList(ItemParts.getPartByName("rubber")); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.trapdoor)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.brick_block)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.crafting_table)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.pumpkin)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.netherrack)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.grass)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.dirt, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.dirt, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sand, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sand, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.glowstone)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.gravel)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.hardened_clay)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.glass)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.glass_pane)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.cactus)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.tallgrass, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.tallgrass, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.deadbush)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.chest)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.tnt)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.rail)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.detector_rail)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.golden_rail)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.activator_rail)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.yellow_flower)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 2)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 3)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 4)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 5)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 6)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 7)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 8)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.brown_mushroom)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_mushroom)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.brown_mushroom_block)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_mushroom_block)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 2)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 3)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 4)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 5)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 1)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 2)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 3)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves2, 1, 0)); - ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves2, 1, 1)); - - ScrapboxList.addItemStackToList(new ItemStack(ModBlocks.rubberSapling)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.trapdoor)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.brick_block)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.crafting_table)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.pumpkin)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.netherrack)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.grass)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.dirt, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.dirt, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sand, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sand, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.glowstone)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.gravel)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.hardened_clay)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.glass)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.glass_pane)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.cactus)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.tallgrass, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.tallgrass, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.deadbush)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.chest)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.tnt)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.rail)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.detector_rail)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.golden_rail)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.activator_rail)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.yellow_flower)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 2)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 3)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 4)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 5)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 6)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 7)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_flower, 1, 8)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.brown_mushroom)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_mushroom)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.brown_mushroom_block)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.red_mushroom_block)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 2)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 3)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 4)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.sapling, 1, 5)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 1)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 2)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves, 1, 3)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves2, 1, 0)); + ScrapboxList.addItemStackToList(new ItemStack(Blocks.leaves2, 1, 1)); - for(String i : ItemDusts.types){ - ScrapboxList.addItemStackToList(ItemDusts.getDustByName(i)); - } + ScrapboxList.addItemStackToList(new ItemStack(ModBlocks.rubberSapling)); - for(String i : ItemGems.types){ - ScrapboxList.addItemStackToList(ItemGems.getGemByName(i)); - } - - registerDyable(Blocks.carpet); - registerDyable(Blocks.stained_glass); - registerDyable(Blocks.stained_glass_pane); - registerDyable(Blocks.stained_hardened_clay); + for (String i : ItemDusts.types) + { + ScrapboxList.addItemStackToList(ItemDusts.getDustByName(i)); + } - for (int i = 0; i < ScrapboxList.stacks.size(); i++) { + for (String i : ItemGems.types) + { + ScrapboxList.addItemStackToList(ItemGems.getGemByName(i)); + } + + registerDyable(Blocks.carpet); + registerDyable(Blocks.stained_glass); + registerDyable(Blocks.stained_glass_pane); + registerDyable(Blocks.stained_hardened_clay); + + for (int i = 0; i < ScrapboxList.stacks.size(); i++) + { RecipeHandler.addRecipe(new ScrapboxRecipe(ScrapboxList.stacks.get(i))); } - - //just for jei - //TODO find a way to get all ItemStacks in mc - for (int i = 0; i < ScrapboxList.stacks.size() ; i++) { + + // just for jei + // TODO find a way to get all ItemStacks in mc + for (int i = 0; i < ScrapboxList.stacks.size(); i++) + { RecipeHandler.addRecipe(new RecyclerRecipe(ScrapboxList.stacks.get(i))); } } - - static void registerDyable(Block block){ - for(int i = 0; i < 16; i++) - ScrapboxList.addItemStackToList(new ItemStack(block, 1 , i)); - } - static void addWireRecipes() { - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("copper", 6), - "XXX","CCC", "XXX", - 'C', "ingotCopper"); - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("tin", 9), - "XXX","CCC", "XXX", - 'C', "ingotTin"); - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("gold", 12), - "XXX","CCC", "XXX", - 'C', "ingotGold"); - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("hv", 8), - "XXX","CCC", "XXX", - 'C', ItemIngots.getIngotByName("refinediron")); - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("glassfiber", 6), - "GGG", - "SDS", - "GGG", - 'G', "blockGlass", - 'S', "ingotSilver", - 'D', Items.diamond); - CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("glassfiber", 4), - "GGG", - "RDR", - "GGG", - 'G', "blockGlass", - 'R', Items.redstone, - 'D', Items.diamond); - - CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedcopper"), ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("copper")); - CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedgold"), ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("gold")); - CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedhv"), ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("hv")); + static void registerDyable(Block block) + { + for (int i = 0; i < 16; i++) + ScrapboxList.addItemStackToList(new ItemStack(block, 1, i)); } + static void addWireRecipes() + { + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("copper", 6), "XXX", "CCC", "XXX", 'C', + "ingotCopper"); + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("tin", 9), "XXX", "CCC", "XXX", 'C', + "ingotTin"); + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("gold", 12), "XXX", "CCC", "XXX", 'C', + "ingotGold"); + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("hv", 8), "XXX", "CCC", "XXX", 'C', + ItemIngots.getIngotByName("refinediron")); + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("glassfiber", 6), "GGG", "SDS", "GGG", + 'G', "blockGlass", 'S', "ingotSilver", 'D', Items.diamond); + CraftingHelper.addShapedOreRecipe(ItemStandaloneCables.getCableByName("glassfiber", 4), "GGG", "RDR", "GGG", + 'G', "blockGlass", 'R', Items.redstone, 'D', Items.diamond); - private static void addCompressorRecipes() { - RecipeHandler.addRecipe(new CompressorRecipe(ItemParts.getPartByName("mixedmetalingot"), ItemParts.getPartByName("advancedAlloy"), 400, 20)); - RecipeHandler.addRecipe(new CompressorRecipe(ItemParts.getPartByName("carbonfiber"), ItemPlates.getPlateByName("carbon"), 400, 20)); + CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedcopper"), + ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("copper")); + CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedgold"), + ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("gold")); + CraftingHelper.addShapelessOreRecipe(ItemStandaloneCables.getCableByName("insulatedhv"), + ItemParts.getPartByName("rubber"), ItemStandaloneCables.getCableByName("hv")); + } + + private static void addCompressorRecipes() + { + RecipeHandler.addRecipe(new CompressorRecipe(ItemParts.getPartByName("mixedmetalingot"), + ItemParts.getPartByName("advancedAlloy"), 400, 20)); + RecipeHandler.addRecipe(new CompressorRecipe(ItemParts.getPartByName("carbonfiber"), + ItemPlates.getPlateByName("carbon"), 400, 20)); } - static void addExtractorRecipes() { - RecipeHandler.addRecipe(new ExtractorRecipe(ItemParts.getPartByName("rubberSap"), ItemParts.getPartByName("rubber", 3), 400, 20)); - RecipeHandler.addRecipe(new ExtractorRecipe(new ItemStack(ModBlocks.rubberLog), ItemParts.getPartByName("rubber"), 400, 20)); + static void addExtractorRecipes() + { + RecipeHandler.addRecipe(new ExtractorRecipe(ItemParts.getPartByName("rubberSap"), + ItemParts.getPartByName("rubber", 3), 400, 20)); + RecipeHandler.addRecipe( + new ExtractorRecipe(new ItemStack(ModBlocks.rubberLog), ItemParts.getPartByName("rubber"), 400, 20)); + } + + static void addIc2ReplacementReicpes() + { + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("pump"), "CEC", "CMC", "PTP", 'C', + ItemCells.getCellByName("empty"), 'T', new ItemStack(ModItems.treeTap), 'M', + new ItemStack(ModBlocks.MachineCasing), 'P', new ItemStack(Blocks.iron_bars), 'E', + ItemParts.getPartByName("electronicCircuit")); + } + + static void addGrinderRecipes() + { + // Vanilla + RecipeHandler.addRecipe( + new GrinderRecipe(new ItemStack(Blocks.iron_ore), ItemDusts.getDustByName("iron", 2), 100, 20)); + RecipeHandler.addRecipe( + new GrinderRecipe(new ItemStack(Blocks.gold_ore), ItemDusts.getDustByName("gold", 2), 100, 20)); + RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Items.coal), ItemDusts.getDustByName("coal"), 100, 20)); + RecipeHandler + .addRecipe(new GrinderRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 2), 100, 20)); + RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Items.bone), new ItemStack(Items.dye, 6, 15), 100, 20)); + RecipeHandler + .addRecipe(new GrinderRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand), 100, 20)); + RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint), 100, 20)); + + // TechReborn + RecipeHandler.addRecipe( + new GrinderRecipe(BlockOre2.getOreByName("copper"), ItemDusts.getDustByName("copper", 2), 100, 20)); + RecipeHandler.addRecipe( + new GrinderRecipe(BlockOre2.getOreByName("tin"), ItemDusts.getDustByName("tin", 2), 100, 20)); + RecipeHandler.addRecipe( + new GrinderRecipe(BlockOre.getOreByName("Lead"), ItemDusts.getDustByName("lead", 2), 100, 20)); + RecipeHandler.addRecipe( + new GrinderRecipe(BlockOre.getOreByName("Silver"), ItemDusts.getDustByName("silver", 2), 100, 20)); + RecipeHandler + .addRecipe(new GrinderRecipe(ItemGems.getGemByName("ruby"), ItemDusts.getDustByName("ruby"), 100, 20)); } - - static void addIc2ReplacementReicpes(){ - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("pump"), - "CEC", - "CMC", - "PTP", - 'C', ItemCells.getCellByName("empty"), - 'T', new ItemStack(ModItems.treeTap), - 'M', new ItemStack(ModBlocks.MachineCasing), - 'P', new ItemStack(Blocks.iron_bars), - 'E', ItemParts.getPartByName("electronicCircuit")); - } - - static void addGrinderRecipes(){ - //Vanilla - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.iron_ore), ItemDusts.getDustByName("iron", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.gold_ore), ItemDusts.getDustByName("gold", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Items.coal), ItemDusts.getDustByName("coal"), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.coal_ore), new ItemStack(Items.coal, 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Items.bone), new ItemStack(Items.dye, 6, 15), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.sand), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Blocks.gravel), new ItemStack(Items.flint), 100, 20)); - //TechReborn - RecipeHandler.addRecipe(new GrinderRecipe(BlockOre2.getOreByName("copper"), ItemDusts.getDustByName("copper", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(BlockOre2.getOreByName("tin"), ItemDusts.getDustByName("tin", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(BlockOre.getOreByName("Lead"), ItemDusts.getDustByName("lead", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(BlockOre.getOreByName("Silver"), ItemDusts.getDustByName("silver", 2), 100, 20)); - RecipeHandler.addRecipe(new GrinderRecipe(ItemGems.getGemByName("ruby"), ItemDusts.getDustByName("ruby"), 100, 20)); - } - public static ItemStack hammerStack = new ItemStack(ModItems.hammer, 1, OreDictionary.WILDCARD_VALUE); public static ItemStack batteryStack = new ItemStack(ModItems.reBattery, 1, OreDictionary.WILDCARD_VALUE); public static ItemStack crystalStack = new ItemStack(ModItems.energyCrystal, 1, OreDictionary.WILDCARD_VALUE); public static ItemStack lapcrystalStack = new ItemStack(ModItems.lapotronCrystal, 1, OreDictionary.WILDCARD_VALUE); public static ItemStack dyes = new ItemStack(Items.dye, 1, OreDictionary.WILDCARD_VALUE); - - - public static Item hammer = ModItems.hammer; - - static void addHammerRecipes(){ - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.hammer), - "III", - "ISI", - " S ", - 'S', Items.stick, - 'I', "ingotIron"); - - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("iron", 1), hammerStack, "ingotIron"); - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("copper", 1), hammerStack, "ingotCopper"); - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("tin", 1), hammerStack, "ingotTin"); - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("bronze", 1), hammerStack, "ingotBronze"); - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("brass", 1), hammerStack, "ingotBrass"); - CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("steel", 1), hammerStack, "ingotSteel"); - - - hammer.setContainerItem(hammer); - } - - static void addReactorRecipes(){ - FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium"), 40000000, 32768, 1024)); - FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium3"), 60000000, 32768, 2048)); - FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("Berylium"), ItemDusts.getDustByName("platinum"), 80000000, -2048, 1024)); - } - - static void addGeneralShapedRecipes() { - - // Storage Blocks - for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) { - CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName(name), - "AAA", "AAA", "AAA", - 'A', "ingot" + name.substring(0, 1).toUpperCase() + name.substring(1)); - } - - CraftingHelper.addShapelessOreRecipe(ItemParts.getPartByName("carbonmesh"), ItemDusts.getDustByName("coal"), ItemDusts.getDustByName("coal"), ItemDusts.getDustByName("coal"), ItemDusts.getDustByName("coal")); - CraftingHelper.addShapelessOreRecipe(ItemParts.getPartByName("carbonfiber"), ItemParts.getPartByName("carbonmesh"), ItemParts.getPartByName("carbonmesh")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("computerMonitor"), - "ADA", "DGD", "ADA", - 'D', dyes, - 'A', "ingotAluminum", - 'G', Blocks.glass_pane); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.reinforcedglass, 7), - "GAG", "GGG", "GAG", - 'A', ItemParts.getPartByName("advancedAlloy"), - 'G', Blocks.glass); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.windMill, 2), - "IXI", "XGX", "IXI", - 'I', "ingotIron", - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.waterMill), - "SWS", "WGW", "SWS", - 'S', Items.stick, - 'W', "plankWood", - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.hvt), - "XHX", "XMX", "XHX", - 'M', ModBlocks.mvt, - 'H', ItemStandaloneCables.getCableByName("insulatedhv")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mvt), - "XGX", "XMX", "XGX", - 'M', BlockMachineFrame.getFrameByName("machine", 1), - 'G', ItemStandaloneCables.getCableByName("insulatedgold")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.lvt), - "PWP", "CCC", "PPP", - 'P', "plankWood", - 'C', "ingotCopper", - 'W', ItemStandaloneCables.getCableByName("insulatedcopper")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 0), - "RRR", "CAC", "RRR", - 'R', ItemIngots.getIngotByName("refinedIron"), - 'C', ItemParts.getPartByName("electronicCircuit"), - 'A', BlockMachineFrame.getFrameByName("machine", 1)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 1), - "RRR", "CAC", "RRR", - 'R', "ingotSteel", - 'C', ItemParts.getPartByName("advancedCircuit"), - 'A', BlockMachineFrame.getFrameByName("advancedMachine", 1)); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataOrb"), - "DDD", "DID", "DDD", - 'D', ItemParts.getPartByName("dataStorageCircuit"), - 'I', ItemParts.getPartByName("dataControlCircuit")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataControlCircuit", 4), - "CDC", "DID", "CDC", - 'I', ItemPlates.getPlateByName("iridium"), - 'D', ItemParts.getPartByName("dataStorageCircuit"), - 'C', ItemParts.getPartByName("advancedCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.thermalGenerator), - "III", "IRI", "CGC", - 'I', ItemIngots.getIngotByName("invar"), - 'R', ModBlocks.reinforcedglass, - 'G', ModBlocks.Generator, - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.recycler), - "XEX", "DCD", "GDG", - 'D', Blocks.dirt, - 'C', ModBlocks.Compressor, - 'G', Items.glowstone_dust, - 'E', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.batBox), - "WCW", "BBB", "WWW", - 'W', "plankWood", - 'B', batteryStack, - 'C', ItemStandaloneCables.getCableByName("insulatedcopper")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mfe), - "GEG", "EME", "GEG", - 'M', BlockMachineFrame.getFrameByName("machine", 1), - 'E', crystalStack, - 'G', ItemStandaloneCables.getCableByName("insulatedgold")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mfsu), - "LAL", "LML", "LAL", - 'A', ItemParts.getPartByName("advancedCircuit"), - 'L', lapcrystalStack, - 'M', new ItemStack(ModBlocks.mfe)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.IndustrialElectrolyzer), - "RER", "CEC", "RER", - 'R', ItemIngots.getIngotByName("refinediron"), - 'E', new ItemStack(ModBlocks.Extractor), - 'C', ItemParts.getPartByName("advancedCircuit")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("mixedmetalingot", 2), - "RRR", "BBB", "TTT", - 'R', ItemIngots.getIngotByName("refinediron"), - 'B', "ingotBronze", - 'T', "ingotTin"); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Compressor), - "SXS", "SCS", "SMS", - 'C', ItemParts.getPartByName("electronicCircuit"), - 'M', BlockMachineFrame.getFrameByName("machine", 1), - 'S', Blocks.stone); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ElectricFurnace), - "XCX", "RFR", "XXX", - 'C', ItemParts.getPartByName("electronicCircuit"), - 'F', new ItemStack(ModBlocks.ironFurnace), - 'R', Items.redstone); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ironFurnace), - "III", "IXI", "III", - 'I', "ingotIron"); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ironFurnace), - "XIX", "IXI", "IFI", - 'I', "ingotIron", - 'F', Blocks.furnace); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("electronicCircuit"), - "WWW", "SRS", "WWW", - 'R', ItemIngots.getIngotByName("refinediron"), - 'S', Items.redstone, - 'W', ItemStandaloneCables.getCableByName("insulatedcopper")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.reBattery), - "XWX", "TRT", "TRT", - 'T', "ingotTin", - 'R', Items.redstone, - 'W', ItemStandaloneCables.getCableByName("insulatedcopper")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.wrench), - "BAB", "BBB", "ABA", - 'B', "ingotBronze"); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Extractor), - "TMT", "TCT", "XXX", - 'T', ModItems.treeTap, - 'M', BlockMachineFrame.getFrameByName("machine", 1), - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.centrifuge), - "RCR", "AEA", "RCR", - 'R', ItemIngots.getIngotByName("refinediron"), - 'E', new ItemStack(ModBlocks.Extractor), - 'A', BlockMachineFrame.getFrameByName("advancedMachine", 1), - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("advancedCircuit"), - "RGR", "LCL", "RGR", - 'R', Items.redstone, - 'G', Items.glowstone_dust, - 'L', "dyeBlue", - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.energyCrystal), - "RRR", "RDR", "RRR", - 'R', Items.redstone, - 'D', Items.diamond); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lapotronCrystal), - "LCL", "LEL", "LCL", - 'L', "dyeBlue", - 'E', new ItemStack(ModItems.energyCrystal), - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapelessOreRecipe(new ItemStack(ModBlocks.Generator), batteryStack, BlockMachineFrame.getFrameByName("machine", 1), Blocks.furnace); - - CraftingHelper.addShapedOreRecipe(BlockMachineFrame.getFrameByName("machine", 1), - "AAA", "AXA", "AAA", - 'A', ItemIngots.getIngotByName("refinediron")); - - CraftingHelper.addShapedOreRecipe(BlockMachineFrame.getFrameByName("advancedMachine", 1), - "XCX", "AMA", "XCX", - 'A', ItemParts.getPartByName("advancedAlloy"), - 'C', ItemPlates.getPlateByName("carbon"), - 'M', BlockMachineFrame.getFrameByName("machine", 1)); - - CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName("sapphire"), - "AAA", "AAA", "AAA", - 'A', "gemSapphire"); - - CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName("ruby"), - "AAA", "AAA", "AAA", - 'A', "gemRuby"); - - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataStorageCircuit"), - "EEE", "ECE", "EEE", - 'E', new ItemStack(Items.emerald), - 'C', ItemParts.getPartByName("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 4, 8), - "DSD", "S S", "DSD", - 'D', "dustDiamond", - 'S', "ingotSteel"); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 15), - "AAA", "AMA", "AAA", - 'A', "ingotAluminium", - 'M', new ItemStack(ModItems.parts, 1, 13)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Supercondensator), - "EOE", "SAS", "EOE", - 'E', ItemParts.getPartByName("energyFlowCircuit"), - 'O', ModItems.lapotronicOrb, - 'S', ItemParts.getPartByName("superconductor"), - 'A', ModBlocks.HighAdvancedMachineBlock); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("diamondSawBlade"), - "DSD", "S S", "DSD", - 'S', "plateSteel", - 'D', "dustDiamond"); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("tungstenGrindingHead", 2), - "TST", "SBS", "TST", - 'T', "plateTungsten", - 'S', "plateSteel", - 'B', "blockSteel"); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("destructoPack"), - "CIC", "IBI", "CIC", - 'C', ItemParts.getPartByName("basicCircuitBoard"), - 'I', "ingotAluminum", - 'B', new ItemStack(Items.lava_bucket) - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.cloakingDevice), - "CIC", "IOI", "CIC", - 'C', "ingotChrome", - 'I', "plateIridium", - 'O', new ItemStack(ModItems.lapotronicOrb) - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.treeTap), - " S ", - "PPP", - "P ", - 'S', "stickWood", - 'P', "plankWood"); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.rockCutter), - "DT ", "DT ", "DCB", - 'D', ItemParts.getPartByName("rockCutterBlade"), - 'T', "ingotTitanium", - 'C', ItemParts.getPartByName("basicCircuitBoard"), - 'B', new ItemStack(Items.diamond) - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("rockCutterBlade"), - "SDS", "SDS", "SDS", - 'D', new ItemStack(Items.diamond), - 'S', "ingotSteel" - ); - - for (String part : ItemParts.types) { - if (part.endsWith("Gear")) { - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName(part), - " O ", "OIO", " O ", - 'I', new ItemStack(Items.iron_ingot), - 'O', "ingot" + capitalizeFirstLetter(part.replace("Gear", "")) - ); - } - } - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("nichromeHeatingCoil"), - " N ", "NCN", " N ", - 'N', "ingotNickel", - 'C', "ingotChrome" - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("kanthalHeatingCoil"), - "III", "CAA", "AAA", - 'I', "ingotSteel", - 'C', "ingotChrome", - 'A', "ingotAluminum" - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("heliumCoolantSimple"), - " T ", "TCT", " T ", - 'T', "ingotTin", - 'C', ItemCells.getCellByName("helium", 1, false) - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("HeliumCoolantTriple"), - "TTT", "CCC", "TTT", - 'T', "ingotTin", - 'C', ItemParts.getPartByName("heliumCoolantSimple") - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("HeliumCoolantSix"), - "THT", "TCT", "THT", - 'T', "ingotTin", - 'C', "ingotCopper", - 'H', ItemParts.getPartByName("HeliumCoolantTriple") - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantTriple"), - "TTT", "CCC", "TTT", - 'T', "ingotTin", - 'C', ItemParts.getPartByName("NaKCoolantSimple") - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantSix"), - "THT", "TCT", "THT", - 'T', "ingotTin", - 'C', "ingotCopper", - 'H', ItemParts.getPartByName("NaKCoolantTriple") - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Aesu), - "LLL", "LCL", "LLL", - 'L', new ItemStack(ModItems.lapotronicOrb), - 'C', new ItemStack(ModBlocks.ComputerCube) - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Idsu), - "PAP", "ACA", "PAP", - 'P', ItemPlates.getPlateByName("iridium"), - 'C', new ItemStack(Blocks.ender_chest), - 'A', new ItemStack(ModBlocks.Aesu) - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.FusionControlComputer), - "CCC", "PTP", "CCC", - 'P', new ItemStack(ModBlocks.ComputerCube), - 'T', new ItemStack(ModBlocks.FusionCoil), - 'C', ItemParts.getPartByName("energyFlowCircuit") - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.LightningRod), - "CAC", "ACA", "CAC", - 'A', new ItemStack(ModBlocks.MachineCasing, 1, 2), - 'S', ItemParts.getPartByName("superConductor"), - 'C', ItemParts.getPartByName("energyFlowCircuit") - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.FusionCoil), - "CSC", "NAN", "CRC", - 'A', new ItemStack(ModBlocks.MachineCasing, 1, 2), - 'N', ItemParts.getPartByName("nichromeHeatingCoil"), - 'C', ItemParts.getPartByName("energyFlowCircuit"), - 'S', ItemParts.getPartByName("superConductor"), - 'R', ItemParts.getPartByName("iridiumNeutronReflector") - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("iridiumNeutronReflector"), - "PPP", "PIP", "PPP", - 'P', ItemParts.getPartByName("thickNeutronReflector"), - 'I', "ingotIridium" - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("thickNeutronReflector"), - " P ", "PCP", " P ", - 'P', ItemParts.getPartByName("neutronReflector"), - 'C', ItemCells.getCellByName("Berylium") - ); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("neutronReflector"), - "TCT", "CPC", "TCT", - 'T', "dustTin", - 'C', "dustCoal", - 'P', "plateCopper" - ); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.scrapBox), - "SSS", "SSS", "SSS", - 'S', ItemParts.getPartByName("scrap") - ); - - Core.logHelper.info("Shapped Recipes Added"); - } - - public static String capitalizeFirstLetter(String original) { - if (original.length() == 0) - return original; - return original.substring(0, 1).toUpperCase() + original.substring(1); - } - - static void addShapelessRecipes() { - for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) { - ItemStack item = null; - try { - item = ItemIngots.getIngotByName(name, 9); - } catch (InvalidParameterException e) { - try { - item = ItemGems.getGemByName(name, 9); - } catch (InvalidParameterException e2) { - continue; - } - } - - if (item == null) { - continue; - } - - GameRegistry.addShapelessRecipe(BlockStorage.getStorageBlockByName(name), item, item, item, item, item, item, item, item, item); - GameRegistry.addShapelessRecipe(item, BlockStorage.getStorageBlockByName(name, 9)); - } - - GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.rubberPlanks, 4), ModBlocks.rubberLog); - - for (String name : ItemDustsSmall.types) { - GameRegistry.addShapelessRecipe(ItemDustsSmall.getSmallDustByName(name, 4), ItemDusts.getDustByName(name)); - GameRegistry.addShapelessRecipe(ItemDusts.getDustByName(name, 1), ItemDustsSmall.getSmallDustByName(name), ItemDustsSmall.getSmallDustByName(name), ItemDustsSmall.getSmallDustByName(name), ItemDustsSmall.getSmallDustByName(name)); - } - - Core.logHelper.info("Shapless Recipes Added"); - } - - static void addMachineRecipes() { - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumTank), - "EPE", "PCP", "EPE", - 'P', "ingotPlatinum", - 'E', ItemParts.getPartByName("advancedCircuit"), - 'C', ModBlocks.quantumChest); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.digitalChest), - "PPP", "PDP", "PCP", - 'P', "plateAluminum", - 'D', ItemParts.getPartByName("dataOrb"), - 'C', ItemParts.getPartByName("computerMonitor")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.digitalChest), - "PPP", "PDP", "PCP", - 'P', "plateSteel", - 'D', ItemParts.getPartByName("dataOrb"), - 'C', ItemParts.getPartByName("computerMonitor")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.AlloySmelter), - "XCX", "FMF", "XXX", - 'C', ItemParts.getPartByName("electronicCircuit"), - 'F', new ItemStack(ModBlocks.ElectricFurnace), - 'M', BlockMachineFrame.getFrameByName("machine", 1)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.LesuStorage), - "LLL", "LCL", "LLL", - 'L', "blockLapis", - 'C', ItemParts.getPartByName("electronicCircuit")); - - TechRebornAPI.addRollingOreMachinceRecipe(ItemParts.getPartByName("cupronickelHeatingCoil"), - "NCN", "C C", "NCN", - 'N', "ingotCupronickel", - 'C', "ingotCopper"); - - - RecipeHandler.addRecipe(new VacuumFreezerRecipe(ItemIngots.getIngotByName("hotTungstensteel"), ItemIngots.getIngotByName("tungstensteel"), 440, 128)); - RecipeHandler.addRecipe(new VacuumFreezerRecipe(ItemCells.getCellByName("water"), ItemCells.getCellByName("cell"), 60, 128)); - } - - static void addSmeltingRecipes() { - GameRegistry.addSmelting(ItemDusts.getDustByName("iron", 1), new ItemStack(Items.iron_ingot), 1F); - GameRegistry.addSmelting(ItemDusts.getDustByName("gold", 1), new ItemStack(Items.gold_ingot), 1F); - GameRegistry.addSmelting(ItemParts.getPartByName("rubberSap"), ItemParts.getPartByName("rubber"), 1F); - GameRegistry.addSmelting(new ItemStack(Items.iron_ingot), ItemIngots.getIngotByName("refinediron"), 1F); - GameRegistry.addSmelting(BlockOre2.getOreByName("copper"), ItemIngots.getIngotByName("copper"), 1F); - GameRegistry.addSmelting(BlockOre2.getOreByName("tin"), ItemIngots.getIngotByName("tin"), 1F); - - Core.logHelper.info("Smelting Recipes Added"); - } - - static void addAlloySmelterRecipes() { - - //Bronze - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemDusts.getDustByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemIngots.getIngotByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); - - //Electrum - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), ItemIngots.getIngotByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), ItemDusts.getDustByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("gold", 1), ItemIngots.getIngotByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("gold", 1), ItemDusts.getDustByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); - - //Invar - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 2), ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 2), ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("iron", 2), ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("iron", 2), ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); - - //Cupronickel - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 1), ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 1), ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 1), ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 1), ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); - - //Nichrome - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("chrome", 1), ItemIngots.getIngotByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("chrome", 1), ItemDusts.getDustByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("chrome", 1), ItemIngots.getIngotByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("chrome", 1), ItemDusts.getDustByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); - - //Magnalium - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("magnesium", 1), ItemIngots.getIngotByName("aluminum", 4), ItemIngots.getIngotByName("magnalium", 3), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("magnesium", 1), ItemDusts.getDustByName("aluminum", 4), ItemIngots.getIngotByName("magnalium", 3), 200, 16)); - - //Battery Alloy - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("lead", 4), ItemIngots.getIngotByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("lead", 4), ItemDusts.getDustByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("lead", 4), ItemIngots.getIngotByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("lead", 4), ItemDusts.getDustByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); - - //Brass - if (OreUtil.doesOreExistAndValid("ingotBrass")) { - ItemStack brassStack = OreDictionary.getOres("ingotBrass").get(0); - brassStack.stackSize = 4; - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("zinc", 1), brassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemDusts.getDustByName("zinc", 1), brassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemIngots.getIngotByName("zinc", 1), brassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("zinc", 1), brassStack, 200, 16)); - } - - //Red Alloy - if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) { - ItemStack redAlloyStack = OreDictionary.getOres("ingotRedAlloy").get(0); - redAlloyStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 4), ItemIngots.getIngotByName("copper", 1), redAlloyStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 4), new ItemStack(Items.iron_ingot, 1), redAlloyStack, 200, 16)); - } - - //Blue Alloy - if (OreUtil.doesOreExistAndValid("ingotBlueAlloy")) { - ItemStack blueAlloyStack = OreDictionary.getOres("ingotBlueAlloy").get(0); - blueAlloyStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("teslatite", 4), ItemIngots.getIngotByName("silver", 1), blueAlloyStack, 200, 16)); - } - - //Blue Alloy - if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) { - ItemStack purpleAlloyStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); - purpleAlloyStack.stackSize = 1; - ItemStack infusedTeslatiteStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); - infusedTeslatiteStack.stackSize = 8; - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("redAlloy", 1), ItemIngots.getIngotByName("blueAlloy", 1), purpleAlloyStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), infusedTeslatiteStack, purpleAlloyStack, 200, 16)); - } - - //Aluminum Brass - if (OreUtil.doesOreExistAndValid("ingotAluminumBrass")) { - ItemStack aluminumBrassStack = OreDictionary.getOres("ingotAluminumBrass").get(0); - aluminumBrassStack.stackSize = 4; - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), ItemDusts.getDustByName("aluminum", 1), aluminumBrassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("aluminum", 1), aluminumBrassStack, 200, 16)); - } - - //Manyullyn - if (OreUtil.doesOreExistAndValid("ingotManyullyn") && OreUtil.doesOreExistAndValid("ingotCobalt") && OreUtil.doesOreExistAndValid("ingotArdite")) { - ItemStack manyullynStack = OreDictionary.getOres("ingotManyullyn").get(0); - manyullynStack.stackSize = 1; - ItemStack cobaltStack = OreDictionary.getOres("ingotCobalt").get(0); - cobaltStack.stackSize = 1; - ItemStack arditeStack = OreDictionary.getOres("ingotArdite").get(0); - arditeStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(cobaltStack, arditeStack, manyullynStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(cobaltStack, ItemDusts.getDustByName("ardite", 1), manyullynStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("cobalt", 1), arditeStack, manyullynStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("cobalt", 1), ItemDusts.getDustByName("ardite", 1), manyullynStack, 200, 16)); - } - - //Conductive Iron - if (OreUtil.doesOreExistAndValid("ingotConductiveIron")) { - ItemStack conductiveIronStack = OreDictionary.getOres("ingotConductiveIron").get(0); - conductiveIronStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 1), new ItemStack(Items.iron_ingot, 1), conductiveIronStack, 200, 16)); - } - - //Redstone Alloy - if (OreUtil.doesOreExistAndValid("ingotRedstoneAlloy") && OreUtil.doesOreExistAndValid("itemSilicon")) { - ItemStack redstoneAlloyStack = OreDictionary.getOres("ingotRedstoneAlloy").get(0); - redstoneAlloyStack.stackSize = 1; - ItemStack siliconStack = OreDictionary.getOres("itemSilicon").get(0); - siliconStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 1), siliconStack, redstoneAlloyStack, 200, 16)); - } - - //Pulsating Iron - if (OreUtil.doesOreExistAndValid("ingotPhasedIron")) { - ItemStack pulsatingIronStack = OreDictionary.getOres("ingotPhasedIron").get(0); - pulsatingIronStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 1), new ItemStack(Items.ender_pearl, 1), pulsatingIronStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 1), ItemDusts.getDustByName("enderPearl", 1), pulsatingIronStack, 200, 16)); - } - - //Vibrant Alloy - if (OreUtil.doesOreExistAndValid("ingotEnergeticAlloy") && OreUtil.doesOreExistAndValid("ingotPhasedGold")) { - ItemStack energeticAlloyStack = OreDictionary.getOres("ingotEnergeticAlloy").get(0); - energeticAlloyStack.stackSize = 1; - ItemStack vibrantAlloyStack = OreDictionary.getOres("ingotPhasedGold").get(0); - vibrantAlloyStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(energeticAlloyStack, new ItemStack(Items.ender_pearl, 1), vibrantAlloyStack, 200, 16)); - RecipeHandler.addRecipe(new AlloySmelterRecipe(energeticAlloyStack, ItemDusts.getDustByName("enderPearl", 1), vibrantAlloyStack, 200, 16)); - } - - //Soularium - if (OreUtil.doesOreExistAndValid("ingotSoularium")) { - ItemStack soulariumStack = OreDictionary.getOres("ingotSoularium").get(0); - soulariumStack.stackSize = 1; - RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Blocks.soul_sand, 1), new ItemStack(Items.gold_ingot, 1), soulariumStack, 200, 16)); - } - - } - - static void addPlateCuttingMachineRecipes() { - - for(String ore : OreUtil.oreNames){ - if(OreUtil.hasBlock(ore) && OreUtil.hasPlate(ore)){ - RecipeHandler.addRecipe(new PlateCuttingMachineRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), OreUtil.getStackFromName("plate" + capitalizeFirstLetter(ore), 9), 200, 16)); - } - } - - //Obsidian - RecipeHandler.addRecipe(new PlateCuttingMachineRecipe(new ItemStack(Blocks.obsidian), ItemPlates.getPlateByName("obsidian", 9), 100, 4)); - } - - static void addIndustrialSawmillRecipes() { - ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 0), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 1), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 2), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 3), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 4), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 5), pulpStack, null, 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(Blocks.planks, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); - } - - static void addBlastFurnaceRecipes() { - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("titanium"), null, ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("titanium", 4), null, ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("titanium", 9), null, ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("aluminum"), null, ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("aluminum", 4), null, ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("aluminum", 9), null, ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("kanthal"), null, ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("kanthal", 4), null, ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("kanthal", 9), null, ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("tungsten"), null, ItemIngots.getIngotByName("tungsten"), null, 18000, 120, 2500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("tungsten", 4), null, ItemIngots.getIngotByName("tungsten"), null, 18000, 120, 2500)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("tungsten", 9), null, ItemIngots.getIngotByName("tungsten"), null, 18000, 120, 2500)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("chrome"), null, ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("chrome", 4), null, ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("chrome", 9), null, ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("steel"), null, ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("steel", 4), null, ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); -// RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("steel", 9), null, ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); - - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("galena", 2), null, ItemIngots.getIngotByName("silver"), ItemIngots.getIngotByName("lead"), 80, 120, 1500)); - - RecipeHandler.addRecipe(new BlastFurnaceRecipe(new ItemStack(Items.iron_ingot), ItemDusts.getDustByName("coal", 2), ItemIngots.getIngotByName("steel"), ItemDusts.getDustByName("darkAshes", 2), 500, 120, 1000)); - - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemIngots.getIngotByName("tungsten"), ItemIngots.getIngotByName("steel"), ItemIngots.getIngotByName("hotTungstensteel"), ItemDusts.getDustByName("darkAshes", 4), 500, 500, 3000)); - - RecipeHandler.addRecipe(new BlastFurnaceRecipe(new ItemStack(Blocks.iron_ore), ItemDusts.getDustByName("calcite"), new ItemStack(Items.iron_ingot, 3), ItemDusts.getDustByName("darkAshes"), 140, 120, 1000)); - - RecipeHandler.addRecipe(new BlastFurnaceRecipe(BlockOre.getOreByName("Pyrite"), ItemDusts.getDustByName("calcite"), new ItemStack(Items.iron_ingot, 2), ItemDusts.getDustByName("darkAshes"), 140, 120, 1000)); - } - - static void addUUrecipes() { - - - if (ConfigTechReborn.UUrecipesWood) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.log, 8), - " U ", - " ", - " ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesStone) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.stone, 16), - " ", - " U ", - " ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesSnowBlock) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.snow, 16), - "U U", - " ", - " ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesGrass) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.grass, 16), - " ", - "U ", - "U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesObsidian) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.obsidian, 12), - "U U", - "U U", - " ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesGlass) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.glass, 32), - " U ", - "U U", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesCocoa) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 32, 3), - "UU ", - " U", - "UU ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesGlowstoneBlock) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.glowstone, 8), - " U ", - "U U", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesCactus) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.cactus, 48), - " U ", - "UUU", - "U U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesSugarCane) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.reeds, 48), - "U U", - "U U", - "U U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesVine) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.vine, 24), - "U ", - "U ", - "U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesSnowBall) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.snowball, 16), - " ", - " ", - "UUU", - 'U', ModItems.uuMatter); - - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.clay_ball, 48), - "UU ", - "U ", - "UU ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipeslilypad) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.waterlily, 64), - "U U", - " U ", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesGunpowder) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.gunpowder, 15), - "UUU", - "U ", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesBone) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.bone, 32), - "U ", - "UU ", - "U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesFeather) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.feather, 32), - " U ", - " U ", - "U U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesInk) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 48), - " UU", - " UU", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesEnderPearl) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.ender_pearl, 1), - "UUU", - "U U", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesCoal) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.coal, 5), - " U", - "U ", - " U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesIronOre) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.iron_ore, 2), - "U U", - " U ", - "U U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesGoldOre) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.gold_ore, 2), - " U ", - "UUU", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesRedStone) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.redstone, 24), - " ", - " U ", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesLapis) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 9, 4), - " U ", - " U ", - " UU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesEmeraldOre) - CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.emerald_ore, 1), - "UU ", - "U U", - " UU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesEmerald) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.emerald, 2), - "UUU", - "UUU", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesDiamond) - CraftingHelper.addShapedOreRecipe(new ItemStack(Items.diamond, 1), - "UUU", - "UUU", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesTinDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 10, 77), - " ", - "U U", - " U", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesCopperDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 10, 21), - " U", - "U U", - " ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesLeadDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 14, 42), - "UUU", - "UUU", - "U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesPlatinumDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 1, 58), - " U", - "UUU", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesTungstenDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 1, 79), - "U ", - "UUU", - "UUU", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesTitaniumDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 2, 78), - "UUU", - " U ", - " U ", - 'U', ModItems.uuMatter); - - if (ConfigTechReborn.UUrecipesAluminumDust) - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 16, 2), - " U ", - " U ", - "UUU", - 'U', ModItems.uuMatter); - - - if (ConfigTechReborn.HideUuRecipes) - hideUUrecipes(); - - } - - static void hideUUrecipes() { - //TODO - } - - static void addIndustrialCentrifugeRecipes() { - - //Mycelium Byproducts - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.mycelium, 8), null, new ItemStack(Blocks.brown_mushroom, 2), new ItemStack(Blocks.red_mushroom, 2), new ItemStack(Items.clay_ball, 1), new ItemStack(Blocks.sand, 4), 1640, 5)); - - //Blaze Powder Byproducts - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.blaze_powder), null, ItemDusts.getDustByName("darkAshes", 1), ItemDusts.getDustByName("sulfur", 1), null, null, 1240, 5)); - - //Magma Cream Products - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.magma_cream, 1), null, new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.slime_ball, 1), null, null, 2500, 5)); - - //Dust Byproducts -// RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("platinum", 1), null, ItemDustsTiny.getTinyDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), null, null, 3000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("electrum", 2), null, ItemDusts.getDustByName("silver", 1), ItemDusts.getDustByName("gold", 1), null, null, 2400, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("invar", 3), null, ItemDusts.getDustByName("iron", 2), ItemDusts.getDustByName("nickel", 1), null, null, 1340, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("marble", 8), null, ItemDusts.getDustByName("magnesium", 1), ItemDusts.getDustByName("calcite", 7), null, null, 1280, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("redrock", 4), null, ItemDusts.getDustByName("calcite", 2), ItemDusts.getDustByName("flint", 1), ItemDusts.getDustByName("clay", 1), null, 640, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("basalt", 16), null, ItemDusts.getDustByName("peridot", 1), ItemDusts.getDustByName("calcite", 3), ItemDusts.getDustByName("magnesium", 8), ItemDusts.getDustByName("darkAshes", 4), 2680, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("yellowGarnet", 16), null, ItemDusts.getDustByName("andradite", 5), ItemDusts.getDustByName("grossular", 8), ItemDusts.getDustByName("uvarovite", 3), null, 2940, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("redGarnet", 16), null, ItemDusts.getDustByName("pyrope", 3), ItemDusts.getDustByName("almandine", 5), ItemDusts.getDustByName("spessartine", 8), null, 2940, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("darkAshes", 2), null, ItemDusts.getDustByName("ashes", 2), null, null, null, 240, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("manyullyn", 2), null, ItemDusts.getDustByName("cobalt", 1), ItemDusts.getDustByName("ardite", 1), null, null, 1240, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("nichrome", 5), null, ItemDusts.getDustByName("nickel", 4), ItemDusts.getDustByName("chrome", 1), null, null, 2240, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("cupronickel", 2), null, ItemDusts.getDustByName("copper", 1), ItemDusts.getDustByName("nickel", 1), null, null, 960, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("kanthal", 3), null, ItemDusts.getDustByName("iron", 1), ItemDusts.getDustByName("aluminum", 1), ItemDusts.getDustByName("chrome", 1), null, 1040, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("brass", 4), null, ItemDusts.getDustByName("zinc", 1), ItemDusts.getDustByName("copper", 3), null, null, 2000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("aluminumBrass", 4), null, ItemDusts.getDustByName("aluminum", 1), ItemDusts.getDustByName("copper", 3), null, null, 2000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("bronze", 4), null, ItemDusts.getDustByName("tin", 1), ItemDusts.getDustByName("copper", 3), null, null, 2420, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("netherrack", 16), null, new ItemStack(Items.redstone, 1), ItemDusts.getDustByName("sulfur", 4), ItemDusts.getDustByName("basalt", 1), new ItemStack(Items.gold_nugget, 1), 2400, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("enderEye", 1), null, ItemDusts.getDustByName("enderPearl", 1), new ItemStack(Items.blaze_powder, 1), null, null, 1280, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("tetrahedrite", 8), null, ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("antimony", 1), ItemDusts.getDustByName("sulfur", 3), ItemDusts.getDustByName("iron", 1), 3640, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("lapis", 16), null, ItemDusts.getDustByName("lazurite", 12), ItemDusts.getDustByName("sodalite", 2), ItemDusts.getDustByName("pyrite", 7), ItemDusts.getDustByName("calcite", 1), 3580, 5)); - - - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.glowstone_dust, 16), RecipeUtils.getEmptyCell(1), ItemCells.getCellByName("helium", 1, false), ItemDusts.getDustByName("gold", 8), new ItemStack(Items.redstone), null, 25000, 20)); -// RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("endstone", 16), RecipeUtils.getEmptyCell(2), ItemCells.getCellByName("helium3", 1, false), ItemCells.getCellByName("helium", 1, false), ItemDustsTiny.getTinyDustByName("Tungsten"), new ItemStack(Blocks.sand, 12), 4800, 5)); - } - - static void addIndustrialGrinderRecipes() { - for(String ore : OreUtil.oreNames){ - if(OreUtil.hasIngot(ore) && OreUtil.hasDustSmall(ore) && OreUtil.hasBlock(ore)){ - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), null, new FluidStack(FluidRegistry.WATER, 1000), OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), new ItemStack(Items.water_bucket), null, OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), new ItemStack(Items.bucket), 100, 120)); - } - } - - //Copper Ore - if (OreUtil.doesOreExistAndValid("oreCopper")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCopper").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("copper", 2), ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("copper", 2), ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDusts.getDustByName("nickel", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDusts.getDustByName("nickel", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Copper Ore"); - } - } - - //Tin Ore - if (OreUtil.doesOreExistAndValid("oreTin")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTin").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Tin Ore"); - } - } - - //Nickel Ore - if (OreUtil.doesOreExistAndValid("oreNickel")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreNickel").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("nickel", 3), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("nickel", 3), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("platinum", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("platinum", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Nickel Ore"); - } - } - - //Zinc Ore - if (OreUtil.doesOreExistAndValid("oreZinc")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreZinc").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Zinc Ore"); - } - } - - //Silver Ore - if (OreUtil.doesOreExistAndValid("oreSilver")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreSilver").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("silver", 2), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("silver", 2), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Silver Ore"); - } - } - - //Lead Ore - if (OreUtil.doesOreExistAndValid("oreLead")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreLead").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("lead", 2), ItemDustsSmall.getSmallDustByName("Silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("lead", 2), ItemDustsSmall.getSmallDustByName("Silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); - } - } - - //Apatite Ore - if (OreUtil.doesOreExistAndValid("oreApatite") & OreUtil.doesOreExistAndValid("gemApatite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreApatite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemApatite").get(0); - gemStack.stackSize = 6; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Apatite Ore"); - } - } - - //Nether Quartz Ore - if (OreUtil.doesOreExistAndValid("dustNetherQuartz")) { - try { - ItemStack dustStack = OreDictionary.getOres("dustNetherQuartz").get(0); - dustStack.stackSize = 4; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Items.quartz, 2), dustStack, ItemDustsSmall.getSmallDustByName("Netherrack", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), new ItemStack(Items.water_bucket), null, new ItemStack(Items.quartz, 2), dustStack, ItemDustsSmall.getSmallDustByName("Netherrack", 2), new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Nether Quartz Ore"); - } - } - - //Certus Quartz Ore - if (OreUtil.doesOreExistAndValid("oreCertusQuartz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCertusQuartz").get(0); - ItemStack gemStack = OreDictionary.getOres("crystalCertusQuartz").get(0); - ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); - dustStack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); - } - } - - //Charged Certus Quartz Ore - if (OreUtil.doesOreExistAndValid("oreChargedCertusQuartz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreChargedCertusQuartz").get(0); - ItemStack gemStack = OreDictionary.getOres("crystalChargedCertusQuartz").get(0); - ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); - dustStack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Charged Certus Quartz Ore"); - } - } - - //Amethyst Ore - if (OreUtil.doesOreExistAndValid("oreAmethyst") && OreUtil.doesOreExistAndValid("gemAmethyst")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreAmethyst").get(0); - ItemStack gemStack = OreDictionary.getOres("gemAmethyst").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemAmethyst").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); - } - } - - //Topaz Ore - if (OreUtil.doesOreExistAndValid("oreTopaz") && OreUtil.doesOreExistAndValid("gemTopaz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTopaz").get(0); - ItemStack gemStack = OreDictionary.getOres("gemTopaz").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemTopaz").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Topaz Ore"); - } - } - - //Tanzanite Ore - if (OreUtil.doesOreExistAndValid("oreTanzanite") && OreUtil.doesOreExistAndValid("gemTanzanite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTanzanite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemTanzanite").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemTanzanite").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Tanzanite Ore"); - } - } - - //Malachite Ore - if (OreUtil.doesOreExistAndValid("oreMalachite") && OreUtil.doesOreExistAndValid("gemMalachite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreMalachite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemMalachite").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemMalachite").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Malachite Ore"); - } - } - - //Galena Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDusts.getDustByName("silver", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDusts.getDustByName("silver", 1), new ItemStack(Items.bucket), 100, 120)); - - - //Ruby Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("ruby", 1), ItemDustsSmall.getSmallDustByName("Ruby", 6), ItemDustsSmall.getSmallDustByName("Chrome", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), new ItemStack(Items.water_bucket), null, ItemGems.getGemByName("ruby", 1), ItemDustsSmall.getSmallDustByName("Ruby", 6), ItemDustsSmall.getSmallDustByName("Chrome", 2), new ItemStack(Items.bucket), 100, 120)); - - //Sapphire Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("sapphire", 1), ItemDustsSmall.getSmallDustByName("Sapphire", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), new ItemStack(Items.water_bucket), null, ItemGems.getGemByName("sapphire", 1), ItemDustsSmall.getSmallDustByName("Sapphire", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), new ItemStack(Items.bucket), 100, 120)); - - //Bauxite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("bauxite", 2), ItemDustsSmall.getSmallDustByName("Grossular", 4), ItemDustsSmall.getSmallDustByName("Titanium", 4), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("bauxite", 2), ItemDustsSmall.getSmallDustByName("Grossular", 4), ItemDustsSmall.getSmallDustByName("Titanium", 4), new ItemStack(Items.bucket), 100, 120)); - - //Pyrite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("pyrite", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Phosphorous", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("pyrite", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Phosphorous", 1), new ItemStack(Items.bucket), 100, 120)); - - //Cinnabar Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("cinnabar", 2), ItemDustsSmall.getSmallDustByName("Redstone", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("cinnabar", 2), ItemDustsSmall.getSmallDustByName("Redstone", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), new ItemStack(Items.bucket), 100, 120)); - - //Sphalerite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("sphalerite", 2), ItemDustsSmall.getSmallDustByName("Zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("sphalerite", 2), ItemDustsSmall.getSmallDustByName("Zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("sphalerite", 2), ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("sphalerite", 2), ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), new ItemStack(Items.bucket), 100, 120)); - - //Tungsten Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDusts.getDustByName("silver", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDusts.getDustByName("silver", 2), new ItemStack(Items.bucket), 100, 120)); - - //Sheldonite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("platinum", 2), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("platinum", 2), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), null, new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("platinum", 3), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), new ItemStack(ModItems.bucketMercury), null, ItemDusts.getDustByName("platinum", 3), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), new ItemStack(Items.bucket), 100, 120)); - - //Peridot Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), null, new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("peridot", 1), ItemDustsSmall.getSmallDustByName("Peridot", 6), ItemDustsSmall.getSmallDustByName("Pyrope", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), new ItemStack(Items.water_bucket), null, ItemGems.getGemByName("peridot", 1), ItemDustsSmall.getSmallDustByName("Peridot", 6), ItemDustsSmall.getSmallDustByName("Pyrope", 2), new ItemStack(Items.bucket), 100, 120)); - - //Sodalite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("sodalite", 12), ItemDustsSmall.getSmallDustByName("Lazurite", 4), ItemDustsSmall.getSmallDustByName("Lapis", 4), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("sodalite", 12), ItemDustsSmall.getSmallDustByName("Lazurite", 4), ItemDustsSmall.getSmallDustByName("Lapis", 4), new ItemStack(Items.bucket), 100, 120)); - - //Tetrahedrite Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), null, new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("tetrahedrite", 2), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("tetrahedrite", 2), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), null, new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("tetrahedrite", 3), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("tetrahedrite", 3), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), new ItemStack(Items.bucket), 100, 120)); - } - - static void addImplosionCompressorRecipes() { - } - - static void addChemicalReactorRecipes() { - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("calcium", 1), ItemCells.getCellByName("carbon", 1), ItemCells.getCellByName("calciumCarbonate", 2), 240, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_nugget, 8), new ItemStack(Items.melon, 1), new ItemStack(Items.speckled_melon, 1), 40, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrogen", 1), ItemCells.getCellByName("carbon", 1), ItemCells.getCellByName("nitrocarbon", 2), 1500, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("carbon", 1), ItemCells.getCellByName("hydrogen", 4), ItemCells.getCellByName("methane", 5), 3500, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sulfur", 1), ItemCells.getCellByName("sodium", 1), ItemCells.getCellByName("sodiumSulfide", 2), 100, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.ender_pearl, 1), new ItemStack(Items.ender_eye, 1), 40, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_nugget, 8), new ItemStack(Items.carrot, 1), new ItemStack(Items.golden_carrot, 1), 40, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("glyceryl", 1), ItemCells.getCellByName("diesel", 4), ItemCells.getCellByName("nitroDiesel", 5), 1000, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_ingot, 8), new ItemStack(Items.apple, 1), new ItemStack(Items.golden_apple, 1), 40, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Blocks.gold_block, 8), new ItemStack(Items.apple, 1), new ItemStack(Items.golden_apple, 1, 1), 40, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.slime_ball, 1), new ItemStack(Items.magma_cream, 1), 40, 30)); - } - - static void addIndustrialElectrolyzerRecipes() { - - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("nitrocarbon", 2), - null, - ItemCells.getCellByName("nitrogen"), - ItemCells.getCellByName("carbon"), - null, - null, - 80, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("pyrite", 3), - null, - ItemDusts.getDustByName("iron"), - ItemDusts.getDustByName("sulfur"), - null, - null, - 120, 128 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("sphalerite", 2), - null, - ItemDusts.getDustByName("zinc"), - ItemDusts.getDustByName("sulfur"), - null, - null, - 150, 100 - )); - - - } - - static void addIc2Recipes(){ - CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.manual), ItemIngots.getIngotByName("refinedIron"), Items.book); - - CraftingHelper.addShapedOreRecipe( - ItemParts.getPartByName("machineParts", 16), - "CSC", "SCS", "CSC", - 'S', "ingotSteel", - 'C', TechRebornAPI.recipeCompact.getItem("electronicCircuit")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("energyFlowCircuit", 4), - "ATA", "LIL", "ATA", - 'T', "ingotTungsten", - 'I', "plateIridium", - 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), - 'L', TechRebornAPI.recipeCompact.getItem("lapotronCrystal")); - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("superconductor", 4), - "CCC", "TIT", "EEE", - 'E', ItemParts.getPartByName("energyFlowCircuit"), - 'C', ItemParts.getPartByName("heliumCoolantSimple"), - 'T', "ingotTungsten", - 'I', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lapotronicOrb), - "LLL", "LPL", "LLL", - 'L', new ItemStack(TechRebornAPI.recipeCompact.getItem("lapotronCrystal").getItem(), 1, OreDictionary.WILDCARD_VALUE), - 'P', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.industrialSawmill), - "PAP", - "SSS", - "ACA", - 'P', ItemIngots.getIngotByName("refinedIron"), - 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), - 'S', ItemParts.getPartByName("diamondSawBlade"), - 'C', TechRebornAPI.recipeCompact.getItem("advancedMachine")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ComputerCube), - "DME", "MAM", "EMD", - 'E', ItemParts.getPartByName("energyFlowCircuit"), - 'D', ItemParts.getPartByName("dataOrb"), - 'M', ItemParts.getPartByName("computerMonitor"), - 'A', TechRebornAPI.recipeCompact.getItem("advancedMachine")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MatterFabricator), - "ETE", "AOA", "ETE", - 'E', ItemParts.getPartByName("energyFlowCircuit"), - 'T', ModBlocks.Extractor, - 'A', ModBlocks.HighAdvancedMachineBlock, - 'O', ModItems.lapotronicOrb); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.heatGenerator), - "III", "IHI", "CGC", - 'I', "plateIron", - 'H', new ItemStack(Blocks.iron_bars), - 'C', "circuitBasic", - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Gasturbine), - "IAI", "WGW", "IAI", - 'I', "ingotInvar", - 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), - 'W', TechRebornAPI.recipeCompact.getItem("windMill"), - 'G', TechRebornAPI.recipeCompact.getItem("reinforcedGlass")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Gasturbine), - "IAI", "WGW", "IAI", - 'I', "ingotAluminum", - 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), - 'W', TechRebornAPI.recipeCompact.getItem("windMill"), - 'G', TechRebornAPI.recipeCompact.getItem("reinforcedGlass")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Semifluidgenerator), - "III", "IHI", "CGC", - 'I', "plateIron", - 'H', ModBlocks.reinforcedglass, - 'C', ItemParts.getPartByName("electronicCircuit"), - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Semifluidgenerator), - "AAA", "AHA", "CGC", - 'A', "plateAluminum", - 'H', ModBlocks.reinforcedglass, - 'C', ItemParts.getPartByName("electronicCircuit"), - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.DieselGenerator), - "III", "I I", "CGC", - 'I', "refinedIron", - 'C', ItemParts.getPartByName("electronicCircuit"), - 'G', ModBlocks.Generator); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.DieselGenerator), - "AAA", "A A", "CGC", - 'A', "ingotAluminum", - 'C', ItemParts.getPartByName("electronicCircuit"), - 'G', ModBlocks.Generator); - -// CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MagicalAbsorber), -// "CSC", "IBI", "CAC", -// 'C', "circuitMaster", -// 'S', "craftingSuperconductor", -// 'B', Blocks.beacon, -// 'A', ModBlocks.Magicenergeyconverter, -// 'I', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); -// -// CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Magicenergeyconverter), -// "CTC", "PBP", "CLC", -// 'C', "circuitAdvanced", -// 'P', "platePlatinum", -// 'B', Blocks.beacon, -// 'L', TechRebornAPI.recipeCompact.getItem("lapotronCrystal"), -// 'T', TechRebornAPI.recipeCompact.getItem("teleporter")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Dragoneggenergysiphoner), - "CTC", "ISI", "CBC", - 'I', TechRebornAPI.recipeCompact.getItem("iridiumPlate"), - 'C', ItemParts.getPartByName("electronicCircuit"), - 'B', ModItems.lithiumBattery, - 'S', ModBlocks.Supercondensator, - 'T', ModBlocks.Extractor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.centrifuge), - "SCS", "BEB", "SCS", - 'S', "plateSteel", - 'C', "circuitAdvanced", - 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine"), - 'E', TechRebornAPI.recipeCompact.getItem("extractor")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.BlastFurnace), - "CHC", "HBH", "FHF", - 'H', new ItemStack(ModItems.parts, 1, 17), - 'C', ItemParts.getPartByName("advancedCircuit"), - 'B', BlockMachineFrame.getFrameByName("advancedMachine", 1), - 'F', ModBlocks.ElectricFurnace); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.IndustrialGrinder), - "ECP", "GGG", "CBC", - 'E', ModBlocks.IndustrialElectrolyzer, - 'P', ModBlocks.Extractor, - 'C', ItemParts.getPartByName("advancedCircuit"), - 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine"), - 'G', ModBlocks.Grinder); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ImplosionCompressor), - "ABA", "CPC", "ABA", - 'A', ItemParts.getPartByName("advancedAlloy"), - 'C', ItemParts.getPartByName("advancedCircuit"), - 'B', BlockMachineFrame.getFrameByName("advancedMachine", 1), - 'P', ModBlocks.Compressor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.VacuumFreezer), - "SPS", "CGC", "SPS", - 'S', "plateSteel", - 'C', ItemParts.getPartByName("advancedCircuit"), - 'G', ModBlocks.reinforcedglass, - 'P', ModBlocks.Extractor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Distillationtower), - "CMC", "PBP", "EME", - 'E', ModBlocks.IndustrialElectrolyzer, - 'M', "circuitMaster", - 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine"), - 'C', ModBlocks.centrifuge, - 'P', ModBlocks.Extractor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.AlloyFurnace), - "III", "F F", "III", - 'I', ItemIngots.getIngotByName("refinediron"), - 'F', new ItemStack(ModBlocks.ironFurnace)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ChemicalReactor), - "IMI", "CPC", "IEI", - 'I', "ingotInvar", - 'C', ItemParts.getPartByName("advancedCircuit"), - 'M', ModBlocks.Extractor, - 'P', ModBlocks.Compressor, - 'E', ModBlocks.Extractor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.RollingMachine), - "PCP", "MBM", "PCP", - 'P', Blocks.piston, - 'C', ItemParts.getPartByName("advancedCircuit"), - 'M', ModBlocks.Compressor, - 'B', BlockMachineFrame.getFrameByName("machine", 1)); - -// CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ElectricCraftingTable), -// "ITI", "IBI", "ICI", -// 'I', "plateIron", -// 'C', "circuitAdvanced", -// 'T', "crafterWood", -// 'B', TechRebornAPI.recipeCompact.getItem("machine")); - -// CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ElectricCraftingTable), -// "ATA", "ABA", "ACA", -// 'A', "plateAluminum", -// 'C', "circuitAdvanced", -// 'T', "crafterWood", -// 'B', TechRebornAPI.recipeCompact.getItem("machine")); - -// CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ChunkLoader), -// "SCS", "CMC", "SCS", -// 'S', "plateSteel", -// 'C', "circuitMaster", -// 'M', new ItemStack(ModItems.parts, 1, 39)); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Lesu), - " L ", "CBC", " M ", - 'L', ModBlocks.lvt, - 'C', ItemParts.getPartByName("advancedCircuit"), - 'M', ModBlocks.mvt, - 'B', ModBlocks.LesuStorage); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.HighAdvancedMachineBlock), - "CTC", "TBT", "CTC", - 'C', "ingotChrome", - 'T', "ingotTitanium", - 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 0), - "III", "CBC", "III", - 'I', "plateIron", - 'C', "circuitBasic", - 'B', TechRebornAPI.recipeCompact.getItem("machine")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 1), - "SSS", "CBC", "SSS", - 'S', "plateSteel", - 'C', "circuitAdvanced", - 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 2), - "HHH", "CBC", "HHH", - 'H', "ingotChrome", - 'C', "circuitElite", - 'B', ModBlocks.HighAdvancedMachineBlock); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumChest), - "DCD", "ATA", "DQD", - 'D', ItemParts.getPartByName("dataOrb"), - 'C', ItemParts.getPartByName("computerMonitor"), - 'A', ModBlocks.HighAdvancedMachineBlock, - 'Q', ModBlocks.digitalChest, - 'T', ModBlocks.Compressor); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.PlasmaGenerator), - "PPP", "PTP", "CGC", - 'P', ItemPlates.getPlateByName("tungstensteel"), - 'T', TechRebornAPI.recipeCompact.getItem("hvTransformer"), - 'G', TechRebornAPI.recipeCompact.getItem("generator"), - 'C', ItemParts.getPartByName("energyFlowCircuit") - ); - - - //Smetling - GameRegistry.addSmelting(ItemDusts.getDustByName("copper", 1), TechRebornAPI.recipeCompact.getItem("copperIngot"), 1F); - GameRegistry.addSmelting(ItemDusts.getDustByName("tin", 1), TechRebornAPI.recipeCompact.getItem("tinIngot"), 1F); - GameRegistry.addSmelting(ItemDusts.getDustByName("bronze", 1), TechRebornAPI.recipeCompact.getItem("bronzeIngot"), 1F); - GameRegistry.addSmelting(ItemDusts.getDustByName("lead", 1), TechRebornAPI.recipeCompact.getItem("leadIngot"), 1F); - GameRegistry.addSmelting(ItemDusts.getDustByName("silver", 1), TechRebornAPI.recipeCompact.getItem("silverIngot"), 1F); - - //Saw mill - ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 0), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 0), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 2), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 3), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 4), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 5), pulpStack, TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); - - //UU - if (ConfigTechReborn.UUrecipesIridiamOre) - CraftingHelper.addShapedOreRecipe((TechRebornAPI.recipeCompact.getItem("iridiumOre")), - "UUU", - " U ", - "UUU", - 'U', ModItems.uuMatter); - - - //Blast Furnace - RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemCells.getCellByName("silicon", 2), null, ItemPlates.getPlateByName("silicon"), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2), 1000, 120, 1500)); - - //CentrifugeRecipes - - //Plantball/Bio Chaff - //FIX with ic2 -// RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.grass, 16), null, new ItemStack(TechRebornAPI.recipeCompact.getItem("biochaff").getItem(), 8), new ItemStack(TechRebornAPI.recipeCompact.getItem("plantBall").getItem(), 8), new ItemStack(Items.clay_ball), new ItemStack(Blocks.sand, 8), 2500, 5)); -// RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.dirt, 16), null, new ItemStack(TechRebornAPI.recipeCompact.getItem("biochaff").getItem(), 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("plantBall").getItem(), 4), new ItemStack(Items.clay_ball), new ItemStack(Blocks.sand, 8), 2500, 5)); - - - //Methane - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.mushroom_stew, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.apple, 32), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.porkchop, 12), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_porkchop, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.bread, 64), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.fish, 12), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_fish, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.beef, 12), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_beef, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.pumpkin, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.speckled_melon, 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), new ItemStack(Items.gold_nugget, 6), null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.spider_eye, 32), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.chicken, 12), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_chicken, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.rotten_flesh, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.melon, 64), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cookie, 64), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cake, 8), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.golden_carrot, 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), new ItemStack(Items.gold_nugget, 6), null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.carrot, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.baked_potato, 24), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.potato, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.poisonous_potato, 12), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.nether_wart, 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - //Fix with ic2 - //RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(TechRebornAPI.recipeCompact.getItem("terraWart").getItem(), 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.brown_mushroom, 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.red_mushroom, 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); - - //Rubber Wood Yields - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(TechRebornAPI.recipeCompact.getItem("rubberWood").getItem(), 15), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 5), new ItemStack(TechRebornAPI.recipeCompact.getItem("resin").getItem(), 8), new ItemStack(Blocks.sapling, 6), ItemCells.getCellByName("methane", 1), ItemCells.getCellByName("carbon", 4), 5000, 5)); - - //Soul Sand Byproducts - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.soul_sand, 16), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("oil", 1), ItemDusts.getDustByName("saltpeter", 4), ItemDusts.getDustByName("coal", 1), new ItemStack(Blocks.sand, 10), 2500, 5)); - - //Ice - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("ice", 1), null, new ItemStack(Blocks.ice, 1), TechRebornAPI.recipeCompact.getItem("cell"), null, null, 40, 5)); - - - //Dust Byproducts - - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.glowstone_dust, 16), TechRebornAPI.recipeCompact.getItem("cell"), new ItemStack(Items.redstone, 8), ItemDusts.getDustByName("gold", 8), ItemCells.getCellByName("helium", 1), null, 25000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("phosphorous", 5), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), ItemCells.getCellByName("calcium", 3), null, null, null, 1280, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("ashes", 1), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("carbon"), null, null, null, 80, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.redstone, 10), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 4), ItemCells.getCellByName("silicon", 1), ItemDusts.getDustByName("pyrite", 3), ItemDusts.getDustByName("ruby", 1), ItemCells.getCellByName("mercury", 3), 6800, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("endstone", 16), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2), ItemCells.getCellByName("helium3", 1), ItemCells.getCellByName("helium"), ItemDustsSmall.getSmallDustByName("Tungsten", 1), new ItemStack(Blocks.sand, 12), 4800, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("cinnabar", 2), TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("mercury", 1), ItemDusts.getDustByName("sulfur", 1), null, null, 80, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("flint", 1), null, TechRebornAPI.recipeCompact.getItem("silicondioxideDust"), null, null, null, 160, 5)); - - - //Deuterium/Tritium - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("helium", 16), null, ItemCells.getCellByName("deuterium", 1), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 15), null, null, 10000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("deuterium", 4), null, ItemCells.getCellByName("tritium", 1), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), null, null, 3000, 5)); - RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("hydrogen", 4), null, ItemCells.getCellByName("deuterium", 1), new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), null, null, 3000, 5)); - - //Lava Cell Byproducts - ItemStack lavaCells = TechRebornAPI.recipeCompact.getItem("lavaCell"); - lavaCells.stackSize = 8; - RecipeHandler.addRecipe(new CentrifugeRecipe(lavaCells, null, ItemNuggets.getNuggetByName("electrum", 4), ItemIngots.getIngotByName("copper", 2), ItemDustsSmall.getSmallDustByName("Tungsten", 1), ItemIngots.getIngotByName("tin", 2), 6000, 5)); - - //IndustrialGrinderRecipes - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.coal_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.coal, 1), ItemDustsSmall.getSmallDustByName("Coal", 6), ItemDustsSmall.getSmallDustByName("Coal", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.iron_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("iron", 2), ItemDustsSmall.getSmallDustByName("Nickel", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("gold", 2), ItemDustsSmall.getSmallDustByName("Copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.iron_ore, 1), ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("iron", 2), ItemDusts.getDustByName("nickel", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("gold", 2), ItemDusts.getDustByName("copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("gold", 3), ItemDustsSmall.getSmallDustByName("Copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.diamond_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.diamond, 1), ItemDustsSmall.getSmallDustByName("Diamond", 6), ItemDustsSmall.getSmallDustByName("Coal", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.emerald_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.emerald, 1), ItemDustsSmall.getSmallDustByName("Emerald", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.redstone_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.redstone, 10), ItemDustsSmall.getSmallDustByName("Cinnabar", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.lapis_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.dye, 6, 4), ItemDustsSmall.getSmallDustByName("Lapis", 36), ItemDustsSmall.getSmallDustByName("Lazurite", 8), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - - //Copper Ore - if (OreUtil.doesOreExistAndValid("oreCopper")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCopper").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("copper", 2), ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDusts.getDustByName("nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Copper Ore"); - } - } - - //Tin Ore - if (OreUtil.doesOreExistAndValid("oreTin")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTin").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Tin Ore"); - } - } - - //Nickel Ore - if (OreUtil.doesOreExistAndValid("oreNickel")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreNickel").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("nickel", 3), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("platinum", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Nickel Ore"); - } - } - - //Zinc Ore - if (OreUtil.doesOreExistAndValid("oreZinc")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreZinc").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Zinc Ore"); - } - } - - //Silver Ore - if (OreUtil.doesOreExistAndValid("oreSilver")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreSilver").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("silver", 2), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Silver Ore"); - } - } - - //Lead Ore - if (OreUtil.doesOreExistAndValid("oreLead")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreLead").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("lead", 2), ItemDustsSmall.getSmallDustByName("Silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); - } - } - - //Uranium Ore - if (OreUtil.doesOreExistAndValid("oreUranium")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreUranium").get(0); - ItemStack uranium238Stack = TechRebornAPI.recipeCompact.getItem("Uran238"); - uranium238Stack.stackSize = 8; - ItemStack uranium235Stack = TechRebornAPI.recipeCompact.getItem("smallUran235"); - uranium235Stack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), uranium238Stack, uranium235Stack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, uranium238Stack, uranium235Stack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, uranium238Stack, uranium235Stack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Uranium Ore"); - } - } - - //Pitchblende Ore - if (OreUtil.doesOreExistAndValid("orePitchblende")) { - try { - ItemStack oreStack = OreDictionary.getOres("orePitchblende").get(0); - ItemStack uranium238Stack = TechRebornAPI.recipeCompact.getItem("Uran238"); - uranium238Stack.stackSize = 8; - ItemStack uranium235Stack = TechRebornAPI.recipeCompact.getItem("smallUran235"); - uranium235Stack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), uranium238Stack, uranium235Stack, null, null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, uranium238Stack, uranium235Stack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, uranium238Stack, uranium235Stack, null, new ItemStack(Items.bucket), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Uranium Ore"); - } - } - - //Aluminum Ore - if (OreUtil.doesOreExistAndValid("oreAluminum")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreAluminum").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("aluminum", 2), ItemDustsSmall.getSmallDustByName("Bauxite", 1), ItemDustsSmall.getSmallDustByName("Bauxite", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); - } - } - - //Ardite Ore - if (OreUtil.doesOreExistAndValid("oreArdite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreArdite").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("ardite", 2), ItemDustsSmall.getSmallDustByName("Ardite", 1), ItemDustsSmall.getSmallDustByName("Ardite", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Ardite Ore"); - } - } - - //Cobalt Ore - if (OreUtil.doesOreExistAndValid("oreCobalt")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCobalt").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("cobalt", 2), ItemDustsSmall.getSmallDustByName("Cobalt", 1), ItemDustsSmall.getSmallDustByName("Cobalt", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Cobalt Ore"); - } - } - - //Dark Iron Ore - if (OreUtil.doesOreExistAndValid("oreDarkIron")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreDarkIron").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("darkIron", 2), ItemDustsSmall.getSmallDustByName("DarkIron", 1), ItemDustsSmall.getSmallDustByName("Iron", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Dark Iron Ore"); - } - } - - //Cadmium Ore - if (OreUtil.doesOreExistAndValid("oreCadmium")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCadmium").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("cadmium", 2), ItemDustsSmall.getSmallDustByName("Cadmium", 1), ItemDustsSmall.getSmallDustByName("Cadmium", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Cadmium Ore"); - } - } - - //Indium Ore - if (OreUtil.doesOreExistAndValid("oreIndium")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreIndium").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("indium", 2), ItemDustsSmall.getSmallDustByName("Indium", 1), ItemDustsSmall.getSmallDustByName("Indium", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Indium Ore"); - } - } - - //Calcite Ore - if (OreUtil.doesOreExistAndValid("oreCalcite") && OreUtil.doesOreExistAndValid("gemCalcite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCalcite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemCalcite").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, ItemDustsSmall.getSmallDustByName("Calcite", 6), null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Calcite Ore"); - } - } - - //Magnetite Ore - if (OreUtil.doesOreExistAndValid("oreMagnetite") && OreUtil.doesOreExistAndValid("chunkMagnetite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreMagnetite").get(0); - ItemStack chunkStack = OreDictionary.getOres("chunkMagnetite").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, chunkStack, ItemDustsSmall.getSmallDustByName("Magnetite", 6), null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Magnetite Ore"); - } - } - - //Graphite Ore - if (OreUtil.doesOreExistAndValid("oreGraphite") && OreUtil.doesOreExistAndValid("chunkGraphite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreGraphite").get(0); - ItemStack chunkStack = OreDictionary.getOres("chunkGraphite").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, chunkStack, ItemDustsSmall.getSmallDustByName("Graphite", 6), null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Graphite Ore"); - } - } - - //Osmium Ore - if (OreUtil.doesOreExistAndValid("oreOsmium")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreOsmium").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("osmium", 2), ItemDustsSmall.getSmallDustByName("Osmium", 1), ItemDustsSmall.getSmallDustByName("Osmium", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Osmium Ore"); - } - } - - //Teslatite Ore - if (OreUtil.doesOreExistAndValid("oreTeslatite") && OreUtil.doesOreExistAndValid("dustTeslatite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTeslatite").get(0); - ItemStack dustStack = OreDictionary.getOres("dustTeslatite").get(0); - dustStack.stackSize = 10; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, dustStack, ItemDustsSmall.getSmallDustByName("Sodalite", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Teslatite Ore"); - } - } - - //Sulfur Ore - if (OreUtil.doesOreExistAndValid("oreSulfur")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreSulfur").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sulfur", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Sulfur Ore"); - } - } - - //Saltpeter Ore - if (OreUtil.doesOreExistAndValid("oreSaltpeter")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreSaltpeter").get(0); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("saltpeter", 2), ItemDustsSmall.getSmallDustByName("Saltpeter", 1), ItemDustsSmall.getSmallDustByName("Saltpeter", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Saltpeter Ore"); - } - } - - //Apatite Ore - if (OreUtil.doesOreExistAndValid("oreApatite") & OreUtil.doesOreExistAndValid("gemApatite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreApatite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemApatite").get(0); - gemStack.stackSize = 6; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Apatite Ore"); - } - } - - //Nether Quartz Ore - if (OreUtil.doesOreExistAndValid("dustNetherQuartz")) { - try { - ItemStack dustStack = OreDictionary.getOres("dustNetherQuartz").get(0); - dustStack.stackSize = 4; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.quartz, 2), dustStack, ItemDustsSmall.getSmallDustByName("Netherrack", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Nether Quartz Ore"); - } - } - - //Certus Quartz Ore - if (OreUtil.doesOreExistAndValid("oreCertusQuartz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreCertusQuartz").get(0); - ItemStack gemStack = OreDictionary.getOres("crystalCertusQuartz").get(0); - ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); - dustStack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); - } - } - - //Charged Certus Quartz Ore - if (OreUtil.doesOreExistAndValid("oreChargedCertusQuartz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreChargedCertusQuartz").get(0); - ItemStack gemStack = OreDictionary.getOres("crystalChargedCertusQuartz").get(0); - ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); - dustStack.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Charged Certus Quartz Ore"); - } - } - - //Amethyst Ore - if (OreUtil.doesOreExistAndValid("oreAmethyst") && OreUtil.doesOreExistAndValid("gemAmethyst")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreAmethyst").get(0); - ItemStack gemStack = OreDictionary.getOres("gemAmethyst").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemAmethyst").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); - } - } - - //Topaz Ore - if (OreUtil.doesOreExistAndValid("oreTopaz") && OreUtil.doesOreExistAndValid("gemTopaz")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTopaz").get(0); - ItemStack gemStack = OreDictionary.getOres("gemTopaz").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemTopaz").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Topaz Ore"); - } - } - - //Tanzanite Ore - if (OreUtil.doesOreExistAndValid("oreTanzanite") && OreUtil.doesOreExistAndValid("gemTanzanite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreTanzanite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemTanzanite").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemTanzanite").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Tanzanite Ore"); - } - } - - //Malachite Ore - if (OreUtil.doesOreExistAndValid("oreMalachite") && OreUtil.doesOreExistAndValid("gemMalachite")) { - try { - ItemStack oreStack = OreDictionary.getOres("oreMalachite").get(0); - ItemStack gemStack = OreDictionary.getOres("gemMalachite").get(0); - gemStack.stackSize = 2; - ItemStack dustStack = OreDictionary.getOres("gemMalachite").get(0); - dustStack.stackSize = 1; - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - } catch (Exception e) { - Core.logHelper.info("Failed to Load Grinder Recipe for Malachite Ore"); - } - } - - - //Implosion Compressor - - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemParts.getPartByName("iridiumAlloyIngot"), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 8), TechRebornAPI.recipeCompact.getItem("iridiumPlate"), ItemDusts.getDustByName("darkAshes", 4), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("diamond", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 32), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialDiamond").getItem(), 3), ItemDusts.getDustByName("darkAshes", 16), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(TechRebornAPI.recipeCompact.getItem("coalChunk"), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 8), TechRebornAPI.recipeCompact.getItem("industrialDiamond"), ItemDusts.getDustByName("darkAshes", 4), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("emerald", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), new ItemStack(Items.emerald, 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("sapphire", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), ItemGems.getGemByName("sapphire", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("ruby", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), ItemGems.getGemByName("ruby", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("yellowGarnet", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), ItemGems.getGemByName("yellowGarnet", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("redGarnet", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), ItemGems.getGemByName("redGarnet", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("peridot", 4), new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), ItemGems.getGemByName("peridot", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); - - - //Grinder - - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDusts.getDustByName("silver", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - //Iridium Ore - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDustsSmall.getSmallDustByName("Platinum", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), TechRebornAPI.recipeCompact.getItem("waterCell"), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDustsSmall.getSmallDustByName("Platinum", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), new ItemStack(Items.water_bucket), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDustsSmall.getSmallDustByName("Platinum", 2), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), null, new FluidStack(ModFluids.fluidMercury, 1000), TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), null, 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), ItemCells.getCellByName("mercury", 1), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), new ItemStack(ModItems.bucketMercury), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), new ItemStack(Items.bucket), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("ruby", 1), ItemDustsSmall.getSmallDustByName("Ruby", 6), ItemDustsSmall.getSmallDustByName("Chrome", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("sapphire", 1), ItemDustsSmall.getSmallDustByName("Sapphire", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("bauxite", 2), ItemDustsSmall.getSmallDustByName("Grossular", 4), ItemDustsSmall.getSmallDustByName("Titanium", 4), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("pyrite", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Phosphorous", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("cinnabar", 2), ItemDustsSmall.getSmallDustByName("Redstone", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sphalerite", 2), ItemDustsSmall.getSmallDustByName("Zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("sphalerite", 2), ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDusts.getDustByName("silver", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("platinum", 2), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("platinum", 3), ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("peridot", 1), ItemDustsSmall.getSmallDustByName("Peridot", 6), ItemDustsSmall.getSmallDustByName("Pyrope", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sodalite", 12), ItemDustsSmall.getSmallDustByName("Lazurite", 4), ItemDustsSmall.getSmallDustByName("Lapis", 4), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tetrahedrite", 2), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("tetrahedrite", 3), ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); - - - //Chemical Reactor - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), null, new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 1), 100, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("phosphorous", 1), new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 3), 100, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sodiumSulfide", 1), TechRebornAPI.recipeCompact.getItem("airCell"), ItemCells.getCellByName("sodiumPersulfate", 2), 2000, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrocarbon", 1), TechRebornAPI.recipeCompact.getItem("waterCell"), ItemCells.getCellByName("glyceryl", 2), 580, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("sulfur", 1), new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 2), 100, 30)); - ItemStack waterCells = TechRebornAPI.recipeCompact.getItem("waterCell").copy(); - waterCells.stackSize = 2; - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sulfur", 1), waterCells, ItemCells.getCellByName("sulfuricAcid", 3), 1140, 30)); - ItemStack waterCells2 = TechRebornAPI.recipeCompact.getItem("waterCell").copy(); - waterCells2.stackSize = 5; - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("hydrogen", 4), TechRebornAPI.recipeCompact.getItem("airCell"), waterCells2, 10, 30)); - RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrogen", 1), TechRebornAPI.recipeCompact.getItem("airCell"), ItemCells.getCellByName("nitrogenDioxide", 2), 1240, 30)); - - -//IndustrialElectrolyzer - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("sulfuricAcid", 7), - null, - ItemCells.getCellByName("hydrogen", 2), - ItemDusts.getDustByName("sulfur"), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3, 0), - 400, 90 - )); - - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("ruby", 6), - TechRebornAPI.recipeCompact.getItem("cell"), - ItemDusts.getDustByName("aluminum", 2), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - ItemDusts.getDustByName("chrome", 1), - null, - 140, 90 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("sapphire", 5), - TechRebornAPI.recipeCompact.getItem("cell"), - ItemDusts.getDustByName("aluminum", 2), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - null, - null, - 100, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("nitrogenDioxide", 3), - null, - ItemCells.getCellByName("nitrogen", 1), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - null, - TechRebornAPI.recipeCompact.getItem("cell"), - 160, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("sodiumSulfide", 2), - null, - ItemCells.getCellByName("sodium", 1), - ItemDusts.getDustByName("sulfur", 1), - null, - TechRebornAPI.recipeCompact.getItem("cell"), - 200, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("greenSapphire", 5), - TechRebornAPI.recipeCompact.getItem("cell"), - ItemDusts.getDustByName("aluminum", 2), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - null, - null, - 100, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("emerald", 29), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 18, 0), - ItemCells.getCellByName("berylium", 3), - ItemDusts.getDustByName("aluminum", 2), - ItemCells.getCellByName("silicon", 6), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 5), - 520, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - new ItemStack(TechRebornAPI.recipeCompact.getItem("silicondioxideDust").getItem(), 3, 0), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), - ItemCells.getCellByName("silicon", 1), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - null, - null, - 60, 60 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(new ItemStack(Items.dye, 3, 15), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 0), - null, - ItemCells.getCellByName("calcium", 1), - null, - null, - 20, 106 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("glyceryl", 20), - null, - ItemCells.getCellByName("carbon", 3), - ItemCells.getCellByName("hydrogen", 5), - ItemCells.getCellByName("nitrogen", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), - 800, 90 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("peridot", 9), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 4, 0), - ItemDusts.getDustByName("magnesium", 2), - ItemDusts.getDustByName("iron"), - ItemCells.getCellByName("silicon", 2), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), - 200, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("calciumCarbonate", 5), - null, - ItemCells.getCellByName("carbon"), - ItemCells.getCellByName("calcium"), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), - 400, 90 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemCells.getCellByName("sodiumPersulfate", 6), - null, - ItemCells.getCellByName("sodium"), - ItemDusts.getDustByName("sulfur"), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3, 0), - 420, 90 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("pyrope", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), - ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("magnesium", 3), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 400, 120 - )); - - ItemStack sand = new ItemStack(Blocks.sand); - sand.stackSize = 16; - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - sand, - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), - ItemCells.getCellByName("silicon", 1), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - null, - null, - 1000, 25 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("almandine", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), - ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("iron", 3), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 480, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("spessartine", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), - ItemDusts.getDustByName("aluminum", 2), - ItemDusts.getDustByName("manganese", 3), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 480, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("andradite", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), - ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("iron", 2), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 480, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("grossular", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), - ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("aluminum", 2), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 440, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("Uvarovite", 20), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), - ItemCells.getCellByName("calcium", 3), - ItemDusts.getDustByName("chrome", 2), - ItemCells.getCellByName("silicon", 3), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), - 480, 120 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 10), - null, - ItemCells.getCellByName("hydrogen", 4), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 0), - null, - 100, 30 - )); - - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - ItemDusts.getDustByName("darkAshes"), - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), - ItemCells.getCellByName("carbon", 2), - null, - null, - null, - 20, 30 - )); - - if (OreUtil.doesOreExistAndValid("dustSalt")) { - ItemStack salt = OreDictionary.getOres("dustSalt").get(0); - salt.stackSize = 2; - RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( - salt, - new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), - ItemCells.getCellByName("sodium"), - ItemCells.getCellByName("chlorine"), - null, - null, - 40, 60 - )); - } - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantSimple"), - "TST", "PCP", "TST", - 'T', "ingotTin", - 'S', ItemCells.getCellByName("sodium"), - 'P', ItemCells.getCellByName("potassium"), - 'C', TechRebornAPI.recipeCompact.getItem("reactorCoolantSimple") - ); - - Item drill = TechRebornAPI.recipeCompact.getItem("miningDrill").getItem(); - ItemStack drillStack = new ItemStack(drill, 1, OreDictionary.WILDCARD_VALUE); - - if (ConfigTechReborn.ExpensiveMacerator) - CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("macerator"), - "FDF", "DMD", "FCF", - 'F', Items.flint, - 'D', Items.diamond, - 'M', TechRebornAPI.recipeCompact.getItem("machine"), - 'C', TechRebornAPI.recipeCompact.getItem("electronicCircuit")); - - if (ConfigTechReborn.ExpensiveDrill) - CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("miningDrill"), - " S ", "SCS", "SBS", - 'S', "ingotSteel", - 'B', TechRebornAPI.recipeCompact.getItem("reBattery"), - 'C', TechRebornAPI.recipeCompact.getItem("electronicCircuit")); - - if (ConfigTechReborn.ExpensiveDiamondDrill) - CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("diamondDrill"), - " D ", "DBD", "TCT", - 'D', "gemDiamond", - 'T', "ingotTitanium", - 'B', drillStack, - 'C', TechRebornAPI.recipeCompact.getItem("advancedCircuit")); - - if (ConfigTechReborn.ExpensiveSolar) - CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("solarPanel"), - "PPP", "SZS", "CGC", - 'P', "paneGlass", - 'S', ItemPlates.getPlateByName("silicon"), - 'Z', TechRebornAPI.recipeCompact.getItem("carbonPlate"), - 'G', TechRebornAPI.recipeCompact.getItem("generator"), - 'C', TechRebornAPI.recipeCompact.getItem("electronicCircuit")); - - - CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("iridiumAlloyIngot"), - "IAI", "ADA", "IAI", - 'I', ItemIngots.getIngotByName("iridium"), - 'D', ItemDusts.getDustByName("diamond"), - 'A', TechRebornAPI.recipeCompact.getItem("advancedAlloy")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lithiumBatpack, 1, OreDictionary.WILDCARD_VALUE), - "BCB", "BPB", "B B", - 'B', new ItemStack(ModItems.lithiumBattery), - 'P', "plateAluminum", - 'C', TechRebornAPI.recipeCompact.getItem("advancedCircuit")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lithiumBattery, 1, OreDictionary.WILDCARD_VALUE), - " C ", "PFP", "PFP", - 'F', ItemCells.getCellByName("lithium"), - 'P', "plateAluminum", - 'C', TechRebornAPI.recipeCompact.getItem("insulatedGoldCableItem")); - - CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lapotronpack, 1, OreDictionary.WILDCARD_VALUE), - "FOF", "SPS", "FIF", - 'F', ItemParts.getPartByName("energyFlowCircuit"), - 'O', new ItemStack(ModItems.lapotronicOrb), - 'S', ItemParts.getPartByName("superConductor"), - 'I', "ingotIridium", - 'P', new ItemStack(ModItems.lapotronpack)); - } + + static void addHammerRecipes() + { + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.hammer), "III", "ISI", " S ", 'S', Items.stick, 'I', + "ingotIron"); + + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("iron", 1), hammerStack, "ingotIron"); + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("copper", 1), hammerStack, "ingotCopper"); + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("tin", 1), hammerStack, "ingotTin"); + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("bronze", 1), hammerStack, "ingotBronze"); + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("brass", 1), hammerStack, "ingotBrass"); + CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName("steel", 1), hammerStack, "ingotSteel"); + + hammer.setContainerItem(hammer); + } + + static void addReactorRecipes() + { + FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), + ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium"), 40000000, 32768, 1024)); + FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), + ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium3"), 60000000, 32768, 2048)); + FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), + ItemCells.getCellByName("Berylium"), ItemDusts.getDustByName("platinum"), 80000000, -2048, 1024)); + } + + static void addGeneralShapedRecipes() + { + + // Storage Blocks + for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) + { + CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName(name), "AAA", "AAA", "AAA", 'A', + "ingot" + name.substring(0, 1).toUpperCase() + name.substring(1)); + } + + CraftingHelper.addShapelessOreRecipe(ItemParts.getPartByName("carbonmesh"), ItemDusts.getDustByName("coal"), + ItemDusts.getDustByName("coal"), ItemDusts.getDustByName("coal"), ItemDusts.getDustByName("coal")); + CraftingHelper.addShapelessOreRecipe(ItemParts.getPartByName("carbonfiber"), + ItemParts.getPartByName("carbonmesh"), ItemParts.getPartByName("carbonmesh")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("computerMonitor"), "ADA", "DGD", "ADA", 'D', dyes, + 'A', "ingotAluminum", 'G', Blocks.glass_pane); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.reinforcedglass, 7), "GAG", "GGG", "GAG", 'A', + ItemParts.getPartByName("advancedAlloy"), 'G', Blocks.glass); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.windMill, 2), "IXI", "XGX", "IXI", 'I', "ingotIron", + 'G', ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.waterMill), "SWS", "WGW", "SWS", 'S', Items.stick, + 'W', "plankWood", 'G', ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.hvt), "XHX", "XMX", "XHX", 'M', ModBlocks.mvt, 'H', + ItemStandaloneCables.getCableByName("insulatedhv")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mvt), "XGX", "XMX", "XGX", 'M', + BlockMachineFrame.getFrameByName("machine", 1), 'G', + ItemStandaloneCables.getCableByName("insulatedgold")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.lvt), "PWP", "CCC", "PPP", 'P', "plankWood", 'C', + "ingotCopper", 'W', ItemStandaloneCables.getCableByName("insulatedcopper")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 0), "RRR", "CAC", "RRR", 'R', + ItemIngots.getIngotByName("refinedIron"), 'C', ItemParts.getPartByName("electronicCircuit"), 'A', + BlockMachineFrame.getFrameByName("machine", 1)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 1), "RRR", "CAC", "RRR", 'R', + "ingotSteel", 'C', ItemParts.getPartByName("advancedCircuit"), 'A', + BlockMachineFrame.getFrameByName("advancedMachine", 1)); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataOrb"), "DDD", "DID", "DDD", 'D', + ItemParts.getPartByName("dataStorageCircuit"), 'I', ItemParts.getPartByName("dataControlCircuit")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataControlCircuit", 4), "CDC", "DID", "CDC", 'I', + ItemPlates.getPlateByName("iridium"), 'D', ItemParts.getPartByName("dataStorageCircuit"), 'C', + ItemParts.getPartByName("advancedCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.thermalGenerator), "III", "IRI", "CGC", 'I', + ItemIngots.getIngotByName("invar"), 'R', ModBlocks.reinforcedglass, 'G', ModBlocks.Generator, 'C', + ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.recycler), "XEX", "DCD", "GDG", 'D', Blocks.dirt, 'C', + ModBlocks.Compressor, 'G', Items.glowstone_dust, 'E', ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.batBox), "WCW", "BBB", "WWW", 'W', "plankWood", 'B', + batteryStack, 'C', ItemStandaloneCables.getCableByName("insulatedcopper")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mfe), "GEG", "EME", "GEG", 'M', + BlockMachineFrame.getFrameByName("machine", 1), 'E', crystalStack, 'G', + ItemStandaloneCables.getCableByName("insulatedgold")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.mfsu), "LAL", "LML", "LAL", 'A', + ItemParts.getPartByName("advancedCircuit"), 'L', lapcrystalStack, 'M', new ItemStack(ModBlocks.mfe)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.IndustrialElectrolyzer), "RER", "CEC", "RER", 'R', + ItemIngots.getIngotByName("refinediron"), 'E', new ItemStack(ModBlocks.Extractor), 'C', + ItemParts.getPartByName("advancedCircuit")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("mixedmetalingot", 2), "RRR", "BBB", "TTT", 'R', + ItemIngots.getIngotByName("refinediron"), 'B', "ingotBronze", 'T', "ingotTin"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Compressor), "SXS", "SCS", "SMS", 'C', + ItemParts.getPartByName("electronicCircuit"), 'M', BlockMachineFrame.getFrameByName("machine", 1), 'S', + Blocks.stone); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ElectricFurnace), "XCX", "RFR", "XXX", 'C', + ItemParts.getPartByName("electronicCircuit"), 'F', new ItemStack(ModBlocks.ironFurnace), 'R', + Items.redstone); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ironFurnace), "III", "IXI", "III", 'I', "ingotIron"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ironFurnace), "XIX", "IXI", "IFI", 'I', "ingotIron", + 'F', Blocks.furnace); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("electronicCircuit"), "WWW", "SRS", "WWW", 'R', + ItemIngots.getIngotByName("refinediron"), 'S', Items.redstone, 'W', + ItemStandaloneCables.getCableByName("insulatedcopper")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.reBattery), "XWX", "TRT", "TRT", 'T', "ingotTin", 'R', + Items.redstone, 'W', ItemStandaloneCables.getCableByName("insulatedcopper")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.wrench), "BAB", "BBB", "ABA", 'B', "ingotBronze"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Extractor), "TMT", "TCT", "XXX", 'T', + ModItems.treeTap, 'M', BlockMachineFrame.getFrameByName("machine", 1), 'C', + ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.centrifuge), "RCR", "AEA", "RCR", 'R', + ItemIngots.getIngotByName("refinediron"), 'E', new ItemStack(ModBlocks.Extractor), 'A', + BlockMachineFrame.getFrameByName("advancedMachine", 1), 'C', + ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("advancedCircuit"), "RGR", "LCL", "RGR", 'R', + Items.redstone, 'G', Items.glowstone_dust, 'L', "dyeBlue", 'C', + ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.energyCrystal), "RRR", "RDR", "RRR", 'R', + Items.redstone, 'D', Items.diamond); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lapotronCrystal), "LCL", "LEL", "LCL", 'L', "dyeBlue", + 'E', new ItemStack(ModItems.energyCrystal), 'C', ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapelessOreRecipe(new ItemStack(ModBlocks.Generator), batteryStack, + BlockMachineFrame.getFrameByName("machine", 1), Blocks.furnace); + + CraftingHelper.addShapedOreRecipe(BlockMachineFrame.getFrameByName("machine", 1), "AAA", "AXA", "AAA", 'A', + ItemIngots.getIngotByName("refinediron")); + + CraftingHelper.addShapedOreRecipe(BlockMachineFrame.getFrameByName("advancedMachine", 1), "XCX", "AMA", "XCX", + 'A', ItemParts.getPartByName("advancedAlloy"), 'C', ItemPlates.getPlateByName("carbon"), 'M', + BlockMachineFrame.getFrameByName("machine", 1)); + + CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName("sapphire"), "AAA", "AAA", "AAA", 'A', + "gemSapphire"); + + CraftingHelper.addShapedOreRecipe(BlockStorage.getStorageBlockByName("ruby"), "AAA", "AAA", "AAA", 'A', + "gemRuby"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("dataStorageCircuit"), "EEE", "ECE", "EEE", 'E', + new ItemStack(Items.emerald), 'C', ItemParts.getPartByName("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 4, 8), "DSD", "S S", "DSD", 'D', "dustDiamond", + 'S', "ingotSteel"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.parts, 1, 15), "AAA", "AMA", "AAA", 'A', + "ingotAluminium", 'M', new ItemStack(ModItems.parts, 1, 13)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Supercondensator), "EOE", "SAS", "EOE", 'E', + ItemParts.getPartByName("energyFlowCircuit"), 'O', ModItems.lapotronicOrb, 'S', + ItemParts.getPartByName("superconductor"), 'A', ModBlocks.HighAdvancedMachineBlock); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("diamondSawBlade"), "DSD", "S S", "DSD", 'S', + "plateSteel", 'D', "dustDiamond"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("tungstenGrindingHead", 2), "TST", "SBS", "TST", 'T', + "plateTungsten", 'S', "plateSteel", 'B', "blockSteel"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("destructoPack"), "CIC", "IBI", "CIC", 'C', + ItemParts.getPartByName("basicCircuitBoard"), 'I', "ingotAluminum", 'B', + new ItemStack(Items.lava_bucket)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.cloakingDevice), "CIC", "IOI", "CIC", 'C', + "ingotChrome", 'I', "plateIridium", 'O', new ItemStack(ModItems.lapotronicOrb)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.treeTap), " S ", "PPP", "P ", 'S', "stickWood", 'P', + "plankWood"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.rockCutter), "DT ", "DT ", "DCB", 'D', + ItemParts.getPartByName("rockCutterBlade"), 'T', "ingotTitanium", 'C', + ItemParts.getPartByName("basicCircuitBoard"), 'B', new ItemStack(Items.diamond)); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("rockCutterBlade"), "SDS", "SDS", "SDS", 'D', + new ItemStack(Items.diamond), 'S', "ingotSteel"); + + for (String part : ItemParts.types) + { + if (part.endsWith("Gear")) + { + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName(part), " O ", "OIO", " O ", 'I', + new ItemStack(Items.iron_ingot), 'O', + "ingot" + capitalizeFirstLetter(part.replace("Gear", ""))); + } + } + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("nichromeHeatingCoil"), " N ", "NCN", " N ", 'N', + "ingotNickel", 'C', "ingotChrome"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("kanthalHeatingCoil"), "III", "CAA", "AAA", 'I', + "ingotSteel", 'C', "ingotChrome", 'A', "ingotAluminum"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("heliumCoolantSimple"), " T ", "TCT", " T ", 'T', + "ingotTin", 'C', ItemCells.getCellByName("helium", 1, false)); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("HeliumCoolantTriple"), "TTT", "CCC", "TTT", 'T', + "ingotTin", 'C', ItemParts.getPartByName("heliumCoolantSimple")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("HeliumCoolantSix"), "THT", "TCT", "THT", 'T', + "ingotTin", 'C', "ingotCopper", 'H', ItemParts.getPartByName("HeliumCoolantTriple")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantTriple"), "TTT", "CCC", "TTT", 'T', + "ingotTin", 'C', ItemParts.getPartByName("NaKCoolantSimple")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantSix"), "THT", "TCT", "THT", 'T', + "ingotTin", 'C', "ingotCopper", 'H', ItemParts.getPartByName("NaKCoolantTriple")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Aesu), "LLL", "LCL", "LLL", 'L', + new ItemStack(ModItems.lapotronicOrb), 'C', new ItemStack(ModBlocks.ComputerCube)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Idsu), "PAP", "ACA", "PAP", 'P', + ItemPlates.getPlateByName("iridium"), 'C', new ItemStack(Blocks.ender_chest), 'A', + new ItemStack(ModBlocks.Aesu)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.FusionControlComputer), "CCC", "PTP", "CCC", 'P', + new ItemStack(ModBlocks.ComputerCube), 'T', new ItemStack(ModBlocks.FusionCoil), 'C', + ItemParts.getPartByName("energyFlowCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.LightningRod), "CAC", "ACA", "CAC", 'A', + new ItemStack(ModBlocks.MachineCasing, 1, 2), 'S', ItemParts.getPartByName("superConductor"), 'C', + ItemParts.getPartByName("energyFlowCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.FusionCoil), "CSC", "NAN", "CRC", 'A', + new ItemStack(ModBlocks.MachineCasing, 1, 2), 'N', ItemParts.getPartByName("nichromeHeatingCoil"), 'C', + ItemParts.getPartByName("energyFlowCircuit"), 'S', ItemParts.getPartByName("superConductor"), 'R', + ItemParts.getPartByName("iridiumNeutronReflector")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("iridiumNeutronReflector"), "PPP", "PIP", "PPP", 'P', + ItemParts.getPartByName("thickNeutronReflector"), 'I', "ingotIridium"); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("thickNeutronReflector"), " P ", "PCP", " P ", 'P', + ItemParts.getPartByName("neutronReflector"), 'C', ItemCells.getCellByName("Berylium")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("neutronReflector"), "TCT", "CPC", "TCT", 'T', + "dustTin", 'C', "dustCoal", 'P', "plateCopper"); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.scrapBox), "SSS", "SSS", "SSS", 'S', + ItemParts.getPartByName("scrap")); + + Core.logHelper.info("Shapped Recipes Added"); + } + + public static String capitalizeFirstLetter(String original) + { + if (original.length() == 0) + return original; + return original.substring(0, 1).toUpperCase() + original.substring(1); + } + + static void addShapelessRecipes() + { + for (String name : ArrayUtils.addAll(BlockStorage.types, BlockStorage2.types)) + { + ItemStack item = null; + try + { + item = ItemIngots.getIngotByName(name, 9); + } catch (InvalidParameterException e) + { + try + { + item = ItemGems.getGemByName(name, 9); + } catch (InvalidParameterException e2) + { + continue; + } + } + + if (item == null) + { + continue; + } + + GameRegistry.addShapelessRecipe(BlockStorage.getStorageBlockByName(name), item, item, item, item, item, + item, item, item, item); + GameRegistry.addShapelessRecipe(item, BlockStorage.getStorageBlockByName(name, 9)); + } + + GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.rubberPlanks, 4), ModBlocks.rubberLog); + + for (String name : ItemDustsSmall.types) + { + GameRegistry.addShapelessRecipe(ItemDustsSmall.getSmallDustByName(name, 4), ItemDusts.getDustByName(name)); + GameRegistry.addShapelessRecipe(ItemDusts.getDustByName(name, 1), ItemDustsSmall.getSmallDustByName(name), + ItemDustsSmall.getSmallDustByName(name), ItemDustsSmall.getSmallDustByName(name), + ItemDustsSmall.getSmallDustByName(name)); + } + + Core.logHelper.info("Shapless Recipes Added"); + } + + static void addMachineRecipes() + { + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumTank), "EPE", "PCP", "EPE", 'P', + "ingotPlatinum", 'E', ItemParts.getPartByName("advancedCircuit"), 'C', ModBlocks.quantumChest); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.digitalChest), "PPP", "PDP", "PCP", 'P', + "plateAluminum", 'D', ItemParts.getPartByName("dataOrb"), 'C', + ItemParts.getPartByName("computerMonitor")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.digitalChest), "PPP", "PDP", "PCP", 'P', "plateSteel", + 'D', ItemParts.getPartByName("dataOrb"), 'C', ItemParts.getPartByName("computerMonitor")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.AlloySmelter), "XCX", "FMF", "XXX", 'C', + ItemParts.getPartByName("electronicCircuit"), 'F', new ItemStack(ModBlocks.ElectricFurnace), 'M', + BlockMachineFrame.getFrameByName("machine", 1)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.LesuStorage), "LLL", "LCL", "LLL", 'L', "blockLapis", + 'C', ItemParts.getPartByName("electronicCircuit")); + + TechRebornAPI.addRollingOreMachinceRecipe(ItemParts.getPartByName("cupronickelHeatingCoil"), "NCN", "C C", + "NCN", 'N', "ingotCupronickel", 'C', "ingotCopper"); + + RecipeHandler.addRecipe(new VacuumFreezerRecipe(ItemIngots.getIngotByName("hotTungstensteel"), + ItemIngots.getIngotByName("tungstensteel"), 440, 128)); + RecipeHandler.addRecipe( + new VacuumFreezerRecipe(ItemCells.getCellByName("water"), ItemCells.getCellByName("cell"), 60, 128)); + } + + static void addSmeltingRecipes() + { + GameRegistry.addSmelting(ItemDusts.getDustByName("iron", 1), new ItemStack(Items.iron_ingot), 1F); + GameRegistry.addSmelting(ItemDusts.getDustByName("gold", 1), new ItemStack(Items.gold_ingot), 1F); + GameRegistry.addSmelting(ItemParts.getPartByName("rubberSap"), ItemParts.getPartByName("rubber"), 1F); + GameRegistry.addSmelting(new ItemStack(Items.iron_ingot), ItemIngots.getIngotByName("refinediron"), 1F); + GameRegistry.addSmelting(BlockOre2.getOreByName("copper"), ItemIngots.getIngotByName("copper"), 1F); + GameRegistry.addSmelting(BlockOre2.getOreByName("tin"), ItemIngots.getIngotByName("tin"), 1F); + + Core.logHelper.info("Smelting Recipes Added"); + } + + static void addAlloySmelterRecipes() + { + + // Bronze + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemIngots.getIngotByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemDusts.getDustByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemIngots.getIngotByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemDusts.getDustByName("tin", 1), ItemIngots.getIngotByName("bronze", 4), 200, 16)); + + // Electrum + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), + ItemIngots.getIngotByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), + ItemDusts.getDustByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("gold", 1), + ItemIngots.getIngotByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("gold", 1), + ItemDusts.getDustByName("silver", 1), ItemIngots.getIngotByName("electrum", 2), 200, 16)); + + // Invar + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 2), + ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 2), + ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("iron", 2), + ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("iron", 2), + ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("invar", 3), 200, 16)); + + // Cupronickel + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 1), + ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 1), + ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 1), + ItemIngots.getIngotByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 1), + ItemDusts.getDustByName("nickel", 1), ItemIngots.getIngotByName("cupronickel", 2), 200, 16)); + + // Nichrome + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("chrome", 1), + ItemIngots.getIngotByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("chrome", 1), + ItemDusts.getDustByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("chrome", 1), + ItemIngots.getIngotByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("chrome", 1), + ItemDusts.getDustByName("nickel", 4), ItemIngots.getIngotByName("nichrome", 5), 200, 16)); + + // Magnalium + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("magnesium", 1), + ItemIngots.getIngotByName("aluminum", 4), ItemIngots.getIngotByName("magnalium", 3), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("magnesium", 1), + ItemDusts.getDustByName("aluminum", 4), ItemIngots.getIngotByName("magnalium", 3), 200, 16)); + + // Battery Alloy + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("lead", 4), + ItemIngots.getIngotByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("lead", 4), + ItemDusts.getDustByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("lead", 4), + ItemIngots.getIngotByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("lead", 4), + ItemDusts.getDustByName("antimony", 1), ItemIngots.getIngotByName("batteryAlloy", 5), 200, 16)); + + // Brass + if (OreUtil.doesOreExistAndValid("ingotBrass")) + { + ItemStack brassStack = OreDictionary.getOres("ingotBrass").get(0); + brassStack.stackSize = 4; + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemIngots.getIngotByName("zinc", 1), brassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemDusts.getDustByName("zinc", 1), brassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemIngots.getIngotByName("zinc", 1), brassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemDusts.getDustByName("zinc", 1), brassStack, 200, 16)); + } + + // Red Alloy + if (OreUtil.doesOreExistAndValid("ingotRedAlloy")) + { + ItemStack redAlloyStack = OreDictionary.getOres("ingotRedAlloy").get(0); + redAlloyStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 4), + ItemIngots.getIngotByName("copper", 1), redAlloyStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 4), + new ItemStack(Items.iron_ingot, 1), redAlloyStack, 200, 16)); + } + + // Blue Alloy + if (OreUtil.doesOreExistAndValid("ingotBlueAlloy")) + { + ItemStack blueAlloyStack = OreDictionary.getOres("ingotBlueAlloy").get(0); + blueAlloyStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("teslatite", 4), + ItemIngots.getIngotByName("silver", 1), blueAlloyStack, 200, 16)); + } + + // Blue Alloy + if (OreUtil.doesOreExistAndValid("ingotPurpleAlloy") && OreUtil.doesOreExistAndValid("dustInfusedTeslatite")) + { + ItemStack purpleAlloyStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); + purpleAlloyStack.stackSize = 1; + ItemStack infusedTeslatiteStack = OreDictionary.getOres("ingotPurpleAlloy").get(0); + infusedTeslatiteStack.stackSize = 8; + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("redAlloy", 1), + ItemIngots.getIngotByName("blueAlloy", 1), purpleAlloyStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.gold_ingot, 1), infusedTeslatiteStack, + purpleAlloyStack, 200, 16)); + } + + // Aluminum Brass + if (OreUtil.doesOreExistAndValid("ingotAluminumBrass")) + { + ItemStack aluminumBrassStack = OreDictionary.getOres("ingotAluminumBrass").get(0); + aluminumBrassStack.stackSize = 4; + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemIngots.getIngotByName("copper", 3), + ItemDusts.getDustByName("aluminum", 1), aluminumBrassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemIngots.getIngotByName("aluminum", 1), aluminumBrassStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("copper", 3), + ItemDusts.getDustByName("aluminum", 1), aluminumBrassStack, 200, 16)); + } + + // Manyullyn + if (OreUtil.doesOreExistAndValid("ingotManyullyn") && OreUtil.doesOreExistAndValid("ingotCobalt") + && OreUtil.doesOreExistAndValid("ingotArdite")) + { + ItemStack manyullynStack = OreDictionary.getOres("ingotManyullyn").get(0); + manyullynStack.stackSize = 1; + ItemStack cobaltStack = OreDictionary.getOres("ingotCobalt").get(0); + cobaltStack.stackSize = 1; + ItemStack arditeStack = OreDictionary.getOres("ingotArdite").get(0); + arditeStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(cobaltStack, arditeStack, manyullynStack, 200, 16)); + RecipeHandler.addRecipe( + new AlloySmelterRecipe(cobaltStack, ItemDusts.getDustByName("ardite", 1), manyullynStack, 200, 16)); + RecipeHandler.addRecipe( + new AlloySmelterRecipe(ItemDusts.getDustByName("cobalt", 1), arditeStack, manyullynStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(ItemDusts.getDustByName("cobalt", 1), + ItemDusts.getDustByName("ardite", 1), manyullynStack, 200, 16)); + } + + // Conductive Iron + if (OreUtil.doesOreExistAndValid("ingotConductiveIron")) + { + ItemStack conductiveIronStack = OreDictionary.getOres("ingotConductiveIron").get(0); + conductiveIronStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 1), + new ItemStack(Items.iron_ingot, 1), conductiveIronStack, 200, 16)); + } + + // Redstone Alloy + if (OreUtil.doesOreExistAndValid("ingotRedstoneAlloy") && OreUtil.doesOreExistAndValid("itemSilicon")) + { + ItemStack redstoneAlloyStack = OreDictionary.getOres("ingotRedstoneAlloy").get(0); + redstoneAlloyStack.stackSize = 1; + ItemStack siliconStack = OreDictionary.getOres("itemSilicon").get(0); + siliconStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.redstone, 1), siliconStack, + redstoneAlloyStack, 200, 16)); + } + + // Pulsating Iron + if (OreUtil.doesOreExistAndValid("ingotPhasedIron")) + { + ItemStack pulsatingIronStack = OreDictionary.getOres("ingotPhasedIron").get(0); + pulsatingIronStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 1), + new ItemStack(Items.ender_pearl, 1), pulsatingIronStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Items.iron_ingot, 1), + ItemDusts.getDustByName("enderPearl", 1), pulsatingIronStack, 200, 16)); + } + + // Vibrant Alloy + if (OreUtil.doesOreExistAndValid("ingotEnergeticAlloy") && OreUtil.doesOreExistAndValid("ingotPhasedGold")) + { + ItemStack energeticAlloyStack = OreDictionary.getOres("ingotEnergeticAlloy").get(0); + energeticAlloyStack.stackSize = 1; + ItemStack vibrantAlloyStack = OreDictionary.getOres("ingotPhasedGold").get(0); + vibrantAlloyStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(energeticAlloyStack, new ItemStack(Items.ender_pearl, 1), + vibrantAlloyStack, 200, 16)); + RecipeHandler.addRecipe(new AlloySmelterRecipe(energeticAlloyStack, + ItemDusts.getDustByName("enderPearl", 1), vibrantAlloyStack, 200, 16)); + } + + // Soularium + if (OreUtil.doesOreExistAndValid("ingotSoularium")) + { + ItemStack soulariumStack = OreDictionary.getOres("ingotSoularium").get(0); + soulariumStack.stackSize = 1; + RecipeHandler.addRecipe(new AlloySmelterRecipe(new ItemStack(Blocks.soul_sand, 1), + new ItemStack(Items.gold_ingot, 1), soulariumStack, 200, 16)); + } + + } + + static void addPlateCuttingMachineRecipes() + { + + for (String ore : OreUtil.oreNames) + { + if (OreUtil.hasBlock(ore) && OreUtil.hasPlate(ore)) + { + RecipeHandler.addRecipe( + new PlateCuttingMachineRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), + OreUtil.getStackFromName("plate" + capitalizeFirstLetter(ore), 9), 200, 16)); + } + } + + // Obsidian + RecipeHandler.addRecipe(new PlateCuttingMachineRecipe(new ItemStack(Blocks.obsidian), + ItemPlates.getPlateByName("obsidian", 9), 100, 4)); + } + + static void addIndustrialSawmillRecipes() + { + ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 0), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 1), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 1), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 1), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 2), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 3), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 4), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Blocks.planks, 6, 5), pulpStack, null, 200, 30, + false)); + RecipeHandler.addRecipe( + new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), new ItemStack(Items.water_bucket), null, + new ItemStack(Blocks.planks, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false)); + } + + static void addBlastFurnaceRecipes() + { + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("titanium"), null, + ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("titanium", 4), null, + ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("titanium", 9), + // null, ItemIngots.getIngotByName("titanium"), null, 3600, 120, 1500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("aluminum"), null, + ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("aluminum", 4), null, + ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("aluminum", 9), + // null, ItemIngots.getIngotByName("aluminum"), null, 2200, 120, 1700)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("kanthal"), null, + ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("kanthal", 4), null, + ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("kanthal", 9), + // null, ItemIngots.getIngotByName("kanthal"), null, 5500, 120, 2500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("tungsten"), null, + ItemIngots.getIngotByName("tungsten"), null, 18000, 120, 2500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("tungsten", 4), null, + ItemIngots.getIngotByName("tungsten"), null, 18000, 120, 2500)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("tungsten", 9), + // null, ItemIngots.getIngotByName("tungsten"), null, 18000, 120, + // 2500)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("chrome"), null, + ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("chrome", 4), null, + ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("chrome", 9), + // null, ItemIngots.getIngotByName("chrome"), null, 4420, 120, 1700)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("steel"), null, + ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDustsSmall.getSmallDustByName("steel", 4), null, + ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); + // RecipeHandler.addRecipe(new + // BlastFurnaceRecipe(ItemDustsTiny.getTinyDustByName("steel", 9), null, + // ItemIngots.getIngotByName("steel"), null, 2800, 120, 1000)); + + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemDusts.getDustByName("galena", 2), null, + ItemIngots.getIngotByName("silver"), ItemIngots.getIngotByName("lead"), 80, 120, 1500)); + + RecipeHandler + .addRecipe(new BlastFurnaceRecipe(new ItemStack(Items.iron_ingot), ItemDusts.getDustByName("coal", 2), + ItemIngots.getIngotByName("steel"), ItemDusts.getDustByName("darkAshes", 2), 500, 120, 1000)); + + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemIngots.getIngotByName("tungsten"), + ItemIngots.getIngotByName("steel"), ItemIngots.getIngotByName("hotTungstensteel"), + ItemDusts.getDustByName("darkAshes", 4), 500, 500, 3000)); + + RecipeHandler + .addRecipe(new BlastFurnaceRecipe(new ItemStack(Blocks.iron_ore), ItemDusts.getDustByName("calcite"), + new ItemStack(Items.iron_ingot, 3), ItemDusts.getDustByName("darkAshes"), 140, 120, 1000)); + + RecipeHandler + .addRecipe(new BlastFurnaceRecipe(BlockOre.getOreByName("Pyrite"), ItemDusts.getDustByName("calcite"), + new ItemStack(Items.iron_ingot, 2), ItemDusts.getDustByName("darkAshes"), 140, 120, 1000)); + } + + static void addUUrecipes() + { + + if (ConfigTechReborn.UUrecipesWood) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.log, 8), " U ", " ", " ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesStone) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.stone, 16), " ", " U ", " ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesSnowBlock) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.snow, 16), "U U", " ", " ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesGrass) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.grass, 16), " ", "U ", "U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesObsidian) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.obsidian, 12), "U U", "U U", " ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesGlass) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.glass, 32), " U ", "U U", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesCocoa) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 32, 3), "UU ", " U", "UU ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesGlowstoneBlock) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.glowstone, 8), " U ", "U U", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesCactus) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.cactus, 48), " U ", "UUU", "U U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesSugarCane) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.reeds, 48), "U U", "U U", "U U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesVine) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.vine, 24), "U ", "U ", "U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesSnowBall) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.snowball, 16), " ", " ", "UUU", 'U', + ModItems.uuMatter); + + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.clay_ball, 48), "UU ", "U ", "UU ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipeslilypad) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.waterlily, 64), "U U", " U ", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesGunpowder) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.gunpowder, 15), "UUU", "U ", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesBone) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.bone, 32), "U ", "UU ", "U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesFeather) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.feather, 32), " U ", " U ", "U U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesInk) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 48), " UU", " UU", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesEnderPearl) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.ender_pearl, 1), "UUU", "U U", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesCoal) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.coal, 5), " U", "U ", " U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesIronOre) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.iron_ore, 2), "U U", " U ", "U U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesGoldOre) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.gold_ore, 2), " U ", "UUU", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesRedStone) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.redstone, 24), " ", " U ", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesLapis) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.dye, 9, 4), " U ", " U ", " UU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesEmeraldOre) + CraftingHelper.addShapedOreRecipe(new ItemStack(Blocks.emerald_ore, 1), "UU ", "U U", " UU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesEmerald) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.emerald, 2), "UUU", "UUU", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesDiamond) + CraftingHelper.addShapedOreRecipe(new ItemStack(Items.diamond, 1), "UUU", "UUU", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesTinDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 10, 77), " ", "U U", " U", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesCopperDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 10, 21), " U", "U U", " ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesLeadDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 14, 42), "UUU", "UUU", "U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesPlatinumDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 1, 58), " U", "UUU", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesTungstenDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 1, 79), "U ", "UUU", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesTitaniumDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 2, 78), "UUU", " U ", " U ", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.UUrecipesAluminumDust) + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.dusts, 16, 2), " U ", " U ", "UUU", 'U', + ModItems.uuMatter); + + if (ConfigTechReborn.HideUuRecipes) + hideUUrecipes(); + + } + + static void hideUUrecipes() + { + // TODO + } + + static void addIndustrialCentrifugeRecipes() + { + + // Mycelium Byproducts + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.mycelium, 8), null, + new ItemStack(Blocks.brown_mushroom, 2), new ItemStack(Blocks.red_mushroom, 2), + new ItemStack(Items.clay_ball, 1), new ItemStack(Blocks.sand, 4), 1640, 5)); + + // Blaze Powder Byproducts + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.blaze_powder), null, + ItemDusts.getDustByName("darkAshes", 1), ItemDusts.getDustByName("sulfur", 1), null, null, 1240, 5)); + + // Magma Cream Products + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.magma_cream, 1), null, + new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.slime_ball, 1), null, null, 2500, 5)); + + // Dust Byproducts + // RecipeHandler.addRecipe(new + // CentrifugeRecipe(ItemDusts.getDustByName("platinum", 1), null, + // ItemDustsTiny.getTinyDustByName("Iridium", 1), + // ItemDustsSmall.getSmallDustByName("Nickel", 1), null, null, 3000, + // 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("electrum", 2), null, + ItemDusts.getDustByName("silver", 1), ItemDusts.getDustByName("gold", 1), null, null, 2400, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("invar", 3), null, + ItemDusts.getDustByName("iron", 2), ItemDusts.getDustByName("nickel", 1), null, null, 1340, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("marble", 8), null, + ItemDusts.getDustByName("magnesium", 1), ItemDusts.getDustByName("calcite", 7), null, null, 1280, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(ItemDusts.getDustByName("redrock", 4), null, ItemDusts.getDustByName("calcite", 2), + ItemDusts.getDustByName("flint", 1), ItemDusts.getDustByName("clay", 1), null, 640, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("basalt", 16), null, + ItemDusts.getDustByName("peridot", 1), ItemDusts.getDustByName("calcite", 3), + ItemDusts.getDustByName("magnesium", 8), ItemDusts.getDustByName("darkAshes", 4), 2680, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("yellowGarnet", 16), null, + ItemDusts.getDustByName("andradite", 5), ItemDusts.getDustByName("grossular", 8), + ItemDusts.getDustByName("uvarovite", 3), null, 2940, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("redGarnet", 16), null, + ItemDusts.getDustByName("pyrope", 3), ItemDusts.getDustByName("almandine", 5), + ItemDusts.getDustByName("spessartine", 8), null, 2940, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("darkAshes", 2), null, + ItemDusts.getDustByName("ashes", 2), null, null, null, 240, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("manyullyn", 2), null, + ItemDusts.getDustByName("cobalt", 1), ItemDusts.getDustByName("ardite", 1), null, null, 1240, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("nichrome", 5), null, + ItemDusts.getDustByName("nickel", 4), ItemDusts.getDustByName("chrome", 1), null, null, 2240, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("cupronickel", 2), null, + ItemDusts.getDustByName("copper", 1), ItemDusts.getDustByName("nickel", 1), null, null, 960, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(ItemDusts.getDustByName("kanthal", 3), null, ItemDusts.getDustByName("iron", 1), + ItemDusts.getDustByName("aluminum", 1), ItemDusts.getDustByName("chrome", 1), null, 1040, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("brass", 4), null, + ItemDusts.getDustByName("zinc", 1), ItemDusts.getDustByName("copper", 3), null, null, 2000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("aluminumBrass", 4), null, + ItemDusts.getDustByName("aluminum", 1), ItemDusts.getDustByName("copper", 3), null, null, 2000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("bronze", 4), null, + ItemDusts.getDustByName("tin", 1), ItemDusts.getDustByName("copper", 3), null, null, 2420, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("netherrack", 16), null, + new ItemStack(Items.redstone, 1), ItemDusts.getDustByName("sulfur", 4), + ItemDusts.getDustByName("basalt", 1), new ItemStack(Items.gold_nugget, 1), 2400, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("enderEye", 1), null, + ItemDusts.getDustByName("enderPearl", 1), new ItemStack(Items.blaze_powder, 1), null, null, 1280, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("tetrahedrite", 8), null, + ItemDusts.getDustByName("copper", 3), ItemDusts.getDustByName("antimony", 1), + ItemDusts.getDustByName("sulfur", 3), ItemDusts.getDustByName("iron", 1), 3640, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("lapis", 16), null, + ItemDusts.getDustByName("lazurite", 12), ItemDusts.getDustByName("sodalite", 2), + ItemDusts.getDustByName("pyrite", 7), ItemDusts.getDustByName("calcite", 1), 3580, 5)); + + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.glowstone_dust, 16), + RecipeUtils.getEmptyCell(1), ItemCells.getCellByName("helium", 1, false), + ItemDusts.getDustByName("gold", 8), new ItemStack(Items.redstone), null, 25000, 20)); + // RecipeHandler.addRecipe(new + // CentrifugeRecipe(ItemDusts.getDustByName("endstone", 16), + // RecipeUtils.getEmptyCell(2), ItemCells.getCellByName("helium3", 1, + // false), ItemCells.getCellByName("helium", 1, false), + // ItemDustsTiny.getTinyDustByName("Tungsten"), new + // ItemStack(Blocks.sand, 12), 4800, 5)); + } + + static void addIndustrialGrinderRecipes() + { + for (String ore : OreUtil.oreNames) + { + if (OreUtil.hasIngot(ore) && OreUtil.hasDustSmall(ore) && OreUtil.hasBlock(ore)) + { + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), + null, new FluidStack(FluidRegistry.WATER, 1000), + OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), + OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), + OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(OreUtil.getStackFromName("block" + capitalizeFirstLetter(ore)), + new ItemStack(Items.water_bucket), null, + OreUtil.getStackFromName("ingot" + capitalizeFirstLetter(ore)), + OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 6), + OreUtil.getStackFromName("dustSmall" + capitalizeFirstLetter(ore), 2), + new ItemStack(Items.bucket), 100, 120)); + } + } + + // Copper Ore + if (OreUtil.doesOreExistAndValid("oreCopper")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCopper").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), + ItemDustsSmall.getSmallDustByName("Nickel", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), + ItemDustsSmall.getSmallDustByName("Nickel", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("copper", 2), + ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), null, 100, + 120)); + RecipeHandler + .addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), + null, ItemDusts.getDustByName("copper", 2), ItemDusts.getDustByName("gold", 1), + ItemDustsSmall.getSmallDustByName("Nickel", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), + ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), + ItemDusts.getDustByName("nickel", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), + ItemDusts.getDustByName("nickel", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Copper Ore"); + } + } + + // Tin Ore + if (OreUtil.doesOreExistAndValid("oreTin")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTin").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Zinc", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Zinc", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("tin", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), null, 100, + 120)); + RecipeHandler + .addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), + null, ItemDusts.getDustByName("tin", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDusts.getDustByName("zinc", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Tin Ore"); + } + } + + // Nickel Ore + if (OreUtil.doesOreExistAndValid("oreNickel")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreNickel").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Platinum", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Platinum", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("nickel", 3), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), + null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("nickel", 3), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), + new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), + ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDusts.getDustByName("platinum", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDusts.getDustByName("platinum", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Nickel Ore"); + } + } + + // Zinc Ore + if (OreUtil.doesOreExistAndValid("oreZinc")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreZinc").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Tin", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDustsSmall.getSmallDustByName("Tin", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("zinc", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), null, 100, + 120)); + RecipeHandler + .addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketSodiumpersulfate), + null, ItemDusts.getDustByName("zinc", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDusts.getDustByName("iron", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Zinc Ore"); + } + } + + // Silver Ore + if (OreUtil.doesOreExistAndValid("oreSilver")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreSilver").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("silver", 2), ItemDustsSmall.getSmallDustByName("Lead", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("silver", 2), ItemDustsSmall.getSmallDustByName("Lead", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), + ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Silver Ore"); + } + } + + // Lead Ore + if (OreUtil.doesOreExistAndValid("oreLead")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreLead").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + ItemDusts.getDustByName("lead", 2), ItemDustsSmall.getSmallDustByName("Silver", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("lead", 2), ItemDustsSmall.getSmallDustByName("Silver", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(ModFluids.fluidMercury, 1000), + ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); + } + } + + // Apatite Ore + if (OreUtil.doesOreExistAndValid("oreApatite") & OreUtil.doesOreExistAndValid("gemApatite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreApatite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemApatite").get(0); + gemStack.stackSize = 6; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), gemStack, + gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), + new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Apatite Ore"); + } + } + + // Nether Quartz Ore + if (OreUtil.doesOreExistAndValid("dustNetherQuartz")) + { + try + { + ItemStack dustStack = OreDictionary.getOres("dustNetherQuartz").get(0); + dustStack.stackSize = 4; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), null, + new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(Items.quartz, 2), dustStack, + ItemDustsSmall.getSmallDustByName("Netherrack", 2), null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), + new ItemStack(Items.water_bucket), null, new ItemStack(Items.quartz, 2), dustStack, + ItemDustsSmall.getSmallDustByName("Netherrack", 2), new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Nether Quartz Ore"); + } + } + + // Certus Quartz Ore + if (OreUtil.doesOreExistAndValid("oreCertusQuartz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCertusQuartz").get(0); + ItemStack gemStack = OreDictionary.getOres("crystalCertusQuartz").get(0); + ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); + dustStack.stackSize = 2; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); + } + } + + // Charged Certus Quartz Ore + if (OreUtil.doesOreExistAndValid("oreChargedCertusQuartz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreChargedCertusQuartz").get(0); + ItemStack gemStack = OreDictionary.getOres("crystalChargedCertusQuartz").get(0); + ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); + dustStack.stackSize = 2; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Charged Certus Quartz Ore"); + } + } + + // Amethyst Ore + if (OreUtil.doesOreExistAndValid("oreAmethyst") && OreUtil.doesOreExistAndValid("gemAmethyst")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreAmethyst").get(0); + ItemStack gemStack = OreDictionary.getOres("gemAmethyst").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemAmethyst").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); + } + } + + // Topaz Ore + if (OreUtil.doesOreExistAndValid("oreTopaz") && OreUtil.doesOreExistAndValid("gemTopaz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTopaz").get(0); + ItemStack gemStack = OreDictionary.getOres("gemTopaz").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemTopaz").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Topaz Ore"); + } + } + + // Tanzanite Ore + if (OreUtil.doesOreExistAndValid("oreTanzanite") && OreUtil.doesOreExistAndValid("gemTanzanite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTanzanite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemTanzanite").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemTanzanite").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Tanzanite Ore"); + } + } + + // Malachite Ore + if (OreUtil.doesOreExistAndValid("oreMalachite") && OreUtil.doesOreExistAndValid("gemMalachite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreMalachite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemMalachite").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemMalachite").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, null, + new FluidStack(FluidRegistry.WATER, 1000), gemStack, dustStack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + gemStack, dustStack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Malachite Ore"); + } + } + + // Galena Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("galena", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + ItemDustsSmall.getSmallDustByName("Silver", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), null, + new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("galena", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDusts.getDustByName("silver", 1), null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + ItemDusts.getDustByName("silver", 1), new ItemStack(Items.bucket), 100, 120)); + + // Ruby Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("ruby", 1), + ItemDustsSmall.getSmallDustByName("Ruby", 6), ItemDustsSmall.getSmallDustByName("Chrome", 2), null, 100, + 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), new ItemStack(Items.water_bucket), null, + ItemGems.getGemByName("ruby", 1), ItemDustsSmall.getSmallDustByName("Ruby", 6), + ItemDustsSmall.getSmallDustByName("Chrome", 2), new ItemStack(Items.bucket), 100, 120)); + + // Sapphire Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("sapphire", 1), + ItemDustsSmall.getSmallDustByName("Sapphire", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), + null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), new ItemStack(Items.water_bucket), null, + ItemGems.getGemByName("sapphire", 1), ItemDustsSmall.getSmallDustByName("Sapphire", 6), + ItemDustsSmall.getSmallDustByName("Aluminum", 2), new ItemStack(Items.bucket), 100, 120)); + + // Bauxite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("bauxite", 2), + ItemDustsSmall.getSmallDustByName("Grossular", 4), ItemDustsSmall.getSmallDustByName("Titanium", 4), + null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("bauxite", 2), ItemDustsSmall.getSmallDustByName("Grossular", 4), + ItemDustsSmall.getSmallDustByName("Titanium", 4), new ItemStack(Items.bucket), 100, 120)); + + // Pyrite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("pyrite", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Phosphorous", 1), + null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("pyrite", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + ItemDustsSmall.getSmallDustByName("Phosphorous", 1), new ItemStack(Items.bucket), 100, 120)); + + // Cinnabar Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("cinnabar", 2), + ItemDustsSmall.getSmallDustByName("Redstone", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), + null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("cinnabar", 2), ItemDustsSmall.getSmallDustByName("Redstone", 1), + ItemDustsSmall.getSmallDustByName("Glowstone", 1), new ItemStack(Items.bucket), 100, 120)); + + // Sphalerite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("sphalerite", 2), + ItemDustsSmall.getSmallDustByName("Zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), + null, 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("sphalerite", 2), ItemDustsSmall.getSmallDustByName("Zinc", 1), + ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("sphalerite", 2), + ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), null, 100, + 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), + new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("sphalerite", 2), + ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), + new ItemStack(Items.bucket), 100, 120)); + + // Tungsten Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("tungsten", 2), + ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), + ItemDustsSmall.getSmallDustByName("Silver", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), null, + new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("tungsten", 2), + ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDusts.getDustByName("silver", 2), null, 100, + 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), + ItemDusts.getDustByName("silver", 2), new ItemStack(Items.bucket), 100, 120)); + + // Sheldonite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("platinum", 2), + ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), new ItemStack(Items.water_bucket), null, + ItemDusts.getDustByName("platinum", 2), ItemDustsSmall.getSmallDustByName("Iridium", 1), + ItemDustsSmall.getSmallDustByName("Iridium", 1), new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), null, + new FluidStack(ModFluids.fluidMercury, 1000), ItemDusts.getDustByName("platinum", 3), + ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), new ItemStack(ModItems.bucketMercury), + null, ItemDusts.getDustByName("platinum", 3), ItemDustsSmall.getSmallDustByName("Iridium", 1), + ItemDustsSmall.getSmallDustByName("Iridium", 1), new ItemStack(Items.bucket), 100, 120)); + + // Peridot Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemGems.getGemByName("peridot", 1), + ItemDustsSmall.getSmallDustByName("Peridot", 6), ItemDustsSmall.getSmallDustByName("Pyrope", 2), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), new ItemStack(Items.water_bucket), + null, ItemGems.getGemByName("peridot", 1), ItemDustsSmall.getSmallDustByName("Peridot", 6), + ItemDustsSmall.getSmallDustByName("Pyrope", 2), new ItemStack(Items.bucket), 100, 120)); + + // Sodalite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("sodalite", 12), + ItemDustsSmall.getSmallDustByName("Lazurite", 4), ItemDustsSmall.getSmallDustByName("Lapis", 4), null, + 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), new ItemStack(Items.water_bucket), + null, ItemDusts.getDustByName("sodalite", 12), ItemDustsSmall.getSmallDustByName("Lazurite", 4), + ItemDustsSmall.getSmallDustByName("Lapis", 4), new ItemStack(Items.bucket), 100, 120)); + + // Tetrahedrite Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), null, + new FluidStack(FluidRegistry.WATER, 1000), ItemDusts.getDustByName("tetrahedrite", 2), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), null, + 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), + new ItemStack(Items.water_bucket), null, ItemDusts.getDustByName("tetrahedrite", 2), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), + new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), null, + new FluidStack(ModFluids.fluidSodiumpersulfate, 1000), ItemDusts.getDustByName("tetrahedrite", 3), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), null, + 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), + new ItemStack(ModItems.bucketSodiumpersulfate), null, ItemDusts.getDustByName("tetrahedrite", 3), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), + new ItemStack(Items.bucket), 100, 120)); + } + + static void addImplosionCompressorRecipes() + { + } + + static void addChemicalReactorRecipes() + { + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("calcium", 1), + ItemCells.getCellByName("carbon", 1), ItemCells.getCellByName("calciumCarbonate", 2), 240, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_nugget, 8), + new ItemStack(Items.melon, 1), new ItemStack(Items.speckled_melon, 1), 40, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrogen", 1), + ItemCells.getCellByName("carbon", 1), ItemCells.getCellByName("nitrocarbon", 2), 1500, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("carbon", 1), + ItemCells.getCellByName("hydrogen", 4), ItemCells.getCellByName("methane", 5), 3500, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sulfur", 1), + ItemCells.getCellByName("sodium", 1), ItemCells.getCellByName("sodiumSulfide", 2), 100, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.blaze_powder, 1), + new ItemStack(Items.ender_pearl, 1), new ItemStack(Items.ender_eye, 1), 40, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_nugget, 8), + new ItemStack(Items.carrot, 1), new ItemStack(Items.golden_carrot, 1), 40, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("glyceryl", 1), + ItemCells.getCellByName("diesel", 4), ItemCells.getCellByName("nitroDiesel", 5), 1000, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.gold_ingot, 8), + new ItemStack(Items.apple, 1), new ItemStack(Items.golden_apple, 1), 40, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Blocks.gold_block, 8), + new ItemStack(Items.apple, 1), new ItemStack(Items.golden_apple, 1, 1), 40, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(new ItemStack(Items.blaze_powder, 1), + new ItemStack(Items.slime_ball, 1), new ItemStack(Items.magma_cream, 1), 40, 30)); + } + + static void addIndustrialElectrolyzerRecipes() + { + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("nitrocarbon", 2), null, + ItemCells.getCellByName("nitrogen"), ItemCells.getCellByName("carbon"), null, null, 80, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("pyrite", 3), null, + ItemDusts.getDustByName("iron"), ItemDusts.getDustByName("sulfur"), null, null, 120, 128)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("sphalerite", 2), null, + ItemDusts.getDustByName("zinc"), ItemDusts.getDustByName("sulfur"), null, null, 150, 100)); + + } + + static void addIc2Recipes() + { + CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.manual), ItemIngots.getIngotByName("refinedIron"), + Items.book); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("machineParts", 16), "CSC", "SCS", "CSC", 'S', + "ingotSteel", 'C', TechRebornAPI.recipeCompact.getItem("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("energyFlowCircuit", 4), "ATA", "LIL", "ATA", 'T', + "ingotTungsten", 'I', "plateIridium", 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), 'L', + TechRebornAPI.recipeCompact.getItem("lapotronCrystal")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("superconductor", 4), "CCC", "TIT", "EEE", 'E', + ItemParts.getPartByName("energyFlowCircuit"), 'C', ItemParts.getPartByName("heliumCoolantSimple"), 'T', + "ingotTungsten", 'I', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); + + CraftingHelper + .addShapedOreRecipe(new ItemStack(ModItems.lapotronicOrb), "LLL", "LPL", "LLL", 'L', + new ItemStack(TechRebornAPI.recipeCompact.getItem("lapotronCrystal").getItem(), 1, + OreDictionary.WILDCARD_VALUE), + 'P', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.industrialSawmill), "PAP", "SSS", "ACA", 'P', + ItemIngots.getIngotByName("refinedIron"), 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), + 'S', ItemParts.getPartByName("diamondSawBlade"), 'C', + TechRebornAPI.recipeCompact.getItem("advancedMachine")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ComputerCube), "DME", "MAM", "EMD", 'E', + ItemParts.getPartByName("energyFlowCircuit"), 'D', ItemParts.getPartByName("dataOrb"), 'M', + ItemParts.getPartByName("computerMonitor"), 'A', + TechRebornAPI.recipeCompact.getItem("advancedMachine")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MatterFabricator), "ETE", "AOA", "ETE", 'E', + ItemParts.getPartByName("energyFlowCircuit"), 'T', ModBlocks.Extractor, 'A', + ModBlocks.HighAdvancedMachineBlock, 'O', ModItems.lapotronicOrb); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.heatGenerator), "III", "IHI", "CGC", 'I', "plateIron", + 'H', new ItemStack(Blocks.iron_bars), 'C', "circuitBasic", 'G', ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Gasturbine), "IAI", "WGW", "IAI", 'I', "ingotInvar", + 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), 'W', + TechRebornAPI.recipeCompact.getItem("windMill"), 'G', + TechRebornAPI.recipeCompact.getItem("reinforcedGlass")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Gasturbine), "IAI", "WGW", "IAI", 'I', + "ingotAluminum", 'A', TechRebornAPI.recipeCompact.getItem("advancedCircuit"), 'W', + TechRebornAPI.recipeCompact.getItem("windMill"), 'G', + TechRebornAPI.recipeCompact.getItem("reinforcedGlass")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Semifluidgenerator), "III", "IHI", "CGC", 'I', + "plateIron", 'H', ModBlocks.reinforcedglass, 'C', ItemParts.getPartByName("electronicCircuit"), 'G', + ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Semifluidgenerator), "AAA", "AHA", "CGC", 'A', + "plateAluminum", 'H', ModBlocks.reinforcedglass, 'C', ItemParts.getPartByName("electronicCircuit"), 'G', + ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.DieselGenerator), "III", "I I", "CGC", 'I', + "refinedIron", 'C', ItemParts.getPartByName("electronicCircuit"), 'G', ModBlocks.Generator); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.DieselGenerator), "AAA", "A A", "CGC", 'A', + "ingotAluminum", 'C', ItemParts.getPartByName("electronicCircuit"), 'G', ModBlocks.Generator); + + // CraftingHelper.addShapedOreRecipe(new + // ItemStack(ModBlocks.MagicalAbsorber), + // "CSC", "IBI", "CAC", + // 'C', "circuitMaster", + // 'S', "craftingSuperconductor", + // 'B', Blocks.beacon, + // 'A', ModBlocks.Magicenergeyconverter, + // 'I', TechRebornAPI.recipeCompact.getItem("iridiumPlate")); + // + // CraftingHelper.addShapedOreRecipe(new + // ItemStack(ModBlocks.Magicenergeyconverter), + // "CTC", "PBP", "CLC", + // 'C', "circuitAdvanced", + // 'P', "platePlatinum", + // 'B', Blocks.beacon, + // 'L', TechRebornAPI.recipeCompact.getItem("lapotronCrystal"), + // 'T', TechRebornAPI.recipeCompact.getItem("teleporter")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Dragoneggenergysiphoner), "CTC", "ISI", "CBC", 'I', + TechRebornAPI.recipeCompact.getItem("iridiumPlate"), 'C', ItemParts.getPartByName("electronicCircuit"), + 'B', ModItems.lithiumBattery, 'S', ModBlocks.Supercondensator, 'T', ModBlocks.Extractor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.centrifuge), "SCS", "BEB", "SCS", 'S', "plateSteel", + 'C', "circuitAdvanced", 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine"), 'E', + TechRebornAPI.recipeCompact.getItem("extractor")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.BlastFurnace), "CHC", "HBH", "FHF", 'H', + new ItemStack(ModItems.parts, 1, 17), 'C', ItemParts.getPartByName("advancedCircuit"), 'B', + BlockMachineFrame.getFrameByName("advancedMachine", 1), 'F', ModBlocks.ElectricFurnace); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.IndustrialGrinder), "ECP", "GGG", "CBC", 'E', + ModBlocks.IndustrialElectrolyzer, 'P', ModBlocks.Extractor, 'C', + ItemParts.getPartByName("advancedCircuit"), 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine"), + 'G', ModBlocks.Grinder); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ImplosionCompressor), "ABA", "CPC", "ABA", 'A', + ItemParts.getPartByName("advancedAlloy"), 'C', ItemParts.getPartByName("advancedCircuit"), 'B', + BlockMachineFrame.getFrameByName("advancedMachine", 1), 'P', ModBlocks.Compressor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.VacuumFreezer), "SPS", "CGC", "SPS", 'S', + "plateSteel", 'C', ItemParts.getPartByName("advancedCircuit"), 'G', ModBlocks.reinforcedglass, 'P', + ModBlocks.Extractor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Distillationtower), "CMC", "PBP", "EME", 'E', + ModBlocks.IndustrialElectrolyzer, 'M', "circuitMaster", 'B', + TechRebornAPI.recipeCompact.getItem("advancedMachine"), 'C', ModBlocks.centrifuge, 'P', + ModBlocks.Extractor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.AlloyFurnace), "III", "F F", "III", 'I', + ItemIngots.getIngotByName("refinediron"), 'F', new ItemStack(ModBlocks.ironFurnace)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.ChemicalReactor), "IMI", "CPC", "IEI", 'I', + "ingotInvar", 'C', ItemParts.getPartByName("advancedCircuit"), 'M', ModBlocks.Extractor, 'P', + ModBlocks.Compressor, 'E', ModBlocks.Extractor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.RollingMachine), "PCP", "MBM", "PCP", 'P', + Blocks.piston, 'C', ItemParts.getPartByName("advancedCircuit"), 'M', ModBlocks.Compressor, 'B', + BlockMachineFrame.getFrameByName("machine", 1)); + + // CraftingHelper.addShapedOreRecipe(new + // ItemStack(ModBlocks.ElectricCraftingTable), + // "ITI", "IBI", "ICI", + // 'I', "plateIron", + // 'C', "circuitAdvanced", + // 'T', "crafterWood", + // 'B', TechRebornAPI.recipeCompact.getItem("machine")); + + // CraftingHelper.addShapedOreRecipe(new + // ItemStack(ModBlocks.ElectricCraftingTable), + // "ATA", "ABA", "ACA", + // 'A', "plateAluminum", + // 'C', "circuitAdvanced", + // 'T', "crafterWood", + // 'B', TechRebornAPI.recipeCompact.getItem("machine")); + + // CraftingHelper.addShapedOreRecipe(new + // ItemStack(ModBlocks.ChunkLoader), + // "SCS", "CMC", "SCS", + // 'S', "plateSteel", + // 'C', "circuitMaster", + // 'M', new ItemStack(ModItems.parts, 1, 39)); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.Lesu), " L ", "CBC", " M ", 'L', ModBlocks.lvt, 'C', + ItemParts.getPartByName("advancedCircuit"), 'M', ModBlocks.mvt, 'B', ModBlocks.LesuStorage); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.HighAdvancedMachineBlock), "CTC", "TBT", "CTC", 'C', + "ingotChrome", 'T', "ingotTitanium", 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 0), "III", "CBC", "III", 'I', + "plateIron", 'C', "circuitBasic", 'B', TechRebornAPI.recipeCompact.getItem("machine")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 1), "SSS", "CBC", "SSS", 'S', + "plateSteel", 'C', "circuitAdvanced", 'B', TechRebornAPI.recipeCompact.getItem("advancedMachine")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.MachineCasing, 4, 2), "HHH", "CBC", "HHH", 'H', + "ingotChrome", 'C', "circuitElite", 'B', ModBlocks.HighAdvancedMachineBlock); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.quantumChest), "DCD", "ATA", "DQD", 'D', + ItemParts.getPartByName("dataOrb"), 'C', ItemParts.getPartByName("computerMonitor"), 'A', + ModBlocks.HighAdvancedMachineBlock, 'Q', ModBlocks.digitalChest, 'T', ModBlocks.Compressor); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModBlocks.PlasmaGenerator), "PPP", "PTP", "CGC", 'P', + ItemPlates.getPlateByName("tungstensteel"), 'T', TechRebornAPI.recipeCompact.getItem("hvTransformer"), + 'G', TechRebornAPI.recipeCompact.getItem("generator"), 'C', + ItemParts.getPartByName("energyFlowCircuit")); + + // Smetling + GameRegistry.addSmelting(ItemDusts.getDustByName("copper", 1), + TechRebornAPI.recipeCompact.getItem("copperIngot"), 1F); + GameRegistry.addSmelting(ItemDusts.getDustByName("tin", 1), TechRebornAPI.recipeCompact.getItem("tinIngot"), + 1F); + GameRegistry.addSmelting(ItemDusts.getDustByName("bronze", 1), + TechRebornAPI.recipeCompact.getItem("bronzeIngot"), 1F); + GameRegistry.addSmelting(ItemDusts.getDustByName("lead", 1), TechRebornAPI.recipeCompact.getItem("leadIngot"), + 1F); + GameRegistry.addSmelting(ItemDusts.getDustByName("silver", 1), + TechRebornAPI.recipeCompact.getItem("silverIngot"), 1F); + + // Saw mill + ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 0), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 0), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 0), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 2), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 2), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log, 1, 3), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 3), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 0), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 4), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(Blocks.log2, 1, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Blocks.planks, 6, 5), pulpStack, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 30, false)); + + // UU + if (ConfigTechReborn.UUrecipesIridiamOre) + CraftingHelper.addShapedOreRecipe((TechRebornAPI.recipeCompact.getItem("iridiumOre")), "UUU", " U ", "UUU", + 'U', ModItems.uuMatter); + + // Blast Furnace + RecipeHandler.addRecipe(new BlastFurnaceRecipe(ItemCells.getCellByName("silicon", 2), null, + ItemPlates.getPlateByName("silicon"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2), 1000, 120, 1500)); + + // CentrifugeRecipes + + // Plantball/Bio Chaff + // FIX with ic2 + // RecipeHandler.addRecipe(new CentrifugeRecipe(new + // ItemStack(Blocks.grass, 16), null, new + // ItemStack(TechRebornAPI.recipeCompact.getItem("biochaff").getItem(), + // 8), new + // ItemStack(TechRebornAPI.recipeCompact.getItem("plantBall").getItem(), + // 8), new ItemStack(Items.clay_ball), new ItemStack(Blocks.sand, 8), + // 2500, 5)); + // RecipeHandler.addRecipe(new CentrifugeRecipe(new + // ItemStack(Blocks.dirt, 16), null, new + // ItemStack(TechRebornAPI.recipeCompact.getItem("biochaff").getItem(), + // 4), new + // ItemStack(TechRebornAPI.recipeCompact.getItem("plantBall").getItem(), + // 4), new ItemStack(Items.clay_ball), new ItemStack(Blocks.sand, 8), + // 2500, 5)); + + // Methane + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.mushroom_stew, 16), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, + 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.apple, 32), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.porkchop, 12), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_porkchop, 16), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, + 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.bread, 64), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.fish, 12), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.cooked_fish, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.beef, 12), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.cooked_beef, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Blocks.pumpkin, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.speckled_melon, 1), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), + new ItemStack(Items.gold_nugget, 6), null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.spider_eye, 32), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.chicken, 12), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.cooked_chicken, 16), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, + 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.rotten_flesh, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.melon, 64), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.cookie, 64), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.cake, 8), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.golden_carrot, 1), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), + new ItemStack(Items.gold_nugget, 6), null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.carrot, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.baked_potato, 24), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.potato, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.poisonous_potato, 12), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, + 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Items.nether_wart, 1), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + // Fix with ic2 + // RecipeHandler.addRecipe(new CentrifugeRecipe(new + // ItemStack(TechRebornAPI.recipeCompact.getItem("terraWart").getItem(), + // 16), TechRebornAPI.recipeCompact.getItem("cell"), + // ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Blocks.brown_mushroom, 1), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("methane", 1), null, null, null, + 5000, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Blocks.red_mushroom, 1), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("methane", 1), null, null, null, 5000, 5)); + + // Rubber Wood Yields + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(TechRebornAPI.recipeCompact.getItem("rubberWood").getItem(), 15), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("resin").getItem(), 8), + new ItemStack(Blocks.sapling, 6), ItemCells.getCellByName("methane", 1), + ItemCells.getCellByName("carbon", 4), 5000, 5)); + + // Soul Sand Byproducts + RecipeHandler.addRecipe( + new CentrifugeRecipe(new ItemStack(Blocks.soul_sand, 16), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("oil", 1), ItemDusts.getDustByName("saltpeter", 4), + ItemDusts.getDustByName("coal", 1), new ItemStack(Blocks.sand, 10), 2500, 5)); + + // Ice + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("ice", 1), null, + new ItemStack(Blocks.ice, 1), TechRebornAPI.recipeCompact.getItem("cell"), null, null, 40, 5)); + + // Dust Byproducts + + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.glowstone_dust, 16), + TechRebornAPI.recipeCompact.getItem("cell"), new ItemStack(Items.redstone, 8), + ItemDusts.getDustByName("gold", 8), ItemCells.getCellByName("helium", 1), null, 25000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("phosphorous", 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), + ItemCells.getCellByName("calcium", 3), null, null, null, 1280, 5)); + RecipeHandler.addRecipe( + new CentrifugeRecipe(ItemDusts.getDustByName("ashes", 1), TechRebornAPI.recipeCompact.getItem("cell"), + ItemCells.getCellByName("carbon"), null, null, null, 80, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(new ItemStack(Items.redstone, 10), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 4), + ItemCells.getCellByName("silicon", 1), ItemDusts.getDustByName("pyrite", 3), + ItemDusts.getDustByName("ruby", 1), ItemCells.getCellByName("mercury", 3), 6800, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("endstone", 16), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2), + ItemCells.getCellByName("helium3", 1), ItemCells.getCellByName("helium"), + ItemDustsSmall.getSmallDustByName("Tungsten", 1), new ItemStack(Blocks.sand, 12), 4800, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("cinnabar", 2), + TechRebornAPI.recipeCompact.getItem("cell"), ItemCells.getCellByName("mercury", 1), + ItemDusts.getDustByName("sulfur", 1), null, null, 80, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemDusts.getDustByName("flint", 1), null, + TechRebornAPI.recipeCompact.getItem("silicondioxideDust"), null, null, null, 160, 5)); + + // Deuterium/Tritium + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("helium", 16), null, + ItemCells.getCellByName("deuterium", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 15), null, null, 10000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("deuterium", 4), null, + ItemCells.getCellByName("tritium", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), null, null, 3000, 5)); + RecipeHandler.addRecipe(new CentrifugeRecipe(ItemCells.getCellByName("hydrogen", 4), null, + ItemCells.getCellByName("deuterium", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3), null, null, 3000, 5)); + + // Lava Cell Byproducts + ItemStack lavaCells = TechRebornAPI.recipeCompact.getItem("lavaCell"); + lavaCells.stackSize = 8; + RecipeHandler.addRecipe(new CentrifugeRecipe(lavaCells, null, ItemNuggets.getNuggetByName("electrum", 4), + ItemIngots.getIngotByName("copper", 2), ItemDustsSmall.getSmallDustByName("Tungsten", 1), + ItemIngots.getIngotByName("tin", 2), 6000, 5)); + + // IndustrialGrinderRecipes + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.coal_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.coal, 1), + ItemDustsSmall.getSmallDustByName("Coal", 6), ItemDustsSmall.getSmallDustByName("Coal", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.iron_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("iron", 2), + ItemDustsSmall.getSmallDustByName("Nickel", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("gold", 2), + ItemDustsSmall.getSmallDustByName("Copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.iron_ore, 1), + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("iron", 2), + ItemDusts.getDustByName("nickel", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("gold", 2), + ItemDusts.getDustByName("copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.gold_ore, 1), + ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("gold", 3), + ItemDustsSmall.getSmallDustByName("Copper", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.diamond_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.diamond, 1), + ItemDustsSmall.getSmallDustByName("Diamond", 6), ItemDustsSmall.getSmallDustByName("Coal", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.emerald_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.emerald, 1), + ItemDustsSmall.getSmallDustByName("Emerald", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.redstone_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.redstone, 10), + ItemDustsSmall.getSmallDustByName("Cinnabar", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.lapis_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.dye, 6, 4), + ItemDustsSmall.getSmallDustByName("Lapis", 36), ItemDustsSmall.getSmallDustByName("Lazurite", 8), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + // Copper Ore + if (OreUtil.doesOreExistAndValid("oreCopper")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCopper").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("copper", 2), + ItemDustsSmall.getSmallDustByName("Gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("copper", 2), + ItemDusts.getDustByName("gold", 1), ItemDustsSmall.getSmallDustByName("Nickel", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("copper", 2), ItemDustsSmall.getSmallDustByName("Gold", 1), + ItemDusts.getDustByName("nickel", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Copper Ore"); + } + } + + // Tin Ore + if (OreUtil.doesOreExistAndValid("oreTin")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTin").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tin", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("tin", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("zinc", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Tin Ore"); + } + } + + // Nickel Ore + if (OreUtil.doesOreExistAndValid("oreNickel")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreNickel").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("nickel", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("nickel", 3), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Platinum", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("nickel", 2), ItemDustsSmall.getSmallDustByName("Iron", 1), + ItemDusts.getDustByName("platinum", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Nickel Ore"); + } + } + + // Zinc Ore + if (OreUtil.doesOreExistAndValid("oreZinc")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreZinc").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("zinc", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDustsSmall.getSmallDustByName("Tin", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("zinc", 2), + ItemDustsSmall.getSmallDustByName("Iron", 1), ItemDusts.getDustByName("iron", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Zinc Ore"); + } + } + + // Silver Ore + if (OreUtil.doesOreExistAndValid("oreSilver")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreSilver").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("silver", 2), + ItemDustsSmall.getSmallDustByName("Lead", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("silver", 3), ItemDustsSmall.getSmallDustByName("Lead", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), + 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Silver Ore"); + } + } + + // Lead Ore + if (OreUtil.doesOreExistAndValid("oreLead")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreLead").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("lead", 2), + ItemDustsSmall.getSmallDustByName("Silver", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("lead", 2), ItemDusts.getDustByName("silver", 1), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), TechRebornAPI.recipeCompact.getItem("cell"), + 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); + } + } + + // Uranium Ore + if (OreUtil.doesOreExistAndValid("oreUranium")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreUranium").get(0); + ItemStack uranium238Stack = TechRebornAPI.recipeCompact.getItem("Uran238"); + uranium238Stack.stackSize = 8; + ItemStack uranium235Stack = TechRebornAPI.recipeCompact.getItem("smallUran235"); + uranium235Stack.stackSize = 2; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + uranium238Stack, uranium235Stack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, uranium238Stack, uranium235Stack, null, + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + uranium238Stack, uranium235Stack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Uranium Ore"); + } + } + + // Pitchblende Ore + if (OreUtil.doesOreExistAndValid("orePitchblende")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("orePitchblende").get(0); + ItemStack uranium238Stack = TechRebornAPI.recipeCompact.getItem("Uran238"); + uranium238Stack.stackSize = 8; + ItemStack uranium235Stack = TechRebornAPI.recipeCompact.getItem("smallUran235"); + uranium235Stack.stackSize = 2; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, null, new FluidStack(FluidRegistry.WATER, 1000), + uranium238Stack, uranium235Stack, null, null, 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, uranium238Stack, uranium235Stack, null, + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, new ItemStack(Items.water_bucket), null, + uranium238Stack, uranium235Stack, null, new ItemStack(Items.bucket), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Uranium Ore"); + } + } + + // Aluminum Ore + if (OreUtil.doesOreExistAndValid("oreAluminum")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreAluminum").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + ItemDusts.getDustByName("aluminum", 2), ItemDustsSmall.getSmallDustByName("Bauxite", 1), + ItemDustsSmall.getSmallDustByName("Bauxite", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Lead Ore"); + } + } + + // Ardite Ore + if (OreUtil.doesOreExistAndValid("oreArdite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreArdite").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("ardite", 2), + ItemDustsSmall.getSmallDustByName("Ardite", 1), ItemDustsSmall.getSmallDustByName("Ardite", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Ardite Ore"); + } + } + + // Cobalt Ore + if (OreUtil.doesOreExistAndValid("oreCobalt")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCobalt").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("cobalt", 2), + ItemDustsSmall.getSmallDustByName("Cobalt", 1), ItemDustsSmall.getSmallDustByName("Cobalt", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Cobalt Ore"); + } + } + + // Dark Iron Ore + if (OreUtil.doesOreExistAndValid("oreDarkIron")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreDarkIron").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("darkIron", 2), + ItemDustsSmall.getSmallDustByName("DarkIron", 1), ItemDustsSmall.getSmallDustByName("Iron", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Dark Iron Ore"); + } + } + + // Cadmium Ore + if (OreUtil.doesOreExistAndValid("oreCadmium")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCadmium").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + ItemDusts.getDustByName("cadmium", 2), ItemDustsSmall.getSmallDustByName("Cadmium", 1), + ItemDustsSmall.getSmallDustByName("Cadmium", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Cadmium Ore"); + } + } + + // Indium Ore + if (OreUtil.doesOreExistAndValid("oreIndium")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreIndium").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("indium", 2), + ItemDustsSmall.getSmallDustByName("Indium", 1), ItemDustsSmall.getSmallDustByName("Indium", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Indium Ore"); + } + } + + // Calcite Ore + if (OreUtil.doesOreExistAndValid("oreCalcite") && OreUtil.doesOreExistAndValid("gemCalcite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCalcite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemCalcite").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, ItemDustsSmall.getSmallDustByName("Calcite", 6), null, + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Calcite Ore"); + } + } + + // Magnetite Ore + if (OreUtil.doesOreExistAndValid("oreMagnetite") && OreUtil.doesOreExistAndValid("chunkMagnetite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreMagnetite").get(0); + ItemStack chunkStack = OreDictionary.getOres("chunkMagnetite").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + chunkStack, ItemDustsSmall.getSmallDustByName("Magnetite", 6), null, + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Magnetite Ore"); + } + } + + // Graphite Ore + if (OreUtil.doesOreExistAndValid("oreGraphite") && OreUtil.doesOreExistAndValid("chunkGraphite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreGraphite").get(0); + ItemStack chunkStack = OreDictionary.getOres("chunkGraphite").get(0); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + chunkStack, ItemDustsSmall.getSmallDustByName("Graphite", 6), null, + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Graphite Ore"); + } + } + + // Osmium Ore + if (OreUtil.doesOreExistAndValid("oreOsmium")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreOsmium").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("osmium", 2), + ItemDustsSmall.getSmallDustByName("Osmium", 1), ItemDustsSmall.getSmallDustByName("Osmium", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Osmium Ore"); + } + } + + // Teslatite Ore + if (OreUtil.doesOreExistAndValid("oreTeslatite") && OreUtil.doesOreExistAndValid("dustTeslatite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTeslatite").get(0); + ItemStack dustStack = OreDictionary.getOres("dustTeslatite").get(0); + dustStack.stackSize = 10; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + dustStack, ItemDustsSmall.getSmallDustByName("Sodalite", 1), + ItemDustsSmall.getSmallDustByName("Glowstone", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Teslatite Ore"); + } + } + + // Sulfur Ore + if (OreUtil.doesOreExistAndValid("oreSulfur")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreSulfur").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sulfur", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Sulfur Ore"); + } + } + + // Saltpeter Ore + if (OreUtil.doesOreExistAndValid("oreSaltpeter")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreSaltpeter").get(0); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(oreStack, + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("saltpeter", 2), + ItemDustsSmall.getSmallDustByName("Saltpeter", 1), + ItemDustsSmall.getSmallDustByName("Saltpeter", 1), TechRebornAPI.recipeCompact.getItem("cell"), + 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Saltpeter Ore"); + } + } + + // Apatite Ore + if (OreUtil.doesOreExistAndValid("oreApatite") & OreUtil.doesOreExistAndValid("gemApatite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreApatite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemApatite").get(0); + gemStack.stackSize = 6; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, gemStack, ItemDustsSmall.getSmallDustByName("Phosphorous", 4), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Apatite Ore"); + } + } + + // Nether Quartz Ore + if (OreUtil.doesOreExistAndValid("dustNetherQuartz")) + { + try + { + ItemStack dustStack = OreDictionary.getOres("dustNetherQuartz").get(0); + dustStack.stackSize = 4; + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(Blocks.quartz_ore, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, new ItemStack(Items.quartz, 2), + dustStack, ItemDustsSmall.getSmallDustByName("Netherrack", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Nether Quartz Ore"); + } + } + + // Certus Quartz Ore + if (OreUtil.doesOreExistAndValid("oreCertusQuartz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreCertusQuartz").get(0); + ItemStack gemStack = OreDictionary.getOres("crystalCertusQuartz").get(0); + ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); + dustStack.stackSize = 2; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); + } + } + + // Charged Certus Quartz Ore + if (OreUtil.doesOreExistAndValid("oreChargedCertusQuartz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreChargedCertusQuartz").get(0); + ItemStack gemStack = OreDictionary.getOres("crystalChargedCertusQuartz").get(0); + ItemStack dustStack = OreDictionary.getOres("dustCertusQuartz").get(0); + dustStack.stackSize = 2; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Charged Certus Quartz Ore"); + } + } + + // Amethyst Ore + if (OreUtil.doesOreExistAndValid("oreAmethyst") && OreUtil.doesOreExistAndValid("gemAmethyst")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreAmethyst").get(0); + ItemStack gemStack = OreDictionary.getOres("gemAmethyst").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemAmethyst").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Certus Quartz Ore"); + } + } + + // Topaz Ore + if (OreUtil.doesOreExistAndValid("oreTopaz") && OreUtil.doesOreExistAndValid("gemTopaz")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTopaz").get(0); + ItemStack gemStack = OreDictionary.getOres("gemTopaz").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemTopaz").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Topaz Ore"); + } + } + + // Tanzanite Ore + if (OreUtil.doesOreExistAndValid("oreTanzanite") && OreUtil.doesOreExistAndValid("gemTanzanite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreTanzanite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemTanzanite").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemTanzanite").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Tanzanite Ore"); + } + } + + // Malachite Ore + if (OreUtil.doesOreExistAndValid("oreMalachite") && OreUtil.doesOreExistAndValid("gemMalachite")) + { + try + { + ItemStack oreStack = OreDictionary.getOres("oreMalachite").get(0); + ItemStack gemStack = OreDictionary.getOres("gemMalachite").get(0); + gemStack.stackSize = 2; + ItemStack dustStack = OreDictionary.getOres("gemMalachite").get(0); + dustStack.stackSize = 1; + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(oreStack, TechRebornAPI.recipeCompact.getItem("waterCell"), null, + gemStack, dustStack, null, TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + } catch (Exception e) + { + Core.logHelper.info("Failed to Load Grinder Recipe for Malachite Ore"); + } + } + + // Implosion Compressor + + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemParts.getPartByName("iridiumAlloyIngot"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 8), + TechRebornAPI.recipeCompact.getItem("iridiumPlate"), ItemDusts.getDustByName("darkAshes", 4), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("diamond", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 32), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialDiamond").getItem(), 3), + ItemDusts.getDustByName("darkAshes", 16), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(TechRebornAPI.recipeCompact.getItem("coalChunk"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 8), + TechRebornAPI.recipeCompact.getItem("industrialDiamond"), ItemDusts.getDustByName("darkAshes", 4), 20, + 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("emerald", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + new ItemStack(Items.emerald, 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("sapphire", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + ItemGems.getGemByName("sapphire", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("ruby", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + ItemGems.getGemByName("ruby", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("yellowGarnet", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + ItemGems.getGemByName("yellowGarnet", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("redGarnet", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + ItemGems.getGemByName("redGarnet", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + RecipeHandler.addRecipe(new ImplosionCompressorRecipe(ItemDusts.getDustByName("peridot", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("industrialTnt").getItem(), 24), + ItemGems.getGemByName("peridot", 3), ItemDusts.getDustByName("darkAshes", 12), 20, 30)); + + // Grinder + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("galena", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 0), ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("galena", 2), ItemDustsSmall.getSmallDustByName("Sulfur", 1), + ItemDusts.getDustByName("silver", 1), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + // Iridium Ore + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), null, + new FluidStack(FluidRegistry.WATER, 1000), TechRebornAPI.recipeCompact.getItem("iridiumOre"), + ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDustsSmall.getSmallDustByName("Platinum", 2), null, + 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, + TechRebornAPI.recipeCompact.getItem("iridiumOre"), ItemDustsSmall.getSmallDustByName("Iridium", 6), + ItemDustsSmall.getSmallDustByName("Platinum", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, + 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), + new ItemStack(Items.water_bucket), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), + ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDustsSmall.getSmallDustByName("Platinum", 2), + new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), null, + new FluidStack(ModFluids.fluidMercury, 1000), TechRebornAPI.recipeCompact.getItem("iridiumOre"), + ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), null, 100, + 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), + ItemCells.getCellByName("mercury", 1), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), + ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 1), + new ItemStack(ModItems.bucketMercury), null, TechRebornAPI.recipeCompact.getItem("iridiumOre"), + ItemDustsSmall.getSmallDustByName("Iridium", 6), ItemDusts.getDustByName("platinum", 2), + new ItemStack(Items.bucket), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 2), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("ruby", 1), + ItemDustsSmall.getSmallDustByName("Ruby", 6), ItemDustsSmall.getSmallDustByName("Chrome", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 3), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("sapphire", 1), + ItemDustsSmall.getSmallDustByName("Sapphire", 6), ItemDustsSmall.getSmallDustByName("Aluminum", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 4), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("bauxite", 2), + ItemDustsSmall.getSmallDustByName("Grossular", 4), ItemDustsSmall.getSmallDustByName("Titanium", 4), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 5), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("pyrite", 2), + ItemDustsSmall.getSmallDustByName("Sulfur", 1), ItemDustsSmall.getSmallDustByName("Phosphorous", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 6), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("cinnabar", 2), + ItemDustsSmall.getSmallDustByName("Redstone", 1), ItemDustsSmall.getSmallDustByName("Glowstone", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sphalerite", 2), + ItemDustsSmall.getSmallDustByName("Zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 7), + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("sphalerite", 2), + ItemDusts.getDustByName("zinc", 1), ItemDustsSmall.getSmallDustByName("YellowGarnet", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tungsten", 2), + ItemDustsSmall.getSmallDustByName("Manganese", 1), ItemDustsSmall.getSmallDustByName("Silver", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe( + new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 8), ItemCells.getCellByName("mercury", 1), + null, ItemDusts.getDustByName("tungsten", 2), ItemDustsSmall.getSmallDustByName("Manganese", 1), + ItemDusts.getDustByName("silver", 2), TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("platinum", 2), + ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 9), + ItemCells.getCellByName("mercury", 1), null, ItemDusts.getDustByName("platinum", 3), + ItemDustsSmall.getSmallDustByName("Iridium", 1), ItemDustsSmall.getSmallDustByName("Iridium", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 10), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemGems.getGemByName("peridot", 1), + ItemDustsSmall.getSmallDustByName("Peridot", 6), ItemDustsSmall.getSmallDustByName("Pyrope", 2), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 11), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("sodalite", 12), + ItemDustsSmall.getSmallDustByName("Lazurite", 4), ItemDustsSmall.getSmallDustByName("Lapis", 4), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), + TechRebornAPI.recipeCompact.getItem("waterCell"), null, ItemDusts.getDustByName("tetrahedrite", 2), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + RecipeHandler.addRecipe(new IndustrialGrinderRecipe(new ItemStack(ModBlocks.ore, 1, 12), + ItemCells.getCellByName("sodiumPersulfate", 1), null, ItemDusts.getDustByName("tetrahedrite", 3), + ItemDustsSmall.getSmallDustByName("Antimony", 1), ItemDustsSmall.getSmallDustByName("Zinc", 1), + TechRebornAPI.recipeCompact.getItem("cell"), 100, 120)); + + // Chemical Reactor + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), null, + new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 1), 100, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), + ItemDusts.getDustByName("phosphorous", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 3), 100, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sodiumSulfide", 1), + TechRebornAPI.recipeCompact.getItem("airCell"), ItemCells.getCellByName("sodiumPersulfate", 2), 2000, + 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrocarbon", 1), + TechRebornAPI.recipeCompact.getItem("waterCell"), ItemCells.getCellByName("glyceryl", 2), 580, 30)); + RecipeHandler.addRecipe( + new ChemicalReactorRecipe(ItemDusts.getDustByName("calcite", 1), ItemDusts.getDustByName("sulfur", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("fertilizer").getItem(), 2), 100, 30)); + ItemStack waterCells = TechRebornAPI.recipeCompact.getItem("waterCell").copy(); + waterCells.stackSize = 2; + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("sulfur", 1), waterCells, + ItemCells.getCellByName("sulfuricAcid", 3), 1140, 30)); + ItemStack waterCells2 = TechRebornAPI.recipeCompact.getItem("waterCell").copy(); + waterCells2.stackSize = 5; + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("hydrogen", 4), + TechRebornAPI.recipeCompact.getItem("airCell"), waterCells2, 10, 30)); + RecipeHandler.addRecipe(new ChemicalReactorRecipe(ItemCells.getCellByName("nitrogen", 1), + TechRebornAPI.recipeCompact.getItem("airCell"), ItemCells.getCellByName("nitrogenDioxide", 2), 1240, + 30)); + + // IndustrialElectrolyzer + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sulfuricAcid", 7), null, + ItemCells.getCellByName("hydrogen", 2), ItemDusts.getDustByName("sulfur"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3, 0), 400, 90)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("ruby", 6), + TechRebornAPI.recipeCompact.getItem("cell"), ItemDusts.getDustByName("aluminum", 2), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), + ItemDusts.getDustByName("chrome", 1), null, 140, 90)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("sapphire", 5), + TechRebornAPI.recipeCompact.getItem("cell"), ItemDusts.getDustByName("aluminum", 2), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), null, null, 100, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("nitrogenDioxide", 3), null, + ItemCells.getCellByName("nitrogen", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), null, + TechRebornAPI.recipeCompact.getItem("cell"), 160, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sodiumSulfide", 2), null, + ItemCells.getCellByName("sodium", 1), ItemDusts.getDustByName("sulfur", 1), null, + TechRebornAPI.recipeCompact.getItem("cell"), 200, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("greenSapphire", 5), + TechRebornAPI.recipeCompact.getItem("cell"), ItemDusts.getDustByName("aluminum", 2), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), null, null, 100, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("emerald", 29), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 18, 0), + ItemCells.getCellByName("berylium", 3), ItemDusts.getDustByName("aluminum", 2), + ItemCells.getCellByName("silicon", 6), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 5), 520, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( + new ItemStack(TechRebornAPI.recipeCompact.getItem("silicondioxideDust").getItem(), 3, 0), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), + ItemCells.getCellByName("silicon", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), null, null, 60, 60)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(new ItemStack(Items.dye, 3, 15), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 0), null, + ItemCells.getCellByName("calcium", 1), null, null, 20, 106)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("glyceryl", 20), null, + ItemCells.getCellByName("carbon", 3), ItemCells.getCellByName("hydrogen", 5), + ItemCells.getCellByName("nitrogen", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), 800, 90)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("peridot", 9), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 4, 0), + ItemDusts.getDustByName("magnesium", 2), ItemDusts.getDustByName("iron"), + ItemCells.getCellByName("silicon", 2), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), 200, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("calciumCarbonate", 5), null, + ItemCells.getCellByName("carbon"), ItemCells.getCellByName("calcium"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), 400, 90)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemCells.getCellByName("sodiumPersulfate", 6), null, + ItemCells.getCellByName("sodium"), ItemDusts.getDustByName("sulfur"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 3, 0), 420, 90)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("pyrope", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), + ItemDusts.getDustByName("aluminum", 2), ItemDusts.getDustByName("magnesium", 3), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 400, 120)); + + ItemStack sand = new ItemStack(Blocks.sand); + sand.stackSize = 16; + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(sand, + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), + ItemCells.getCellByName("silicon", 1), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), null, null, 1000, 25)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("almandine", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), + ItemDusts.getDustByName("aluminum", 2), ItemDusts.getDustByName("iron", 3), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 480, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("spessartine", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 9, 0), + ItemDusts.getDustByName("aluminum", 2), ItemDusts.getDustByName("manganese", 3), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 480, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("andradite", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), + ItemCells.getCellByName("calcium", 3), ItemDusts.getDustByName("iron", 2), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 480, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("grossular", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), + ItemCells.getCellByName("calcium", 3), ItemDusts.getDustByName("aluminum", 2), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 440, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("Uvarovite", 20), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 12, 0), + ItemCells.getCellByName("calcium", 3), ItemDusts.getDustByName("chrome", 2), + ItemCells.getCellByName("silicon", 3), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 5), 480, 120)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe( + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 6, 10), null, + ItemCells.getCellByName("hydrogen", 4), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 5), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 1, 0), null, 100, 30)); + + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(ItemDusts.getDustByName("darkAshes"), + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), + ItemCells.getCellByName("carbon", 2), null, null, null, 20, 30)); + + if (OreUtil.doesOreExistAndValid("dustSalt")) + { + ItemStack salt = OreDictionary.getOres("dustSalt").get(0); + salt.stackSize = 2; + RecipeHandler.addRecipe(new IndustrialElectrolyzerRecipe(salt, + new ItemStack(TechRebornAPI.recipeCompact.getItem("cell").getItem(), 2, 0), + ItemCells.getCellByName("sodium"), ItemCells.getCellByName("chlorine"), null, null, 40, 60)); + } + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("NaKCoolantSimple"), "TST", "PCP", "TST", 'T', + "ingotTin", 'S', ItemCells.getCellByName("sodium"), 'P', ItemCells.getCellByName("potassium"), 'C', + TechRebornAPI.recipeCompact.getItem("reactorCoolantSimple")); + + Item drill = TechRebornAPI.recipeCompact.getItem("miningDrill").getItem(); + ItemStack drillStack = new ItemStack(drill, 1, OreDictionary.WILDCARD_VALUE); + + if (ConfigTechReborn.ExpensiveMacerator) + CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("macerator"), "FDF", "DMD", "FCF", + 'F', Items.flint, 'D', Items.diamond, 'M', TechRebornAPI.recipeCompact.getItem("machine"), 'C', + TechRebornAPI.recipeCompact.getItem("electronicCircuit")); + + if (ConfigTechReborn.ExpensiveDrill) + CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("miningDrill"), " S ", "SCS", "SBS", + 'S', "ingotSteel", 'B', TechRebornAPI.recipeCompact.getItem("reBattery"), 'C', + TechRebornAPI.recipeCompact.getItem("electronicCircuit")); + + if (ConfigTechReborn.ExpensiveDiamondDrill) + CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("diamondDrill"), " D ", "DBD", "TCT", + 'D', "gemDiamond", 'T', "ingotTitanium", 'B', drillStack, 'C', + TechRebornAPI.recipeCompact.getItem("advancedCircuit")); + + if (ConfigTechReborn.ExpensiveSolar) + CraftingHelper.addShapedOreRecipe(TechRebornAPI.recipeCompact.getItem("solarPanel"), "PPP", "SZS", "CGC", + 'P', "paneGlass", 'S', ItemPlates.getPlateByName("silicon"), 'Z', + TechRebornAPI.recipeCompact.getItem("carbonPlate"), 'G', + TechRebornAPI.recipeCompact.getItem("generator"), 'C', + TechRebornAPI.recipeCompact.getItem("electronicCircuit")); + + CraftingHelper.addShapedOreRecipe(ItemParts.getPartByName("iridiumAlloyIngot"), "IAI", "ADA", "IAI", 'I', + ItemIngots.getIngotByName("iridium"), 'D', ItemDusts.getDustByName("diamond"), 'A', + TechRebornAPI.recipeCompact.getItem("advancedAlloy")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lithiumBatpack, 1, OreDictionary.WILDCARD_VALUE), + "BCB", "BPB", "B B", 'B', new ItemStack(ModItems.lithiumBattery), 'P', "plateAluminum", 'C', + TechRebornAPI.recipeCompact.getItem("advancedCircuit")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lithiumBattery, 1, OreDictionary.WILDCARD_VALUE), + " C ", "PFP", "PFP", 'F', ItemCells.getCellByName("lithium"), 'P', "plateAluminum", 'C', + TechRebornAPI.recipeCompact.getItem("insulatedGoldCableItem")); + + CraftingHelper.addShapedOreRecipe(new ItemStack(ModItems.lapotronpack, 1, OreDictionary.WILDCARD_VALUE), "FOF", + "SPS", "FIF", 'F', ItemParts.getPartByName("energyFlowCircuit"), 'O', + new ItemStack(ModItems.lapotronicOrb), 'S', ItemParts.getPartByName("superConductor"), 'I', + "ingotIridium", 'P', new ItemStack(ModItems.lapotronpack)); + } } diff --git a/src/main/java/techreborn/init/ModSounds.java b/src/main/java/techreborn/init/ModSounds.java index 2b859a697..dd266da12 100644 --- a/src/main/java/techreborn/init/ModSounds.java +++ b/src/main/java/techreborn/init/ModSounds.java @@ -1,24 +1,25 @@ package techreborn.init; -import net.minecraft.client.audio.Sound; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; /** * Created by Mark on 20/03/2016. */ -public class ModSounds { +public class ModSounds +{ - public static SoundEvent shock; + public static SoundEvent shock; - public static void init() { - shock = getSound("cable_shock"); - } - - private static SoundEvent getSound(String str){ - SoundEvent soundEvent = SoundEvent.soundEventRegistry.getObject(new ResourceLocation("techreborn" + str)); - return soundEvent; - } + public static void init() + { + shock = getSound("cable_shock"); + } + private static SoundEvent getSound(String str) + { + SoundEvent soundEvent = SoundEvent.soundEventRegistry.getObject(new ResourceLocation("techreborn" + str)); + return soundEvent; + } } diff --git a/src/main/java/techreborn/init/RecipeCompact.java b/src/main/java/techreborn/init/RecipeCompact.java index 320e6a94d..d513231a4 100644 --- a/src/main/java/techreborn/init/RecipeCompact.java +++ b/src/main/java/techreborn/init/RecipeCompact.java @@ -1,5 +1,12 @@ package techreborn.init; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -11,92 +18,94 @@ import techreborn.items.ItemParts; import techreborn.items.ItemPlates; import techreborn.parts.ItemStandaloneCables; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; +public class RecipeCompact implements IRecipeCompact +{ -public class RecipeCompact implements IRecipeCompact { + HashMap recipes = new HashMap<>(); - HashMap recipes = new HashMap<>(); + ArrayList missingItems = new ArrayList<>(); - ArrayList missingItems = new ArrayList<>(); + boolean inited = false; - boolean inited = false; + public void init() + { + recipes.put("industrialDiamond", new ItemStack(Items.diamond)); + recipes.put("industrialTnt", new ItemStack(Blocks.tnt)); + recipes.put("copperIngot", ItemIngots.getIngotByName("copper")); + recipes.put("tinIngot", ItemIngots.getIngotByName("tin")); + recipes.put("bronzeIngot", ItemIngots.getIngotByName("bronze")); + recipes.put("leadIngot", ItemIngots.getIngotByName("lead")); + recipes.put("silverIngot", ItemIngots.getIngotByName("silver")); + recipes.put("iridiumOre", ItemIngots.getIngotByName("Iridium")); + recipes.put("plateiron", ItemPlates.getPlateByName("iron")); + recipes.put("iridiumPlate", ItemPlates.getPlateByName("iridium")); + recipes.put("cell", ItemCells.getCellByName("empty")); + recipes.put("airCell", ItemCells.getCellByName("empty")); + recipes.put("electronicCircuit", ItemParts.getPartByName("electronicCircuit")); + recipes.put("advancedCircuit", ItemParts.getPartByName("advancedCircuit")); + recipes.put("rubberWood", new ItemStack(ModBlocks.rubberLog)); + recipes.put("resin", ItemParts.getPartByName("rubberSap")); + recipes.put("carbonPlate", ItemPlates.getPlateByName("carbon")); + recipes.put("reBattery", new ItemStack(ModItems.reBattery)); + recipes.put("machine", BlockMachineFrame.getFrameByName("machine", 1)); + recipes.put("advancedMachine", BlockMachineFrame.getFrameByName("advancedMachine", 1)); + recipes.put("extractor", new ItemStack(ModBlocks.Extractor)); + recipes.put("generator", new ItemStack(ModBlocks.Generator)); + recipes.put("macerator", new ItemStack(ModBlocks.Grinder)); + recipes.put("diamondDrill", new ItemStack(ModItems.diamondDrill)); + recipes.put("miningDrill", new ItemStack(ModItems.ironDrill)); + recipes.put("solarPanel", new ItemStack(ModBlocks.solarPanel)); + recipes.put("waterCell", ItemCells.getCellByName("water")); + recipes.put("lavaCell", ItemCells.getCellByName("lava")); + recipes.put("pump", ItemParts.getPartByName("pump")); + recipes.put("teleporter", ItemParts.getPartByName("teleporter")); + recipes.put("advancedAlloy", ItemParts.getPartByName("advancedAlloy")); + recipes.put("lvTransformer", new ItemStack(ModBlocks.lvt)); + recipes.put("mvTransformer", new ItemStack(ModBlocks.mvt)); + recipes.put("hvTransformer", new ItemStack(ModBlocks.hvt)); + recipes.put("windMill", new ItemStack(ModBlocks.windMill)); + recipes.put("energyCrystal", new ItemStack(ModItems.energyCrystal)); + recipes.put("lapotronCrystal", new ItemStack(ModItems.lapotronCrystal)); + recipes.put("reinforcedGlass", new ItemStack(ModBlocks.reinforcedglass)); + recipes.put("compressor", new ItemStack(ModBlocks.Compressor)); + recipes.put("insulatedGoldCableItem", ItemStandaloneCables.getCableByName("insulatedgold")); + inited = false; + } - public void init(){ - recipes.put("industrialDiamond", new ItemStack(Items.diamond)); - recipes.put("industrialTnt", new ItemStack(Blocks.tnt)); - recipes.put("copperIngot", ItemIngots.getIngotByName("copper")); - recipes.put("tinIngot", ItemIngots.getIngotByName("tin")); - recipes.put("bronzeIngot", ItemIngots.getIngotByName("bronze")); - recipes.put("leadIngot", ItemIngots.getIngotByName("lead")); - recipes.put("silverIngot", ItemIngots.getIngotByName("silver")); - recipes.put("iridiumOre", ItemIngots.getIngotByName("Iridium")); - recipes.put("plateiron", ItemPlates.getPlateByName("iron")); - recipes.put("iridiumPlate", ItemPlates.getPlateByName("iridium")); - recipes.put("cell", ItemCells.getCellByName("empty")); - recipes.put("airCell", ItemCells.getCellByName("empty")); - recipes.put("electronicCircuit", ItemParts.getPartByName("electronicCircuit")); - recipes.put("advancedCircuit", ItemParts.getPartByName("advancedCircuit")); - recipes.put("rubberWood", new ItemStack(ModBlocks.rubberLog)); - recipes.put("resin", ItemParts.getPartByName("rubberSap")); - recipes.put("carbonPlate", ItemPlates.getPlateByName("carbon")); - recipes.put("reBattery", new ItemStack(ModItems.reBattery)); - recipes.put("machine", BlockMachineFrame.getFrameByName("machine", 1)); - recipes.put("advancedMachine", BlockMachineFrame.getFrameByName("advancedMachine", 1)); - recipes.put("extractor", new ItemStack(ModBlocks.Extractor)); - recipes.put("generator", new ItemStack(ModBlocks.Generator)); - recipes.put("macerator", new ItemStack(ModBlocks.Grinder)); - recipes.put("diamondDrill", new ItemStack(ModItems.diamondDrill)); - recipes.put("miningDrill", new ItemStack(ModItems.ironDrill)); - recipes.put("solarPanel", new ItemStack(ModBlocks.solarPanel)); - recipes.put("waterCell", ItemCells.getCellByName("water")); - recipes.put("lavaCell", ItemCells.getCellByName("lava")); - recipes.put("pump", ItemParts.getPartByName("pump")); - recipes.put("teleporter", ItemParts.getPartByName("teleporter")); - recipes.put("advancedAlloy", ItemParts.getPartByName("advancedAlloy")); - recipes.put("lvTransformer", new ItemStack(ModBlocks.lvt)); - recipes.put("mvTransformer", new ItemStack(ModBlocks.mvt)); - recipes.put("hvTransformer", new ItemStack(ModBlocks.hvt)); - recipes.put("windMill", new ItemStack(ModBlocks.windMill)); - recipes.put("energyCrystal", new ItemStack(ModItems.energyCrystal)); - recipes.put("lapotronCrystal", new ItemStack(ModItems.lapotronCrystal)); - recipes.put("reinforcedGlass", new ItemStack(ModBlocks.reinforcedglass)); - recipes.put("compressor", new ItemStack(ModBlocks.Compressor)); - recipes.put("insulatedGoldCableItem", ItemStandaloneCables.getCableByName("insulatedgold")); - inited = false; - } + @Override + public ItemStack getItem(String name) + { + if (!inited) + { + init(); + } + if (!recipes.containsKey(name)) + { + if (!missingItems.contains(name)) + { + missingItems.add(name); + } + return new ItemStack(ModItems.missingRecipe); + } else + { + return recipes.get(name); + } + } - - @Override - public ItemStack getItem(String name) { - if(!inited){ - init(); - } - if(!recipes.containsKey(name)){ - if(!missingItems.contains(name)){ - missingItems.add(name); - } - return new ItemStack(ModItems.missingRecipe); - } else { - return recipes.get(name); - } - } - - public void saveMissingItems(File mcDir) throws IOException { - File missingItemsFile = new File(mcDir, "missingItems.txt"); - if(missingItemsFile.exists()){ - missingItemsFile.delete(); - } - BufferedWriter writer = new BufferedWriter(new FileWriter(missingItemsFile)); - for(String str : missingItems){ - writer.write(str); - writer.newLine(); - } - writer.close(); - } + public void saveMissingItems(File mcDir) throws IOException + { + File missingItemsFile = new File(mcDir, "missingItems.txt"); + if (missingItemsFile.exists()) + { + missingItemsFile.delete(); + } + BufferedWriter writer = new BufferedWriter(new FileWriter(missingItemsFile)); + for (String str : missingItems) + { + writer.write(str); + writer.newLine(); + } + writer.close(); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockAesu.java b/src/main/java/techreborn/itemblocks/ItemBlockAesu.java index 989a6f7ad..63f6c6e0a 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockAesu.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockAesu.java @@ -1,5 +1,7 @@ package techreborn.itemblocks; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -17,70 +19,75 @@ import reborncore.common.powerSystem.PowerSystem; import techreborn.init.ModBlocks; import techreborn.tiles.TileAesu; -import java.util.List; +public class ItemBlockAesu extends ItemBlock +{ -public class ItemBlockAesu extends ItemBlock { + public ItemBlockAesu(Block p_i45328_1_) + { + super(p_i45328_1_); + } - public ItemBlockAesu(Block p_i45328_1_) { - super(p_i45328_1_); - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack != null && stack.hasTagCompound()) + { + if (stack.getTagCompound().getCompoundTag("tileEntity") != null) + list.add(PowerSystem + .getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("energy"))); + } + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, - boolean par4) { - if (stack != null && stack.hasTagCompound()) { - if (stack.getTagCompound().getCompoundTag("tileEntity") != null) - list.add(PowerSystem.getLocaliszedPower(stack.getTagCompound().getCompoundTag("tileEntity") - .getInteger("energy"))); - } - } + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, + float hitX, float hitY, float hitZ, IBlockState newState) + { + if (!world.setBlockState(pos, newState)) + { + return false; + } + if (world.getBlockState(pos).getBlock() == block) + { + world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack); + // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, + // y, z, metadata); + } + if (stack != null && stack.hasTagCompound()) + { + ((TileAesu) world.getTileEntity(pos)) + .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); + } + return true; + } - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { - if (!world.setBlockState(pos, newState)) { - return false; - } - if (world.getBlockState(pos).getBlock() == block) { - world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, - stack); -// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, y, z, metadata); - } - if (stack != null && stack.hasTagCompound()) { - ((TileAesu) world.getTileEntity(pos)) - .readFromNBTWithoutCoords(stack.getTagCompound() - .getCompoundTag("tileEntity")); - } - return true; - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + itemList.add(getDropWithNBT(0)); + itemList.add(getDropWithNBT(1000000000)); + } + public ItemStack getDropWithNBT(double energy) + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1); + writeToNBTWithoutCoords(tileEntity, energy); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - itemList.add(getDropWithNBT(0)); - itemList.add(getDropWithNBT(1000000000)); - } - - public ItemStack getDropWithNBT(double energy) { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1); - writeToNBTWithoutCoords(tileEntity, energy); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } - - public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy) { - NBTTagCompound data = new NBTTagCompound(); - data.setDouble("energy", energy); - tagCompound.setTag("TilePowerAcceptor", data); - tagCompound.setDouble("energy", energy); - tagCompound.setDouble("euChange", 0); - tagCompound.setDouble("euLastTick", 0); - tagCompound.setBoolean("active", false); - } + public void writeToNBTWithoutCoords(NBTTagCompound tagCompound, double energy) + { + NBTTagCompound data = new NBTTagCompound(); + data.setDouble("energy", energy); + tagCompound.setTag("TilePowerAcceptor", data); + tagCompound.setDouble("energy", energy); + tagCompound.setDouble("euChange", 0); + tagCompound.setDouble("euLastTick", 0); + tagCompound.setBoolean("active", false); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java b/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java index 285435e64..f8d502a61 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockDigitalChest.java @@ -1,5 +1,7 @@ package techreborn.itemblocks; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -12,43 +14,45 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.tiles.TileDigitalChest; -import java.util.List; +public class ItemBlockDigitalChest extends ItemBlock +{ -public class ItemBlockDigitalChest extends ItemBlock { + public ItemBlockDigitalChest(Block p_i45328_1_) + { + super(p_i45328_1_); + } - public ItemBlockDigitalChest(Block p_i45328_1_) { - super(p_i45328_1_); - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack != null && stack.hasTagCompound()) + { + if (stack.getTagCompound().getCompoundTag("tileEntity") != null) + list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items"); + } + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, - boolean par4) { - if (stack != null && stack.hasTagCompound()) { - if (stack.getTagCompound().getCompoundTag("tileEntity") != null) - list.add(stack.getTagCompound().getCompoundTag("tileEntity") - .getInteger("storedQuantity") - + " items"); - } - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { - if (!world.setBlockState(pos, newState)) { - return false; - } - if (world.getBlockState(pos).getBlock() == block) { - world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, - stack); -// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, y, z, metadata); - } - if (stack != null && stack.hasTagCompound()) { - ((TileDigitalChest) world.getTileEntity(pos)) - .readFromNBTWithoutCoords(stack.getTagCompound() - .getCompoundTag("tileEntity")); - } - return true; - } + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, + float hitX, float hitY, float hitZ, IBlockState newState) + { + if (!world.setBlockState(pos, newState)) + { + return false; + } + if (world.getBlockState(pos).getBlock() == block) + { + world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack); + // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, + // y, z, metadata); + } + if (stack != null && stack.hasTagCompound()) + { + ((TileDigitalChest) world.getTileEntity(pos)) + .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); + } + return true; + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockMachineCasing.java b/src/main/java/techreborn/itemblocks/ItemBlockMachineCasing.java index df06b426f..96ff48352 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockMachineCasing.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockMachineCasing.java @@ -5,11 +5,12 @@ import net.minecraft.item.ItemMultiTexture; import techreborn.blocks.BlockMachineCasing; import techreborn.init.ModBlocks; -public class ItemBlockMachineCasing extends ItemMultiTexture { +public class ItemBlockMachineCasing extends ItemMultiTexture +{ - public ItemBlockMachineCasing(Block block) { - super(ModBlocks.MachineCasing, ModBlocks.MachineCasing, - BlockMachineCasing.types); - } + public ItemBlockMachineCasing(Block block) + { + super(ModBlocks.MachineCasing, ModBlocks.MachineCasing, BlockMachineCasing.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockMachineFrame.java b/src/main/java/techreborn/itemblocks/ItemBlockMachineFrame.java index c654c7fdf..e20bfb746 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockMachineFrame.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockMachineFrame.java @@ -5,10 +5,12 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockMachineFrame; import techreborn.init.ModBlocks; -public class ItemBlockMachineFrame extends ItemBlockBase { +public class ItemBlockMachineFrame extends ItemBlockBase +{ - public ItemBlockMachineFrame(Block block) { - super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types); - } + public ItemBlockMachineFrame(Block block) + { + super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockOre.java b/src/main/java/techreborn/itemblocks/ItemBlockOre.java index a979c98d7..1975f5949 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockOre.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockOre.java @@ -5,10 +5,12 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockOre; import techreborn.init.ModBlocks; -public class ItemBlockOre extends ItemBlockBase { +public class ItemBlockOre extends ItemBlockBase +{ - public ItemBlockOre(Block block) { - super(ModBlocks.ore, ModBlocks.ore, BlockOre.types); - } + public ItemBlockOre(Block block) + { + super(ModBlocks.ore, ModBlocks.ore, BlockOre.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockOre2.java b/src/main/java/techreborn/itemblocks/ItemBlockOre2.java index 57ef610c9..39694cfb8 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockOre2.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockOre2.java @@ -5,10 +5,12 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockOre2; import techreborn.init.ModBlocks; -public class ItemBlockOre2 extends ItemBlockBase { +public class ItemBlockOre2 extends ItemBlockBase +{ - public ItemBlockOre2(Block block) { - super(ModBlocks.ore2, ModBlocks.ore2, BlockOre2.types); - } + public ItemBlockOre2(Block block) + { + super(ModBlocks.ore2, ModBlocks.ore2, BlockOre2.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockPlayerDetector.java b/src/main/java/techreborn/itemblocks/ItemBlockPlayerDetector.java index d2776f245..e336c2f5e 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockPlayerDetector.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockPlayerDetector.java @@ -5,8 +5,10 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockPlayerDetector; import techreborn.init.ModBlocks; -public class ItemBlockPlayerDetector extends ItemBlockBase { - public ItemBlockPlayerDetector(Block block) { - super(ModBlocks.playerDetector, ModBlocks.playerDetector, BlockPlayerDetector.types); - } +public class ItemBlockPlayerDetector extends ItemBlockBase +{ + public ItemBlockPlayerDetector(Block block) + { + super(ModBlocks.playerDetector, ModBlocks.playerDetector, BlockPlayerDetector.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java b/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java index 017380d93..9c332cec8 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockQuantumChest.java @@ -1,5 +1,7 @@ package techreborn.itemblocks; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -12,43 +14,45 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.tiles.TileQuantumChest; -import java.util.List; +public class ItemBlockQuantumChest extends ItemBlock +{ -public class ItemBlockQuantumChest extends ItemBlock { + public ItemBlockQuantumChest(Block p_i45328_1_) + { + super(p_i45328_1_); + } - public ItemBlockQuantumChest(Block p_i45328_1_) { - super(p_i45328_1_); - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (stack != null && stack.hasTagCompound()) + { + if (stack.getTagCompound().getCompoundTag("tileEntity") != null) + list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items"); + } + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, - boolean par4) { - if (stack != null && stack.hasTagCompound()) { - if (stack.getTagCompound().getCompoundTag("tileEntity") != null) - list.add(stack.getTagCompound().getCompoundTag("tileEntity") - .getInteger("storedQuantity") - + " items"); - } - } - - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { - if (!world.setBlockState(pos, newState)) { - return false; - } - if (world.getBlockState(pos).getBlock() == block) { - world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, - stack); -// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, y, z, metadata); - } - if (stack != null && stack.hasTagCompound()) { - ((TileQuantumChest) world.getTileEntity(pos)) - .readFromNBTWithoutCoords(stack.getTagCompound() - .getCompoundTag("tileEntity")); - } - return true; - } + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, + float hitX, float hitY, float hitZ, IBlockState newState) + { + if (!world.setBlockState(pos, newState)) + { + return false; + } + if (world.getBlockState(pos).getBlock() == block) + { + world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack); + // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, + // y, z, metadata); + } + if (stack != null && stack.hasTagCompound()) + { + ((TileQuantumChest) world.getTileEntity(pos)) + .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); + } + return true; + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java b/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java index a6aa161c0..8ef675e5e 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockQuantumTank.java @@ -10,27 +10,33 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import techreborn.tiles.TileQuantumTank; -public class ItemBlockQuantumTank extends ItemBlock { +public class ItemBlockQuantumTank extends ItemBlock +{ - public ItemBlockQuantumTank(Block block) { - super(block); - } + public ItemBlockQuantumTank(Block block) + { + super(block); + } - @Override - public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, IBlockState newState) { - if (!world.setBlockState(pos, newState)) { - return false; - } - if (world.getBlockState(pos).getBlock() == block) { - world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, - stack); -// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, y, z, metadata); - } - if (stack != null && stack.hasTagCompound()) { - ((TileQuantumTank) world.getTileEntity(pos)) - .readFromNBTWithoutCoords(stack.getTagCompound() - .getCompoundTag("tileEntity")); - } - return true; - } + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, + float hitX, float hitY, float hitZ, IBlockState newState) + { + if (!world.setBlockState(pos, newState)) + { + return false; + } + if (world.getBlockState(pos).getBlock() == block) + { + world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack); + // world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x, + // y, z, metadata); + } + if (stack != null && stack.hasTagCompound()) + { + ((TileQuantumTank) world.getTileEntity(pos)) + .readFromNBTWithoutCoords(stack.getTagCompound().getCompoundTag("tileEntity")); + } + return true; + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java index 85fea0717..129ffe2f8 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockRubberSapling.java @@ -15,28 +15,33 @@ import techreborn.lib.ModInfo; /** * Created by modmuss50 on 20/02/2016. */ -public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem { +public class ItemBlockRubberSapling extends ItemBlock implements ITexturedItem +{ - public ItemBlockRubberSapling(Block block) { - super(block); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.rubberSapling"); - RebornCore.jsonDestroyer.registerObject(this); - } + public ItemBlockRubberSapling(Block block) + { + super(block); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.rubberSapling"); + RebornCore.jsonDestroyer.registerObject(this); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/rubber_sapling"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/rubber_sapling"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockStorage.java b/src/main/java/techreborn/itemblocks/ItemBlockStorage.java index f52577465..1518bad6c 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockStorage.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockStorage.java @@ -5,10 +5,12 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockStorage; import techreborn.init.ModBlocks; -public class ItemBlockStorage extends ItemBlockBase { +public class ItemBlockStorage extends ItemBlockBase +{ - public ItemBlockStorage(Block block) { - super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types); - } + public ItemBlockStorage(Block block) + { + super(ModBlocks.storage, ModBlocks.storage, BlockStorage.types); + } } diff --git a/src/main/java/techreborn/itemblocks/ItemBlockStorage2.java b/src/main/java/techreborn/itemblocks/ItemBlockStorage2.java index ee67ca4a1..793610720 100644 --- a/src/main/java/techreborn/itemblocks/ItemBlockStorage2.java +++ b/src/main/java/techreborn/itemblocks/ItemBlockStorage2.java @@ -5,11 +5,12 @@ import reborncore.common.itemblock.ItemBlockBase; import techreborn.blocks.BlockStorage2; import techreborn.init.ModBlocks; -public class ItemBlockStorage2 extends ItemBlockBase { +public class ItemBlockStorage2 extends ItemBlockBase +{ - public ItemBlockStorage2(Block block) { - super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types); - } + public ItemBlockStorage2(Block block) + { + super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types); + } } - diff --git a/src/main/java/techreborn/items/ItemCells.java b/src/main/java/techreborn/items/ItemCells.java index 442c94388..746b376c6 100644 --- a/src/main/java/techreborn/items/ItemCells.java +++ b/src/main/java/techreborn/items/ItemCells.java @@ -1,5 +1,7 @@ package techreborn.items; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -12,150 +14,175 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.util.List; +public class ItemCells extends ItemTextureBase implements IFluidContainerItem +{ -public class ItemCells extends ItemTextureBase implements IFluidContainerItem { + public static ItemStack getCellByName(String name, int count) + { + return getCellByName(name, count, true); + } - public static ItemStack getCellByName(String name, int count) { - return getCellByName(name, count, true); - } + public static ItemStack getCellByName(String name, int count, boolean lookForIC2) + { + Fluid fluid = FluidRegistry.getFluid("fluid" + name.toLowerCase()); + // if (lookForIC2 && IC2Items.getItem("FluidCell") != null) { + // if (fluid != null) { + // ItemStack stack = IC2Items.getItem("FluidCell").copy(); + // if (stack != null && stack.getItem() instanceof IFluidContainerItem) + // { + // IFluidContainerItem containerItem = (IFluidContainerItem) + // stack.getItem(); + // containerItem.fill(stack, new FluidStack(fluid.getID(), 2147483647), + // true); + // stack.stackSize = count; + // return stack; + // } + // } else { + // Core.logHelper.debug("Could not find " + "fluid" + name + " in the + // fluid registry!"); + // } + // } //TODO ic2 + int index = -1; + for (int i = 0; i < types.length; i++) + { + if (types[i].equals(name)) + { + index = i; + break; + } + } + return new ItemStack(ModItems.cells, count, index); + } + public static ItemStack getCellByName(String name) + { + return getCellByName(name, 1); + } - public static ItemStack getCellByName(String name, int count, boolean lookForIC2) { - Fluid fluid = FluidRegistry.getFluid("fluid" + name.toLowerCase()); -// if (lookForIC2 && IC2Items.getItem("FluidCell") != null) { -// if (fluid != null) { -// ItemStack stack = IC2Items.getItem("FluidCell").copy(); -// if (stack != null && stack.getItem() instanceof IFluidContainerItem) { -// IFluidContainerItem containerItem = (IFluidContainerItem) stack.getItem(); -// containerItem.fill(stack, new FluidStack(fluid.getID(), 2147483647), true); -// stack.stackSize = count; -// return stack; -// } -// } else { -// Core.logHelper.debug("Could not find " + "fluid" + name + " in the fluid registry!"); -// } -// } //TODO ic2 - int index = -1; - for (int i = 0; i < types.length; i++) { - if (types[i].equals(name)) { - index = i; - break; - } - } - return new ItemStack(ModItems.cells, count, index); - } + public static final String[] types = new String[] { "Berylium", "biomass", "calciumCarbonate", "calcium", "carbon", + "chlorine", "deuterium", "diesel", "ethanol", "glyceryl", "helium3", "helium", "heliumPlasma", "hydrogen", + "ice", "lithium", "mercury", "methane", "nitrocarbon", "nitroCoalfuel", "nitroDiesel", "nitrogen", + "nitrogenDioxide", "oil", "potassium", "seedOil", "silicon", "sodium", "sodiumPersulfate", "sodiumSulfide", + "sulfur", "sulfuricAcid", "tritium", "wolframium", "empty", "lava", "water" }; - public static ItemStack getCellByName(String name) { - return getCellByName(name, 1); - } + public ItemCells() + { + setUnlocalizedName("techreborn.cell"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTab.instance); + } - public static final String[] types = new String[] - {"Berylium", "biomass", "calciumCarbonate", "calcium", "carbon", - "chlorine", "deuterium", "diesel", "ethanol", "glyceryl", - "helium3", "helium", "heliumPlasma", "hydrogen", "ice", "lithium", - "mercury", "methane", "nitrocarbon", "nitroCoalfuel", - "nitroDiesel", "nitrogen", "nitrogenDioxide", "oil", "potassium", - "seedOil", "silicon", "sodium", "sodiumPersulfate", - "sodiumSulfide", "sulfur", "sulfuricAcid", "tritium", "wolframium", "empty", "lava", "water"}; + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + return super.getUnlocalizedName() + "." + types[meta]; + } - public ItemCells() { - setUnlocalizedName("techreborn.cell"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTab.instance); - } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + ItemStack stack = new ItemStack(item, 1, meta); + if (types[meta].toLowerCase().equals("water") || types[meta].toLowerCase().equals("lava")) + { + this.fill(stack, new FluidStack(FluidRegistry.getFluid(types[meta].toLowerCase()), getCapacity(stack)), + true); + } else if (FluidRegistry.getFluid("fluid" + types[meta].toLowerCase()) != null) + { + this.fill(stack, + new FluidStack(FluidRegistry.getFluid("fluid" + types[meta].toLowerCase()), getCapacity(stack)), + true); + } + list.add(stack); + } + } + @Override + public FluidStack getFluid(ItemStack container) + { + return FluidStack.loadFluidStackFromNBT(container.getTagCompound()); + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public int getCapacity(ItemStack container) + { + return 1000; + } - return super.getUnlocalizedName() + "." + types[meta]; - } + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) + { + if (container.stackSize != 1) + { + return 0; + } + if (resource == null || resource.amount != getCapacity(container)) + { + return 0; + } + if (types[container.getItemDamage()].toLowerCase().equals("water") + || types[container.getItemDamage()].toLowerCase().equals("lava")) + { - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - ItemStack stack = new ItemStack(item, 1, meta); - if(types[meta].toLowerCase().equals("water") || types[meta].toLowerCase().equals("lava")){ - this.fill(stack, new FluidStack(FluidRegistry.getFluid(types[meta].toLowerCase()), getCapacity(stack)), true); - } else if(FluidRegistry.getFluid("fluid" +types[meta].toLowerCase()) != null){ - this.fill(stack, new FluidStack(FluidRegistry.getFluid("fluid" +types[meta].toLowerCase()), getCapacity(stack)), true); - } - list.add(stack); - } - } + } else if (FluidRegistry.getFluid("fluid" + types[container.getItemDamage()].toLowerCase()) == null) + { + return 0; + } - @Override - public FluidStack getFluid(ItemStack container) { - return FluidStack.loadFluidStackFromNBT(container.getTagCompound()); - } + if (doFill) + { + NBTTagCompound tag = container.getTagCompound(); + if (tag == null) + { + tag = new NBTTagCompound(); + } + resource.writeToNBT(tag); + container.setTagCompound(tag); + } + return getCapacity(container); + } - @Override - public int getCapacity(ItemStack container) { - return 1000; - } + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) + { + if (maxDrain < getCapacity(container)) + { + return null; + } + FluidStack fluidStack = getFluid(container); + if (doDrain && fluidStack != null) + { + ItemStack empty = ItemCells.getCellByName("empty"); + if (empty != null) + { + container.setItemDamage(empty.getItemDamage()); + container.setTagCompound(empty.getTagCompound()); + } else + { + container.stackSize = 0; + } + } - @Override - public int fill(ItemStack container, FluidStack resource, boolean doFill) { - if (container.stackSize != 1) { - return 0; - } - if (resource == null || resource.amount != getCapacity(container)) { - return 0; - } - if(types[container.getItemDamage()].toLowerCase().equals("water") || types[container.getItemDamage()].toLowerCase().equals("lava")){ + return fluidStack; + } - } else - if(FluidRegistry.getFluid("fluid" +types[container.getItemDamage()].toLowerCase()) == null){ - return 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/cells/" + types[damage] + "Cell"; + } - if (doFill) - { - NBTTagCompound tag = container.getTagCompound(); - if (tag == null) - { - tag = new NBTTagCompound(); - } - resource.writeToNBT(tag); - container.setTagCompound(tag); - } - return getCapacity(container); - } - - @Override - public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) { - if (maxDrain < getCapacity(container)) { - return null; - } - FluidStack fluidStack = getFluid(container); - if (doDrain && fluidStack != null) { - ItemStack empty = ItemCells.getCellByName("empty"); - if(empty != null) { - container.setItemDamage(empty.getItemDamage()); - container.setTagCompound(empty.getTagCompound()); - } - else { - container.stackSize = 0; - } - } - - return fluidStack; - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/cells/" + types[damage] + "Cell"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemCrushedOre.java b/src/main/java/techreborn/items/ItemCrushedOre.java index bbe66c263..de956bf9d 100644 --- a/src/main/java/techreborn/items/ItemCrushedOre.java +++ b/src/main/java/techreborn/items/ItemCrushedOre.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,62 +10,68 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemCrushedOre extends ItemTextureBase +{ + public static ItemStack getCrushedOreByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.crushedOre, count, i); + } + } + throw new InvalidParameterException("The gem " + name + " could not be found."); + } -public class ItemCrushedOre extends ItemTextureBase { - public static ItemStack getCrushedOreByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.crushedOre, count, i); - } - } - throw new InvalidParameterException("The gem " + name + " could not be found."); - } + public static ItemStack getCrushedOreByName(String name) + { + return getCrushedOreByName(name, 1); + } - public static ItemStack getCrushedOreByName(String name) { - return getCrushedOreByName(name, 1); - } + public static final String[] types = new String[] { "Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", + "Cobalt", "DarkIron", "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", + "Tetrahedrite", "Tungsten", "Galena" }; - public static final String[] types = new String[] - {"Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", "Cobalt", "DarkIron", - "Indium", "Iridium", "Nickel", "Osmium", "Platinum", - "Pyrite", "Sphalerite", "Tetrahedrite", "Tungsten", "Galena"}; + public ItemCrushedOre() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.crushedore"); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemCrushedOre() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.crushedore"); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/crushedOre/crushed" + types[damage] + "Ore"; + } - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/crushedOre/crushed" + types[damage] + "Ore"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemDusts.java b/src/main/java/techreborn/items/ItemDusts.java index ee7e831b0..a547fb6e7 100644 --- a/src/main/java/techreborn/items/ItemDusts.java +++ b/src/main/java/techreborn/items/ItemDusts.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; @@ -8,85 +11,89 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemDusts extends ItemTextureBase +{ + public static ItemStack getDustByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.dusts, count, i); + } + } -public class ItemDusts extends ItemTextureBase { - public static ItemStack getDustByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.dusts, count, i); - } - } + if (name.equalsIgnoreCase("glowstone")) + { + return new ItemStack(Items.glowstone_dust, count); + } + if (name.equalsIgnoreCase("redstone")) + { + return new ItemStack(Items.redstone, count); + } + if (name.equalsIgnoreCase("gunpowder")) + { + return new ItemStack(Items.gunpowder, count); + } + throw new InvalidParameterException("The dust " + name + " could not be found."); + } - if (name.equalsIgnoreCase("glowstone")) { - return new ItemStack(Items.glowstone_dust, count); - } - if (name.equalsIgnoreCase("redstone")) { - return new ItemStack(Items.redstone, count); - } - if (name.equalsIgnoreCase("gunpowder")) { - return new ItemStack(Items.gunpowder, count); - } - throw new InvalidParameterException("The dust " + name + " could not be found."); - } + public static ItemStack getDustByName(String name) + { + return getDustByName(name, 1); + } - public static ItemStack getDustByName(String name) { - return getDustByName(name, 1); - } + public static final String[] types = new String[] { "almandine", "aluminumBrass", "aluminum", "alumite", + "andradite", "antimony", "ardite", "ashes", "basalt", "bauxite", "biotite", "brass", "bronze", "cadmium", + "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "cobalt", "copper", "cupronickel", "darkAshes", + "darkIron", "diamond", "electrum", "emerald", "enderEye", "enderPearl", "endstone", "flint", "galena", + "gold", "graphite", "grossular", "indium", "invar", "iridium", "iron", "kanthal", "lapis", "lazurite", + "lead", "limestone", "lodestone", "magnesium", "magnetite", "manganese", "manyullyn", "marble", "mithril", + "netherrack", "nichrome", "nickel", "obsidian", "osmium", "peridot", "phosphorous", "platinum", + "potassiumFeldspar", "pyrite", "pyrope", "redGarnet", "redrock", "ruby", "saltpeter", "sapphire", "sawDust", + "silicon", "silver", "sodalite", "spessartine", "sphalerite", "steel", "sulfur", "tellurium", "teslatite", + "tetrahedrite", "tin", "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", "zinc", + "greenSapphire", "olivine" }; - public static final String[] types = new String[] - {"almandine", "aluminumBrass", "aluminum", "alumite", "andradite", - "antimony", "ardite", "ashes", "basalt", "bauxite", "biotite", - "brass", "bronze", "cadmium", "calcite", "charcoal", "chrome", - "cinnabar", "clay", "coal", "cobalt", "copper", "cupronickel", - "darkAshes", "darkIron", "diamond", "electrum", "emerald", - "enderEye", "enderPearl", "endstone", "flint", "galena", "gold", "graphite", - "grossular", "indium", "invar", "iridium", "iron", "kanthal", "lapis", "lazurite", - "lead", "limestone", "lodestone", "magnesium", "magnetite", "manganese", - "manyullyn", "marble", "mithril", "netherrack", "nichrome", "nickel", - "obsidian", "osmium", "peridot", "phosphorous", "platinum", "potassiumFeldspar", - "pyrite", "pyrope", "redGarnet", "redrock", "ruby", "saltpeter", - "sapphire", "sawDust", "silicon", "silver", "sodalite", "spessartine", "sphalerite", - "steel", "sulfur", "tellurium", "teslatite", "tetrahedrite", "tin", - "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", - "zinc", "greenSapphire", "olivine"}; + public ItemDusts() + { + setUnlocalizedName("techreborn.dust"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + return super.getUnlocalizedName() + "." + types[meta]; + } - public ItemDusts() { - setUnlocalizedName("techreborn.dust"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTabMisc.instance); - } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/dust/" + types[damage] + "Dust"; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } - - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/dust/" + types[damage] + "Dust"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemDustsSmall.java b/src/main/java/techreborn/items/ItemDustsSmall.java index 8074d8d9e..166d4ef7f 100644 --- a/src/main/java/techreborn/items/ItemDustsSmall.java +++ b/src/main/java/techreborn/items/ItemDustsSmall.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,76 +10,77 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemDustsSmall extends ItemTextureBase +{ -public class ItemDustsSmall extends ItemTextureBase { + public static ItemStack getSmallDustByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.smallDusts, count, i); + } + } + throw new InvalidParameterException("The small dust " + name + " could not be found."); + } - public static ItemStack getSmallDustByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.smallDusts, count, i); - } - } - throw new InvalidParameterException("The small dust " + name + " could not be found."); - } + public static ItemStack getSmallDustByName(String name) + { + return getSmallDustByName(name, 1); + } - public static ItemStack getSmallDustByName(String name) { - return getSmallDustByName(name, 1); - } + public static final String[] types = new String[] { "Almandine", "AluminumBrass", "Aluminum", "Alumite", + "Andradite", "Antimony", "Ardite", "Ashes", "Basalt", "Bauxite", "Biotite", "Brass", "Bronze", "Cadmium", + "Calcite", "Charcoal", "Chrome", "Cinnabar", "Clay", "Coal", "Cobalt", "Copper", "Cupronickel", "DarkAshes", + "DarkIron", "Diamond", "Electrum", "Emerald", "EnderEye", "EnderPearl", "Endstone", "Flint", "Glowstone", + "Gold", "Graphite", "Grossular", "Gunpowder", "Indium", "Invar", "Iridium", "Iron", "Kanthal", "Lapis", + "Lazurite", "Lead", "Limestone", "Lodestone", "Magnesium", "Magnetite", "Manganese", "Manyullyn", "Marble", + "Mithril", "Netherrack", "Nichrome", "Nickel", "Obsidian", "Osmium", "Peridot", "Phosphorous", "Platinum", + "PotassiumFeldspar", "Pyrite", "Pyrope", "RedGarnet", "Redrock", "Redstone", "Ruby", "Saltpeter", + "Sapphire", "Silicon", "Silver", "Sodalite", "Spessartine", "Sphalerite", "Steel", "Sulfur", "Tellurium", + "Teslatite", "Tetrahedrite", "Tin", "Titanium", "Tungsten", "Uvarovite", "Vinteum", "Voidstone", + "YellowGarnet", "Zinc", "Galena", "Olivine" }; - public static final String[] types = new String[] - {"Almandine", "AluminumBrass", "Aluminum", "Alumite", "Andradite", - "Antimony", "Ardite", "Ashes", "Basalt", "Bauxite", "Biotite", - "Brass", "Bronze", "Cadmium", "Calcite", "Charcoal", "Chrome", - "Cinnabar", "Clay", "Coal", "Cobalt", "Copper", "Cupronickel", - "DarkAshes", "DarkIron", "Diamond", "Electrum", "Emerald", - "EnderEye", "EnderPearl", "Endstone", "Flint", "Glowstone", "Gold", "Graphite", - "Grossular", "Gunpowder", "Indium", "Invar", "Iridium", "Iron", "Kanthal", "Lapis", "Lazurite", - "Lead", "Limestone", "Lodestone", "Magnesium", "Magnetite", "Manganese", - "Manyullyn", "Marble", "Mithril", "Netherrack", "Nichrome", "Nickel", - "Obsidian", "Osmium", "Peridot", "Phosphorous", "Platinum", "PotassiumFeldspar", - "Pyrite", "Pyrope", "RedGarnet", "Redrock", "Redstone", "Ruby", "Saltpeter", - "Sapphire", "Silicon", "Silver", "Sodalite", "Spessartine", "Sphalerite", - "Steel", "Sulfur", "Tellurium", "Teslatite", "Tetrahedrite", "Tin", - "Titanium", "Tungsten", "Uvarovite", "Vinteum", "Voidstone", "YellowGarnet", - "Zinc", "Galena", "Olivine"}; + public ItemDustsSmall() + { + setUnlocalizedName("techreborn.dustsmall"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemDustsSmall() { - setUnlocalizedName("techreborn.dustsmall"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTabMisc.instance); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/smallDust/small" + types[damage] + "Dust"; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } - - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/smallDust/small" + types[damage] + "Dust"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemEnergyCrystal.java b/src/main/java/techreborn/items/ItemEnergyCrystal.java index de8906b98..a29e940bd 100644 --- a/src/main/java/techreborn/items/ItemEnergyCrystal.java +++ b/src/main/java/techreborn/items/ItemEnergyCrystal.java @@ -4,53 +4,61 @@ import net.minecraft.item.ItemStack; import reborncore.api.power.IEnergyItemInfo; import techreborn.client.TechRebornCreativeTab; +public class ItemEnergyCrystal extends ItemTextureBase implements IEnergyItemInfo +{ -public class ItemEnergyCrystal extends ItemTextureBase implements IEnergyItemInfo { + public static final int maxCharge = 100000; + public static final int tier = 1; + public double transferLimit = 512; - public static final int maxCharge = 100000; - public static final int tier = 1; - public double transferLimit = 512; + public ItemEnergyCrystal() + { + super(); + setMaxStackSize(1); + setMaxDamage(13); + setUnlocalizedName("techreborn.energycrystal"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemEnergyCrystal() { - super(); - setMaxStackSize(1); - setMaxDamage(13); - setUnlocalizedName("techreborn.energycrystal"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return transferLimit; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return transferLimit; - } + @Override + public int getStackTier(ItemStack stack) + { + return tier; + } - @Override - public int getStackTier(ItemStack stack) { - return tier; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/energyCrystal"; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/energyCrystal"; - } - - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemGems.java b/src/main/java/techreborn/items/ItemGems.java index eba89ed6e..9f5c6939e 100644 --- a/src/main/java/techreborn/items/ItemGems.java +++ b/src/main/java/techreborn/items/ItemGems.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,63 +10,67 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemGems extends ItemTextureBase +{ -public class ItemGems extends ItemTextureBase { + public static ItemStack getGemByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.gems, count, i); + } + } + throw new InvalidParameterException("The gem " + name + " could not be found."); + } - public static ItemStack getGemByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.gems, count, i); - } - } - throw new InvalidParameterException("The gem " + name + " could not be found."); - } + public static ItemStack getGemByName(String name) + { + return getGemByName(name, 1); + } - public static ItemStack getGemByName(String name) { - return getGemByName(name, 1); - } + public static final String[] types = new String[] { "ruby", "sapphire", "peridot", "redGarnet", "yellowGarnet" }; - public static final String[] types = new String[] - {"ruby", "sapphire", "peridot", "redGarnet", - "yellowGarnet"}; + public ItemGems() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.gem"); + setHasSubtypes(true); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemGems() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.gem"); - setHasSubtypes(true); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/gem/" + types[damage]; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } - - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/gem/" + types[damage]; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemIngots.java b/src/main/java/techreborn/items/ItemIngots.java index 54e37839c..45bb8bfbb 100644 --- a/src/main/java/techreborn/items/ItemIngots.java +++ b/src/main/java/techreborn/items/ItemIngots.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,64 +10,69 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemIngots extends ItemTextureBase +{ + public static ItemStack getIngotByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.ingots, count, i); + } + } + throw new InvalidParameterException("The ingot " + name + " could not be found."); + } -public class ItemIngots extends ItemTextureBase { - public static ItemStack getIngotByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.ingots, count, i); - } - } - throw new InvalidParameterException("The ingot " + name + " could not be found."); - } + public static ItemStack getIngotByName(String name) + { + return getIngotByName(name, 1); + } - public static ItemStack getIngotByName(String name) { - return getIngotByName(name, 1); - } + public static final String[] types = new String[] { "aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", + "brass", "bronze", "cadmium", "chrome", "copper", "cupronickel", "electrum", "indium", "invar", "iridium", + "kanthal", "lead", "lodestone", "magnalium", "nichrome", "nickel", "osmium", "platinum", "silver", "steel", + "tellurium", "tin", "titanium", "tungsten", "hotTungstensteel", "tungstensteel", "zinc", "refinedIron" }; - public static final String[] types = new String[] - {"aluminum", "antimony", "batteryAlloy", "redAlloy", "blueAlloy", "brass", - "bronze", "cadmium", "chrome", "copper", "cupronickel", "electrum", "indium", - "invar", "iridium", "kanthal", "lead", "lodestone", "magnalium", "nichrome", "nickel", - "osmium", "platinum", "silver", "steel", "tellurium", "tin", "titanium", - "tungsten", "hotTungstensteel", "tungstensteel", "zinc", "refinedIron"}; + public ItemIngots() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.ingot"); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemIngots() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.ingot"); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/ingot/" + types[damage] + "Ingot"; + } - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/ingot/" + types[damage] + "Ingot"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemLapotronCrystal.java b/src/main/java/techreborn/items/ItemLapotronCrystal.java index 3ca2ebb66..5bfdfd9b3 100644 --- a/src/main/java/techreborn/items/ItemLapotronCrystal.java +++ b/src/main/java/techreborn/items/ItemLapotronCrystal.java @@ -4,53 +4,61 @@ import net.minecraft.item.ItemStack; import reborncore.api.power.IEnergyItemInfo; import techreborn.client.TechRebornCreativeTab; +public class ItemLapotronCrystal extends ItemTextureBase implements IEnergyItemInfo +{ -public class ItemLapotronCrystal extends ItemTextureBase implements IEnergyItemInfo { + public static final int maxCharge = 100000; + public static final int tier = 2; + public double transferLimit = 512; - public static final int maxCharge = 100000; - public static final int tier = 2; - public double transferLimit = 512; + public ItemLapotronCrystal() + { + super(); + setMaxStackSize(1); + setMaxDamage(13); + setUnlocalizedName("techreborn.lapotroncrystal"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemLapotronCrystal() { - super(); - setMaxStackSize(1); - setMaxDamage(13); - setUnlocalizedName("techreborn.lapotroncrystal"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return transferLimit; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return transferLimit; - } + @Override + public int getStackTier(ItemStack stack) + { + return tier; + } - @Override - public int getStackTier(ItemStack stack) { - return tier; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/lapotronCrystal"; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/lapotronCrystal"; - } - - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemLapotronicOrb.java b/src/main/java/techreborn/items/ItemLapotronicOrb.java index b258af349..427b8d2bb 100644 --- a/src/main/java/techreborn/items/ItemLapotronicOrb.java +++ b/src/main/java/techreborn/items/ItemLapotronicOrb.java @@ -5,56 +5,61 @@ import reborncore.api.power.IEnergyItemInfo; import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; +public class ItemLapotronicOrb extends ItemTextureBase implements IEnergyItemInfo +{ -public class ItemLapotronicOrb extends ItemTextureBase implements IEnergyItemInfo{ + public static final int maxCharge = ConfigTechReborn.LapotronicOrbMaxCharge; + public static final int tier = ConfigTechReborn.LithiumBatpackTier; + public double transferLimit = 10000; - public static final int maxCharge = ConfigTechReborn.LapotronicOrbMaxCharge; - public static final int tier = ConfigTechReborn.LithiumBatpackTier; - public double transferLimit = 10000; + public ItemLapotronicOrb() + { + super(); + setMaxStackSize(1); + setMaxDamage(13); + setUnlocalizedName("techreborn.lapotronicorb"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemLapotronicOrb() { - super(); - setMaxStackSize(1); - setMaxDamage(13); - setUnlocalizedName("techreborn.lapotronicorb"); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } + @Override + public double getMaxTransfer(ItemStack stack) + { + return transferLimit; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public int getStackTier(ItemStack stack) + { + return tier; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/lapotronicEnergyOrb"; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } - - @Override - public double getMaxTransfer(ItemStack stack) { - return transferLimit; - } - - @Override - public int getStackTier(ItemStack stack) { - return tier; - } - - @Override - public String getTextureName(int damage) { - return "techreborn:items/lapotronicEnergyOrb"; - } - - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemLithiumBattery.java b/src/main/java/techreborn/items/ItemLithiumBattery.java index 8c1d96fb5..9f55a3a46 100644 --- a/src/main/java/techreborn/items/ItemLithiumBattery.java +++ b/src/main/java/techreborn/items/ItemLithiumBattery.java @@ -1,5 +1,7 @@ package techreborn.items; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -9,74 +11,83 @@ import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PoweredItem; import techreborn.client.TechRebornCreativeTab; -import java.util.List; +public class ItemLithiumBattery extends ItemTextureBase implements IEnergyItemInfo +{ -public class ItemLithiumBattery extends ItemTextureBase implements IEnergyItemInfo { + public ItemLithiumBattery() + { + super(); + setMaxStackSize(1); + setMaxDamage(1); + setUnlocalizedName("techreborn.lithiumBattery"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemLithiumBattery() { - super(); - setMaxStackSize(1); - setMaxDamage(1); - setUnlocalizedName("techreborn.lithiumBattery"); - setCreativeTab(TechRebornCreativeTab.instance); - } - - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - } - - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + } - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - @Override - public double getMaxPower(ItemStack stack) { - return 100000; - } + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxPower(ItemStack stack) + { + return 100000; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return 64; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } - @Override - public int getStackTier(ItemStack stack) { - return 1; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return 64; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/lithiumBattery"; - } + @Override + public int getStackTier(ItemStack stack) + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/lithiumBattery"; + } + + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemMissingRecipe.java b/src/main/java/techreborn/items/ItemMissingRecipe.java index f3d7d0e80..6bb1230ec 100644 --- a/src/main/java/techreborn/items/ItemMissingRecipe.java +++ b/src/main/java/techreborn/items/ItemMissingRecipe.java @@ -5,5 +5,6 @@ import net.minecraft.item.Item; /** * Created by modmuss50 on 19/02/2016. */ -public class ItemMissingRecipe extends Item { +public class ItemMissingRecipe extends Item +{ } \ No newline at end of file diff --git a/src/main/java/techreborn/items/ItemNuggets.java b/src/main/java/techreborn/items/ItemNuggets.java index 12ed8d054..23712691b 100644 --- a/src/main/java/techreborn/items/ItemNuggets.java +++ b/src/main/java/techreborn/items/ItemNuggets.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,64 +10,69 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemNuggets extends ItemTextureBase +{ -public class ItemNuggets extends ItemTextureBase { + public static ItemStack getNuggetByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.nuggets, count, i); + } + } + throw new InvalidParameterException("The nugget " + name + " could not be found."); + } - public static ItemStack getNuggetByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.nuggets, count, i); - } - } - throw new InvalidParameterException("The nugget " + name + " could not be found."); - } + public static ItemStack getNuggetByName(String name) + { + return getNuggetByName(name, 1); + } - public static ItemStack getNuggetByName(String name) { - return getNuggetByName(name, 1); - } + public static final String[] types = new String[] { "aluminum", "antimony", "brass", "bronze", "chrome", "copper", + "electrum", "invar", "iridium", "iron", "lead", "nickel", "osmium", "platinum", "silver", "steel", "tin", + "titanium", "tungsten", "zinc" }; - public static final String[] types = new String[] - {"aluminum", "antimony", "brass", "bronze", "chrome", "copper", - "electrum", "invar", "iridium", "iron", "lead", - "nickel", "osmium", "platinum", "silver", "steel", - "tin", "titanium", "tungsten", "zinc"}; + public ItemNuggets() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.nuggets"); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemNuggets() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.nuggets"); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/nuggets/" + types[damage] + "Nugget"; + } - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/nuggets/" + types[damage] + "Nugget"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemParts.java b/src/main/java/techreborn/items/ItemParts.java index c24039934..0c4321415 100644 --- a/src/main/java/techreborn/items/ItemParts.java +++ b/src/main/java/techreborn/items/ItemParts.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -11,79 +14,86 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemParts extends ItemTextureBase +{ + public static ItemStack getPartByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.parts, count, i); + } + } + throw new InvalidParameterException("The part " + name + " could not be found."); + } -public class ItemParts extends ItemTextureBase { - public static ItemStack getPartByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.parts, count, i); - } - } - throw new InvalidParameterException("The part " + name + " could not be found."); - } + public static ItemStack getPartByName(String name) + { + return getPartByName(name, 1); + } - public static ItemStack getPartByName(String name) { - return getPartByName(name, 1); - } + public static final String[] types = new String[] { "advancedCircuitParts", "basicCircuitBoard", + "advancedCircuitBoard", "processorCircuitBoard", "energyFlowCircuit", "dataControlCircuit", "dataOrb", + "dataStorageCircuit", "diamondGrindingHead", "diamondSawBlade", "tungstenGrindingHead", + "heliumCoolantSimple", "HeliumCoolantTriple", "HeliumCoolantSix", "NaKCoolantSimple", "NaKCoolantTriple", + "NaKCoolantSix", "cupronickelHeatingCoil", "nichromeHeatingCoil", "kanthalHeatingCoil", "laserFocus", + "ductTape", "lazuriteChunk", "iridiumAlloyIngot", "rockCutterBlade", "superConductor", "thoriumCell", + "doubleThoriumCell", "quadThoriumCell", "plutoniumCell", "doublePlutoniumCell", "quadPlutoniumCell", + "destructoPack", "iridiumNeutronReflector", "massHoleDevice", "computerMonitor", "machineParts", + "thickNeutronReflector", "neutronReflector", "electronicCircuit", "advancedCircuit", "rubberSap", "rubber", + "scrap", "pump", "teleporter", "advancedAlloy", "mixedmetalingot", "carbonmesh", "carbonfiber" }; - public static final String[] types = new String[] - {"advancedCircuitParts", "basicCircuitBoard", "advancedCircuitBoard", "processorCircuitBoard", - "energyFlowCircuit", "dataControlCircuit", "dataOrb", "dataStorageCircuit", - "diamondGrindingHead", "diamondSawBlade", "tungstenGrindingHead", - "heliumCoolantSimple", "HeliumCoolantTriple", "HeliumCoolantSix", - "NaKCoolantSimple", "NaKCoolantTriple", "NaKCoolantSix", - "cupronickelHeatingCoil", "nichromeHeatingCoil", "kanthalHeatingCoil", - "laserFocus", "ductTape", "lazuriteChunk", "iridiumAlloyIngot", "rockCutterBlade", "superConductor", - "thoriumCell", "doubleThoriumCell", "quadThoriumCell", "plutoniumCell", "doublePlutoniumCell", - "quadPlutoniumCell", "destructoPack", "iridiumNeutronReflector", "massHoleDevice", "computerMonitor" - , "machineParts", "thickNeutronReflector", "neutronReflector", "electronicCircuit", "advancedCircuit" - , "rubberSap", "rubber", "scrap", "pump", "teleporter", "advancedAlloy", "mixedmetalingot", "carbonmesh", "carbonfiber"}; + public ItemParts() + { + setCreativeTab(TechRebornCreativeTab.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.part"); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemParts() { - setCreativeTab(TechRebornCreativeTab.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.part"); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + switch (itemStack.getItemDamage()) + { + case 37: // Destructo pack + player.openGui(Core.INSTANCE, GuiHandler.destructoPackID, world, (int) player.posX, (int) player.posY, + (int) player.posY); + break; + } + return itemStack; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/part/" + types[damage]; + } - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - switch (itemStack.getItemDamage()) { - case 37: // Destructo pack - player.openGui(Core.INSTANCE, GuiHandler.destructoPackID, world, - (int) player.posX, (int) player.posY, (int) player.posY); - break; - } - return itemStack; - } - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/part/" + types[damage]; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemPlates.java b/src/main/java/techreborn/items/ItemPlates.java index 22bac53e6..0aad8a743 100644 --- a/src/main/java/techreborn/items/ItemPlates.java +++ b/src/main/java/techreborn/items/ItemPlates.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,69 +10,71 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemPlates extends ItemTextureBase +{ -public class ItemPlates extends ItemTextureBase { + public static ItemStack getPlateByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.plate, count, i); + } + } + throw new InvalidParameterException("The plate " + name + " could not be found."); + } - public static ItemStack getPlateByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.plate, count, i); - } - } - throw new InvalidParameterException("The plate " + name + " could not be found."); - } + public static ItemStack getPlateByName(String name) + { + return getPlateByName(name, 1); + } - public static ItemStack getPlateByName(String name) { - return getPlateByName(name, 1); - } + public static final String[] types = new String[] { "aluminum", "batteryAlloy", "brass", "bronze", "carbon", + "chrome", "coal", "copper", "diamond", "electrum", "emerald", "gold", "invar", "iridium", "iron", "lapis", + "lead", "magnalium", "nickel", "obsidian", "osmium", "peridot", "platinum", "redGarnet", "redstone", "ruby", + "sapphire", "silicon", "silver", "steel", "teslatite", "tin", "titanium", "tungsten", "tungstensteel", + "yellowGarnet", "zinc" }; - public static final String[] types = new String[] - {"aluminum", "batteryAlloy", "brass", "bronze", "carbon", - "chrome", "coal", "copper", "diamond", "electrum", "emerald", - "gold", "invar", "iridium", "iron", "lapis", "lead", - "magnalium", "nickel", "obsidian", "osmium", - "peridot", "platinum", "redGarnet", "redstone", - "ruby", "sapphire", "silicon", "silver", "steel", - "teslatite", "tin", "titanium", "tungsten", "tungstensteel", - "yellowGarnet", "zinc"}; + public ItemPlates() + { + setUnlocalizedName("techreborn.plate"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemPlates() { - setUnlocalizedName("techreborn.plate"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTabMisc.instance); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/plate/" + types[damage] + "Plate"; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } - - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/plate/" + types[damage] + "Plate"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java index c0ff62860..82852d669 100644 --- a/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java +++ b/src/main/java/techreborn/items/ItemPurifiedCrushedOre.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -7,63 +10,69 @@ import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemPurifiedCrushedOre extends ItemTextureBase +{ -public class ItemPurifiedCrushedOre extends ItemTextureBase { + public static ItemStack getPurifiedCrushedOreByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.purifiedCrushedOre, count, i); + } + } + throw new InvalidParameterException("The crushed ore " + name + " could not be found."); + } - public static ItemStack getPurifiedCrushedOreByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.purifiedCrushedOre, count, i); - } - } - throw new InvalidParameterException("The crushed ore " + name + " could not be found."); - } + public static ItemStack getPurifiedCrushedOreByName(String name) + { + return getPurifiedCrushedOreByName(name, 1); + } - public static ItemStack getPurifiedCrushedOreByName(String name) { - return getPurifiedCrushedOreByName(name, 1); - } + public static final String[] types = new String[] { "Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", + "Cobalt", "DarkIron", "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", + "Tetrahedrite", "Tungsten", "Galena" }; - public static final String[] types = new String[] - {"Aluminum", "Ardite", "Bauxite", "Cadmium", "Cinnabar", "Cobalt", "DarkIron", - "Indium", "Iridium", "Nickel", "Osmium", "Platinum", "Pyrite", "Sphalerite", - "Tetrahedrite", "Tungsten", "Galena"}; + public ItemPurifiedCrushedOre() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.purifiedcrushedore"); + } - public ItemPurifiedCrushedOre() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.purifiedcrushedore"); - } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/purifiedCrushedOre/purifiedCrushed" + types[damage] + "Ore"; + } - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/purifiedCrushedOre/purifiedCrushed" + types[damage] + "Ore"; - } - - @Override - public int getMaxMeta() { - return types.length; - } + @Override + public int getMaxMeta() + { + return types.length; + } } diff --git a/src/main/java/techreborn/items/ItemReBattery.java b/src/main/java/techreborn/items/ItemReBattery.java index 2e6c30f05..53467a59d 100644 --- a/src/main/java/techreborn/items/ItemReBattery.java +++ b/src/main/java/techreborn/items/ItemReBattery.java @@ -1,5 +1,7 @@ package techreborn.items; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -9,74 +11,83 @@ import reborncore.api.power.IEnergyItemInfo; import reborncore.common.powerSystem.PoweredItem; import techreborn.client.TechRebornCreativeTab; -import java.util.List; +public class ItemReBattery extends ItemTextureBase implements IEnergyItemInfo +{ -public class ItemReBattery extends ItemTextureBase implements IEnergyItemInfo { + public ItemReBattery() + { + super(); + setMaxStackSize(1); + setMaxDamage(1); + setUnlocalizedName("techreborn.rebattery"); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemReBattery() { - super(); - setMaxStackSize(1); - setMaxDamage(1); - setUnlocalizedName("techreborn.rebattery"); - setCreativeTab(TechRebornCreativeTab.instance); - } - - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } - - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - } + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } + } - @Override - public double getMaxPower(ItemStack stack) { - return 10000; - } + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxPower(ItemStack stack) + { + return 10000; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return 64; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } - @Override - public int getStackTier(ItemStack stack) { - return 1; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return 64; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/rebattery"; - } + @Override + public int getStackTier(ItemStack stack) + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/rebattery"; + } + + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemScrapBox.java b/src/main/java/techreborn/items/ItemScrapBox.java index f041937a2..9bcd064c1 100644 --- a/src/main/java/techreborn/items/ItemScrapBox.java +++ b/src/main/java/techreborn/items/ItemScrapBox.java @@ -12,23 +12,29 @@ import reborncore.RebornCore; import techreborn.api.ScrapboxList; import techreborn.client.TechRebornCreativeTabMisc; -public class ItemScrapBox extends ItemTextureBase implements ITexturedItem{ - - public ItemScrapBox() { +public class ItemScrapBox extends ItemTextureBase implements ITexturedItem +{ + + public ItemScrapBox() + { setUnlocalizedName("techreborn.scrapbox"); setCreativeTab(TechRebornCreativeTabMisc.instance); RebornCore.jsonDestroyer.registerObject(this); } @Override - public ActionResult onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { - if(!world.isRemote) { + public ActionResult onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, + EnumHand hand) + { + if (!world.isRemote) + { int random = world.rand.nextInt(ScrapboxList.stacks.size()); ItemStack out = ScrapboxList.stacks.get(random).copy(); float xOffset = world.rand.nextFloat() * 0.8F + 0.1F; float yOffset = world.rand.nextFloat() * 0.8F + 0.1F; float zOffset = world.rand.nextFloat() * 0.8F + 0.1F; - EntityItem entityitem = new EntityItem(world, player.getPosition().getX() + xOffset, player.getPosition().getY() + yOffset, player.getPosition().getZ() + zOffset, out); + EntityItem entityitem = new EntityItem(world, player.getPosition().getX() + xOffset, + player.getPosition().getY() + yOffset, player.getPosition().getZ() + zOffset, out); entityitem.setPickupDelay(20); world.spawnEntityInWorld(entityitem); @@ -38,14 +44,15 @@ public class ItemScrapBox extends ItemTextureBase implements ITexturedItem{ return new ActionResult<>(EnumActionResult.SUCCESS, itemStack); } - @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 1; } @Override - public String getTextureName(int arg0) { - return "techreborn:items/misc/scrapBox"; + public String getTextureName(int arg0) + { + return "techreborn:items/misc/scrapBox"; } } diff --git a/src/main/java/techreborn/items/ItemTR.java b/src/main/java/techreborn/items/ItemTR.java index 07bb56eac..9e497d4be 100644 --- a/src/main/java/techreborn/items/ItemTR.java +++ b/src/main/java/techreborn/items/ItemTR.java @@ -4,12 +4,14 @@ import net.minecraft.item.Item; import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTab; -public class ItemTR extends Item { +public class ItemTR extends Item +{ - public ItemTR() { - setNoRepair(); - setCreativeTab(TechRebornCreativeTab.instance); - RebornCore.jsonDestroyer.registerObject(this); - } + public ItemTR() + { + setNoRepair(); + setCreativeTab(TechRebornCreativeTab.instance); + RebornCore.jsonDestroyer.registerObject(this); + } } diff --git a/src/main/java/techreborn/items/ItemTextureBase.java b/src/main/java/techreborn/items/ItemTextureBase.java index 471885db9..8966412d4 100644 --- a/src/main/java/techreborn/items/ItemTextureBase.java +++ b/src/main/java/techreborn/items/ItemTextureBase.java @@ -6,10 +6,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import techreborn.lib.ModInfo; -public abstract class ItemTextureBase extends ItemTR implements ITexturedItem { +public abstract class ItemTextureBase extends ItemTR implements ITexturedItem +{ - @Override - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/ItemUUmatter.java b/src/main/java/techreborn/items/ItemUUmatter.java index 07b91ff8d..a76ef4615 100644 --- a/src/main/java/techreborn/items/ItemUUmatter.java +++ b/src/main/java/techreborn/items/ItemUUmatter.java @@ -3,21 +3,24 @@ package techreborn.items; import me.modmuss50.jsonDestroyer.api.ITexturedItem; import techreborn.client.TechRebornCreativeTabMisc; -public class ItemUUmatter extends ItemTextureBase implements ITexturedItem { +public class ItemUUmatter extends ItemTextureBase implements ITexturedItem +{ - public ItemUUmatter() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.uuMatter"); - } + public ItemUUmatter() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.uuMatter"); + } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/misc/itemMatter"; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/misc/itemMatter"; - } - - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/ItemUpgrade.java b/src/main/java/techreborn/items/ItemUpgrade.java index 1ab76271f..1a9bafaa0 100644 --- a/src/main/java/techreborn/items/ItemUpgrade.java +++ b/src/main/java/techreborn/items/ItemUpgrade.java @@ -1,5 +1,8 @@ package techreborn.items; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -8,69 +11,79 @@ import techreborn.api.upgrade.IMachineUpgrade; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.init.ModItems; -import java.security.InvalidParameterException; -import java.util.List; +public class ItemUpgrade extends ItemTR implements IMachineUpgrade +{ -public class ItemUpgrade extends ItemTR implements IMachineUpgrade { + public static ItemStack getUpgradeByName(String name, int count) + { + for (int i = 0; i < types.length; i++) + { + if (types[i].equalsIgnoreCase(name)) + { + return new ItemStack(ModItems.plate, count, i); + } + } + throw new InvalidParameterException("The upgrade " + name + " could not be found."); + } - public static ItemStack getUpgradeByName(String name, int count) { - for (int i = 0; i < types.length; i++) { - if (types[i].equalsIgnoreCase(name)) { - return new ItemStack(ModItems.plate, count, i); - } - } - throw new InvalidParameterException("The upgrade " + name + " could not be found."); - } + public static ItemStack getUpgradeByName(String name) + { + return getUpgradeByName(name, 1); + } - public static ItemStack getUpgradeByName(String name) { - return getUpgradeByName(name, 1); - } + public static final String[] types = new String[] { "0.2Speed", "0.2Power", "0.5Speed" }; - public static final String[] types = new String[] - {"0.2Speed", "0.2Power", "0.5Speed"}; + public ItemUpgrade() + { + setUnlocalizedName("techreborn.upgrade"); + setHasSubtypes(true); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setMaxStackSize(1); + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= types.length) + { + meta = 0; + } - public ItemUpgrade() { - setUnlocalizedName("techreborn.upgrade"); - setHasSubtypes(true); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setMaxStackSize(1); - } + return super.getUnlocalizedName() + "." + types[meta]; + } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < types.length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= types.length) { - meta = 0; - } + @Override + public void processUpgrade(RecipeCrafter crafter, ItemStack stack) + { + // Remember the max speed multiplier can only be 0.99!! - return super.getUnlocalizedName() + "." + types[meta]; - } - - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < types.length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } - - @Override - public void processUpgrade(RecipeCrafter crafter, ItemStack stack) { - //Remember the max speed multiplier can only be 0.99!! - - if (stack.getItemDamage() == 0) {//Check the meta data here - crafter.addSpeedMulti(0.2);//This will set the speed multiplier to 0.8 - crafter.addPowerMulti(0.5);//This will use eu/tick x 1.5 - //crafter.addPowerMulti(2); This will use twice the amount of power. - } - if (stack.getItemDamage() == 1) { - crafter.addPowerMulti(-0.2);//This will use eu/tick 0.8 - } - if (stack.getItemDamage() == 2) { - crafter.addSpeedMulti(0.5); - crafter.addPowerMulti(1); - } - } + if (stack.getItemDamage() == 0) + {// Check the meta data here + crafter.addSpeedMulti(0.2);// This will set the speed multiplier to + // 0.8 + crafter.addPowerMulti(0.5);// This will use eu/tick x 1.5 + // crafter.addPowerMulti(2); This will use twice the amount of + // power. + } + if (stack.getItemDamage() == 1) + { + crafter.addPowerMulti(-0.2);// This will use eu/tick 0.8 + } + if (stack.getItemDamage() == 2) + { + crafter.addSpeedMulti(0.5); + crafter.addPowerMulti(1); + } + } } \ No newline at end of file diff --git a/src/main/java/techreborn/items/armor/ItemLapotronPack.java b/src/main/java/techreborn/items/armor/ItemLapotronPack.java index 4a7409e60..25b89e303 100644 --- a/src/main/java/techreborn/items/armor/ItemLapotronPack.java +++ b/src/main/java/techreborn/items/armor/ItemLapotronPack.java @@ -1,5 +1,6 @@ package techreborn.items.armor; +import java.util.List; import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; @@ -19,92 +20,102 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; import techreborn.lib.ModInfo; -import java.util.List; +public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, ITexturedItem +{ -public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, ITexturedItem { + public static final int maxCharge = ConfigTechReborn.LapotronPackCharge; + public static final int tier = ConfigTechReborn.LapotronPackTier; + public double transferLimit = 100000; - public static final int maxCharge = ConfigTechReborn.LapotronPackCharge; - public static final int tier = ConfigTechReborn.LapotronPackTier; - public double transferLimit = 100000; + public ItemLapotronPack() + { + super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST); + setCreativeTab(TechRebornCreativeTab.instance); + setUnlocalizedName("techreborn.lapotronpack"); + setMaxStackSize(1); + RebornCore.jsonDestroyer.registerObject(this); + } - public ItemLapotronPack() { - super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST); - setCreativeTab(TechRebornCreativeTab.instance); - setUnlocalizedName("techreborn.lapotronpack"); - setMaxStackSize(1); - RebornCore.jsonDestroyer.registerObject(this); - } + @Override + @SideOnly(Side.CLIENT) + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) + { + return "techreborn:" + "textures/models/lapotronpack.png"; + } - @Override - @SideOnly(Side.CLIENT) - public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { - return "techreborn:" + "textures/models/lapotronpack.png"; - } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) + { + return true; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return true; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return transferLimit; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return transferLimit; - } + @Override + public int getStackTier(ItemStack stack) + { + return tier; + } - @Override - public int getStackTier(ItemStack stack) { - return tier; - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + } - } + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/lapotronicEnergyOrb"; + } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/lapotronicEnergyOrb"; - } - - @Override - public int getMaxMeta() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java index 9093d1b24..8a02e670b 100644 --- a/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java +++ b/src/main/java/techreborn/items/armor/ItemLithiumBatpack.java @@ -1,5 +1,7 @@ package techreborn.items.armor; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; @@ -18,93 +20,102 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; import techreborn.lib.ModInfo; -import java.util.List; +public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, ITexturedItem +{ -public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, ITexturedItem { + public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge; + public static final int tier = ConfigTechReborn.LithiumBatpackTier; + public double transferLimit = 10000; - public static final int maxCharge = ConfigTechReborn.LithiumBatpackCharge; - public static final int tier = ConfigTechReborn.LithiumBatpackTier; - public double transferLimit = 10000; + public ItemLithiumBatpack() + { + super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST); + setMaxStackSize(1); + setUnlocalizedName("techreborn.lithiumbatpack"); + setCreativeTab(TechRebornCreativeTab.instance); + RebornCore.jsonDestroyer.registerObject(this); + } - public ItemLithiumBatpack() { - super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST); - setMaxStackSize(1); - setUnlocalizedName("techreborn.lithiumbatpack"); - setCreativeTab(TechRebornCreativeTab.instance); - RebornCore.jsonDestroyer.registerObject(this); - } + @Override + @SideOnly(Side.CLIENT) + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) + { + return "techreborn:" + "textures/models/lithiumbatpack.png"; + } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - @SideOnly(Side.CLIENT) - public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { - return "techreborn:" + "textures/models/lithiumbatpack.png"; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return true; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return transferLimit; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public int getStackTier(ItemStack stack) + { + return tier; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return true; - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - @Override - public double getMaxTransfer(ItemStack stack) { - return transferLimit; - } + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - @Override - public int getStackTier(ItemStack stack) { - return tier; - } + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + } - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/lithiumBatpack"; + } - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } - - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/lithiumBatpack"; - } - - @Override - public int getMaxMeta() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java index eaeda0ab9..731fce21a 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedChainsaw.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemAdvancedChainsaw extends ItemChainsaw { +public class ItemAdvancedChainsaw extends ItemChainsaw +{ - public ItemAdvancedChainsaw() { - super(ToolMaterial.DIAMOND, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F); - this.cost = 250; - } + public ItemAdvancedChainsaw() + { + super(ToolMaterial.DIAMOND, "techreborn.advancedChainsaw", ConfigTechReborn.AdvancedChainsawCharge, + ConfigTechReborn.AdvancedDrillTier, 4.0F); + this.cost = 250; + } - @Override - public boolean canHarvestBlock(IBlockState blockIn) { - return Items.diamond_axe.canHarvestBlock(blockIn); - } + @Override + public boolean canHarvestBlock(IBlockState blockIn) + { + return Items.diamond_axe.canHarvestBlock(blockIn); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/advancedChainsaw"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/advancedChainsaw"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java index 442c332c8..bbe4f0b00 100644 --- a/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java +++ b/src/main/java/techreborn/items/tools/ItemAdvancedDrill.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemAdvancedDrill extends ItemDrill { +public class ItemAdvancedDrill extends ItemDrill +{ - public ItemAdvancedDrill() { - super(ToolMaterial.DIAMOND, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, ConfigTechReborn.AdvancedDrillTier, 4.0F); - this.cost = 250; - } + public ItemAdvancedDrill() + { + super(ToolMaterial.DIAMOND, "techreborn.advancedDrill", ConfigTechReborn.AdvancedDrillCharge, + ConfigTechReborn.AdvancedDrillTier, 4.0F); + this.cost = 250; + } - @Override - public boolean canHarvestBlock(IBlockState blockIn) { - return Items.diamond_pickaxe.canHarvestBlock(blockIn) || Items.diamond_shovel.canHarvestBlock(blockIn); - } + @Override + public boolean canHarvestBlock(IBlockState blockIn) + { + return Items.diamond_pickaxe.canHarvestBlock(blockIn) || Items.diamond_shovel.canHarvestBlock(blockIn); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/advancedDrill"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/advancedDrill"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemChainsaw.java b/src/main/java/techreborn/items/tools/ItemChainsaw.java index 68d4f7d1e..bd9cf07c9 100644 --- a/src/main/java/techreborn/items/tools/ItemChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemChainsaw.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; @@ -22,9 +24,8 @@ import reborncore.common.util.TorchHelper; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; -import java.util.List; - -public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem { +public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedItem +{ public int maxCharge = 1; public int cost = 250; @@ -32,7 +33,9 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI public static int tier = 1; public double transferLimit = 100; - public ItemChainsaw(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) { + public ItemChainsaw(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, + float unpoweredSpeed) + { super(material); efficiencyOnProperMaterial = 20F; setCreativeTab(TechRebornCreativeTab.instance); @@ -45,75 +48,89 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI this.unpoweredSpeed = unpoweredSpeed; } -// @Override -// public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) { -// Random rand = new Random(); -// if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack) + 1) == 0) { -// PoweredItem.useEnergy(cost, stack); -// } -// return true; -// } + // @Override + // public boolean onBlockDestroyed(ItemStack stack, World worldIn, + // IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) { + // Random rand = new Random(); + // if + // (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, + // stack) + 1) == 0) { + // PoweredItem.useEnergy(cost, stack); + // } + // return true; + // } -// @Override -// public float getDigSpeed(ItemStack stack, IBlockState state) { -// if (!PoweredItem.canUseEnergy(cost, stack)) { -// return unpoweredSpeed; -// } -// -// if (OreDictUtils.isOre(state, "treeLeaves") && PoweredItem.canUseEnergy(cost, stack)) { -// return 40F; -// } -// -// if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F) { -// return efficiencyOnProperMaterial; -// } else { -// return super.getDigSpeed(stack, state); -// } -// } + // @Override + // public float getDigSpeed(ItemStack stack, IBlockState state) { + // if (!PoweredItem.canUseEnergy(cost, stack)) { + // return unpoweredSpeed; + // } + // + // if (OreDictUtils.isOre(state, "treeLeaves") && + // PoweredItem.canUseEnergy(cost, stack)) { + // return 40F; + // } + // + // if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F) { + // return efficiencyOnProperMaterial; + // } else { + // return super.getDigSpeed(stack, state); + // } + // } @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) + { return true; } @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); } @Override - public boolean isRepairable() { + public boolean isRepairable() + { return false; } @Override - public double getMaxPower(ItemStack stack) { + public double getMaxPower(ItemStack stack) + { return maxCharge; } @Override - public boolean canAcceptEnergy(ItemStack stack) { + public boolean canAcceptEnergy(ItemStack stack) + { return true; } @Override - public boolean canProvideEnergy(ItemStack stack) { + public boolean canProvideEnergy(ItemStack stack) + { return false; } @Override - public double getMaxTransfer(ItemStack stack) { + public double getMaxTransfer(ItemStack stack) + { return transferLimit; } @Override - public int getStackTier(ItemStack stack) { + public int getStackTier(ItemStack stack) + { return tier; } @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { ItemStack itemStack = new ItemStack(this, 1); itemList.add(itemStack); @@ -123,30 +140,35 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, ITexturedI } @Override - public double getDurabilityForDisplay(ItemStack stack) { + public double getDurabilityForDisplay(ItemStack stack) + { double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); return 1 - charge; } @Override - public boolean showDurabilityBar(ItemStack stack) { + public boolean showDurabilityBar(ItemStack stack) + { return true; } @Override - public String getTextureName(int damage) { + public String getTextureName(int damage) + { return "techreborn:items/tool/nullChainsaw"; } @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 1; } @Override @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); } } diff --git a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java index da454e53a..04019c0f3 100644 --- a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java +++ b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; @@ -15,98 +17,112 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; import techreborn.items.ItemTextureBase; -import java.util.List; +public class ItemCloakingDevice extends ItemTextureBase implements IEnergyItemInfo +{ + public static int Teir = ConfigTechReborn.CloakingDeviceTier; + public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge; + public static int Limit = 100; + public static boolean isActive; + private int armorType = 1; -public class ItemCloakingDevice extends ItemTextureBase implements IEnergyItemInfo { - public static int Teir = ConfigTechReborn.CloakingDeviceTier; - public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge; - public static int Limit = 100; - public static boolean isActive; - private int armorType = 1; + public ItemCloakingDevice() + { + setUnlocalizedName("techreborn.cloakingdevice"); + setMaxStackSize(1); + setCreativeTab(TechRebornCreativeTab.instance); + } - public ItemCloakingDevice() { - setUnlocalizedName("techreborn.cloakingdevice"); - setMaxStackSize(1); - setCreativeTab(TechRebornCreativeTab.instance); - } + @Override + public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) + { + if (PoweredItem.canUseEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack)) + { + PoweredItem.useEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack); + player.setInvisible(true); + } else + { + if (!player.isPotionActive(MobEffects.invisibility)) + { + player.setInvisible(false); + } + } + } - @Override - public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { - if (PoweredItem.canUseEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack)) { - PoweredItem.useEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack); - player.setInvisible(true); - } else { - if (!player.isPotionActive(MobEffects.invisibility)) { - player.setInvisible(false); - } - } - } + @Override + public double getMaxPower(ItemStack stack) + { + return MaxCharge; + } - @Override - public double getMaxPower(ItemStack stack) { - return MaxCharge; - } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) + { + return false; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return Limit; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return Limit; - } + @Override + public int getStackTier(ItemStack stack) + { + return Teir; + } - @Override - public int getStackTier(ItemStack stack) { - return Teir; - } + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + ItemStack itemstack1 = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - ItemStack itemstack1 = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST); + if (itemstack1 == null) + { + player.setItemStackToSlot(EntityEquipmentSlot.CHEST, itemStack.copy()); + itemStack.stackSize = 0; + } - if (itemstack1 == null) { - player.setItemStackToSlot(EntityEquipmentSlot.CHEST, itemStack.copy()); - itemStack.stackSize = 0; - } + return itemStack; + } - return itemStack; - } + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + } + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + @Override + public String getTextureName(int damage) + { + return "techreborn:items/techreborn.cloakingdevice"; + } - } - - public boolean showDurabilityBar(ItemStack stack) { - return true; - } - - @Override - public String getTextureName(int damage) { - return "techreborn:items/techreborn.cloakingdevice"; - } - - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemDebugTool.java b/src/main/java/techreborn/items/tools/ItemDebugTool.java index 10584130e..ffa8d841b 100644 --- a/src/main/java/techreborn/items/tools/ItemDebugTool.java +++ b/src/main/java/techreborn/items/tools/ItemDebugTool.java @@ -19,33 +19,42 @@ import techreborn.items.ItemTextureBase; /** * Created by Mark on 20/03/2016. */ -public class ItemDebugTool extends ItemTextureBase implements ITexturedItem { +public class ItemDebugTool extends ItemTextureBase implements ITexturedItem +{ - public ItemDebugTool() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.debug"); - } + public ItemDebugTool() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.debug"); + } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/misc/debug"; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/misc/debug"; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } - - @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - TileEntity tile = worldIn.getTileEntity(pos); - if(tile instanceof IEnergyInterfaceTile){ - if(!tile.getWorld().isRemote){ - playerIn.addChatComponentMessage(new TextComponentString(TextFormatting.GREEN + "Power" + TextFormatting.BLUE + PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy()))); - } - return EnumActionResult.SUCCESS; - } - return EnumActionResult.FAIL; - } + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { + TileEntity tile = worldIn.getTileEntity(pos); + if (tile instanceof IEnergyInterfaceTile) + { + if (!tile.getWorld().isRemote) + { + playerIn.addChatComponentMessage( + new TextComponentString(TextFormatting.GREEN + "Power" + TextFormatting.BLUE + + PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy()))); + } + return EnumActionResult.SUCCESS; + } + return EnumActionResult.FAIL; + } } diff --git a/src/main/java/techreborn/items/tools/ItemDiamondChainsaw.java b/src/main/java/techreborn/items/tools/ItemDiamondChainsaw.java index ed92dd7ca..6b022f1a6 100644 --- a/src/main/java/techreborn/items/tools/ItemDiamondChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemDiamondChainsaw.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemDiamondChainsaw extends ItemChainsaw { +public class ItemDiamondChainsaw extends ItemChainsaw +{ - public ItemDiamondChainsaw() { - super(ToolMaterial.DIAMOND, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, ConfigTechReborn.DiamondChainsawTier, 2.5F); - this.cost = 250; - } + public ItemDiamondChainsaw() + { + super(ToolMaterial.DIAMOND, "techreborn.diamondChainsaw", ConfigTechReborn.DiamondChainsawCharge, + ConfigTechReborn.DiamondChainsawTier, 2.5F); + this.cost = 250; + } - @Override - public boolean canHarvestBlock(IBlockState blockIn) { - return Items.diamond_axe.canHarvestBlock(blockIn); - } + @Override + public boolean canHarvestBlock(IBlockState blockIn) + { + return Items.diamond_axe.canHarvestBlock(blockIn); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/diamondChainsaw"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/diamondChainsaw"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemDiamondDrill.java b/src/main/java/techreborn/items/tools/ItemDiamondDrill.java index ec9786171..4a0ed6355 100644 --- a/src/main/java/techreborn/items/tools/ItemDiamondDrill.java +++ b/src/main/java/techreborn/items/tools/ItemDiamondDrill.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemDiamondDrill extends ItemDrill { +public class ItemDiamondDrill extends ItemDrill +{ - public ItemDiamondDrill() { - super(ToolMaterial.DIAMOND, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge, ConfigTechReborn.DiamondDrillTier, 2.5F); - this.cost = 250; - } + public ItemDiamondDrill() + { + super(ToolMaterial.DIAMOND, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge, + ConfigTechReborn.DiamondDrillTier, 2.5F); + this.cost = 250; + } - @Override - public boolean canHarvestBlock(IBlockState state) { - return Items.diamond_pickaxe.canHarvestBlock(state) || Items.diamond_shovel.canHarvestBlock(state); - } + @Override + public boolean canHarvestBlock(IBlockState state) + { + return Items.diamond_pickaxe.canHarvestBlock(state) || Items.diamond_shovel.canHarvestBlock(state); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/diamondDrill"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/diamondDrill"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemDiamondJackhammer.java b/src/main/java/techreborn/items/tools/ItemDiamondJackhammer.java index c3eaa659f..c281c6dbd 100644 --- a/src/main/java/techreborn/items/tools/ItemDiamondJackhammer.java +++ b/src/main/java/techreborn/items/tools/ItemDiamondJackhammer.java @@ -2,21 +2,26 @@ package techreborn.items.tools; import techreborn.config.ConfigTechReborn; -public class ItemDiamondJackhammer extends ItemJackhammer { +public class ItemDiamondJackhammer extends ItemJackhammer +{ - public ItemDiamondJackhammer() { - super(ToolMaterial.DIAMOND, "techreborn.diamondJackhammer", ConfigTechReborn.DiamondJackhammerCharge, ConfigTechReborn.DiamondJackhammerTier); - this.cost = 250; + public ItemDiamondJackhammer() + { + super(ToolMaterial.DIAMOND, "techreborn.diamondJackhammer", ConfigTechReborn.DiamondJackhammerCharge, + ConfigTechReborn.DiamondJackhammerTier); + this.cost = 250; this.efficiencyOnProperMaterial = 60F; - } + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/diamondJackhammer"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/diamondJackhammer"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemDrill.java b/src/main/java/techreborn/items/tools/ItemDrill.java index a3a472aba..cd37c3cfa 100644 --- a/src/main/java/techreborn/items/tools/ItemDrill.java +++ b/src/main/java/techreborn/items/tools/ItemDrill.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; @@ -22,9 +24,8 @@ import reborncore.common.util.TorchHelper; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; -import java.util.List; - -public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem { +public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem +{ public int maxCharge = 1; public int cost = 250; @@ -32,7 +33,8 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured public static int tier = 1; public double transferLimit = 100; - public ItemDrill(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) { + public ItemDrill(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier, float unpoweredSpeed) + { super(material); efficiencyOnProperMaterial = 20F; setCreativeTab(TechRebornCreativeTab.instance); @@ -45,70 +47,84 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured this.unpoweredSpeed = unpoweredSpeed; } -// @Override -// public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) { -// Random rand = new Random(); -// if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack)+1) == 0) { -// PoweredItem.useEnergy(cost, stack); -// } -// return true; -// } -// -// @Override -// public float getDigSpeed(ItemStack stack, IBlockState state) { -// if (!PoweredItem.canUseEnergy(cost, stack)) { -// return unpoweredSpeed; -// } -// if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) { -// return efficiencyOnProperMaterial; -// } else { -// return super.getDigSpeed(stack, state); -// } -// } + // @Override + // public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block + // blockIn, BlockPos pos, EntityLivingBase playerIn) { + // Random rand = new Random(); + // if + // (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, + // stack)+1) == 0) { + // PoweredItem.useEnergy(cost, stack); + // } + // return true; + // } + // + // @Override + // public float getDigSpeed(ItemStack stack, IBlockState state) { + // if (!PoweredItem.canUseEnergy(cost, stack)) { + // return unpoweredSpeed; + // } + // if (Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F || + // Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F) { + // return efficiencyOnProperMaterial; + // } else { + // return super.getDigSpeed(stack, state); + // } + // } @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) + { return true; } @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); } @Override - public boolean isRepairable() { + public boolean isRepairable() + { return false; } @Override - public double getMaxPower(ItemStack stack) { + public double getMaxPower(ItemStack stack) + { return maxCharge; } @Override - public boolean canAcceptEnergy(ItemStack stack) { + public boolean canAcceptEnergy(ItemStack stack) + { return true; } @Override - public boolean canProvideEnergy(ItemStack stack) { + public boolean canProvideEnergy(ItemStack stack) + { return false; } @Override - public double getMaxTransfer(ItemStack stack) { + public double getMaxTransfer(ItemStack stack) + { return transferLimit; } @Override - public int getStackTier(ItemStack stack) { + public int getStackTier(ItemStack stack) + { return tier; } @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { ItemStack itemStack = new ItemStack(this, 1); itemList.add(itemStack); @@ -118,30 +134,35 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, ITextured } @Override - public double getDurabilityForDisplay(ItemStack stack) { + public double getDurabilityForDisplay(ItemStack stack) + { double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); return 1 - charge; } @Override - public boolean showDurabilityBar(ItemStack stack) { + public boolean showDurabilityBar(ItemStack stack) + { return true; } @Override - public String getTextureName(int damage) { + public String getTextureName(int damage) + { return "techreborn:items/tool/nullDrill"; } @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 1; } @Override @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); } } diff --git a/src/main/java/techreborn/items/tools/ItemFluidbucket.java b/src/main/java/techreborn/items/tools/ItemFluidbucket.java index 75334b947..d478f8041 100644 --- a/src/main/java/techreborn/items/tools/ItemFluidbucket.java +++ b/src/main/java/techreborn/items/tools/ItemFluidbucket.java @@ -1,6 +1,5 @@ package techreborn.items.tools; -import me.modmuss50.jsonDestroyer.api.ITexturedBucket; import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; @@ -13,49 +12,54 @@ import reborncore.RebornCore; import techreborn.blocks.fluid.BlockFluidBase; import techreborn.client.TechRebornCreativeTabMisc; -public class ItemFluidbucket extends ItemBucket implements ITexturedItem { - private String iconName; +public class ItemFluidbucket extends ItemBucket implements ITexturedItem +{ + private String iconName; - Fluid containedFluid; + Fluid containedFluid; - public ItemFluidbucket(BlockFluidBase block) { - super(block); - setContainerItem(Items.bucket); - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.fluidbucket"); - RebornCore.jsonDestroyer.registerObject(this); - containedFluid = block.getFluid(); - } + public ItemFluidbucket(BlockFluidBase block) + { + super(block); + setContainerItem(Items.bucket); + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.fluidbucket"); + RebornCore.jsonDestroyer.registerObject(this); + containedFluid = block.getFluid(); + } - @Override - public Item setUnlocalizedName(String par1Str) { - iconName = par1Str; - return super.setUnlocalizedName(par1Str); - } + @Override + public Item setUnlocalizedName(String par1Str) + { + iconName = par1Str; + return super.setUnlocalizedName(par1Str); + } + // @Override + // public boolean isGas(int damage) { + // return false; + // } + // + // @Override + // public Fluid getFluid(int damage) { + // return containedFluid; + // } -// @Override -// public boolean isGas(int damage) { -// return false; -// } -// -// @Override -// public Fluid getFluid(int damage) { -// return containedFluid; -// } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/bucket/" + iconName; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/bucket/" + iconName; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } - - @Override - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return null; - } + @Override + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return null; + } } diff --git a/src/main/java/techreborn/items/tools/ItemHammer.java b/src/main/java/techreborn/items/tools/ItemHammer.java index 5c0f408b1..1eaeb0c0a 100644 --- a/src/main/java/techreborn/items/tools/ItemHammer.java +++ b/src/main/java/techreborn/items/tools/ItemHammer.java @@ -10,54 +10,65 @@ import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.items.ItemTR; import techreborn.lib.ModInfo; -public class ItemHammer extends ItemTR implements ITexturedItem { - private String iconName; +public class ItemHammer extends ItemTR implements ITexturedItem +{ + private String iconName; - public ItemHammer(int MaxDamage) { - setUnlocalizedName("techreborn.hammer"); - setMaxDamage(MaxDamage); - } + public ItemHammer(int MaxDamage) + { + setUnlocalizedName("techreborn.hammer"); + setMaxDamage(MaxDamage); + } -// @Override -// public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { -// world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, 0.4F); -// return true; -// } - - @Override - public Item setUnlocalizedName(String par1Str) { - iconName = par1Str; - return super.setUnlocalizedName(par1Str); - } + // @Override + // public boolean onItemUse(ItemStack stack, EntityPlayer player, World + // world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) + // { + // world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, + // 0.4F); + // return true; + // } - @Override - public boolean getShareTag() { - return true; - } + @Override + public Item setUnlocalizedName(String par1Str) + { + iconName = par1Str; + return super.setUnlocalizedName(par1Str); + } - @Override - public ItemStack getContainerItem(ItemStack itemStack) { - ItemStack copiedStack = itemStack.copy(); + @Override + public boolean getShareTag() + { + return true; + } - copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); - copiedStack.stackSize = 1; - - return copiedStack; - } + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + ItemStack copiedStack = itemStack.copy(); - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/hammer"; - } + copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); + copiedStack.stackSize = 1; - @Override - public int getMaxMeta() { - return 1; - } + return copiedStack; + } - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/hammer"; + } + + @Override + public int getMaxMeta() + { + return 1; + } + + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/tools/ItemIronChainsaw.java b/src/main/java/techreborn/items/tools/ItemIronChainsaw.java index a04e76818..1181d7117 100644 --- a/src/main/java/techreborn/items/tools/ItemIronChainsaw.java +++ b/src/main/java/techreborn/items/tools/ItemIronChainsaw.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemIronChainsaw extends ItemChainsaw { +public class ItemIronChainsaw extends ItemChainsaw +{ - public ItemIronChainsaw() { - super(ToolMaterial.IRON, "techreborn.ironChainsaw", ConfigTechReborn.IronChainsawCharge, ConfigTechReborn.IronChainsawTier, 2.0F); - this.cost = 50; - } + public ItemIronChainsaw() + { + super(ToolMaterial.IRON, "techreborn.ironChainsaw", ConfigTechReborn.IronChainsawCharge, + ConfigTechReborn.IronChainsawTier, 2.0F); + this.cost = 50; + } - @Override - public boolean canHarvestBlock(IBlockState state) { - return Items.iron_axe.canHarvestBlock(state); - } + @Override + public boolean canHarvestBlock(IBlockState state) + { + return Items.iron_axe.canHarvestBlock(state); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/ironChainsaw"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/ironChainsaw"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemIronDrill.java b/src/main/java/techreborn/items/tools/ItemIronDrill.java index 2d96b3bf3..ead992ea1 100644 --- a/src/main/java/techreborn/items/tools/ItemIronDrill.java +++ b/src/main/java/techreborn/items/tools/ItemIronDrill.java @@ -4,25 +4,31 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Items; import techreborn.config.ConfigTechReborn; -public class ItemIronDrill extends ItemDrill { +public class ItemIronDrill extends ItemDrill +{ - public ItemIronDrill() { - super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge, ConfigTechReborn.IronDrillTier, 2.0F); - this.cost = 50; - } + public ItemIronDrill() + { + super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge, + ConfigTechReborn.IronDrillTier, 2.0F); + this.cost = 50; + } - @Override - public boolean canHarvestBlock(IBlockState state) { - return Items.iron_pickaxe.canHarvestBlock(state) || Items.iron_shovel.canHarvestBlock(state); - } + @Override + public boolean canHarvestBlock(IBlockState state) + { + return Items.iron_pickaxe.canHarvestBlock(state) || Items.iron_shovel.canHarvestBlock(state); + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/ironDrill"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/ironDrill"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemIronJackhammer.java b/src/main/java/techreborn/items/tools/ItemIronJackhammer.java index 1fa798082..b505739b6 100644 --- a/src/main/java/techreborn/items/tools/ItemIronJackhammer.java +++ b/src/main/java/techreborn/items/tools/ItemIronJackhammer.java @@ -2,21 +2,26 @@ package techreborn.items.tools; import techreborn.config.ConfigTechReborn; -public class ItemIronJackhammer extends ItemJackhammer { +public class ItemIronJackhammer extends ItemJackhammer +{ - public ItemIronJackhammer() { - super(ToolMaterial.IRON, "techreborn.ironJackhammer", ConfigTechReborn.IronJackhammerCharge, ConfigTechReborn.IronJackhammerTier); - this.cost = 50; + public ItemIronJackhammer() + { + super(ToolMaterial.IRON, "techreborn.ironJackhammer", ConfigTechReborn.IronJackhammerCharge, + ConfigTechReborn.IronJackhammerTier); + this.cost = 50; this.efficiencyOnProperMaterial = 12F; - } + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/ironJackhammer"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/ironJackhammer"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } } diff --git a/src/main/java/techreborn/items/tools/ItemJackhammer.java b/src/main/java/techreborn/items/tools/ItemJackhammer.java index 10c0319e7..058cebb47 100644 --- a/src/main/java/techreborn/items/tools/ItemJackhammer.java +++ b/src/main/java/techreborn/items/tools/ItemJackhammer.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; @@ -24,16 +26,16 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; import techreborn.utils.OreDictUtils; -import java.util.List; - -public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem { +public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem +{ public int maxCharge = 1; public int cost = 250; public static int tier = 1; public double transferLimit = 100; - public ItemJackhammer(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier) { + public ItemJackhammer(ToolMaterial material, String unlocalizedName, int energyCapacity, int tier) + { super(material); efficiencyOnProperMaterial = 20F; setCreativeTab(TechRebornCreativeTab.instance); @@ -45,76 +47,92 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex this.tier = tier; } -// @Override -// public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) { -// Random rand = new Random(); -// if (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack) + 1) == 0) { -// PoweredItem.useEnergy(cost, stack); -// } -// return true; -// } + // @Override + // public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block + // blockIn, BlockPos pos, EntityLivingBase playerIn) { + // Random rand = new Random(); + // if + // (rand.nextInt(EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, + // stack) + 1) == 0) { + // PoweredItem.useEnergy(cost, stack); + // } + // return true; + // } @Override - public boolean canHarvestBlock(IBlockState state) { - //TODO needs // FIXME: 13/03/2016 - if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, null)) { + public boolean canHarvestBlock(IBlockState state) + { + // TODO needs // FIXME: 13/03/2016 + if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, null)) + { return true; } return false; } -// @Override -// public float getDigSpeed(ItemStack stack, IBlockState state) { -// if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, stack)) { -// return efficiencyOnProperMaterial; -// } else { -// return 0.5F; -// } -// } + // @Override + // public float getDigSpeed(ItemStack stack, IBlockState state) { + // if (OreDictUtils.isOre(state, "stone") && PoweredItem.canUseEnergy(cost, + // stack)) { + // return efficiencyOnProperMaterial; + // } else { + // return 0.5F; + // } + // } @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) + { return true; } @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); } @Override - public boolean isRepairable() { + public boolean isRepairable() + { return false; } @Override - public double getMaxPower(ItemStack stack) { + public double getMaxPower(ItemStack stack) + { return maxCharge; } @Override - public boolean canAcceptEnergy(ItemStack stack) { + public boolean canAcceptEnergy(ItemStack stack) + { return true; } @Override - public boolean canProvideEnergy(ItemStack stack) { + public boolean canProvideEnergy(ItemStack stack) + { return false; } @Override - public double getMaxTransfer(ItemStack stack) { + public double getMaxTransfer(ItemStack stack) + { return transferLimit; } @Override - public int getStackTier(ItemStack stack) { + public int getStackTier(ItemStack stack) + { return tier; } @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { ItemStack itemStack = new ItemStack(this, 1); itemList.add(itemStack); @@ -124,8 +142,10 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex } @Override - public double getDurabilityForDisplay(ItemStack stack) { - if (PoweredItem.getEnergy(stack) > getMaxPower(stack)) { + public double getDurabilityForDisplay(ItemStack stack) + { + if (PoweredItem.getEnergy(stack) > getMaxPower(stack)) + { return 0; } double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); @@ -134,23 +154,27 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, ITex } @Override - public boolean showDurabilityBar(ItemStack stack) { + public boolean showDurabilityBar(ItemStack stack) + { return true; } @Override - public String getTextureName(int damage) { + public String getTextureName(int damage) + { return "techreborn:items/tool/nullJackhammer"; } @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 1; } @Override @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); } } diff --git a/src/main/java/techreborn/items/tools/ItemNanosaber.java b/src/main/java/techreborn/items/tools/ItemNanosaber.java index f0590c699..4a25d3cd1 100644 --- a/src/main/java/techreborn/items/tools/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tools/ItemNanosaber.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; @@ -21,9 +23,8 @@ import reborncore.common.util.ItemNBTHelper; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; -import java.util.List; - -public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITexturedItem { +public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITexturedItem +{ public int maxCharge = 1; public int cost = 250; @@ -31,7 +32,8 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur public static int tier = 1; public double transferLimit = 100; - public ItemNanosaber() { + public ItemNanosaber() + { super(ToolMaterial.DIAMOND); setCreativeTab(TechRebornCreativeTab.instance); setMaxStackSize(1); @@ -43,14 +45,16 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur } @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) { + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase entityliving1) + { PoweredItem.useEnergy(cost, itemstack); return true; } @Override - public ActionResult onItemRightClick(ItemStack stack, World worldIn, EntityPlayer player, EnumHand hand) { - if(player.isSneaking()) + public ActionResult onItemRightClick(ItemStack stack, World worldIn, EntityPlayer player, EnumHand hand) + { + if (player.isSneaking()) { changeMode(stack); } @@ -62,71 +66,75 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur if (!ItemNBTHelper.verifyExistance(stack, "isActive")) { ItemNBTHelper.setBoolean(stack, "isActive", true); - } - else if(ItemNBTHelper.verifyExistance(stack, "isActive")) + } else if (ItemNBTHelper.verifyExistance(stack, "isActive")) { stack.getTagCompound().removeTag("isActive"); } } - + public boolean isItemActive(ItemStack stack) { if (!ItemNBTHelper.verifyExistance(stack, "isActive")) { return true; - } - else + } else return false; } - + @SideOnly(Side.CLIENT) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - if(ItemNBTHelper.verifyExistance(stack, "isActive")) + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (ItemNBTHelper.verifyExistance(stack, "isActive")) { list.add("Active"); - } - else if(!ItemNBTHelper.verifyExistance(stack, "isActive")) + } else if (!ItemNBTHelper.verifyExistance(stack, "isActive")) { list.add("Not Active"); } - super.addInformation(stack, player, list, par4); - } + super.addInformation(stack, player, list, par4); + } @Override - public boolean isRepairable() { + public boolean isRepairable() + { return false; } @Override - public double getMaxPower(ItemStack stack) { + public double getMaxPower(ItemStack stack) + { return maxCharge; } @Override - public boolean canAcceptEnergy(ItemStack stack) { + public boolean canAcceptEnergy(ItemStack stack) + { return true; } @Override - public boolean canProvideEnergy(ItemStack stack) { + public boolean canProvideEnergy(ItemStack stack) + { return false; } @Override - public double getMaxTransfer(ItemStack stack) { + public double getMaxTransfer(ItemStack stack) + { return transferLimit; } @Override - public int getStackTier(ItemStack stack) { + public int getStackTier(ItemStack stack) + { return tier; } @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { ItemStack itemStack = new ItemStack(this, 1); itemList.add(itemStack); @@ -136,33 +144,39 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, ITextur } @Override - public double getDurabilityForDisplay(ItemStack stack) { + public double getDurabilityForDisplay(ItemStack stack) + { double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); return 1 - charge; } @Override - public boolean showDurabilityBar(ItemStack stack) { + public boolean showDurabilityBar(ItemStack stack) + { return true; } @Override - public String getTextureName(int damage) { - if(damage==1){ + public String getTextureName(int damage) + { + if (damage == 1) + { return "techreborn:items/tool/nanosaber_on"; } return "techreborn:items/tool/nanosaber_off"; } @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 2; } @Override @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); } } diff --git a/src/main/java/techreborn/items/tools/ItemOmniTool.java b/src/main/java/techreborn/items/tools/ItemOmniTool.java index 3a61b893b..f425c6803 100644 --- a/src/main/java/techreborn/items/tools/ItemOmniTool.java +++ b/src/main/java/techreborn/items/tools/ItemOmniTool.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; @@ -26,141 +28,156 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; import techreborn.lib.ModInfo; -import java.util.List; +public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem +{ -public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem { + public static final int maxCharge = ConfigTechReborn.OmniToolCharge; + public static final int tier = ConfigTechReborn.OmniToolTier; + public int cost = 100; + public int hitCost = 125; - public static final int maxCharge = ConfigTechReborn.OmniToolCharge; - public static final int tier = ConfigTechReborn.OmniToolTier; - public int cost = 100; - public int hitCost = 125; + public ItemOmniTool() + { + super(ToolMaterial.DIAMOND); + efficiencyOnProperMaterial = 13F; + setCreativeTab(TechRebornCreativeTab.instance); + setMaxStackSize(1); + setMaxDamage(200); + setUnlocalizedName("techreborn.omniTool"); + RebornCore.jsonDestroyer.registerObject(this); + } - public ItemOmniTool() { - super(ToolMaterial.DIAMOND); - efficiencyOnProperMaterial = 13F; - setCreativeTab(TechRebornCreativeTab.instance); - setMaxStackSize(1); - setMaxDamage(200); - setUnlocalizedName("techreborn.omniTool"); - RebornCore.jsonDestroyer.registerObject(this); - } + @Override + public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, + EntityLivingBase entityLiving) + { + PoweredItem.useEnergy(cost, stack); + return true; + } - @Override - public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState blockIn, BlockPos pos, EntityLivingBase entityLiving) { - PoweredItem.useEnergy(cost, stack); - return true; - } + @Override + public boolean canHarvestBlock(IBlockState state) + { + return Items.diamond_axe.canHarvestBlock(state) || Items.diamond_sword.canHarvestBlock(state) + || Items.diamond_pickaxe.canHarvestBlock(state) || Items.diamond_shovel.canHarvestBlock(state) + || Items.shears.canHarvestBlock(state); + } - @Override - public boolean canHarvestBlock(IBlockState state) { - return Items.diamond_axe.canHarvestBlock(state) - || Items.diamond_sword.canHarvestBlock(state) - || Items.diamond_pickaxe.canHarvestBlock(state) - || Items.diamond_shovel.canHarvestBlock(state) - || Items.shears.canHarvestBlock(state); - } + // @Override + // public float getDigSpeed(ItemStack stack, IBlockState state) { + // if (PoweredItem.canUseEnergy(cost, stack)) { + // PoweredItem.useEnergy(cost, stack); + // return 5.0F; + // } + // + // if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F + // || Items.wooden_sword.getDigSpeed(stack, state) > 1.0F + // || Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F + // || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F + // || Items.shears.getDigSpeed(stack, state) > 1.0F) { + // return efficiencyOnProperMaterial; + // } else { + // return super.getDigSpeed(stack, state); + // } + // } -// @Override -// public float getDigSpeed(ItemStack stack, IBlockState state) { -// if (PoweredItem.canUseEnergy(cost, stack)) { -// PoweredItem.useEnergy(cost, stack); -// return 5.0F; -// } -// -// if (Items.wooden_axe.getDigSpeed(stack, state) > 1.0F -// || Items.wooden_sword.getDigSpeed(stack, state) > 1.0F -// || Items.wooden_pickaxe.getDigSpeed(stack, state) > 1.0F -// || Items.wooden_shovel.getDigSpeed(stack, state) > 1.0F -// || Items.shears.getDigSpeed(stack, state) > 1.0F) { -// return efficiencyOnProperMaterial; -// } else { -// return super.getDigSpeed(stack, state); -// } -// } + @Override + public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) + { + if (PoweredItem.canUseEnergy(hitCost, itemstack)) + { + PoweredItem.useEnergy(hitCost, itemstack); + entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F); + } + return false; + } - @Override - public boolean hitEntity(ItemStack itemstack, EntityLivingBase entityliving, EntityLivingBase attacker) { - if (PoweredItem.canUseEnergy(hitCost, itemstack)) { - PoweredItem.useEnergy(hitCost, itemstack); - entityliving.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), 8F); - } - return false; - } + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, + EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { + return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); + } - @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - return TorchHelper.placeTorch(stack, playerIn, worldIn, pos, facing, hitX, hitY, hitZ, hand); - } + @Override + public boolean isRepairable() + { + return false; + } - @Override - public boolean isRepairable() { - return false; - } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public boolean canProvideEnergy(ItemStack itemStack) + { + return false; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return 200; + } - @Override - public boolean canProvideEnergy(ItemStack itemStack) { - return false; - } + @Override + public int getStackTier(ItemStack stack) + { + return 2; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return 200; - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - @Override - public int getStackTier(ItemStack stack) { - return 2; - } + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + } - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/omnitool"; + } - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/omnitool"; - } - - @Override - public int getMaxMeta() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/tools/ItemRockCutter.java b/src/main/java/techreborn/items/tools/ItemRockCutter.java index 3fc163dca..eb75aaae6 100644 --- a/src/main/java/techreborn/items/tools/ItemRockCutter.java +++ b/src/main/java/techreborn/items/tools/ItemRockCutter.java @@ -1,5 +1,7 @@ package techreborn.items.tools; +import java.util.List; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; @@ -19,136 +21,152 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.config.ConfigTechReborn; import techreborn.lib.ModInfo; -import java.util.List; +public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem +{ -public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, ITexturedItem { + public static final int maxCharge = ConfigTechReborn.RockCutterCharge; + public int cost = 500; + public static final int tier = ConfigTechReborn.RockCutterTier; - public static final int maxCharge = ConfigTechReborn.RockCutterCharge; - public int cost = 500; - public static final int tier = ConfigTechReborn.RockCutterTier; + public ItemRockCutter() + { + super(ToolMaterial.DIAMOND); + setUnlocalizedName("techreborn.rockcutter"); + setCreativeTab(TechRebornCreativeTab.instance); + setMaxStackSize(1); + efficiencyOnProperMaterial = 16F; + RebornCore.jsonDestroyer.registerObject(this); + } - public ItemRockCutter() { - super(ToolMaterial.DIAMOND); - setUnlocalizedName("techreborn.rockcutter"); - setCreativeTab(TechRebornCreativeTab.instance); - setMaxStackSize(1); - efficiencyOnProperMaterial = 16F; - RebornCore.jsonDestroyer.registerObject(this); - } + @Override + @SideOnly(Side.CLIENT) + public boolean hasEffect(ItemStack ist) + { + return true; + } - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack ist) { - return true; - } + @Override + public void addInformation(ItemStack iS, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + if (!iS.isItemEnchanted()) + { + par3List.add(Color.WHITE + "Silk Touch I"); + } + } - @Override - public void addInformation(ItemStack iS, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { - if (!iS.isItemEnchanted()) { - par3List.add(Color.WHITE + "Silk Touch I"); - } - } + @Override + public boolean canHarvestBlock(IBlockState state) + { + if (Items.diamond_pickaxe.canHarvestBlock(state)) + { + // if (PoweredItem.canUseEnergy(cost, stack)) { + // PoweredItem.useEnergy(cost, stack); + // return true; + // } + } + return false; + } - @Override - public boolean canHarvestBlock(IBlockState state) { - if (Items.diamond_pickaxe.canHarvestBlock(state)) { -// if (PoweredItem.canUseEnergy(cost, stack)) { -// PoweredItem.useEnergy(cost, stack); -// return true; -// } - } - return false; - } + // @Override + // public int getHarvestLevel(ItemStack stack, String toolClass) { + // if (!stack.isItemEnchanted()) { + // stack.addEnchantment(Enchantment.silkTouch, 1); + // } + // return super.getHarvestLevel(stack, toolClass); + // } + // + // @Override + // public float getStrVsBlock(ItemStack stack, Block block) { + // if (!stack.isItemEnchanted()) { + // stack.addEnchantment(Enchantment.silkTouch, 1); + // } + // return super.getStrVsBlock(stack, block); + // } -// @Override -// public int getHarvestLevel(ItemStack stack, String toolClass) { -// if (!stack.isItemEnchanted()) { -// stack.addEnchantment(Enchantment.silkTouch, 1); -// } -// return super.getHarvestLevel(stack, toolClass); -// } -// -// @Override -// public float getStrVsBlock(ItemStack stack, Block block) { -// if (!stack.isItemEnchanted()) { -// stack.addEnchantment(Enchantment.silkTouch, 1); -// } -// return super.getStrVsBlock(stack, block); -// } + @Override + public boolean isRepairable() + { + return false; + } - @Override - public boolean isRepairable() { - return false; - } + // public void onCreated(ItemStack par1ItemStack, World par2World, + // EntityPlayer par3EntityPlayer) { + // par1ItemStack.addEnchantment(Enchantment.silkTouch, 1); + // } -// public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -// par1ItemStack.addEnchantment(Enchantment.silkTouch, 1); -// } + @Override + public double getMaxPower(ItemStack stack) + { + return maxCharge; + } + @Override + public boolean canAcceptEnergy(ItemStack stack) + { + return true; + } - @Override - public double getMaxPower(ItemStack stack) { - return maxCharge; - } + @Override + public boolean canProvideEnergy(ItemStack stack) + { + return false; + } - @Override - public boolean canAcceptEnergy(ItemStack stack) { - return true; - } + @Override + public double getMaxTransfer(ItemStack stack) + { + return 200; + } - @Override - public boolean canProvideEnergy(ItemStack stack) { - return false; - } + @Override + public int getStackTier(ItemStack stack) + { + return 2; + } - @Override - public double getMaxTransfer(ItemStack stack) { - return 200; - } + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) + { + ItemStack itemStack = new ItemStack(this, 1); + itemList.add(itemStack); - @Override - public int getStackTier(ItemStack stack) { - return 2; - } + ItemStack charged = new ItemStack(this, 1); + PoweredItem.setEnergy(getMaxPower(charged), charged); + itemList.add(charged); + } - @SuppressWarnings( - {"rawtypes", "unchecked"}) - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { - ItemStack itemStack = new ItemStack(this, 1); - itemList.add(itemStack); + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); + return 1 - charge; - ItemStack charged = new ItemStack(this, 1); - PoweredItem.setEnergy(getMaxPower(charged), charged); - itemList.add(charged); - } + } - @Override - public double getDurabilityForDisplay(ItemStack stack) { - double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); - return 1 - charge; + @Override + public boolean showDurabilityBar(ItemStack stack) + { + return true; + } - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/rockcutter"; + } - @Override - public boolean showDurabilityBar(ItemStack stack) { - return true; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/rockcutter"; - } - - @Override - public int getMaxMeta() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } } diff --git a/src/main/java/techreborn/items/tools/ItemSteelJackhammer.java b/src/main/java/techreborn/items/tools/ItemSteelJackhammer.java index ee1381183..7b7bfcb7b 100644 --- a/src/main/java/techreborn/items/tools/ItemSteelJackhammer.java +++ b/src/main/java/techreborn/items/tools/ItemSteelJackhammer.java @@ -2,21 +2,26 @@ package techreborn.items.tools; import techreborn.config.ConfigTechReborn; -public class ItemSteelJackhammer extends ItemJackhammer { +public class ItemSteelJackhammer extends ItemJackhammer +{ - public ItemSteelJackhammer() { - super(ToolMaterial.DIAMOND, "techreborn.steelJackhammer", ConfigTechReborn.SteelJackhammerCharge, ConfigTechReborn.SteelJackhammerTier); + public ItemSteelJackhammer() + { + super(ToolMaterial.DIAMOND, "techreborn.steelJackhammer", ConfigTechReborn.SteelJackhammerCharge, + ConfigTechReborn.SteelJackhammerTier); this.cost = 100; this.efficiencyOnProperMaterial = 16F; } @Override - public String getTextureName(int damage) { + public String getTextureName(int damage) + { return "techreborn:items/tool/steelJackhammer"; } @Override - public int getMaxMeta() { + public int getMaxMeta() + { return 1; } } diff --git a/src/main/java/techreborn/items/tools/ItemTechManual.java b/src/main/java/techreborn/items/tools/ItemTechManual.java index 74be6508b..cfdc743ba 100644 --- a/src/main/java/techreborn/items/tools/ItemTechManual.java +++ b/src/main/java/techreborn/items/tools/ItemTechManual.java @@ -12,30 +12,35 @@ import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; import techreborn.items.ItemTextureBase; -public class ItemTechManual extends ItemTextureBase implements ITexturedItem { +public class ItemTechManual extends ItemTextureBase implements ITexturedItem +{ - public ItemTechManual() { - setCreativeTab(TechRebornCreativeTab.instance); - setUnlocalizedName("techreborn.manual"); - setMaxStackSize(1); - } + public ItemTechManual() + { + setCreativeTab(TechRebornCreativeTab.instance); + setUnlocalizedName("techreborn.manual"); + setMaxStackSize(1); + } + @Override + public ActionResult onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, + EnumHand hand) + { + player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, (int) player.posX, (int) player.posY, + (int) player.posY); + return new ActionResult<>(EnumActionResult.SUCCESS, itemStackIn); + } - @Override - public ActionResult onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) { - player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, - (int) player.posX, (int) player.posY, (int) player.posY); - return new ActionResult<>(EnumActionResult.SUCCESS, itemStackIn); - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } - - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/manual"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/manual"; + } } diff --git a/src/main/java/techreborn/items/tools/ItemTreeTap.java b/src/main/java/techreborn/items/tools/ItemTreeTap.java index 511aac124..fed3c3a0e 100644 --- a/src/main/java/techreborn/items/tools/ItemTreeTap.java +++ b/src/main/java/techreborn/items/tools/ItemTreeTap.java @@ -11,37 +11,44 @@ import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; -public class ItemTreeTap extends Item implements ITexturedItem { +public class ItemTreeTap extends Item implements ITexturedItem +{ - public ItemTreeTap() { + public ItemTreeTap() + { setMaxStackSize(1); setMaxDamage(20); setUnlocalizedName("techreborn.treetap"); RebornCore.jsonDestroyer.registerObject(this); setCreativeTab(TechRebornCreativeTab.instance); } - + @Override - public boolean showDurabilityBar(ItemStack stack) { - if(stack.getMetadata()!=0){ + public boolean showDurabilityBar(ItemStack stack) + { + if (stack.getMetadata() != 0) + { return true; } return false; } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/treetap"; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/treetap"; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + public int getMaxMeta() + { + return 1; + } @Override @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); } } diff --git a/src/main/java/techreborn/items/tools/ItemWrench.java b/src/main/java/techreborn/items/tools/ItemWrench.java index 2f99d9ac1..e32806caf 100644 --- a/src/main/java/techreborn/items/tools/ItemWrench.java +++ b/src/main/java/techreborn/items/tools/ItemWrench.java @@ -1,6 +1,9 @@ package techreborn.items.tools; -import ic2.api.tile.IWrenchable; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + import me.modmuss50.jsonDestroyer.api.ITexturedItem; import net.minecraft.block.BlockDynamicLiquid; import net.minecraft.block.BlockStaticLiquid; @@ -24,112 +27,134 @@ import net.minecraftforge.fml.relauncher.SideOnly; import techreborn.client.TechRebornCreativeTabMisc; import techreborn.items.ItemTR; import techreborn.lib.ModInfo; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; +import ic2.api.tile.IWrenchable; /** * Created by modmuss50 on 26/02/2016. */ -public class ItemWrench extends ItemTR implements ITexturedItem { +public class ItemWrench extends ItemTR implements ITexturedItem +{ - public ItemWrench() { - setCreativeTab(TechRebornCreativeTabMisc.instance); - setUnlocalizedName("techreborn.wrench"); - setMaxStackSize(1); - } + public ItemWrench() + { + setCreativeTab(TechRebornCreativeTabMisc.instance); + setUnlocalizedName("techreborn.wrench"); + setMaxStackSize(1); + } + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, + EnumFacing facing, float hitX, float hitY, float hitZ) + { + if (world.isAirBlock(pos) || !player.isSneaking()) + { + return EnumActionResult.FAIL; + } + TileEntity tile = world.getTileEntity(pos); + if (tile == null) + { + return EnumActionResult.FAIL; + } + if (!(tile instanceof IInventory)) + { + return EnumActionResult.FAIL; + } - @Override - public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { - if(world.isAirBlock(pos) || !player.isSneaking()){ - return EnumActionResult.FAIL; - } - TileEntity tile = world.getTileEntity(pos); - if(tile == null){ - return EnumActionResult.FAIL; - } - if(!(tile instanceof IInventory)){ - return EnumActionResult.FAIL; - } + List items = new ArrayList(); + IInventory inventory = (IInventory) tile; + for (int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack itemStack = inventory.getStackInSlot(i); - List items = new ArrayList(); - IInventory inventory = (IInventory) tile; - for (int i = 0; i < inventory.getSizeInventory(); i++) { - ItemStack itemStack = inventory.getStackInSlot(i); + if (itemStack == null) + { + continue; + } + if (itemStack != null && itemStack.stackSize > 0) + { + if (itemStack.getItem() instanceof ItemBlock) + { + if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase + || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid + || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) + { + continue; + } + } + } + items.add(itemStack.copy()); + } - if(itemStack == null){ - continue; - } - if (itemStack != null && itemStack.stackSize > 0) { - if (itemStack.getItem() instanceof ItemBlock) { - if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) { - continue; - } - } - } - items.add(itemStack.copy()); - } + if (tile instanceof IWrenchable) + { + if (((IWrenchable) tile).wrenchCanRemove(player)) + { + ItemStack itemStack = ((IWrenchable) tile).getWrenchDrop(player); + if (itemStack == null) + { + return EnumActionResult.FAIL; + } + items.add(itemStack); + } + for (ItemStack itemStack : items) + { + Random rand = new Random(); - if(tile instanceof IWrenchable){ - if(((IWrenchable) tile).wrenchCanRemove(player)){ - ItemStack itemStack = ((IWrenchable) tile).getWrenchDrop(player); - if(itemStack == null){ - return EnumActionResult.FAIL; - } - items.add(itemStack); - } - for(ItemStack itemStack : items){ - Random rand = new Random(); + float dX = rand.nextFloat() * 0.8F + 0.1F; + float dY = rand.nextFloat() * 0.8F + 0.1F; + float dZ = rand.nextFloat() * 0.8F + 0.1F; - float dX = rand.nextFloat() * 0.8F + 0.1F; - float dY = rand.nextFloat() * 0.8F + 0.1F; - float dZ = rand.nextFloat() * 0.8F + 0.1F; + EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, + itemStack.copy()); - EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, itemStack.copy()); + if (itemStack.hasTagCompound()) + { + entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); + } - if (itemStack.hasTagCompound()) { - entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy()); - } + float factor = 0.05F; + entityItem.motionX = rand.nextGaussian() * factor; + entityItem.motionY = rand.nextGaussian() * factor + 0.2F; + entityItem.motionZ = rand.nextGaussian() * factor; + if (!world.isRemote) + { + world.spawnEntityInWorld(entityItem); + } + } + // TODO 1.9 sounds + // world.playSoundAtEntity(player, "techreborn:block_dismantle", + // 0.8F, 1F); + if (!world.isRemote) + { + world.setBlockState(pos, Blocks.air.getDefaultState(), 2); + } + return EnumActionResult.SUCCESS; + } + return EnumActionResult.FAIL; + } - float factor = 0.05F; - entityItem.motionX = rand.nextGaussian() * factor; - entityItem.motionY = rand.nextGaussian() * factor + 0.2F; - entityItem.motionZ = rand.nextGaussian() * factor; - if(!world.isRemote){ - world.spawnEntityInWorld(entityItem); - } - } - //TODO 1.9 sounds - //world.playSoundAtEntity(player, "techreborn:block_dismantle", 0.8F, 1F); - if(!world.isRemote){ - world.setBlockState(pos, Blocks.air.getDefaultState(), 2); - } - return EnumActionResult.SUCCESS; - } - return EnumActionResult.FAIL; - } + @Override + public String getTextureName(int damage) + { + return "techreborn:items/tool/wrench"; + } - @Override - public String getTextureName(int damage) { - return "techreborn:items/tool/wrench"; - } + @Override + public int getMaxMeta() + { + return 1; + } - @Override - public int getMaxMeta() { - return 1; - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } - - @SideOnly(Side.CLIENT) - public boolean isFull3D() - { - return true; - } + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } } diff --git a/src/main/java/techreborn/lib/Key.java b/src/main/java/techreborn/lib/Key.java index 44ee1effb..b3ee569e7 100644 --- a/src/main/java/techreborn/lib/Key.java +++ b/src/main/java/techreborn/lib/Key.java @@ -1,6 +1,7 @@ package techreborn.lib; -public enum Key { +public enum Key +{ - UNKNOWN, CONFIG; + UNKNOWN, CONFIG; } diff --git a/src/main/java/techreborn/lib/ModInfo.java b/src/main/java/techreborn/lib/ModInfo.java index ec693e629..6f550dc99 100644 --- a/src/main/java/techreborn/lib/ModInfo.java +++ b/src/main/java/techreborn/lib/ModInfo.java @@ -2,38 +2,43 @@ package techreborn.lib; import reborncore.common.IModInfo; -public class ModInfo implements IModInfo { - public static final String MOD_NAME = "TechReborn"; - public static final String MOD_ID = "techreborn"; - public static final String MOD_VERSION = "@MODVERSION@"; - public static final String MOD_DEPENDENCUIES = - "required-after:Forge@[11.15.0.1609,);required-after:reborncore;after:JEI@[2.14,)"; - public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy"; - public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy"; - public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory"; +public class ModInfo implements IModInfo +{ + public static final String MOD_NAME = "TechReborn"; + public static final String MOD_ID = "techreborn"; + public static final String MOD_VERSION = "@MODVERSION@"; + public static final String MOD_DEPENDENCUIES = "required-after:Forge@[11.15.0.1609,);required-after:reborncore;after:JEI@[2.14,)"; + public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy"; + public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy"; + public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory"; - @Override - public String MOD_NAME() { - return MOD_NAME; - } + @Override + public String MOD_NAME() + { + return MOD_NAME; + } - @Override - public String MOD_ID() { - return MOD_ID; - } + @Override + public String MOD_ID() + { + return MOD_ID; + } - @Override - public String MOD_VERSION() { - return MOD_VERSION; - } + @Override + public String MOD_VERSION() + { + return MOD_VERSION; + } - @Override - public String MOD_DEPENDENCIES() { - return MOD_DEPENDENCUIES; - } + @Override + public String MOD_DEPENDENCIES() + { + return MOD_DEPENDENCUIES; + } - public static final class Keys { - public static final String CATEGORY = "keys.techreborn.category"; - public static final String CONFIG = "keys.techreborn.config"; - } + public static final class Keys + { + public static final String CATEGORY = "keys.techreborn.category"; + public static final String CONFIG = "keys.techreborn.config"; + } } diff --git a/src/main/java/techreborn/lib/Reference.java b/src/main/java/techreborn/lib/Reference.java index 86d624cb4..3c55b69b1 100644 --- a/src/main/java/techreborn/lib/Reference.java +++ b/src/main/java/techreborn/lib/Reference.java @@ -1,24 +1,25 @@ package techreborn.lib; - import net.minecraft.util.text.translation.I18n; -public class Reference { - public static String alloySmelteRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter"); - public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine"); - public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace"); - public static String centrifugeRecipe = I18n.translateToLocal("techreborn.recipe.centrifuge"); - public static String chemicalReactorRecipe = I18n.translateToLocal("techreborn.recipe.chemicalReactor"); - public static String industrialGrinderRecipe = I18n.translateToLocal("techreborn.recipe.grinder"); - public static String implosionCompressorRecipe = I18n.translateToLocal("techreborn.recipe.implosioncompressor"); - public static String industrialElectrolyzerRecipe = I18n.translateToLocal("techreborn.recipe.industrialelectrolyzer"); - public static String industrialSawmillRecipe = I18n.translateToLocal("techreborn.recipe.industrialsawmill"); - public static String latheRecipe = I18n.translateToLocal("techreborn.recipe.lathe"); - public static String plateCuttingMachineRecipe = I18n.translateToLocal("techreborn.recipe.platecuttingmachine"); - public static String vacuumFreezerRecipe = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name"); - public static String grinderRecipe = I18n.translateToLocal("tile.techreborn.grinder.name"); - public static String extractorRecipe = I18n.translateToLocal("tile.techreborn.extractor.name"); - public static String compressorRecipe = I18n.translateToLocal("tile.techreborn.compressor.name"); - public static String recyclerRecipe = I18n.translateToLocal("tile.techreborn.recycler.name"); - public static String scrapboxRecipe = I18n.translateToLocal("techreborn.recipe.scrapbox"); +public class Reference +{ + public static String alloySmelteRecipe = I18n.translateToLocal("techreborn.recipe.alloysmelter"); + public static String assemblingMachineRecipe = I18n.translateToLocal("techreborn.recipe.assemblingmachine"); + public static String blastFurnaceRecipe = I18n.translateToLocal("techreborn.recipe.blastfurnace"); + public static String centrifugeRecipe = I18n.translateToLocal("techreborn.recipe.centrifuge"); + public static String chemicalReactorRecipe = I18n.translateToLocal("techreborn.recipe.chemicalReactor"); + public static String industrialGrinderRecipe = I18n.translateToLocal("techreborn.recipe.grinder"); + public static String implosionCompressorRecipe = I18n.translateToLocal("techreborn.recipe.implosioncompressor"); + public static String industrialElectrolyzerRecipe = I18n + .translateToLocal("techreborn.recipe.industrialelectrolyzer"); + public static String industrialSawmillRecipe = I18n.translateToLocal("techreborn.recipe.industrialsawmill"); + public static String latheRecipe = I18n.translateToLocal("techreborn.recipe.lathe"); + public static String plateCuttingMachineRecipe = I18n.translateToLocal("techreborn.recipe.platecuttingmachine"); + public static String vacuumFreezerRecipe = I18n.translateToLocal("tile.techreborn.vacuumfreezer.name"); + public static String grinderRecipe = I18n.translateToLocal("tile.techreborn.grinder.name"); + public static String extractorRecipe = I18n.translateToLocal("tile.techreborn.extractor.name"); + public static String compressorRecipe = I18n.translateToLocal("tile.techreborn.compressor.name"); + public static String recyclerRecipe = I18n.translateToLocal("tile.techreborn.recycler.name"); + public static String scrapboxRecipe = I18n.translateToLocal("techreborn.recipe.scrapbox"); } diff --git a/src/main/java/techreborn/manual/GuiManual.java b/src/main/java/techreborn/manual/GuiManual.java index 3a1cf4590..0d8d7b872 100644 --- a/src/main/java/techreborn/manual/GuiManual.java +++ b/src/main/java/techreborn/manual/GuiManual.java @@ -1,5 +1,7 @@ package techreborn.manual; +import java.io.IOException; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -8,170 +10,203 @@ import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; + import techreborn.init.ModBlocks; import techreborn.init.ModItems; import techreborn.items.ItemParts; import techreborn.items.ItemPlates; -import techreborn.manual.pages.*; - -import java.io.IOException; +import techreborn.manual.pages.AdvancedMachines; +import techreborn.manual.pages.BasicMachinesPage; +import techreborn.manual.pages.ContentsPage; +import techreborn.manual.pages.CraftingInfoPage; +import techreborn.manual.pages.DescriptionPage; +import techreborn.manual.pages.GeneratingPowerPage; +import techreborn.manual.pages.GettingStartedPage; +import techreborn.manual.pages.ToolsPage; @SideOnly(Side.CLIENT) -public class GuiManual extends GuiScreen +public class GuiManual extends GuiScreen { - protected final PageCollection root; - protected int pageIndex = 0; - protected int xSize = 0; - protected int ySize = 0; - public Container inventorySlots; - protected int guiLeft; - protected int guiTop; + protected final PageCollection root; + protected int pageIndex = 0; + protected int xSize = 0; + protected int ySize = 0; + public Container inventorySlots; + protected int guiLeft; + protected int guiTop; - public GuiManual() - { - this.xSize = 146; - this.ySize = 180; - root = createRoot(); - } + public GuiManual() + { + this.xSize = 146; + this.ySize = 180; + root = createRoot(); + } - protected PageCollection createRoot() - { - pageIndex = 0; - final PageCollection pageCollection = new PageCollection(); - pageCollection.addPage(new ContentsPage(Reference.pageNames.CONTENTS_PAGE, pageCollection)); - - //GETTING STARTED - pageCollection.addPage(new GettingStartedPage(Reference.pageNames.GETTINGSTARTED_PAGE, pageCollection)); + protected PageCollection createRoot() + { + pageIndex = 0; + final PageCollection pageCollection = new PageCollection(); + pageCollection.addPage(new ContentsPage(Reference.pageNames.CONTENTS_PAGE, pageCollection)); - pageCollection.addPage(new DescriptionPage(Reference.pageNames.GETTINGRUBBER_PAGE, pageCollection, true, Reference.pageNames.GETTINGRUBBER2_PAGE)); - pageCollection.addPage(new CraftingInfoPage(Reference.pageNames.GETTINGRUBBER2_PAGE, pageCollection, ItemParts.getPartByName("rubber"), "", Reference.pageNames.GETTINGRUBBER_PAGE)); - pageCollection.addPage(new CraftingInfoPage(Reference.pageNames.CRAFTINGPLATES_PAGE, pageCollection, ItemPlates.getPlateByName("iron"), "", Reference.pageNames.GETTINGSTARTED_PAGE)); - - //POWER GENERATION - pageCollection.addPage(new GeneratingPowerPage(Reference.pageNames.GENERATINGPOWER_PAGE, pageCollection)); + // GETTING STARTED + pageCollection.addPage(new GettingStartedPage(Reference.pageNames.GETTINGSTARTED_PAGE, pageCollection)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.Generator.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Generator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.thermalGenerator.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.thermalGenerator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.solarPanel.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.solarPanel), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.heatGenerator.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.heatGenerator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.LightningRod.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.LightningRod), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - - //BASIC MACHINES - pageCollection.addPage(new BasicMachinesPage(Reference.pageNames.BASICMACHINES_PAGE, pageCollection)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.Grinder.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Grinder), "", Reference.pageNames.BASICMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.ElectricFurnace.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.ElectricFurnace), "", Reference.pageNames.BASICMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.AlloySmelter.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.AlloySmelter), "", Reference.pageNames.BASICMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.Extractor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Extractor), "", Reference.pageNames.BASICMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.Compressor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.Compressor), "", Reference.pageNames.BASICMACHINES_PAGE)); - - //ADVANCED MACHINES - pageCollection.addPage(new AdvancedMachines(Reference.pageNames.ADVANCEDMACHINES_PAGE, pageCollection)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.BlastFurnace.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.BlastFurnace), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.industrialSawmill.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.industrialSawmill), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialElectrolyzer.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.IndustrialElectrolyzer), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialGrinder.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.IndustrialGrinder), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.ImplosionCompressor.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.ImplosionCompressor), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModBlocks.centrifuge.getLocalizedName(), pageCollection, new ItemStack(ModBlocks.centrifuge), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new DescriptionPage(Reference.pageNames.GETTINGRUBBER_PAGE, pageCollection, true, + Reference.pageNames.GETTINGRUBBER2_PAGE)); + pageCollection.addPage(new CraftingInfoPage(Reference.pageNames.GETTINGRUBBER2_PAGE, pageCollection, + ItemParts.getPartByName("rubber"), "", Reference.pageNames.GETTINGRUBBER_PAGE)); + pageCollection.addPage(new CraftingInfoPage(Reference.pageNames.CRAFTINGPLATES_PAGE, pageCollection, + ItemPlates.getPlateByName("iron"), "", Reference.pageNames.GETTINGSTARTED_PAGE)); - //TOOLS - pageCollection.addPage(new ToolsPage(Reference.pageNames.TOOLS_PAGE, pageCollection)); - pageCollection.addPage(new CraftingInfoPage(ModItems.ironDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.ironDrill), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.diamondDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.diamondDrill), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.advancedDrill.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.advancedDrill), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.ironChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.ironChainsaw), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.diamondChainsaw), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.advancedChainsaw), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.omniTool.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.omniTool), "", Reference.pageNames.TOOLS_PAGE)); - pageCollection.addPage(new CraftingInfoPage(ModItems.treeTap.getUnlocalizedName() + ".name", pageCollection, new ItemStack(ModItems.treeTap), "", Reference.pageNames.TOOLS_PAGE)); + // POWER GENERATION + pageCollection.addPage(new GeneratingPowerPage(Reference.pageNames.GENERATINGPOWER_PAGE, pageCollection)); - return pageCollection; - } + pageCollection.addPage(new CraftingInfoPage(ModBlocks.Generator.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.Generator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.thermalGenerator.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.thermalGenerator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.solarPanel.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.solarPanel), "", Reference.pageNames.GENERATINGPOWER_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.heatGenerator.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.heatGenerator), "", Reference.pageNames.GENERATINGPOWER_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.LightningRod.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.LightningRod), "", Reference.pageNames.GENERATINGPOWER_PAGE)); - private int getNextPageIndex() - { - int i = pageIndex; - pageIndex++; - return i; - } + // BASIC MACHINES + pageCollection.addPage(new BasicMachinesPage(Reference.pageNames.BASICMACHINES_PAGE, pageCollection)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.Grinder.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.Grinder), "", Reference.pageNames.BASICMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.ElectricFurnace.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.ElectricFurnace), "", Reference.pageNames.BASICMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.AlloySmelter.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.AlloySmelter), "", Reference.pageNames.BASICMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.Extractor.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.Extractor), "", Reference.pageNames.BASICMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.Compressor.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.Compressor), "", Reference.pageNames.BASICMACHINES_PAGE)); - @Override - public void drawScreen(int mouseX, int mouseY, float par3) - { - drawGuiBackgroundLayer(par3, mouseX, mouseY); - super.drawScreen(mouseX, mouseY, par3); + // ADVANCED MACHINES + pageCollection.addPage(new AdvancedMachines(Reference.pageNames.ADVANCEDMACHINES_PAGE, pageCollection)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.BlastFurnace.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.BlastFurnace), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.industrialSawmill.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.industrialSawmill), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialElectrolyzer.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.IndustrialElectrolyzer), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.IndustrialGrinder.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.IndustrialGrinder), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.ImplosionCompressor.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.ImplosionCompressor), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModBlocks.centrifuge.getLocalizedName(), pageCollection, + new ItemStack(ModBlocks.centrifuge), "", Reference.pageNames.ADVANCEDMACHINES_PAGE)); - prepareRenderState(); - GL11.glPushMatrix(); + // TOOLS + pageCollection.addPage(new ToolsPage(Reference.pageNames.TOOLS_PAGE, pageCollection)); + pageCollection.addPage(new CraftingInfoPage(ModItems.ironDrill.getUnlocalizedName() + ".name", pageCollection, + new ItemStack(ModItems.ironDrill), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.diamondDrill.getUnlocalizedName() + ".name", + pageCollection, new ItemStack(ModItems.diamondDrill), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.advancedDrill.getUnlocalizedName() + ".name", + pageCollection, new ItemStack(ModItems.advancedDrill), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.ironChainsaw.getUnlocalizedName() + ".name", + pageCollection, new ItemStack(ModItems.ironChainsaw), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name", + pageCollection, new ItemStack(ModItems.diamondChainsaw), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name", + pageCollection, new ItemStack(ModItems.advancedChainsaw), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.omniTool.getUnlocalizedName() + ".name", pageCollection, + new ItemStack(ModItems.omniTool), "", Reference.pageNames.TOOLS_PAGE)); + pageCollection.addPage(new CraftingInfoPage(ModItems.treeTap.getUnlocalizedName() + ".name", pageCollection, + new ItemStack(ModItems.treeTap), "", Reference.pageNames.TOOLS_PAGE)); - root.drawScreen(this.mc, this.guiLeft, this.guiTop, mouseX - this.guiLeft, mouseY - this.guiTop); + return pageCollection; + } - GL11.glPopMatrix(); - restoreRenderState(); - } + private int getNextPageIndex() + { + int i = pageIndex; + pageIndex++; + return i; + } - protected void prepareRenderState() - { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - } + @Override + public void drawScreen(int mouseX, int mouseY, float par3) + { + drawGuiBackgroundLayer(par3, mouseX, mouseY); + super.drawScreen(mouseX, mouseY, par3); - protected void restoreRenderState() - { - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - RenderHelper.enableStandardItemLighting(); - } + prepareRenderState(); + GL11.glPushMatrix(); - protected void drawGuiBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) - { - GL11.glPushMatrix(); - GL11.glTranslated(this.guiLeft, this.guiTop, 0); - root.renderBackgroundLayer(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop); - GL11.glPopMatrix(); - } + root.drawScreen(this.mc, this.guiLeft, this.guiTop, mouseX - this.guiLeft, mouseY - this.guiTop); - @Override - public void setWorldAndResolution(Minecraft minecraft, int x, int y) - { - super.setWorldAndResolution(minecraft, x, y); - root.setWorldAndResolution(minecraft, x, y); - } + GL11.glPopMatrix(); + restoreRenderState(); + } - @Override - public void actionPerformed(GuiButton button) - { - root.actionPerformed(button); - } + protected void prepareRenderState() + { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + protected void restoreRenderState() + { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } - @Override - public void mouseClicked(int par1, int par2, int par3) throws IOException - { - root.mouseClicked(par1, par2, par3); - } + protected void drawGuiBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) + { + GL11.glPushMatrix(); + GL11.glTranslated(this.guiLeft, this.guiTop, 0); + root.renderBackgroundLayer(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop); + GL11.glPopMatrix(); + } - @Override - public void handleInput() throws IOException - { - super.handleInput(); - } + @Override + public void setWorldAndResolution(Minecraft minecraft, int x, int y) + { + super.setWorldAndResolution(minecraft, x, y); + root.setWorldAndResolution(minecraft, x, y); + } - @Override - public void initGui() - { - super.initGui(); - this.guiLeft = (this.width - this.xSize) / 2; - this.guiTop = (this.height - this.ySize) / 2; - } + @Override + public void actionPerformed(GuiButton button) + { + root.actionPerformed(button); + } - @Override - public boolean doesGuiPauseGame() - { - return false; - } + @Override + public void mouseClicked(int par1, int par2, int par3) throws IOException + { + root.mouseClicked(par1, par2, par3); + } + + @Override + public void handleInput() throws IOException + { + super.handleInput(); + } + + @Override + public void initGui() + { + super.initGui(); + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + } + + @Override + public boolean doesGuiPauseGame() + { + return false; + } } diff --git a/src/main/java/techreborn/manual/PageCollection.java b/src/main/java/techreborn/manual/PageCollection.java index f2d834a09..62736efda 100644 --- a/src/main/java/techreborn/manual/PageCollection.java +++ b/src/main/java/techreborn/manual/PageCollection.java @@ -1,85 +1,106 @@ package techreborn.manual; -import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import techreborn.manual.pages.BasePage; -import java.io.IOException; -import java.util.List; +import com.google.common.collect.Lists; -public class PageCollection extends Gui { +public class PageCollection extends Gui +{ - public final List pages = Lists.newArrayList(); - private String ACTIVE_PAGE = Reference.pageNames.CONTENTS_PAGE; - protected int x; - protected int y; + public final List pages = Lists.newArrayList(); + private String ACTIVE_PAGE = Reference.pageNames.CONTENTS_PAGE; + protected int x; + protected int y; - public PageCollection() { - this.x = 0; - this.y = 0; - } + public PageCollection() + { + this.x = 0; + this.y = 0; + } - public void addPage(BasePage page) { - pages.add(page); - } + public void addPage(BasePage page) + { + pages.add(page); + } - public BasePage getPageByName(String name) { - for (BasePage component : pages) { - if (component.getReferenceName().equals(ACTIVE_PAGE)) { - return component; - } - } - return null; - } + public BasePage getPageByName(String name) + { + for (BasePage component : pages) + { + if (component.getReferenceName().equals(ACTIVE_PAGE)) + { + return component; + } + } + return null; + } - public BasePage getActivePage() { - for (BasePage component : pages) { - if (component.getReferenceName().equals(ACTIVE_PAGE)) { - return component; - } - } - return null; - } + public BasePage getActivePage() + { + for (BasePage component : pages) + { + if (component.getReferenceName().equals(ACTIVE_PAGE)) + { + return component; + } + } + return null; + } - public final void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - if (getActivePage() == null) return; - getActivePage().drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY); - } + public final void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + if (getActivePage() == null) + return; + getActivePage().drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY); + } + public final void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + if (getActivePage() == null) + return; + getActivePage().renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); + } - public final void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - if (getActivePage() == null) return; - getActivePage().renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); - } + public void changeActivePage(String newPage) + { + ACTIVE_PAGE = newPage; + if (getActivePage() == null) + return; + getActivePage().setWorldAndResolution(Minecraft.getMinecraft(), x, y); + } - public void changeActivePage(String newPage) { - ACTIVE_PAGE = newPage; - if (getActivePage() == null) return; - getActivePage().setWorldAndResolution(Minecraft.getMinecraft(), x, y); - } + public void setWorldAndResolution(Minecraft minecraft, int x, int y) + { + if (getActivePage() == null) + return; + getActivePage().setWorldAndResolution(minecraft, x, y); + this.x = x; + this.y = y; + } - public void setWorldAndResolution(Minecraft minecraft, int x, int y) { - if (getActivePage() == null) return; - getActivePage().setWorldAndResolution(minecraft, x, y); - this.x = x; - this.y = y; - } + protected void actionPerformed(GuiButton button) + { + if (getActivePage() == null) + return; + getActivePage().actionPerformed(button); + } - protected void actionPerformed(GuiButton button) { - if (getActivePage() == null) return; - getActivePage().actionPerformed(button); - } + // protected void mouseMovedOrUp(int par1, int par2, int par3) { + // if (getActivePage() == null) return; + // getActivePage().mo(par1, par2, par3); + // } -// protected void mouseMovedOrUp(int par1, int par2, int par3) { -// if (getActivePage() == null) return; -// getActivePage().mo(par1, par2, par3); -// } - - protected void mouseClicked(int par1, int par2, int par3) throws IOException { - if (getActivePage() == null) return; - getActivePage().mouseClicked(par1, par2, par3); - } + protected void mouseClicked(int par1, int par2, int par3) throws IOException + { + if (getActivePage() == null) + return; + getActivePage().mouseClicked(par1, par2, par3); + } } diff --git a/src/main/java/techreborn/manual/Reference.java b/src/main/java/techreborn/manual/Reference.java index 55555a060..7cf32799c 100644 --- a/src/main/java/techreborn/manual/Reference.java +++ b/src/main/java/techreborn/manual/Reference.java @@ -1,8 +1,8 @@ package techreborn.manual; -public class Reference +public class Reference { - public static final String CONTENTS_KEY = "techreborn.manual.contents"; + public static final String CONTENTS_KEY = "techreborn.manual.contents"; public static final String GETTINGSTARTED_KEY = "techreborn.manual.gettingstarted"; public static final String GENERATINGPOWER_KEY = "techreborn.manual.generatingpower"; public static final String BASICMACHINES_KEY = "techreborn.manual.basicmachines"; @@ -12,7 +12,6 @@ public class Reference public static final String GETTINGRUBBER_KEY = "techreborn.manual.gettingrubber"; public static final String CRAFTINGPLATES_KEY = "techreborn.manual.gettingplates"; - public class pageNames { public static final String CONTENTS_PAGE = "contents"; diff --git a/src/main/java/techreborn/manual/pages/AdvancedMachines.java b/src/main/java/techreborn/manual/pages/AdvancedMachines.java index 3d3c640b1..7eb5658d9 100644 --- a/src/main/java/techreborn/manual/pages/AdvancedMachines.java +++ b/src/main/java/techreborn/manual/pages/AdvancedMachines.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import techreborn.init.ModBlocks; @@ -8,43 +10,54 @@ import techreborn.manual.Reference; import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - public class AdvancedMachines extends TitledPage { - public AdvancedMachines(String name, PageCollection collection) - { - super(name, false, collection, Reference.ADVANCEDMACHINES_KEY, Color.white.getRGB()); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(1, getXMin() + 10, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModBlocks.BlastFurnace), - ModBlocks.BlastFurnace.getUnlocalizedName(), ttl(ModBlocks.BlastFurnace.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 10, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModBlocks.industrialSawmill), - ModBlocks.industrialSawmill.getUnlocalizedName(), ttl(ModBlocks.industrialSawmill.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(3, getXMin() + 10, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.IndustrialElectrolyzer), - ModBlocks.IndustrialElectrolyzer.getUnlocalizedName(), ttl(ModBlocks.IndustrialElectrolyzer.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(4, getXMin() + 10, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.IndustrialGrinder), - ModBlocks.IndustrialGrinder.getUnlocalizedName(), ttl(ModBlocks.IndustrialGrinder.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(5, getXMin() + 10, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModBlocks.ImplosionCompressor), - ModBlocks.ImplosionCompressor.getUnlocalizedName(), ttl(ModBlocks.ImplosionCompressor.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(6, getXMin() + 10, getYMin() + 120, 0, 46, 100, 20, new ItemStack(ModBlocks.centrifuge), - ModBlocks.centrifuge.getUnlocalizedName(), ttl(ModBlocks.centrifuge.getLocalizedName()))); - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - if (button.id == 1) collection.changeActivePage(ModBlocks.BlastFurnace.getLocalizedName()); - if (button.id == 2) collection.changeActivePage(ModBlocks.industrialSawmill.getLocalizedName()); - if (button.id == 3) collection.changeActivePage(ModBlocks.IndustrialElectrolyzer.getLocalizedName()); - if (button.id == 4) collection.changeActivePage(ModBlocks.IndustrialGrinder.getLocalizedName()); - if (button.id == 5) collection.changeActivePage(ModBlocks.ImplosionCompressor.getLocalizedName()); - if (button.id == 6) collection.changeActivePage(ModBlocks.centrifuge.getLocalizedName()); - } + public AdvancedMachines(String name, PageCollection collection) + { + super(name, false, collection, Reference.ADVANCEDMACHINES_KEY, Color.white.getRGB()); + } + + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(1, getXMin() + 10, getYMin() + 20, 0, 46, 100, 20, + new ItemStack(ModBlocks.BlastFurnace), ModBlocks.BlastFurnace.getUnlocalizedName(), + ttl(ModBlocks.BlastFurnace.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 10, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModBlocks.industrialSawmill), ModBlocks.industrialSawmill.getUnlocalizedName(), + ttl(ModBlocks.industrialSawmill.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(3, getXMin() + 10, getYMin() + 60, 0, 46, 100, 20, + new ItemStack(ModBlocks.IndustrialElectrolyzer), ModBlocks.IndustrialElectrolyzer.getUnlocalizedName(), + ttl(ModBlocks.IndustrialElectrolyzer.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(4, getXMin() + 10, getYMin() + 80, 0, 46, 100, 20, + new ItemStack(ModBlocks.IndustrialGrinder), ModBlocks.IndustrialGrinder.getUnlocalizedName(), + ttl(ModBlocks.IndustrialGrinder.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(5, getXMin() + 10, getYMin() + 100, 0, 46, 100, 20, + new ItemStack(ModBlocks.ImplosionCompressor), ModBlocks.ImplosionCompressor.getUnlocalizedName(), + ttl(ModBlocks.ImplosionCompressor.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(6, getXMin() + 10, getYMin() + 120, 0, 46, 100, 20, + new ItemStack(ModBlocks.centrifuge), ModBlocks.centrifuge.getUnlocalizedName(), + ttl(ModBlocks.centrifuge.getLocalizedName()))); + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + if (button.id == 1) + collection.changeActivePage(ModBlocks.BlastFurnace.getLocalizedName()); + if (button.id == 2) + collection.changeActivePage(ModBlocks.industrialSawmill.getLocalizedName()); + if (button.id == 3) + collection.changeActivePage(ModBlocks.IndustrialElectrolyzer.getLocalizedName()); + if (button.id == 4) + collection.changeActivePage(ModBlocks.IndustrialGrinder.getLocalizedName()); + if (button.id == 5) + collection.changeActivePage(ModBlocks.ImplosionCompressor.getLocalizedName()); + if (button.id == 6) + collection.changeActivePage(ModBlocks.centrifuge.getLocalizedName()); + } } diff --git a/src/main/java/techreborn/manual/pages/BasePage.java b/src/main/java/techreborn/manual/pages/BasePage.java index 5a867bee0..b736ef289 100644 --- a/src/main/java/techreborn/manual/pages/BasePage.java +++ b/src/main/java/techreborn/manual/pages/BasePage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.io.IOException; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; @@ -8,90 +10,107 @@ import net.minecraft.util.text.translation.I18n; import techreborn.manual.PageCollection; import techreborn.manual.Reference; -import java.io.IOException; +public class BasePage extends GuiScreen +{ -public class BasePage extends GuiScreen { + // Name used to reference the page + private String REFERENCE_NAME; + // Name Displayed in the index page + public String INDEX_NAME; + public boolean hasIndexButton = false; + public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation( + "techreborn:textures/manual/gui/manual.png"); + private final int xSize = 146; + private final int ySize = 180; + protected PageCollection collection; - //Name used to reference the page - private String REFERENCE_NAME; - //Name Displayed in the index page - public String INDEX_NAME; - public boolean hasIndexButton = false; - public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation("techreborn:textures/manual/gui/manual.png"); - private final int xSize = 146; - private final int ySize = 180; - protected PageCollection collection; + public BasePage() + { + } - public BasePage() { - } + public BasePage(String referenceName, PageCollection collection) + { + this.REFERENCE_NAME = referenceName; + this.mc = Minecraft.getMinecraft(); + this.collection = collection; + initGui(); + } - public BasePage(String referenceName, PageCollection collection) { - this.REFERENCE_NAME = referenceName; - this.mc = Minecraft.getMinecraft(); - this.collection = collection; - initGui(); - } + public BasePage(String referenceName, boolean showInMenue, PageCollection collection) + { + this(referenceName, collection); + this.hasIndexButton = showInMenue; + } - public BasePage(String referenceName, boolean showInMenue, PageCollection collection) { - this(referenceName, collection); - this.hasIndexButton = showInMenue; - } + public int getXMin() + { + return (this.width - xSize) / 2; + } - public int getXMin() { - return (this.width - xSize) / 2; - } + public int getYMin() + { + return (this.height - ySize) / 2; + } - public int getYMin() { - return (this.height - ySize) / 2; - } + public void setXMin(int x) + { + this.width = x; + } - public void setXMin(int x) { - this.width = x; - } + public void setYMin(int y) + { + this.height = y; + } - public void setYMin(int y) { - this.height = y; - } + // Unlocalized Index Page Name + public BasePage setIndexName(String unlocalizedName) + { + this.INDEX_NAME = ttl(unlocalizedName); + return this; + } - //Unlocalized Index Page Name - public BasePage setIndexName(String unlocalizedName) { - this.INDEX_NAME = ttl(unlocalizedName); - return this; - } + public void setReferenceName(String name) + { + REFERENCE_NAME = name; + } - public void setReferenceName(String name) { - REFERENCE_NAME = name; - } + public String getReferenceName() + { + return REFERENCE_NAME; + } - public String getReferenceName() { - return REFERENCE_NAME; - } + public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + minecraft.renderEngine.bindTexture(PAGE_TEXTURE); + drawTexturedModalRect(offsetX, offsetY, 0, 0, xSize, ySize); + } - public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - minecraft.renderEngine.bindTexture(PAGE_TEXTURE); - drawTexturedModalRect(offsetX, offsetY, 0, 0, xSize, ySize); - } + public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + } - public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - } + public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + super.drawScreen(mouseX + offsetX, mouseY + offsetY, 0); + renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY); + } - public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - super.drawScreen(mouseX + offsetX, mouseY + offsetY, 0); - renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY); - } + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + } - @Override - public void actionPerformed(GuiButton button) { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - } + @Override + public void mouseClicked(int par1, int par2, int par3) throws IOException + { + super.mouseClicked(par1, par2, par3); + } - @Override - public void mouseClicked(int par1, int par2, int par3) throws IOException { - super.mouseClicked(par1, par2, par3); - } - - //Translate To Local - public String ttl(String unlocalizedName) { - return I18n.translateToLocal(unlocalizedName); - } + // Translate To Local + public String ttl(String unlocalizedName) + { + return I18n.translateToLocal(unlocalizedName); + } } diff --git a/src/main/java/techreborn/manual/pages/BasicMachinesPage.java b/src/main/java/techreborn/manual/pages/BasicMachinesPage.java index 1f5a627a9..f86fa0c73 100644 --- a/src/main/java/techreborn/manual/pages/BasicMachinesPage.java +++ b/src/main/java/techreborn/manual/pages/BasicMachinesPage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import techreborn.init.ModBlocks; @@ -8,40 +10,49 @@ import techreborn.manual.Reference; import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - public class BasicMachinesPage extends TitledPage { - public BasicMachinesPage(String name, PageCollection collection) - { - super(name, false, collection, Reference.BASICMACHINES_KEY, Color.white.getRGB()); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModBlocks.Grinder), - ModBlocks.Grinder.getUnlocalizedName(), ttl(ModBlocks.Grinder.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModBlocks.ElectricFurnace), - ModBlocks.ElectricFurnace.getUnlocalizedName(), ttl(ModBlocks.ElectricFurnace.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.AlloySmelter), - ModBlocks.AlloySmelter.getUnlocalizedName(), ttl(ModBlocks.AlloySmelter.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.Extractor), - ModBlocks.Extractor.getUnlocalizedName(), ttl(ModBlocks.Extractor.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModBlocks.Compressor), - ModBlocks.Compressor.getUnlocalizedName(), ttl(ModBlocks.Compressor.getLocalizedName()))); - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - if (button.id == 1) collection.changeActivePage(ModBlocks.Grinder.getLocalizedName()); - if (button.id == 2) collection.changeActivePage(ModBlocks.ElectricFurnace.getLocalizedName()); - if (button.id == 3) collection.changeActivePage(ModBlocks.AlloySmelter.getLocalizedName()); - if (button.id == 4) collection.changeActivePage(ModBlocks.Extractor.getLocalizedName()); - if (button.id == 5) collection.changeActivePage(ModBlocks.Compressor.getLocalizedName()); - } + public BasicMachinesPage(String name, PageCollection collection) + { + super(name, false, collection, Reference.BASICMACHINES_KEY, Color.white.getRGB()); + } + + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + new ItemStack(ModBlocks.Grinder), ModBlocks.Grinder.getUnlocalizedName(), + ttl(ModBlocks.Grinder.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModBlocks.ElectricFurnace), ModBlocks.ElectricFurnace.getUnlocalizedName(), + ttl(ModBlocks.ElectricFurnace.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, + new ItemStack(ModBlocks.AlloySmelter), ModBlocks.AlloySmelter.getUnlocalizedName(), + ttl(ModBlocks.AlloySmelter.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, + new ItemStack(ModBlocks.Extractor), ModBlocks.Extractor.getUnlocalizedName(), + ttl(ModBlocks.Extractor.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, + new ItemStack(ModBlocks.Compressor), ModBlocks.Compressor.getUnlocalizedName(), + ttl(ModBlocks.Compressor.getLocalizedName()))); + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + if (button.id == 1) + collection.changeActivePage(ModBlocks.Grinder.getLocalizedName()); + if (button.id == 2) + collection.changeActivePage(ModBlocks.ElectricFurnace.getLocalizedName()); + if (button.id == 3) + collection.changeActivePage(ModBlocks.AlloySmelter.getLocalizedName()); + if (button.id == 4) + collection.changeActivePage(ModBlocks.Extractor.getLocalizedName()); + if (button.id == 5) + collection.changeActivePage(ModBlocks.Compressor.getLocalizedName()); + } } diff --git a/src/main/java/techreborn/manual/pages/ContentsPage.java b/src/main/java/techreborn/manual/pages/ContentsPage.java index 0aa7262fb..45a8795f7 100644 --- a/src/main/java/techreborn/manual/pages/ContentsPage.java +++ b/src/main/java/techreborn/manual/pages/ContentsPage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; @@ -10,45 +12,52 @@ import techreborn.manual.PageCollection; import techreborn.manual.Reference; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - -public class ContentsPage extends TitledPage +public class ContentsPage extends TitledPage { - public ContentsPage(String name, PageCollection collection) - { - super(name, false, collection, Reference.CONTENTS_KEY, Color.white.getRGB()); - } + public ContentsPage(String name, PageCollection collection) + { + super(name, false, collection, Reference.CONTENTS_KEY, Color.white.getRGB()); + } - @SuppressWarnings("unchecked") - @Override - public void initGui() - { - buttonList.clear(); - buttonList.add(new GuiButtonItemTexture(0, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, ItemPlates.getPlateByName("iron"), - Reference.pageNames.GETTINGSTARTED_PAGE, ttl(Reference.GETTINGSTARTED_KEY))); - buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModBlocks.Generator), - Reference.pageNames.GENERATINGPOWER_PAGE, ttl(Reference.GENERATINGPOWER_KEY))); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.ElectricFurnace), - Reference.pageNames.BASICMACHINES_PAGE, ttl(Reference.BASICMACHINES_KEY))); - buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.BlastFurnace), - Reference.pageNames.ADVANCEDMACHINES_PAGE, ttl(Reference.ADVANCEDMACHINES_KEY))); - buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModItems.ironDrill), - Reference.pageNames.TOOLS_PAGE, ttl(Reference.TOOLS_KEY))); - } + @SuppressWarnings("unchecked") + @Override + public void initGui() + { + buttonList.clear(); + buttonList.add(new GuiButtonItemTexture(0, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + ItemPlates.getPlateByName("iron"), Reference.pageNames.GETTINGSTARTED_PAGE, + ttl(Reference.GETTINGSTARTED_KEY))); + buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModBlocks.Generator), Reference.pageNames.GENERATINGPOWER_PAGE, + ttl(Reference.GENERATINGPOWER_KEY))); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, + new ItemStack(ModBlocks.ElectricFurnace), Reference.pageNames.BASICMACHINES_PAGE, + ttl(Reference.BASICMACHINES_KEY))); + buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, + new ItemStack(ModBlocks.BlastFurnace), Reference.pageNames.ADVANCEDMACHINES_PAGE, + ttl(Reference.ADVANCEDMACHINES_KEY))); + buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, + new ItemStack(ModItems.ironDrill), Reference.pageNames.TOOLS_PAGE, ttl(Reference.TOOLS_KEY))); + } - @Override - public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) - { - super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); - } + @Override + public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); + } - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.GETTINGSTARTED_PAGE); - if (button.id == 1) collection.changeActivePage(Reference.pageNames.GENERATINGPOWER_PAGE); - if (button.id == 2) collection.changeActivePage(Reference.pageNames.BASICMACHINES_PAGE); - if (button.id == 3) collection.changeActivePage(Reference.pageNames.ADVANCEDMACHINES_PAGE); - if (button.id == 4) collection.changeActivePage(Reference.pageNames.TOOLS_PAGE); - } + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.GETTINGSTARTED_PAGE); + if (button.id == 1) + collection.changeActivePage(Reference.pageNames.GENERATINGPOWER_PAGE); + if (button.id == 2) + collection.changeActivePage(Reference.pageNames.BASICMACHINES_PAGE); + if (button.id == 3) + collection.changeActivePage(Reference.pageNames.ADVANCEDMACHINES_PAGE); + if (button.id == 4) + collection.changeActivePage(Reference.pageNames.TOOLS_PAGE); + } } diff --git a/src/main/java/techreborn/manual/pages/CraftingInfoPage.java b/src/main/java/techreborn/manual/pages/CraftingInfoPage.java index 08bd19732..af9ddf74d 100644 --- a/src/main/java/techreborn/manual/pages/CraftingInfoPage.java +++ b/src/main/java/techreborn/manual/pages/CraftingInfoPage.java @@ -1,26 +1,5 @@ package techreborn.manual.pages; -import com.google.common.base.Objects; -import com.google.common.base.Strings; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.RenderItem; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.*; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.TextFormatting; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import org.lwjgl.opengl.GL11; -import techreborn.manual.PageCollection; -import techreborn.manual.util.ButtonUtil; - import java.awt.*; import java.lang.reflect.Field; import java.util.ArrayList; @@ -28,106 +7,137 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -public class CraftingInfoPage extends TitledPage +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.RenderItem; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +import org.lwjgl.opengl.GL11; + +import techreborn.manual.PageCollection; +import techreborn.manual.util.ButtonUtil; + +import com.google.common.base.Objects; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; + +public class CraftingInfoPage extends TitledPage { - public ItemStack result; - private boolean isSmelting = false; - private ItemStack[] recipe = new ItemStack[9]; - private boolean hasRecipe = false; - private String rawDescription; - private List formattedDescription; - private float descriptionScale = 0.66f; + public ItemStack result; + private boolean isSmelting = false; + private ItemStack[] recipe = new ItemStack[9]; + private boolean hasRecipe = false; + private String rawDescription; + private List formattedDescription; + private float descriptionScale = 0.66f; public String imageprefix = "techreborn:textures/manual/elements/"; public String backpage; + public CraftingInfoPage(String name, PageCollection collection, ItemStack itemStack, String unlocalizedDescription, + String backPage) + { + super(name, true, collection, itemStack.getUnlocalizedName() + ".name", Color.white.getRGB()); + this.result = itemStack; + this.recipe = getFirstRecipeForItem(itemStack); + this.backpage = backPage; + for (ItemStack stack : recipe) + if (stack != null) + hasRecipe = true; + if (unlocalizedDescription == "") + rawDescription = ttl(itemStack.getUnlocalizedName() + ".description"); + else + rawDescription = ttl(unlocalizedDescription); + } - public CraftingInfoPage(String name, PageCollection collection, ItemStack itemStack, String unlocalizedDescription, String backPage) - { - super(name, true, collection, itemStack.getUnlocalizedName() + ".name", Color.white.getRGB()); - this.result = itemStack; - this.recipe = getFirstRecipeForItem(itemStack); - this.backpage = backPage; - for (ItemStack stack : recipe) if (stack != null) hasRecipe = true; - if (unlocalizedDescription == "") rawDescription = ttl(itemStack.getUnlocalizedName() + ".description"); - else rawDescription = ttl(unlocalizedDescription); - } + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + } - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - } - - @Override - public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); - GL11.glPushMatrix(); - if (isSmelting) - { - renderImage(offsetX + 15, offsetY + 10, "furnacerecipe"); - } - else - { - if (hasRecipe) - { - renderImage(offsetX, offsetY + 10, "craftingtable"); - } - else - { - drawString(fontRendererObj, "No Crafting Recipe", offsetX + 40, offsetY + 22, Color.black.getRGB()); - } - } - GL11.glPopMatrix(); + @Override + public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY); + GL11.glPushMatrix(); + if (isSmelting) + { + renderImage(offsetX + 15, offsetY + 10, "furnacerecipe"); + } else + { + if (hasRecipe) + { + renderImage(offsetX, offsetY + 10, "craftingtable"); + } else + { + drawString(fontRendererObj, "No Crafting Recipe", offsetX + 40, offsetY + 22, Color.black.getRGB()); + } + } + GL11.glPopMatrix(); - } + } - public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) - { - super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY); - int relativeMouseX = mouseX + offsetX; - int relativeMouseY = mouseY + offsetY; - int gridOffsetX = isSmelting ? 85 : 71; - int gridOffsetY = 18; - int itemBoxSize = 18; - addDescription(minecraft, offsetX + 8, offsetY); + public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY); + int relativeMouseX = mouseX + offsetX; + int relativeMouseY = mouseY + offsetY; + int gridOffsetX = isSmelting ? 85 : 71; + int gridOffsetY = 18; + int itemBoxSize = 18; + addDescription(minecraft, offsetX + 8, offsetY); - ItemStack tooltip = null; - int i = 0; - for (ItemStack input : recipe) - { - if (input != null) { - int row = (i % 3); - int column = i / 3; - int itemX = offsetX + gridOffsetX + (row * itemBoxSize) - 54; - int itemY = offsetY + gridOffsetY + (column * itemBoxSize) + 2; - drawItemStack(input, itemX, itemY, ""); - if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize && - relativeMouseY > itemY - 2 && relativeMouseY < itemY - 2 + itemBoxSize) { - tooltip = input; - } - } - i++; - } - int itemX = offsetX + (isSmelting ? 92 : 112); - int itemY = offsetY + (isSmelting ? 40 : 38); - if (!hasRecipe) { - itemX = offsetX + 20; - itemY = offsetY + 18; - } + ItemStack tooltip = null; + int i = 0; + for (ItemStack input : recipe) + { + if (input != null) + { + int row = (i % 3); + int column = i / 3; + int itemX = offsetX + gridOffsetX + (row * itemBoxSize) - 54; + int itemY = offsetY + gridOffsetY + (column * itemBoxSize) + 2; + drawItemStack(input, itemX, itemY, ""); + if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize && relativeMouseY > itemY - 2 + && relativeMouseY < itemY - 2 + itemBoxSize) + { + tooltip = input; + } + } + i++; + } + int itemX = offsetX + (isSmelting ? 92 : 112); + int itemY = offsetY + (isSmelting ? 40 : 38); + if (!hasRecipe) + { + itemX = offsetX + 20; + itemY = offsetY + 18; + } - drawItemStack(result, itemX, itemY, ""); - if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize && - relativeMouseY > itemY - 2 && relativeMouseY < itemY - 2 + itemBoxSize) { - tooltip = result; - } - if (tooltip != null) { - drawItemStackTooltip(tooltip, relativeMouseX, relativeMouseY); - } - } - - public void renderImage(int offsetX, int offsetY, String imagename) - { + drawItemStack(result, itemX, itemY, ""); + if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize && relativeMouseY > itemY - 2 + && relativeMouseY < itemY - 2 + itemBoxSize) + { + tooltip = result; + } + if (tooltip != null) + { + drawItemStackTooltip(tooltip, relativeMouseX, relativeMouseY); + } + } + + public void renderImage(int offsetX, int offsetY, String imagename) + { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(new ResourceLocation(imageprefix + imagename + ".png")); @@ -136,210 +146,236 @@ public class CraftingInfoPage extends TitledPage GL11.glColor4f(1F, 1F, 1F, 1F); drawTexturedModalRect(offsetX, offsetY - 14, 0, 0, 140, this.height); GL11.glDisable(GL11.GL_BLEND); - } + } - public void addDescription(Minecraft minecraft, int offsetX, int offsetY) - { - GL11.glPushMatrix(); - if (hasRecipe) GL11.glTranslated(offsetX + 5, offsetY + 75, 1); - else GL11.glTranslated(offsetX + 5, offsetY + 40, 1); - GL11.glScalef(descriptionScale, descriptionScale, descriptionScale); - int offset = 0; - for (String s : getFormattedText(fontRendererObj)) { - if (s == null) break; - if (s.contains("\\%") && s.substring(0, 2).equals("\\%")) { - s = s.substring(2); - offset += fontRendererObj.FONT_HEIGHT / 2; - } - fontRendererObj.drawString(s, 0, offset, Color.black.getRGB()); - offset += fontRendererObj.FONT_HEIGHT; - } - GL11.glPopMatrix(); - } + public void addDescription(Minecraft minecraft, int offsetX, int offsetY) + { + GL11.glPushMatrix(); + if (hasRecipe) + GL11.glTranslated(offsetX + 5, offsetY + 75, 1); + else + GL11.glTranslated(offsetX + 5, offsetY + 40, 1); + GL11.glScalef(descriptionScale, descriptionScale, descriptionScale); + int offset = 0; + for (String s : getFormattedText(fontRendererObj)) + { + if (s == null) + break; + if (s.contains("\\%") && s.substring(0, 2).equals("\\%")) + { + s = s.substring(2); + offset += fontRendererObj.FONT_HEIGHT / 2; + } + fontRendererObj.drawString(s, 0, offset, Color.black.getRGB()); + offset += fontRendererObj.FONT_HEIGHT; + } + GL11.glPopMatrix(); + } + @SuppressWarnings("unchecked") + public List getFormattedText(FontRenderer fr) + { + if (formattedDescription == null) + { + formattedDescription = new ArrayList(); - @SuppressWarnings("unchecked") - public List getFormattedText(FontRenderer fr) - { - if (formattedDescription == null) { - formattedDescription = new ArrayList(); + if (Strings.isNullOrEmpty(rawDescription)) + { + formattedDescription = ImmutableList.of(); + return formattedDescription; + } + if (!rawDescription.contains("\\n")) + { + formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 370)); + return formattedDescription; + } - if (Strings.isNullOrEmpty(rawDescription)) { - formattedDescription = ImmutableList.of(); - return formattedDescription; - } - if (!rawDescription.contains("\\n")) { - formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 370)); - return formattedDescription; - } + List segments = new ArrayList(); + String raw = rawDescription; - List segments = new ArrayList(); - String raw = rawDescription; + int escape = 0; + while (raw.contains("\\n")) + { + segments.add(raw.substring(0, raw.indexOf("\\n"))); + raw = raw.substring(raw.indexOf("\\n") + 2); + if (!raw.contains("\\n")) + segments.add(raw); + escape++; + if (escape > 100) + { + break; + } + } - int escape = 0; - while (raw.contains("\\n")) { - segments.add(raw.substring(0, raw.indexOf("\\n"))); - raw = raw.substring(raw.indexOf("\\n") + 2); - if (!raw.contains("\\n")) segments.add(raw); + for (String s : segments) + formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370))); + } + return formattedDescription; + } - escape++; - if (escape > 100) { - break; - } - } + protected void drawItemStackTooltip(ItemStack stack, int x, int y) + { + final Minecraft mc = Minecraft.getMinecraft(); + FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj); - for (String s : segments) - formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370))); - } - return formattedDescription; - } + @SuppressWarnings("unchecked") + List list = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); - protected void drawItemStackTooltip(ItemStack stack, int x, int y) - { - final Minecraft mc = Minecraft.getMinecraft(); - FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj); + List colored = Lists.newArrayListWithCapacity(list.size()); + colored.add(stack.getRarity().rarityColor + list.get(0)); + for (String line : list) + colored.add(TextFormatting.GRAY + line); - @SuppressWarnings("unchecked") - List list = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips); + if (colored.size() >= 2) + colored.remove(1); + drawHoveringText(colored, x, y, font); + } - List colored = Lists.newArrayListWithCapacity(list.size()); - colored.add(stack.getRarity().rarityColor + list.get(0)); - for (String line : list) - colored.add(TextFormatting.GRAY + line); + private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) + { + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + this.zLevel = 200.0F; + RenderHelper.enableGUIStandardItemLighting(); + GL11.glColor3f(1f, 1f, 1f); + GL11.glEnable(GL11.GL_NORMALIZE); + FontRenderer font = null; + if (par1ItemStack != null) + font = par1ItemStack.getItem().getFontRenderer(par1ItemStack); + if (font == null) + font = Minecraft.getMinecraft().fontRendererObj; + renderItemStack(par1ItemStack, par2, par3); + this.zLevel = 0.0F; + } - if (colored.size() >= 2) colored.remove(1); - drawHoveringText(colored, x, y, font); - } + public void renderItemStack(ItemStack stack, int x, int y) + { + if (stack != null) + { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + RenderHelper.enableGUIStandardItemLighting(); - private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) - { - GL11.glTranslatef(0.0F, 0.0F, 32.0F); - this.zLevel = 200.0F; - RenderHelper.enableGUIStandardItemLighting(); - GL11.glColor3f(1f, 1f, 1f); - GL11.glEnable(GL11.GL_NORMALIZE); - FontRenderer font = null; - if (par1ItemStack != null) font = par1ItemStack.getItem().getFontRenderer(par1ItemStack); - if (font == null) font = Minecraft.getMinecraft().fontRendererObj; - renderItemStack(par1ItemStack, par2, par3); - this.zLevel = 0.0F; - } + RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); + itemRenderer.renderItemAndEffectIntoGUI(stack, x, y); - public void renderItemStack(ItemStack stack, int x, int y) - { - if (stack != null) - { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + } + } - RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); - itemRenderer.renderItemAndEffectIntoGUI(stack, x, y); + @SuppressWarnings("unchecked") + private ItemStack[] getFirstRecipeForItem(ItemStack resultingItem) + { + ItemStack[] recipeItems = new ItemStack[9]; + for (IRecipe recipe : (List) CraftingManager.getInstance().getRecipeList()) + { + if (recipe == null) + continue; - GL11.glDisable(GL11.GL_LIGHTING); - } - } + ItemStack result = recipe.getRecipeOutput(); + if (result == null || !result.isItemEqual(resultingItem)) + continue; - @SuppressWarnings("unchecked") - private ItemStack[] getFirstRecipeForItem(ItemStack resultingItem) - { - ItemStack[] recipeItems = new ItemStack[9]; - for (IRecipe recipe : (List) CraftingManager.getInstance().getRecipeList()) - { - if (recipe == null) continue; + Object[] input = getRecipeInput(recipe); + if (input == null) + continue; - ItemStack result = recipe.getRecipeOutput(); - if (result == null || !result.isItemEqual(resultingItem)) continue; + for (int i = 0; i < input.length; i++) + recipeItems[i] = convertToStack(input[i]); + break; - Object[] input = getRecipeInput(recipe); - if (input == null) continue; + } - for (int i = 0; i < input.length; i++) - recipeItems[i] = convertToStack(input[i]); - break; + Iterator iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator(); + Map.Entry entry; - } + while (iterator.hasNext()) + { + entry = (Map.Entry) iterator.next(); + if (entry.getKey() instanceof ItemStack && ((ItemStack) entry.getValue()).isItemEqual(result)) + { + isSmelting = true; + recipeItems[0] = (ItemStack) entry.getKey(); + } + } - Iterator iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator(); - Map.Entry entry; + return recipeItems; + } - while (iterator.hasNext()) - { - entry = (Map.Entry) iterator.next(); - if (entry.getKey() instanceof ItemStack && ((ItemStack) entry.getValue()).isItemEqual(result)) - { - isSmelting = true; - recipeItems[0] = (ItemStack) entry.getKey(); - } - } + protected ItemStack convertToStack(Object obj) + { + ItemStack entry = null; + if (obj instanceof ItemStack) + { + entry = (ItemStack) obj; + } else if (obj instanceof List) + { + @SuppressWarnings("unchecked") + List list = (List) obj; + if (list.size() > 0) + entry = list.get(0); + } - return recipeItems; - } + if (entry == null) + return null; + entry = entry.copy(); + if (entry.getItemDamage() == OreDictionary.WILDCARD_VALUE) + entry.setItemDamage(0); + return entry; + } - protected ItemStack convertToStack(Object obj) - { - ItemStack entry = null; - if (obj instanceof ItemStack) { - entry = (ItemStack) obj; - } else if (obj instanceof List) { - @SuppressWarnings("unchecked") - List list = (List) obj; - if (list.size() > 0) entry = list.get(0); - } + @SuppressWarnings("unchecked") + private Object[] getRecipeInput(IRecipe recipe) + { + if (recipe instanceof ShapelessOreRecipe) + return ((ShapelessOreRecipe) recipe).getInput().toArray(); + else if (recipe instanceof ShapedOreRecipe) + return getShapedOreRecipe((ShapedOreRecipe) recipe); + else if (recipe instanceof ShapedRecipes) + return ((ShapedRecipes) recipe).recipeItems; + else if (recipe instanceof ShapelessRecipes) + return ((ShapelessRecipes) recipe).recipeItems.toArray(new ItemStack[0]); + return null; + } - if (entry == null) return null; - entry = entry.copy(); - if (entry.getItemDamage() == OreDictionary.WILDCARD_VALUE) entry.setItemDamage(0); - return entry; - } + private Object[] getShapedOreRecipe(ShapedOreRecipe recipe) + { + try + { + Field field = ShapedOreRecipe.class.getDeclaredField("width"); + if (field != null) + { + field.setAccessible(true); + int width = field.getInt(recipe); + Object[] input = recipe.getInput(); + Object[] grid = new Object[9]; + for (int i = 0, offset = 0, y = 0; y < 3; y++) + { + for (int x = 0; x < 3; x++, i++) + { + if (x < width && offset < input.length) + { + grid[i] = input[offset]; + offset++; + } else + { + grid[i] = null; + } + } + } + return grid; + } + } catch (Exception e) + { + e.printStackTrace(); + } + return null; + } - @SuppressWarnings("unchecked") - private Object[] getRecipeInput(IRecipe recipe) - { - if (recipe instanceof ShapelessOreRecipe) return ((ShapelessOreRecipe) recipe).getInput().toArray(); - else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe); - else if (recipe instanceof ShapedRecipes) return ((ShapedRecipes) recipe).recipeItems; - else if (recipe instanceof ShapelessRecipes) - return ((ShapelessRecipes) recipe).recipeItems.toArray(new ItemStack[0]); - return null; - } - - private Object[] getShapedOreRecipe(ShapedOreRecipe recipe) - { - try - { - Field field = ShapedOreRecipe.class.getDeclaredField("width"); - if (field != null) { - field.setAccessible(true); - int width = field.getInt(recipe); - Object[] input = recipe.getInput(); - Object[] grid = new Object[9]; - for (int i = 0, offset = 0, y = 0; y < 3; y++) - { - for (int x = 0; x < 3; x++, i++) { - if (x < width && offset < input.length) - { - grid[i] = input[offset]; - offset++; - } else - { - grid[i] = null; - } - } - } - return grid; - } - } catch (Exception e) - { - e.printStackTrace(); - } - return null; - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(backpage); - } + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(backpage); + } } diff --git a/src/main/java/techreborn/manual/pages/DescriptionPage.java b/src/main/java/techreborn/manual/pages/DescriptionPage.java index 204ad82cc..e32bc0197 100644 --- a/src/main/java/techreborn/manual/pages/DescriptionPage.java +++ b/src/main/java/techreborn/manual/pages/DescriptionPage.java @@ -1,64 +1,66 @@ package techreborn.manual.pages; -import com.google.common.base.Strings; -import com.google.common.collect.ImmutableList; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import techreborn.manual.PageCollection; -import techreborn.manual.Reference; -import techreborn.manual.util.ButtonUtil; - import java.awt.*; import java.util.ArrayList; import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import techreborn.manual.PageCollection; +import techreborn.manual.Reference; +import techreborn.manual.util.ButtonUtil; + +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableList; + public class DescriptionPage extends TitledPage { public boolean hasImage; public String secondpage; - private String rawDescription; - private List formattedDescription; - private float descriptionScale = 0.88f; - + private String rawDescription; + private List formattedDescription; + private float descriptionScale = 0.88f; + public String imageprefix = "techreborn:textures/manual/screenshots/"; - - public DescriptionPage(String name, PageCollection collection, boolean hasImage, String secondPage) - { - super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB()); - this.hasImage = hasImage; - this.rawDescription = "techreborn.manual." + this.getReferenceName() + ".description"; - this.secondpage = secondPage; - } - - @Override - public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) - { - if(hasImage) - { - renderImage(offsetX, offsetY); - addDescription(mc, offsetX, offsetY + 60); - } - else - addDescription(mc, offsetX, offsetY); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - if(secondpage != null) - { - ButtonUtil.addNextButton(1, width / 2 + 40, height / 2 + 64, buttonList); - } - } - - public void renderImage(int offsetX, int offsetY) - { + + public DescriptionPage(String name, PageCollection collection, boolean hasImage, String secondPage) + { + super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB()); + this.hasImage = hasImage; + this.rawDescription = "techreborn.manual." + this.getReferenceName() + ".description"; + this.secondpage = secondPage; + } + + @Override + public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + if (hasImage) + { + renderImage(offsetX, offsetY); + addDescription(mc, offsetX, offsetY + 60); + } else + addDescription(mc, offsetX, offsetY); + } + + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + if (secondpage != null) + { + ButtonUtil.addNextButton(1, width / 2 + 40, height / 2 + 64, buttonList); + } + } + + public void renderImage(int offsetX, int offsetY) + { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(new ResourceLocation(imageprefix + this.getReferenceName() + ".png")); @@ -67,63 +69,66 @@ public class DescriptionPage extends TitledPage GL11.glColor4f(1F, 1F, 1F, 1F); drawTexturedModalRect(offsetX, offsetY - 14, 0, 0, 120, this.height); GL11.glDisable(GL11.GL_BLEND); - } - - public void addDescription(Minecraft minecraft, int offsetX, int offsetY) - { - GL11.glPushMatrix(); - GL11.glTranslated(offsetX + 15, offsetY + 40, 1); - GL11.glScalef(descriptionScale, descriptionScale, descriptionScale); - int offset = 0; - for (String s : getFormattedText(fontRendererObj)) - { - if (s == null) break; - if (s.contains("\\%") && s.substring(0, 2).equals("\\%")) - { - s = s.substring(2); - offset += fontRendererObj.FONT_HEIGHT / 2; - } - fontRendererObj.drawString(s, 0, offset, Color.black.getRGB()); - offset += fontRendererObj.FONT_HEIGHT; - } - GL11.glPopMatrix(); - } - - @SuppressWarnings("unchecked") - public List getFormattedText(FontRenderer fr) - { - if (formattedDescription == null) - { - formattedDescription = new ArrayList(); + } - if (Strings.isNullOrEmpty(rawDescription)) - { - formattedDescription = ImmutableList.of(); - return formattedDescription; - } - if (!rawDescription.contains("\\n")) - { - formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 130)); - return formattedDescription; - } + public void addDescription(Minecraft minecraft, int offsetX, int offsetY) + { + GL11.glPushMatrix(); + GL11.glTranslated(offsetX + 15, offsetY + 40, 1); + GL11.glScalef(descriptionScale, descriptionScale, descriptionScale); + int offset = 0; + for (String s : getFormattedText(fontRendererObj)) + { + if (s == null) + break; + if (s.contains("\\%") && s.substring(0, 2).equals("\\%")) + { + s = s.substring(2); + offset += fontRendererObj.FONT_HEIGHT / 2; + } + fontRendererObj.drawString(s, 0, offset, Color.black.getRGB()); + offset += fontRendererObj.FONT_HEIGHT; + } + GL11.glPopMatrix(); + } - List segments = new ArrayList(); - String raw = rawDescription; + @SuppressWarnings("unchecked") + public List getFormattedText(FontRenderer fr) + { + if (formattedDescription == null) + { + formattedDescription = new ArrayList(); - for (String s : segments) - formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370))); - } - return formattedDescription; - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.GETTINGSTARTED_PAGE); + if (Strings.isNullOrEmpty(rawDescription)) + { + formattedDescription = ImmutableList.of(); + return formattedDescription; + } + if (!rawDescription.contains("\\n")) + { + formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 130)); + return formattedDescription; + } - if(secondpage != null) - { - if (button.id == 1) collection.changeActivePage(secondpage); - } - } + List segments = new ArrayList(); + String raw = rawDescription; + + for (String s : segments) + formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370))); + } + return formattedDescription; + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.GETTINGSTARTED_PAGE); + + if (secondpage != null) + { + if (button.id == 1) + collection.changeActivePage(secondpage); + } + } } diff --git a/src/main/java/techreborn/manual/pages/GeneratingPowerPage.java b/src/main/java/techreborn/manual/pages/GeneratingPowerPage.java index 2c60a095e..316497afd 100644 --- a/src/main/java/techreborn/manual/pages/GeneratingPowerPage.java +++ b/src/main/java/techreborn/manual/pages/GeneratingPowerPage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import techreborn.init.ModBlocks; @@ -8,40 +10,49 @@ import techreborn.manual.Reference; import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - public class GeneratingPowerPage extends TitledPage { - public GeneratingPowerPage(String name, PageCollection collection) - { - super(name, false, collection, Reference.GENERATINGPOWER_KEY, Color.white.getRGB()); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModBlocks.Generator), - ModBlocks.Generator.getUnlocalizedName(), ttl(ModBlocks.Generator.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModBlocks.thermalGenerator), - ModBlocks.thermalGenerator.getUnlocalizedName(), ttl(ModBlocks.thermalGenerator.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModBlocks.solarPanel), - ModBlocks.solarPanel.getUnlocalizedName(), ttl(ModBlocks.solarPanel.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModBlocks.heatGenerator), - ModBlocks.heatGenerator.getUnlocalizedName(), ttl(ModBlocks.heatGenerator.getLocalizedName()))); - buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModBlocks.LightningRod), - ModBlocks.LightningRod.getUnlocalizedName(), ttl(ModBlocks.LightningRod.getLocalizedName()))); - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - if (button.id == 1) collection.changeActivePage(ModBlocks.Generator.getLocalizedName()); - if (button.id == 2) collection.changeActivePage(ModBlocks.thermalGenerator.getLocalizedName()); - if (button.id == 3) collection.changeActivePage(ModBlocks.solarPanel.getLocalizedName()); - if (button.id == 4) collection.changeActivePage(ModBlocks.heatGenerator.getLocalizedName()); - if (button.id == 5) collection.changeActivePage(ModBlocks.LightningRod.getLocalizedName()); - } + public GeneratingPowerPage(String name, PageCollection collection) + { + super(name, false, collection, Reference.GENERATINGPOWER_KEY, Color.white.getRGB()); + } + + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + new ItemStack(ModBlocks.Generator), ModBlocks.Generator.getUnlocalizedName(), + ttl(ModBlocks.Generator.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModBlocks.thermalGenerator), ModBlocks.thermalGenerator.getUnlocalizedName(), + ttl(ModBlocks.thermalGenerator.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, + new ItemStack(ModBlocks.solarPanel), ModBlocks.solarPanel.getUnlocalizedName(), + ttl(ModBlocks.solarPanel.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, + new ItemStack(ModBlocks.heatGenerator), ModBlocks.heatGenerator.getUnlocalizedName(), + ttl(ModBlocks.heatGenerator.getLocalizedName()))); + buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, + new ItemStack(ModBlocks.LightningRod), ModBlocks.LightningRod.getUnlocalizedName(), + ttl(ModBlocks.LightningRod.getLocalizedName()))); + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + if (button.id == 1) + collection.changeActivePage(ModBlocks.Generator.getLocalizedName()); + if (button.id == 2) + collection.changeActivePage(ModBlocks.thermalGenerator.getLocalizedName()); + if (button.id == 3) + collection.changeActivePage(ModBlocks.solarPanel.getLocalizedName()); + if (button.id == 4) + collection.changeActivePage(ModBlocks.heatGenerator.getLocalizedName()); + if (button.id == 5) + collection.changeActivePage(ModBlocks.LightningRod.getLocalizedName()); + } } diff --git a/src/main/java/techreborn/manual/pages/GettingStartedPage.java b/src/main/java/techreborn/manual/pages/GettingStartedPage.java index fd301eb3c..df9a5e515 100644 --- a/src/main/java/techreborn/manual/pages/GettingStartedPage.java +++ b/src/main/java/techreborn/manual/pages/GettingStartedPage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.gui.GuiButton; import techreborn.items.ItemParts; import techreborn.items.ItemPlates; @@ -8,32 +10,35 @@ import techreborn.manual.Reference; import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - public class GettingStartedPage extends TitledPage { - public GettingStartedPage(String name, PageCollection collection) - { - super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB()); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, ItemParts.getPartByName("rubberSap"), - Reference.pageNames.GETTINGRUBBER_PAGE, ttl(Reference.GETTINGRUBBER_KEY))); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, ItemPlates.getPlateByName("iron"), - Reference.pageNames.CRAFTINGPLATES_PAGE, ttl(Reference.CRAFTINGPLATES_KEY))); - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - if (button.id == 1) collection.changeActivePage(Reference.pageNames.GETTINGRUBBER_PAGE); - if (button.id == 2) collection.changeActivePage(Reference.pageNames.CRAFTINGPLATES_PAGE); + public GettingStartedPage(String name, PageCollection collection) + { + super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB()); + } - } + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(1, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + ItemParts.getPartByName("rubberSap"), Reference.pageNames.GETTINGRUBBER_PAGE, + ttl(Reference.GETTINGRUBBER_KEY))); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + ItemPlates.getPlateByName("iron"), Reference.pageNames.CRAFTINGPLATES_PAGE, + ttl(Reference.CRAFTINGPLATES_KEY))); + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + if (button.id == 1) + collection.changeActivePage(Reference.pageNames.GETTINGRUBBER_PAGE); + if (button.id == 2) + collection.changeActivePage(Reference.pageNames.CRAFTINGPLATES_PAGE); + + } } diff --git a/src/main/java/techreborn/manual/pages/TitledPage.java b/src/main/java/techreborn/manual/pages/TitledPage.java index e0bf5a2c3..b74f83d80 100644 --- a/src/main/java/techreborn/manual/pages/TitledPage.java +++ b/src/main/java/techreborn/manual/pages/TitledPage.java @@ -3,20 +3,25 @@ package techreborn.manual.pages; import net.minecraft.client.Minecraft; import techreborn.manual.PageCollection; -public class TitledPage extends BasePage { - private String title; - public boolean drawTitle = true; - private int colour; +public class TitledPage extends BasePage +{ + private String title; + public boolean drawTitle = true; + private int colour; - public TitledPage(String name, boolean showInMenue, PageCollection collection, String unlocalizedTitle, int colour) { - super(name, showInMenue, collection); - this.title = unlocalizedTitle; - this.colour = colour; - } + public TitledPage(String name, boolean showInMenue, PageCollection collection, String unlocalizedTitle, int colour) + { + super(name, showInMenue, collection); + this.title = unlocalizedTitle; + this.colour = colour; + } - @Override - public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { - if (title == null) title = INDEX_NAME; - if (drawTitle) drawCenteredString(minecraft.fontRendererObj, ttl(title), offsetX + 70, offsetY + 10, colour); - } + @Override + public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) + { + if (title == null) + title = INDEX_NAME; + if (drawTitle) + drawCenteredString(minecraft.fontRendererObj, ttl(title), offsetX + 70, offsetY + 10, colour); + } } diff --git a/src/main/java/techreborn/manual/pages/ToolsPage.java b/src/main/java/techreborn/manual/pages/ToolsPage.java index 50b9dc1af..5a3b7491d 100644 --- a/src/main/java/techreborn/manual/pages/ToolsPage.java +++ b/src/main/java/techreborn/manual/pages/ToolsPage.java @@ -1,5 +1,7 @@ package techreborn.manual.pages; +import java.awt.*; + import net.minecraft.client.gui.GuiButton; import net.minecraft.item.ItemStack; import techreborn.init.ModItems; @@ -8,55 +10,70 @@ import techreborn.manual.Reference; import techreborn.manual.util.ButtonUtil; import techreborn.manual.util.GuiButtonItemTexture; -import java.awt.*; - public class ToolsPage extends TitledPage -{ - public ToolsPage(String name, PageCollection collection) - { - super(name, false, collection, Reference.TOOLS_KEY, Color.white.getRGB()); - } - - @Override - public void initGui() - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - ButtonUtil.addNextButton(1, width / 2 + 40, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModItems.ironDrill), - ModItems.ironDrill.getUnlocalizedName(), ttl(ModItems.ironDrill.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModItems.diamondDrill), - ModItems.diamondDrill.getUnlocalizedName(), ttl(ModItems.diamondDrill.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, new ItemStack(ModItems.advancedDrill), - ModItems.advancedDrill.getUnlocalizedName(), ttl(ModItems.advancedDrill.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, new ItemStack(ModItems.ironChainsaw), - ModItems.ironChainsaw.getUnlocalizedName(), ttl(ModItems.ironChainsaw.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(6, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, new ItemStack(ModItems.diamondChainsaw), - ModItems.diamondChainsaw.getUnlocalizedName(), ttl(ModItems.diamondChainsaw.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(7, getXMin() + 20, getYMin() + 120, 0, 46, 100, 20, new ItemStack(ModItems.advancedChainsaw), - ModItems.advancedChainsaw.getUnlocalizedName(), ttl(ModItems.advancedChainsaw.getUnlocalizedName() + ".name"))); - } - - @Override - public void actionPerformed(GuiButton button) - { - if (button.id == 0) collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); - if (button.id == 1) - { - buttonList.clear(); - ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); - buttonList.add(new GuiButtonItemTexture(8, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, new ItemStack(ModItems.omniTool), - ModItems.omniTool.getUnlocalizedName(), ttl(ModItems.omniTool.getUnlocalizedName() + ".name"))); - buttonList.add(new GuiButtonItemTexture(9, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, new ItemStack(ModItems.treeTap), - ModItems.treeTap.getUnlocalizedName(), ttl(ModItems.treeTap.getUnlocalizedName() + ".name"))); - } - if (button.id == 2) collection.changeActivePage(ModItems.ironDrill.getUnlocalizedName() + ".name"); - if (button.id == 3) collection.changeActivePage(ModItems.diamondDrill.getUnlocalizedName() + ".name"); - if (button.id == 4) collection.changeActivePage(ModItems.advancedDrill.getUnlocalizedName() + ".name"); - if (button.id == 5) collection.changeActivePage(ModItems.ironChainsaw.getUnlocalizedName() + ".name"); - if (button.id == 6) collection.changeActivePage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name"); - if (button.id == 7) collection.changeActivePage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name"); - if (button.id == 8) collection.changeActivePage(ModItems.omniTool.getUnlocalizedName() + ".name"); - if (button.id == 9) collection.changeActivePage(ModItems.treeTap.getUnlocalizedName() + ".name"); - } +{ + public ToolsPage(String name, PageCollection collection) + { + super(name, false, collection, Reference.TOOLS_KEY, Color.white.getRGB()); + } + + @Override + public void initGui() + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + ButtonUtil.addNextButton(1, width / 2 + 40, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(2, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + new ItemStack(ModItems.ironDrill), ModItems.ironDrill.getUnlocalizedName(), + ttl(ModItems.ironDrill.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(3, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModItems.diamondDrill), ModItems.diamondDrill.getUnlocalizedName(), + ttl(ModItems.diamondDrill.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(4, getXMin() + 20, getYMin() + 60, 0, 46, 100, 20, + new ItemStack(ModItems.advancedDrill), ModItems.advancedDrill.getUnlocalizedName(), + ttl(ModItems.advancedDrill.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(5, getXMin() + 20, getYMin() + 80, 0, 46, 100, 20, + new ItemStack(ModItems.ironChainsaw), ModItems.ironChainsaw.getUnlocalizedName(), + ttl(ModItems.ironChainsaw.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(6, getXMin() + 20, getYMin() + 100, 0, 46, 100, 20, + new ItemStack(ModItems.diamondChainsaw), ModItems.diamondChainsaw.getUnlocalizedName(), + ttl(ModItems.diamondChainsaw.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(7, getXMin() + 20, getYMin() + 120, 0, 46, 100, 20, + new ItemStack(ModItems.advancedChainsaw), ModItems.advancedChainsaw.getUnlocalizedName(), + ttl(ModItems.advancedChainsaw.getUnlocalizedName() + ".name"))); + } + + @Override + public void actionPerformed(GuiButton button) + { + if (button.id == 0) + collection.changeActivePage(Reference.pageNames.CONTENTS_PAGE); + if (button.id == 1) + { + buttonList.clear(); + ButtonUtil.addBackButton(0, width / 2 - 60, height / 2 + 64, buttonList); + buttonList.add(new GuiButtonItemTexture(8, getXMin() + 20, getYMin() + 20, 0, 46, 100, 20, + new ItemStack(ModItems.omniTool), ModItems.omniTool.getUnlocalizedName(), + ttl(ModItems.omniTool.getUnlocalizedName() + ".name"))); + buttonList.add(new GuiButtonItemTexture(9, getXMin() + 20, getYMin() + 40, 0, 46, 100, 20, + new ItemStack(ModItems.treeTap), ModItems.treeTap.getUnlocalizedName(), + ttl(ModItems.treeTap.getUnlocalizedName() + ".name"))); + } + if (button.id == 2) + collection.changeActivePage(ModItems.ironDrill.getUnlocalizedName() + ".name"); + if (button.id == 3) + collection.changeActivePage(ModItems.diamondDrill.getUnlocalizedName() + ".name"); + if (button.id == 4) + collection.changeActivePage(ModItems.advancedDrill.getUnlocalizedName() + ".name"); + if (button.id == 5) + collection.changeActivePage(ModItems.ironChainsaw.getUnlocalizedName() + ".name"); + if (button.id == 6) + collection.changeActivePage(ModItems.diamondChainsaw.getUnlocalizedName() + ".name"); + if (button.id == 7) + collection.changeActivePage(ModItems.advancedChainsaw.getUnlocalizedName() + ".name"); + if (button.id == 8) + collection.changeActivePage(ModItems.omniTool.getUnlocalizedName() + ".name"); + if (button.id == 9) + collection.changeActivePage(ModItems.treeTap.getUnlocalizedName() + ".name"); + } } diff --git a/src/main/java/techreborn/manual/util/ButtonUtil.java b/src/main/java/techreborn/manual/util/ButtonUtil.java index 601408cb3..b39aea483 100644 --- a/src/main/java/techreborn/manual/util/ButtonUtil.java +++ b/src/main/java/techreborn/manual/util/ButtonUtil.java @@ -1,22 +1,22 @@ package techreborn.manual.util; +import java.util.List; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.List; - @SideOnly(Side.CLIENT) -public class ButtonUtil +public class ButtonUtil { @SideOnly(Side.CLIENT) public static void addBackButton(int ID, int X, int Y, List buttonList) { - buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 11, 10, 16)); + buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 11, 10, 16)); } - + @SideOnly(Side.CLIENT) public static void addNextButton(int ID, int X, int Y, List buttonList) { - buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 1, 10, 17)); + buttonList.add(new GuiButtonCustomTexture(ID, X, Y, 50, 60, 17, 12, "button", "", "", 0, 1, 10, 17)); } } diff --git a/src/main/java/techreborn/manual/util/GuiButtonAHeight.java b/src/main/java/techreborn/manual/util/GuiButtonAHeight.java index 6f1e01a38..3dcb2c412 100644 --- a/src/main/java/techreborn/manual/util/GuiButtonAHeight.java +++ b/src/main/java/techreborn/manual/util/GuiButtonAHeight.java @@ -4,45 +4,59 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.OpenGlHelper; + import org.lwjgl.opengl.GL11; -public class GuiButtonAHeight extends GuiButton { +public class GuiButtonAHeight extends GuiButton +{ - public GuiButtonAHeight(int id, int xPos, int yPos, int width, int hight, String displayString) { - super(id, xPos, yPos, width, hight, displayString); - } + public GuiButtonAHeight(int id, int xPos, int yPos, int width, int hight, String displayString) + { + super(id, xPos, yPos, width, hight, displayString); + } - @Override - public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { - if (this.visible) { - FontRenderer fontrenderer = minecraft.fontRendererObj; - minecraft.getTextureManager().bindTexture(buttonTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; - int k = this.getHoverState(this.hovered); - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); - this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); + @Override + public void drawButton(Minecraft minecraft, int mouseX, int mouseY) + { + if (this.visible) + { + FontRenderer fontrenderer = minecraft.fontRendererObj; + minecraft.getTextureManager().bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.hovered); + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, + 46 + k * 20, this.width / 2, this.height); - if (this.height < 20) { - this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width / 2, height - 3); - this.drawTexturedModalRect(xPosition + width / 2, yPosition + 3, 200 - width / 2, (46 + k * 20) + 20 - height + 3, width / 2, height - 3); - } + if (this.height < 20) + { + this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width / 2, + height - 3); + this.drawTexturedModalRect(xPosition + width / 2, yPosition + 3, 200 - width / 2, + (46 + k * 20) + 20 - height + 3, width / 2, height - 3); + } - this.mouseDragged(minecraft, mouseX, mouseY); - int l = 14737632; + this.mouseDragged(minecraft, mouseX, mouseY); + int l = 14737632; - if (packedFGColour != 0) { - l = packedFGColour; - } else if (!this.enabled) { - l = 10526880; - } else if (this.hovered) { - l = 16777120; - } - this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l); - } - } + if (packedFGColour != 0) + { + l = packedFGColour; + } else if (!this.enabled) + { + l = 10526880; + } else if (this.hovered) + { + l = 16777120; + } + this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, + this.yPosition + (this.height - 8) / 2, l); + } + } } diff --git a/src/main/java/techreborn/manual/util/GuiButtonCustomTexture.java b/src/main/java/techreborn/manual/util/GuiButtonCustomTexture.java index 9ad089b3f..469516038 100644 --- a/src/main/java/techreborn/manual/util/GuiButtonCustomTexture.java +++ b/src/main/java/techreborn/manual/util/GuiButtonCustomTexture.java @@ -1,21 +1,22 @@ package techreborn.manual.util; +import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.config.GuiButtonExt; -import org.lwjgl.opengl.GL11; -import java.awt.*; +import org.lwjgl.opengl.GL11; public class GuiButtonCustomTexture extends GuiButtonExt { - public int textureU; - public int textureV; - public String texturename; - public String LINKED_PAGE; - public String NAME; + public int textureU; + public int textureV; + public String texturename; + public String LINKED_PAGE; + public String NAME; public String imageprefix = "techreborn:textures/manual/elements/"; public int buttonHeight; public int buttonWidth; @@ -24,52 +25,53 @@ public class GuiButtonCustomTexture extends GuiButtonExt public int textureH; public int textureW; - public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int buttonWidth, int buttonHeight, String texturename, String linkedPage, String name, int buttonU, int buttonV, int textureH, int textureW) - { - super(id, xPos, yPos, buttonWidth, buttonHeight, "_"); - this.textureU = u; - this.textureV = v; - this.texturename = texturename; - this.NAME = name; - this.LINKED_PAGE = linkedPage; - this.buttonHeight = height; - this.buttonWidth = width; - this.buttonU = buttonU; - this.buttonV = buttonV; - this.textureH = textureH; - this.textureW = textureW; - } - - public void drawButton(Minecraft mc, int mouseX, int mouseY) - { - if (this.visible) - { - boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition - && mouseX < this.xPosition + this.width - && mouseY < this.yPosition + this.height; - mc.getTextureManager().bindTexture(buttonTextures); - int u = textureU; - int v = textureV; + public GuiButtonCustomTexture(int id, int xPos, int yPos, int u, int v, int buttonWidth, int buttonHeight, + String texturename, String linkedPage, String name, int buttonU, int buttonV, int textureH, int textureW) + { + super(id, xPos, yPos, buttonWidth, buttonHeight, "_"); + this.textureU = u; + this.textureV = v; + this.texturename = texturename; + this.NAME = name; + this.LINKED_PAGE = linkedPage; + this.buttonHeight = height; + this.buttonWidth = width; + this.buttonU = buttonU; + this.buttonV = buttonV; + this.textureH = textureH; + this.textureW = textureW; + } - if (flag) - { - u += width; - GL11.glPushMatrix(); - GL11.glColor4f(0f, 0f, 0f, 1f); - this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); - GL11.glPopMatrix(); - } - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(32826); - RenderHelper.enableStandardItemLighting(); - RenderHelper.enableGUIStandardItemLighting(); - renderImage(this.xPosition, this.yPosition); - this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB()); - } - } - - public void renderImage(int offsetX, int offsetY) - { + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + mc.getTextureManager().bindTexture(buttonTextures); + int u = textureU; + int v = textureV; + + if (flag) + { + u += width; + GL11.glPushMatrix(); + GL11.glColor4f(0f, 0f, 0f, 1f); + this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); + GL11.glPopMatrix(); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); + renderImage(this.xPosition, this.yPosition); + this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, + Color.white.getRGB()); + } + } + + public void renderImage(int offsetX, int offsetY) + { TextureManager render = Minecraft.getMinecraft().renderEngine; render.bindTexture(new ResourceLocation(imageprefix + this.texturename + ".png")); @@ -78,10 +80,10 @@ public class GuiButtonCustomTexture extends GuiButtonExt GL11.glColor4f(1F, 1F, 1F, 1F); drawTexturedModalRect(offsetX, offsetY, this.buttonU, this.buttonV, this.textureW, this.textureH); GL11.glDisable(GL11.GL_BLEND); - } + } - public boolean getIsHovering() - { - return hovered; - } + public boolean getIsHovering() + { + return hovered; + } } diff --git a/src/main/java/techreborn/manual/util/GuiButtonItemTexture.java b/src/main/java/techreborn/manual/util/GuiButtonItemTexture.java index 56b9314a8..1cd06513f 100644 --- a/src/main/java/techreborn/manual/util/GuiButtonItemTexture.java +++ b/src/main/java/techreborn/manual/util/GuiButtonItemTexture.java @@ -1,59 +1,67 @@ package techreborn.manual.util; +import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderItem; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.client.config.GuiButtonExt; + import org.lwjgl.opengl.GL11; -import java.awt.*; +public class GuiButtonItemTexture extends GuiButtonExt +{ -public class GuiButtonItemTexture extends GuiButtonExt { + public int textureU; + public int textureV; + public ItemStack itemstack; + public String LINKED_PAGE; + public String NAME; - public int textureU; - public int textureV; - public ItemStack itemstack; - public String LINKED_PAGE; - public String NAME; + public GuiButtonItemTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack, + String linkedPage, String name) + { + super(id, xPos, yPos, width, height, "_"); + textureU = u; + textureV = v; + itemstack = stack; + NAME = name; + this.LINKED_PAGE = linkedPage; + } - public GuiButtonItemTexture(int id, int xPos, int yPos, int u, int v, int width, int height, ItemStack stack, String linkedPage, String name) { - super(id, xPos, yPos, width, height, "_"); - textureU = u; - textureV = v; - itemstack = stack; - NAME = name; - this.LINKED_PAGE = linkedPage; - } + public void drawButton(Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + mc.getTextureManager().bindTexture(buttonTextures); + int u = textureU; + int v = textureV; - public void drawButton(Minecraft mc, int mouseX, int mouseY) { - if (this.visible) { - boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition - && mouseX < this.xPosition + this.width - && mouseY < this.yPosition + this.height; - mc.getTextureManager().bindTexture(buttonTextures); - int u = textureU; - int v = textureV; - - if (flag) { - u += width; - GL11.glPushMatrix(); - GL11.glColor4f(0f, 0f, 0f, 1f); - this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); - GL11.glPopMatrix(); - } - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(32826); - RenderHelper.enableStandardItemLighting(); - RenderHelper.enableGUIStandardItemLighting(); + if (flag) + { + u += width; + GL11.glPushMatrix(); + GL11.glColor4f(0f, 0f, 0f, 1f); + this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); + GL11.glPopMatrix(); + } + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(32826); + RenderHelper.enableStandardItemLighting(); + RenderHelper.enableGUIStandardItemLighting(); RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem(); itemRenderer.renderItemIntoGUI(itemstack, this.xPosition, this.yPosition); - this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB()); - } - } + this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, + Color.white.getRGB()); + } + } - public boolean getIsHovering() { - return hovered; - } + public boolean getIsHovering() + { + return hovered; + } } diff --git a/src/main/java/techreborn/manual/util/GuiButtonTextOnly.java b/src/main/java/techreborn/manual/util/GuiButtonTextOnly.java index 27f16160b..279e8888c 100644 --- a/src/main/java/techreborn/manual/util/GuiButtonTextOnly.java +++ b/src/main/java/techreborn/manual/util/GuiButtonTextOnly.java @@ -1,63 +1,77 @@ package techreborn.manual.util; +import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.util.text.TextFormatting; + import org.lwjgl.opengl.GL11; -import java.awt.*; +public class GuiButtonTextOnly extends GuiButton +{ + public String LINKED_PAGE; + public int textColour; -public class GuiButtonTextOnly extends GuiButton { - public String LINKED_PAGE; - public int textColour; + public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, + int colour) + { + super(id, xPos, yPos, width, hight, displayString); + this.LINKED_PAGE = linkedPage; + this.textColour = colour; + } - public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) { - super(id, xPos, yPos, width, hight, displayString); - this.LINKED_PAGE = linkedPage; - this.textColour = colour; - } + @Override + public void drawButton(Minecraft minecraft, int mouseX, int mouseY) + { + if (this.visible) + { + FontRenderer fontrenderer = minecraft.fontRendererObj; + minecraft.getTextureManager().bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height; + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - @Override - public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { - if (this.visible) { - FontRenderer fontrenderer = minecraft.fontRendererObj; - minecraft.getTextureManager().bindTexture(buttonTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; - GL11.glEnable(GL11.GL_BLEND); - OpenGlHelper.glBlendFunc(770, 771, 1, 0); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.mouseDragged(minecraft, mouseX, mouseY); - this.mouseDragged(minecraft, mouseX, mouseY); + String trimmedDisplayString = displayString; + if (fontrenderer.getStringWidth(displayString) > width + 30 && !this.hovered) + { + int energencyBreak = 0; + while (fontrenderer.getStringWidth(trimmedDisplayString) * 0.7 > width - 5) + { + trimmedDisplayString = trimmedDisplayString.substring(0, trimmedDisplayString.length() - 1); + energencyBreak++; + if (energencyBreak > 100) + break; + } + trimmedDisplayString += "..."; + } - String trimmedDisplayString = displayString; - if (fontrenderer.getStringWidth(displayString) > width + 30 && !this.hovered) { - int energencyBreak = 0; - while (fontrenderer.getStringWidth(trimmedDisplayString) * 0.7 > width - 5) { - trimmedDisplayString = trimmedDisplayString.substring(0, trimmedDisplayString.length() - 1); - energencyBreak++; - if (energencyBreak > 100) break; - } - trimmedDisplayString += "..."; - } + if (this.hovered) + { + trimmedDisplayString = TextFormatting.BOLD + "" + TextFormatting.ITALIC + trimmedDisplayString; + GL11.glPushMatrix(); + GL11.glColor4f(0f, 0f, 0f, 1f); + drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46, + (int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8); + GL11.glPopMatrix(); + } + GL11.glPushMatrix(); + GL11.glScalef(0.7F, 0.7F, 1); + fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45), + (int) ((yPosition + (height - 8) / 2) * 1.45), Color.WHITE.getRGB()); + GL11.glPopMatrix(); + } + } - if (this.hovered) { - trimmedDisplayString = TextFormatting.BOLD + "" + TextFormatting.ITALIC + trimmedDisplayString; - GL11.glPushMatrix(); - GL11.glColor4f(0f, 0f, 0f, 1f); - drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46, (int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8); - GL11.glPopMatrix(); - } - GL11.glPushMatrix(); - GL11.glScalef(0.7F, 0.7F, 1); - fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45), (int) ((yPosition + (height - 8) / 2) * 1.45), Color.WHITE.getRGB()); - GL11.glPopMatrix(); - } - } - - public boolean getIsHovering() { - return hovered; - } + public boolean getIsHovering() + { + return hovered; + } } diff --git a/src/main/java/techreborn/multiblocks/MultiBlockCasing.java b/src/main/java/techreborn/multiblocks/MultiBlockCasing.java index 8c7126165..77e1ac0c6 100644 --- a/src/main/java/techreborn/multiblocks/MultiBlockCasing.java +++ b/src/main/java/techreborn/multiblocks/MultiBlockCasing.java @@ -12,428 +12,476 @@ import reborncore.common.multiblock.MultiblockValidationException; import reborncore.common.multiblock.rectangular.RectangularMultiblockControllerBase; import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase; -public class MultiBlockCasing extends RectangularMultiblockControllerBase { +public class MultiBlockCasing extends RectangularMultiblockControllerBase +{ - public boolean hasLava; - public boolean isStar = false; - public int height = 0; + public boolean hasLava; + public boolean isStar = false; + public int height = 0; - public MultiBlockCasing(World world) { - super(world); - } + public MultiBlockCasing(World world) + { + super(world); + } + public String getInfo() + { + String value = "Intact"; + try + { + isMachineWhole(); + } catch (MultiblockValidationException e) + { + e.printStackTrace(); + value = e.getLocalizedMessage(); + } + return value; + } - public String getInfo(){ - String value = "Intact"; - try { - isMachineWhole(); - } catch (MultiblockValidationException e) { - e.printStackTrace(); - value = e.getLocalizedMessage(); - } - return value; - } + /** + * @return True if the machine is "whole" and should be assembled. False + * otherwise. + */ + @Override + protected void isMachineWhole() throws MultiblockValidationException + { + if (connectedParts.size() < getMinimumNumberOfBlocksForAssembledMachine()) + { + throw new MultiblockValidationException("Machine is too small."); + } - /** - * @return True if the machine is "whole" and should be assembled. False - * otherwise. - */ - @Override - protected void isMachineWhole() throws MultiblockValidationException { - if (connectedParts.size() < getMinimumNumberOfBlocksForAssembledMachine()) { - throw new MultiblockValidationException("Machine is too small."); - } + CoordTriplet maximumCoord = getMaximumCoord(); + CoordTriplet minimumCoord = getMinimumCoord(); - CoordTriplet maximumCoord = getMaximumCoord(); - CoordTriplet minimumCoord = getMinimumCoord(); + // Quickly check for exceeded dimensions + int deltaX = maximumCoord.x - minimumCoord.x + 1; + int deltaY = maximumCoord.y - minimumCoord.y + 1; + int deltaZ = maximumCoord.z - minimumCoord.z + 1; - // Quickly check for exceeded dimensions - int deltaX = maximumCoord.x - minimumCoord.x + 1; - int deltaY = maximumCoord.y - minimumCoord.y + 1; - int deltaZ = maximumCoord.z - minimumCoord.z + 1; + int maxX = getMaximumXSize(); + int maxY = getMaximumYSize(); + int maxZ = getMaximumZSize(); + int minX = getMinimumXSize(); + int minY = getMinimumYSize(); + int minZ = getMinimumZSize(); - int maxX = getMaximumXSize(); - int maxY = getMaximumYSize(); - int maxZ = getMaximumZSize(); - int minX = getMinimumXSize(); - int minY = getMinimumYSize(); - int minZ = getMinimumZSize(); + if (maxX > 0 && deltaX > maxX) + { + throw new MultiblockValidationException( + String.format("Machine is too large, it may be at most %d blocks in the X dimension", maxX)); + } + if (maxY > 0 && deltaY > maxY) + { + throw new MultiblockValidationException( + String.format("Machine is too large, it may be at most %d blocks in the Y dimension", maxY)); + } + if (maxZ > 0 && deltaZ > maxZ) + { + throw new MultiblockValidationException( + String.format("Machine is too large, it may be at most %d blocks in the Z dimension", maxZ)); + } + if (deltaX < minX) + { + throw new MultiblockValidationException( + String.format("Machine is too small, it must be at least %d blocks in the X dimension", minX)); + } + if (deltaY < minY) + { + throw new MultiblockValidationException( + String.format("Machine is too small, it must be at least %d blocks in the Y dimension", minY)); + } + if (deltaZ < minZ) + { + throw new MultiblockValidationException( + String.format("Machine is too small, it must be at least %d blocks in the Z dimension", minZ)); + } + height = deltaY; - if (maxX > 0 && deltaX > maxX) { - throw new MultiblockValidationException( - String.format( - "Machine is too large, it may be at most %d blocks in the X dimension", - maxX)); - } - if (maxY > 0 && deltaY > maxY) { - throw new MultiblockValidationException( - String.format( - "Machine is too large, it may be at most %d blocks in the Y dimension", - maxY)); - } - if (maxZ > 0 && deltaZ > maxZ) { - throw new MultiblockValidationException( - String.format( - "Machine is too large, it may be at most %d blocks in the Z dimension", - maxZ)); - } - if (deltaX < minX) { - throw new MultiblockValidationException( - String.format( - "Machine is too small, it must be at least %d blocks in the X dimension", - minX)); - } - if (deltaY < minY) { - throw new MultiblockValidationException( - String.format( - "Machine is too small, it must be at least %d blocks in the Y dimension", - minY)); - } - if (deltaZ < minZ) { - throw new MultiblockValidationException( - String.format( - "Machine is too small, it must be at least %d blocks in the Z dimension", - minZ)); - } - height = deltaY; + // if(checkIfStarShape(minimumCoord.x, minimumCoord.y, minimumCoord.z)){ + // isStar = true; + // return; + // } else { + // isStar = false; + // } -// if(checkIfStarShape(minimumCoord.x, minimumCoord.y, minimumCoord.z)){ -// isStar = true; -// return; -// } else { -// isStar = false; -// } + if (deltaY < minY) + { + throw new MultiblockValidationException( + String.format("Machine is too small, it must be at least %d blocks in the Y dimension", minY)); + } - if (deltaY < minY) { - throw new MultiblockValidationException( - String.format( - "Machine is too small, it must be at least %d blocks in the Y dimension", - minY)); - } + // Now we run a simple check on each block within that volume. + // Any block deviating = NO DEAL SIR + TileEntity te; + RectangularMultiblockTileEntityBase part; + Class myClass = this.getClass(); - // Now we run a simple check on each block within that volume. - // Any block deviating = NO DEAL SIR - TileEntity te; - RectangularMultiblockTileEntityBase part; - Class myClass = this - .getClass(); + for (int x = minimumCoord.x; x <= maximumCoord.x; x++) + { + for (int y = minimumCoord.y; y <= maximumCoord.y; y++) + { + for (int z = minimumCoord.z; z <= maximumCoord.z; z++) + { + // Okay, figure out what sort of block this should be. - for (int x = minimumCoord.x; x <= maximumCoord.x; x++) { - for (int y = minimumCoord.y; y <= maximumCoord.y; y++) { - for (int z = minimumCoord.z; z <= maximumCoord.z; z++) { - // Okay, figure out what sort of block this should be. + te = this.worldObj.getTileEntity(new BlockPos(x, y, z)); + if (te instanceof RectangularMultiblockTileEntityBase) + { + part = (RectangularMultiblockTileEntityBase) te; - te = this.worldObj.getTileEntity(new BlockPos(x, y, z)); - if (te instanceof RectangularMultiblockTileEntityBase) { - part = (RectangularMultiblockTileEntityBase) te; + // Ensure this part should actually be allowed within a + // cube of this controller's type + if (!myClass.equals(part.getMultiblockControllerType())) + { + throw new MultiblockValidationException( + String.format("Part @ %d, %d, %d is incompatible with machines of type %s", x, y, z, + myClass.getSimpleName())); + } + } else + { + // This is permitted so that we can incorporate certain + // non-multiblock parts inside interiors + part = null; + } - // Ensure this part should actually be allowed within a - // cube of this controller's type - if (!myClass.equals(part.getMultiblockControllerType())) { - throw new MultiblockValidationException( - String.format( - "Part @ %d, %d, %d is incompatible with machines of type %s", - x, y, z, myClass.getSimpleName())); - } - } else { - // This is permitted so that we can incorporate certain - // non-multiblock parts inside interiors - part = null; - } + // Validate block type against both part-level and + // material-level validators. + int extremes = 0; + if (x == minimumCoord.x) + { + extremes++; + } + if (y == minimumCoord.y) + { + extremes++; + } + if (z == minimumCoord.z) + { + extremes++; + } - // Validate block type against both part-level and - // material-level validators. - int extremes = 0; - if (x == minimumCoord.x) { - extremes++; - } - if (y == minimumCoord.y) { - extremes++; - } - if (z == minimumCoord.z) { - extremes++; - } + if (x == maximumCoord.x) + { + extremes++; + } + if (y == maximumCoord.y) + { + extremes++; + } + if (z == maximumCoord.z) + { + extremes++; + } - if (x == maximumCoord.x) { - extremes++; - } - if (y == maximumCoord.y) { - extremes++; - } - if (z == maximumCoord.z) { - extremes++; - } + if (extremes >= 2) + { + if (part != null) + { + part.isGoodForFrame(); + } else + { + isBlockGoodForFrame(this.worldObj, x, y, z); + } + } else if (extremes == 1) + { + if (y == maximumCoord.y) + { + if (part != null) + { + part.isGoodForTop(); + } else + { + isBlockGoodForTop(this.worldObj, x, y, z); + } + } else if (y == minimumCoord.y) + { + if (part != null) + { + part.isGoodForBottom(); + } else + { + isBlockGoodForBottom(this.worldObj, x, y, z); + } + } else + { + // Side + if (part != null) + { + part.isGoodForSides(); + } else + { + isBlockGoodForSides(this.worldObj, x, y, z); + } + } + } else + { + if (part != null) + { + part.isGoodForInterior(); + } else + { + isBlockGoodForInterior(this.worldObj, x, y, z); + } + } + } + } + } + } - if (extremes >= 2) { - if (part != null) { - part.isGoodForFrame(); - } else { - isBlockGoodForFrame(this.worldObj, x, y, z); - } - } else if (extremes == 1) { - if (y == maximumCoord.y) { - if (part != null) { - part.isGoodForTop(); - } else { - isBlockGoodForTop(this.worldObj, x, y, z); - } - } else if (y == minimumCoord.y) { - if (part != null) { - part.isGoodForBottom(); - } else { - isBlockGoodForBottom(this.worldObj, x, y, z); - } - } else { - // Side - if (part != null) { - part.isGoodForSides(); - } else { - isBlockGoodForSides(this.worldObj, x, y, z); - } - } - } else { - if (part != null) { - part.isGoodForInterior(); - } else { - isBlockGoodForInterior(this.worldObj, x, y, z); - } - } - } - } - } - } + @Override + public void onAttachedPartWithMultiblockData(IMultiblockPart part, NBTTagCompound data) + { + } - @Override - public void onAttachedPartWithMultiblockData(IMultiblockPart part, - NBTTagCompound data) { + @Override + protected void onBlockAdded(IMultiblockPart newPart) + { + } - } + @Override + protected void onBlockRemoved(IMultiblockPart oldPart) + { - @Override - protected void onBlockAdded(IMultiblockPart newPart) { - } + } - @Override - protected void onBlockRemoved(IMultiblockPart oldPart) { + @Override + protected void onMachineAssembled() + { - } + } - @Override - protected void onMachineAssembled() { + @Override + protected void onMachineRestored() + { - } + } - @Override - protected void onMachineRestored() { + @Override + protected void onMachinePaused() + { - } + } - @Override - protected void onMachinePaused() { + @Override + protected void onMachineDisassembled() + { - } + } - @Override - protected void onMachineDisassembled() { + @Override + protected int getMinimumNumberOfBlocksForAssembledMachine() + { + return 1; + } - } + @Override + protected int getMaximumXSize() + { + return 3; + } - @Override - protected int getMinimumNumberOfBlocksForAssembledMachine() { - return 1; - } + @Override + protected int getMaximumZSize() + { + return 3; + } - @Override - protected int getMaximumXSize() { - return 3; - } + @Override + protected int getMaximumYSize() + { + return 4; + } - @Override - protected int getMaximumZSize() { - return 3; - } + @Override + protected int getMinimumXSize() + { + return 3; + } - @Override - protected int getMaximumYSize() { - return 4; - } + @Override + protected int getMinimumYSize() + { + return 3; + } - @Override - protected int getMinimumXSize() { - return 3; - } + @Override + protected int getMinimumZSize() + { + return 3; + } - @Override - protected int getMinimumYSize() { - return 3; - } + @Override + protected void onAssimilate(MultiblockControllerBase assimilated) + { - @Override - protected int getMinimumZSize() { - return 3; - } + } - @Override - protected void onAssimilate(MultiblockControllerBase assimilated) { + @Override + protected void onAssimilated(MultiblockControllerBase assimilator) + { - } + } - @Override - protected void onAssimilated(MultiblockControllerBase assimilator) { + @Override + protected boolean updateServer() + { + return true; + } - } + @Override + protected void updateClient() + { - @Override - protected boolean updateServer() { - return true; - } + } - @Override - protected void updateClient() { + @Override + public void writeToNBT(NBTTagCompound data) + { - } + } - @Override - public void writeToNBT(NBTTagCompound data) { + @Override + public void readFromNBT(NBTTagCompound data) + { - } + } - @Override - public void readFromNBT(NBTTagCompound data) { + @Override + public void formatDescriptionPacket(NBTTagCompound data) + { - } + } - @Override - public void formatDescriptionPacket(NBTTagCompound data) { + @Override + public void decodeDescriptionPacket(NBTTagCompound data) + { - } + } - @Override - public void decodeDescriptionPacket(NBTTagCompound data) { + @Override + protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException + { + Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock(); - } + if (block.isAir(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) + { - @Override - protected void isBlockGoodForInterior(World world, int x, int y, int z) - throws MultiblockValidationException { - Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock(); + } else if (block.getUnlocalizedName().equals("tile.lava")) + { + hasLava = true; + } else + { + super.isBlockGoodForInterior(world, x, y, z); + } + } - - if (block.isAir(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) { - - } else if (block.getUnlocalizedName().equals("tile.lava")) { - hasLava = true; - } else { - super.isBlockGoodForInterior(world, x, y, z); - } - } - - -// /** -// * This is horrible code, don't look at this -// * -// * @param x -// * @param y -// * @param z -// * @return -// */ -// -// public boolean checkIfStarShape(int x, int y, int z) { -// boolean isSolid = true; -// -// TileEntity te; -// {//corners -// te = this.worldObj.getTileEntity(x, y, z); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 2, y, z); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x, y, z + 2); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 2, y, z + 2); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x, y + 2, z); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 2, y + 2, z); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x, y + 2, z + 2); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 2, y + 2, z + 2); -// isSolid = checkTeIsCorner(te); -// if (!isSolid) { -// return false; -// } -// } -// {//middle blocks -// for (int i = 0; i < 3; i++) { -// System.out.println(this.worldObj.getBlock(x, y - 1, z)); -// te = this.worldObj.getTileEntity(x + 1, y + i, z); -// isSolid = checkTeIsCenter(te); -// if (!isSolid) { -// return false; -// } -// te = this.worldObj.getTileEntity(x, y + i, z + 1); -// isSolid = checkTeIsCenter(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 1, y + i, z + 1); -// isSolid = checkTeIsCenter(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 2, y + i, z + 1); -// isSolid = checkTeIsCenter(te); -// if (!isSolid) { -// return false; -// } -// -// te = this.worldObj.getTileEntity(x + 1, y + i, z + 2); -// isSolid = checkTeIsCenter(te); -// if (!isSolid) { -// return false; -// } -// } -// } -// return isSolid; -// } -// -// public boolean checkTeIsCorner(TileEntity te) { -// return (te.blockType instanceof BlockMachineCasing && te.blockMetadata == 0); -// } -// -// public boolean checkTeIsCenter(TileEntity te) { -// return (te.blockType instanceof BlockMachineCasing && te.blockMetadata == 1); -// } + // /** + // * This is horrible code, don't look at this + // * + // * @param x + // * @param y + // * @param z + // * @return + // */ + // + // public boolean checkIfStarShape(int x, int y, int z) { + // boolean isSolid = true; + // + // TileEntity te; + // {//corners + // te = this.worldObj.getTileEntity(x, y, z); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 2, y, z); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x, y, z + 2); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 2, y, z + 2); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x, y + 2, z); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 2, y + 2, z); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x, y + 2, z + 2); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 2, y + 2, z + 2); + // isSolid = checkTeIsCorner(te); + // if (!isSolid) { + // return false; + // } + // } + // {//middle blocks + // for (int i = 0; i < 3; i++) { + // System.out.println(this.worldObj.getBlock(x, y - 1, z)); + // te = this.worldObj.getTileEntity(x + 1, y + i, z); + // isSolid = checkTeIsCenter(te); + // if (!isSolid) { + // return false; + // } + // te = this.worldObj.getTileEntity(x, y + i, z + 1); + // isSolid = checkTeIsCenter(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 1, y + i, z + 1); + // isSolid = checkTeIsCenter(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 2, y + i, z + 1); + // isSolid = checkTeIsCenter(te); + // if (!isSolid) { + // return false; + // } + // + // te = this.worldObj.getTileEntity(x + 1, y + i, z + 2); + // isSolid = checkTeIsCenter(te); + // if (!isSolid) { + // return false; + // } + // } + // } + // return isSolid; + // } + // + // public boolean checkTeIsCorner(TileEntity te) { + // return (te.blockType instanceof BlockMachineCasing && te.blockMetadata == + // 0); + // } + // + // public boolean checkTeIsCenter(TileEntity te) { + // return (te.blockType instanceof BlockMachineCasing && te.blockMetadata == + // 1); + // } } diff --git a/src/main/java/techreborn/packets/PacketAesu.java b/src/main/java/techreborn/packets/PacketAesu.java index ed86871e6..f5d8ce052 100644 --- a/src/main/java/techreborn/packets/PacketAesu.java +++ b/src/main/java/techreborn/packets/PacketAesu.java @@ -1,42 +1,48 @@ package techreborn.packets; -import io.netty.buffer.ByteBuf; -import reborncore.common.packets.SimplePacket; -import techreborn.tiles.TileAesu; - import java.io.IOException; -public class PacketAesu extends SimplePacket { +import reborncore.common.packets.SimplePacket; +import techreborn.tiles.TileAesu; +import io.netty.buffer.ByteBuf; +public class PacketAesu extends SimplePacket +{ - public PacketAesu() { - } + public PacketAesu() + { + } - int buttonID; + int buttonID; - TileAesu aesu; + TileAesu aesu; - public PacketAesu(int buttonID, TileAesu aesu) { - this.aesu = aesu; - this.buttonID = buttonID; - } + public PacketAesu(int buttonID, TileAesu aesu) + { + this.aesu = aesu; + this.buttonID = buttonID; + } - @Override - public void writeData(ByteBuf out) throws IOException { - SimplePacket.writeTileEntity(aesu, out); - out.writeInt(buttonID); - } + @Override + public void writeData(ByteBuf out) throws IOException + { + SimplePacket.writeTileEntity(aesu, out); + out.writeInt(buttonID); + } - @Override - public void readData(ByteBuf in) throws IOException { - this.aesu = (TileAesu) SimplePacket.readTileEntity(in); - buttonID = in.readInt(); - } + @Override + public void readData(ByteBuf in) throws IOException + { + this.aesu = (TileAesu) SimplePacket.readTileEntity(in); + buttonID = in.readInt(); + } - @Override - public void execute() { - if (!aesu.getWorld().isRemote) { - aesu.handleGuiInputFromClient(buttonID); - } - } + @Override + public void execute() + { + if (!aesu.getWorld().isRemote) + { + aesu.handleGuiInputFromClient(buttonID); + } + } } diff --git a/src/main/java/techreborn/packets/PacketIdsu.java b/src/main/java/techreborn/packets/PacketIdsu.java index c60d6ad19..d71c5c1c2 100644 --- a/src/main/java/techreborn/packets/PacketIdsu.java +++ b/src/main/java/techreborn/packets/PacketIdsu.java @@ -1,42 +1,48 @@ package techreborn.packets; -import io.netty.buffer.ByteBuf; -import reborncore.common.packets.SimplePacket; -import techreborn.tiles.idsu.TileIDSU; - import java.io.IOException; -public class PacketIdsu extends SimplePacket { +import reborncore.common.packets.SimplePacket; +import techreborn.tiles.idsu.TileIDSU; +import io.netty.buffer.ByteBuf; +public class PacketIdsu extends SimplePacket +{ - public PacketIdsu() { - } + public PacketIdsu() + { + } - int buttonID; + int buttonID; - TileIDSU idsu; + TileIDSU idsu; - public PacketIdsu(int buttonID, TileIDSU aesu) { - this.idsu = aesu; - this.buttonID = buttonID; - } + public PacketIdsu(int buttonID, TileIDSU aesu) + { + this.idsu = aesu; + this.buttonID = buttonID; + } - @Override - public void writeData(ByteBuf out) throws IOException { - SimplePacket.writeTileEntity(idsu, out); - out.writeInt(buttonID); - } + @Override + public void writeData(ByteBuf out) throws IOException + { + SimplePacket.writeTileEntity(idsu, out); + out.writeInt(buttonID); + } - @Override - public void readData(ByteBuf in) throws IOException { - this.idsu = (TileIDSU) SimplePacket.readTileEntity(in); - buttonID = in.readInt(); - } + @Override + public void readData(ByteBuf in) throws IOException + { + this.idsu = (TileIDSU) SimplePacket.readTileEntity(in); + buttonID = in.readInt(); + } - @Override - public void execute() { - if (!idsu.getWorld().isRemote) { - idsu.handleGuiInputFromClient(buttonID); - } - } + @Override + public void execute() + { + if (!idsu.getWorld().isRemote) + { + idsu.handleGuiInputFromClient(buttonID); + } + } } diff --git a/src/main/java/techreborn/parts/CableMultipart.java b/src/main/java/techreborn/parts/CableMultipart.java index 797ff8146..f6e02090e 100644 --- a/src/main/java/techreborn/parts/CableMultipart.java +++ b/src/main/java/techreborn/parts/CableMultipart.java @@ -1,5 +1,11 @@ package techreborn.parts; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import mcmultipart.MCMultiPartMod; import mcmultipart.microblock.IMicroblock; import mcmultipart.multipart.IMultipartContainer; @@ -7,7 +13,6 @@ import mcmultipart.multipart.INormallyOccludingPart; import mcmultipart.multipart.ISlottedPart; import mcmultipart.multipart.Multipart; import mcmultipart.multipart.MultipartHelper; -import mcmultipart.multipart.OcclusionHelper; import mcmultipart.multipart.PartSlot; import mcmultipart.raytrace.PartMOP; import net.minecraft.block.Block; @@ -44,408 +49,474 @@ import techreborn.init.ModSounds; import techreborn.power.TRPowerNet; import techreborn.utils.damageSources.ElectrialShockSource; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * Created by modmuss50 on 02/03/2016. */ -public abstract class CableMultipart extends Multipart implements INormallyOccludingPart, ISlottedPart, ITickable, ICableType { +public abstract class CableMultipart extends Multipart + implements INormallyOccludingPart, ISlottedPart, ITickable, ICableType +{ - public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14]; - public float center = 0.6F; - public float offset = 0.10F; - public Map connectedSides; - public int ticks = 0; - public ItemStack stack; - public TRPowerNet mergeWith = null; + public Vecs3dCube[] boundingBoxes = new Vecs3dCube[14]; + public float center = 0.6F; + public float offset = 0.10F; + public Map connectedSides; + public int ticks = 0; + public ItemStack stack; + public TRPowerNet mergeWith = null; - public static final IUnlistedProperty UP = Properties.toUnlisted(PropertyBool.create("up")); - public static final IUnlistedProperty DOWN = Properties.toUnlisted(PropertyBool.create("down")); - public static final IUnlistedProperty NORTH = Properties.toUnlisted(PropertyBool.create("north")); - public static final IUnlistedProperty EAST = Properties.toUnlisted(PropertyBool.create("east")); - public static final IUnlistedProperty SOUTH = Properties.toUnlisted(PropertyBool.create("south")); - public static final IUnlistedProperty WEST = Properties.toUnlisted(PropertyBool.create("west")); - public static final IProperty TYPE = PropertyEnum.create("type", EnumCableType.class); + public static final IUnlistedProperty UP = Properties.toUnlisted(PropertyBool.create("up")); + public static final IUnlistedProperty DOWN = Properties.toUnlisted(PropertyBool.create("down")); + public static final IUnlistedProperty NORTH = Properties.toUnlisted(PropertyBool.create("north")); + public static final IUnlistedProperty EAST = Properties.toUnlisted(PropertyBool.create("east")); + public static final IUnlistedProperty SOUTH = Properties.toUnlisted(PropertyBool.create("south")); + public static final IUnlistedProperty WEST = Properties.toUnlisted(PropertyBool.create("west")); + public static final IProperty TYPE = PropertyEnum.create("type", EnumCableType.class); - public CableMultipart() { - connectedSides = new HashMap<>(); - refreshBounding(); - } + public CableMultipart() + { + connectedSides = new HashMap<>(); + refreshBounding(); + } - public void refreshBounding() { - float centerFirst = center - offset; - double w = (getCableType().cableThickness / 16) - 0.5; - boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w, - centerFirst - w, centerFirst + w, centerFirst + w, centerFirst - + w); + public void refreshBounding() + { + float centerFirst = center - offset; + double w = (getCableType().cableThickness / 16) - 0.5; + boundingBoxes[6] = new Vecs3dCube(centerFirst - w, centerFirst - w, centerFirst - w, centerFirst + w, + centerFirst + w, centerFirst + w); - int i = 0; - for (EnumFacing dir : EnumFacing.VALUES) { - double xMin1 = (dir.getFrontOffsetX() < 0 ? 0.0 - : (dir.getFrontOffsetX() == 0 ? centerFirst - w : centerFirst + w)); - double xMax1 = (dir.getFrontOffsetX() > 0 ? 1.0 - : (dir.getFrontOffsetX() == 0 ? centerFirst + w : centerFirst - w)); + int i = 0; + for (EnumFacing dir : EnumFacing.VALUES) + { + double xMin1 = (dir.getFrontOffsetX() < 0 ? 0.0 + : (dir.getFrontOffsetX() == 0 ? centerFirst - w : centerFirst + w)); + double xMax1 = (dir.getFrontOffsetX() > 0 ? 1.0 + : (dir.getFrontOffsetX() == 0 ? centerFirst + w : centerFirst - w)); - double yMin1 = (dir.getFrontOffsetY() < 0 ? 0.0 - : (dir.getFrontOffsetY() == 0 ? centerFirst - w : centerFirst + w)); - double yMax1 = (dir.getFrontOffsetY() > 0 ? 1.0 - : (dir.getFrontOffsetY() == 0 ? centerFirst + w : centerFirst - w)); + double yMin1 = (dir.getFrontOffsetY() < 0 ? 0.0 + : (dir.getFrontOffsetY() == 0 ? centerFirst - w : centerFirst + w)); + double yMax1 = (dir.getFrontOffsetY() > 0 ? 1.0 + : (dir.getFrontOffsetY() == 0 ? centerFirst + w : centerFirst - w)); - double zMin1 = (dir.getFrontOffsetZ() < 0 ? 0.0 - : (dir.getFrontOffsetZ() == 0 ? centerFirst - w : centerFirst + w)); - double zMax1 = (dir.getFrontOffsetZ() > 0 ? 1.0 - : (dir.getFrontOffsetZ() == 0 ? centerFirst + w : centerFirst - w)); + double zMin1 = (dir.getFrontOffsetZ() < 0 ? 0.0 + : (dir.getFrontOffsetZ() == 0 ? centerFirst - w : centerFirst + w)); + double zMax1 = (dir.getFrontOffsetZ() > 0 ? 1.0 + : (dir.getFrontOffsetZ() == 0 ? centerFirst + w : centerFirst - w)); - boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1, - yMax1, zMax1); - i++; - } - } + boundingBoxes[i] = new Vecs3dCube(xMin1, yMin1, zMin1, xMax1, yMax1, zMax1); + i++; + } + } - @Override - public void addCollisionBoxes(AxisAlignedBB mask, List list, Entity collidingEntity) { + @Override + public void addCollisionBoxes(AxisAlignedBB mask, List list, Entity collidingEntity) + { - for (EnumFacing dir : EnumFacing.VALUES) { - if (connectedSides.containsKey(dir) && mask.intersectsWith(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) - list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); - } - if (mask.intersectsWith(boundingBoxes[6].toAABB())) { - list.add(boundingBoxes[6].toAABB()); - } - super.addCollisionBoxes(mask, list, collidingEntity); - } + for (EnumFacing dir : EnumFacing.VALUES) + { + if (connectedSides.containsKey(dir) + && mask.intersectsWith(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + if (mask.intersectsWith(boundingBoxes[6].toAABB())) + { + list.add(boundingBoxes[6].toAABB()); + } + super.addCollisionBoxes(mask, list, collidingEntity); + } - @Override - public void addSelectionBoxes(List list) { + @Override + public void addSelectionBoxes(List list) + { - for (EnumFacing dir : EnumFacing.VALUES) { - if (connectedSides.containsKey(dir)) - list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); - } - list.add(boundingBoxes[6].toAABB()); - super.addSelectionBoxes(list); - } + for (EnumFacing dir : EnumFacing.VALUES) + { + if (connectedSides.containsKey(dir)) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + list.add(boundingBoxes[6].toAABB()); + super.addSelectionBoxes(list); + } - @Override - public void onRemoved() { - super.onRemoved(); - removeFromNetwork(); - for(EnumFacing dir : EnumFacing.VALUES){ - CableMultipart multipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); - if(multipart != null){ - multipart.nearByChange(); - } - } - } + @Override + public void onRemoved() + { + super.onRemoved(); + removeFromNetwork(); + for (EnumFacing dir : EnumFacing.VALUES) + { + CableMultipart multipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); + if (multipart != null) + { + multipart.nearByChange(); + } + } + } - @Override - public void onUnloaded() { - super.onUnloaded(); - removeFromNetwork(); - } + @Override + public void onUnloaded() + { + super.onUnloaded(); + removeFromNetwork(); + } - @Override - public void addOcclusionBoxes(List list) { - for (EnumFacing dir : EnumFacing.VALUES) { - if (connectedSides.containsKey(dir)) - list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); - } - list.add(boundingBoxes[6].toAABB()); - } + @Override + public void addOcclusionBoxes(List list) + { + for (EnumFacing dir : EnumFacing.VALUES) + { + if (connectedSides.containsKey(dir)) + list.add(boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB()); + } + list.add(boundingBoxes[6].toAABB()); + } - @Override - public void onNeighborBlockChange(Block block) { - super.onNeighborBlockChange(block); - nearByChange(); + @Override + public void onNeighborBlockChange(Block block) + { + super.onNeighborBlockChange(block); + nearByChange(); - } + } - public void nearByChange() { - if(network == null){ - findAndJoinNetwork(getWorld(), getPos()); - } - checkConnectedSides(); - for (EnumFacing direction : EnumFacing.VALUES) { - BlockPos blockPos = getPos().offset(direction); - WorldUtils.updateBlock(getWorld(), blockPos); - CableMultipart part = getPartFromWorld(getWorld(), blockPos, direction); - if (part != null) { - part.checkConnectedSides(); - } - } - TRPowerNet.buildEndpoint(network); - } + public void nearByChange() + { + if (network == null) + { + findAndJoinNetwork(getWorld(), getPos()); + } + checkConnectedSides(); + for (EnumFacing direction : EnumFacing.VALUES) + { + BlockPos blockPos = getPos().offset(direction); + WorldUtils.updateBlock(getWorld(), blockPos); + CableMultipart part = getPartFromWorld(getWorld(), blockPos, direction); + if (part != null) + { + part.checkConnectedSides(); + } + } + TRPowerNet.buildEndpoint(network); + } - public static CableMultipart getPartFromWorld(World world, BlockPos pos, EnumFacing side) { - if(world == null || pos == null){ - return null; - } - IMultipartContainer container = MultipartHelper.getPartContainer(world, pos); - if (side != null && container != null) { - ISlottedPart slottedPart = container.getPartInSlot(PartSlot.getFaceSlot(side)); - if (slottedPart instanceof IMicroblock.IFaceMicroblock && !((IMicroblock.IFaceMicroblock) slottedPart).isFaceHollow()) { - return null; - } - } + public static CableMultipart getPartFromWorld(World world, BlockPos pos, EnumFacing side) + { + if (world == null || pos == null) + { + return null; + } + IMultipartContainer container = MultipartHelper.getPartContainer(world, pos); + if (side != null && container != null) + { + ISlottedPart slottedPart = container.getPartInSlot(PartSlot.getFaceSlot(side)); + if (slottedPart instanceof IMicroblock.IFaceMicroblock + && !((IMicroblock.IFaceMicroblock) slottedPart).isFaceHollow()) + { + return null; + } + } - if (container == null) { - return null; - } - ISlottedPart part = container.getPartInSlot(PartSlot.CENTER); - if (part instanceof CableMultipart) { - return (CableMultipart) part; - } - return null; - } + if (container == null) + { + return null; + } + ISlottedPart part = container.getPartInSlot(PartSlot.CENTER); + if (part instanceof CableMultipart) + { + return (CableMultipart) part; + } + return null; + } - @Override - public void onAdded() { - nearByChange(); - } + @Override + public void onAdded() + { + nearByChange(); + } - public boolean shouldConnectTo(EnumFacing dir) { - if (dir != null) { - if (internalShouldConnectTo(dir)) { - CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); - if (cableMultipart != null && cableMultipart.internalShouldConnectTo(dir.getOpposite())) { - return true; - } - } else { - TileEntity tile = getNeighbourTile(dir); + public boolean shouldConnectTo(EnumFacing dir) + { + if (dir != null) + { + if (internalShouldConnectTo(dir)) + { + CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); + if (cableMultipart != null && cableMultipart.internalShouldConnectTo(dir.getOpposite())) + { + return true; + } + } else + { + TileEntity tile = getNeighbourTile(dir); - if (tile instanceof IEnergyInterfaceTile) { - return true; - } - } - } - return false; - } + if (tile instanceof IEnergyInterfaceTile) + { + return true; + } + } + } + return false; + } - public boolean internalShouldConnectTo(EnumFacing dir) { - ISlottedPart part = getContainer().getPartInSlot(PartSlot.getFaceSlot(dir)); - if (part instanceof IMicroblock.IFaceMicroblock) { - if (!((IMicroblock.IFaceMicroblock) part).isFaceHollow()) { - return false; - } - } + public boolean internalShouldConnectTo(EnumFacing dir) + { + ISlottedPart part = getContainer().getPartInSlot(PartSlot.getFaceSlot(dir)); + if (part instanceof IMicroblock.IFaceMicroblock) + { + if (!((IMicroblock.IFaceMicroblock) part).isFaceHollow()) + { + return false; + } + } - //TODO 1.9 boken -// if (!OcclusionHelper.occlusionTest(this, boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) { -// return false; -// } + // TODO 1.9 boken + // if (!OcclusionHelper.occlusionTest(this, + // boundingBoxes[Functions.getIntDirFromDirection(dir)].toAABB())) { + // return false; + // } - CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir.getOpposite()); + CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir.getOpposite()); - if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) { - return true; - } - return false; - } + if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) + { + return true; + } + return false; + } - public TileEntity getNeighbourTile(EnumFacing side) { - return side != null ? getWorld().getTileEntity(getPos().offset(side)) : null; - } + public TileEntity getNeighbourTile(EnumFacing side) + { + return side != null ? getWorld().getTileEntity(getPos().offset(side)) : null; + } - public void checkConnectedSides() { - refreshBounding(); - connectedSides = new HashMap<>(); - for (EnumFacing dir : EnumFacing.values()) { - int d = Functions.getIntDirFromDirection(dir); - if (getWorld() == null) { - return; - } - TileEntity te = getNeighbourTile(dir); - if (shouldConnectTo(dir)) { - connectedSides.put(dir, te.getPos()); - } - } - } + public void checkConnectedSides() + { + refreshBounding(); + connectedSides = new HashMap<>(); + for (EnumFacing dir : EnumFacing.values()) + { + int d = Functions.getIntDirFromDirection(dir); + if (getWorld() == null) + { + return; + } + TileEntity te = getNeighbourTile(dir); + if (shouldConnectTo(dir)) + { + connectedSides.put(dir, te.getPos()); + } + } + } - @Override - public EnumSet getSlotMask() { - return EnumSet.of(PartSlot.CENTER); - } + @Override + public EnumSet getSlotMask() + { + return EnumSet.of(PartSlot.CENTER); + } - @Override - public void update() { - if (getWorld() != null) { - if (getWorld().getTotalWorldTime() % 80 == 0) { - checkConnectedSides(); - } - } - if (network == null) { - this.findAndJoinNetwork(getWorld(), getPos()); - } else { - if(mergeWith != null){ - getNetwork().merge(network); - mergeWith = null; - } - } - } + @Override + public void update() + { + if (getWorld() != null) + { + if (getWorld().getTotalWorldTime() % 80 == 0) + { + checkConnectedSides(); + } + } + if (network == null) + { + this.findAndJoinNetwork(getWorld(), getPos()); + } else + { + if (mergeWith != null) + { + getNetwork().merge(network); + mergeWith = null; + } + } + } - @Override - public IBlockState getExtendedState(IBlockState state) { - IExtendedBlockState extendedBlockState = (IExtendedBlockState) state; - return extendedBlockState - .withProperty(DOWN, shouldConnectTo(EnumFacing.DOWN)) - .withProperty(UP, shouldConnectTo(EnumFacing.UP)) - .withProperty(NORTH, shouldConnectTo(EnumFacing.NORTH)) - .withProperty(SOUTH, shouldConnectTo(EnumFacing.SOUTH)) - .withProperty(WEST, shouldConnectTo(EnumFacing.WEST)) - .withProperty(EAST, shouldConnectTo(EnumFacing.EAST)) - .withProperty(TYPE, getCableType()); - } + @Override + public IBlockState getExtendedState(IBlockState state) + { + IExtendedBlockState extendedBlockState = (IExtendedBlockState) state; + return extendedBlockState.withProperty(DOWN, shouldConnectTo(EnumFacing.DOWN)) + .withProperty(UP, shouldConnectTo(EnumFacing.UP)).withProperty(NORTH, shouldConnectTo(EnumFacing.NORTH)) + .withProperty(SOUTH, shouldConnectTo(EnumFacing.SOUTH)) + .withProperty(WEST, shouldConnectTo(EnumFacing.WEST)) + .withProperty(EAST, shouldConnectTo(EnumFacing.EAST)).withProperty(TYPE, getCableType()); + } - @Override - public BlockStateContainer createBlockState() { - return new ExtendedBlockState(MCMultiPartMod.multipart, - new IProperty[]{ - TYPE - }, - new IUnlistedProperty[]{ - DOWN, - UP, - NORTH, - SOUTH, - WEST, - EAST}); - } + @Override + public BlockStateContainer createBlockState() + { + return new ExtendedBlockState(MCMultiPartMod.multipart, new IProperty[] { TYPE }, + new IUnlistedProperty[] { DOWN, UP, NORTH, SOUTH, WEST, EAST }); + } + // @Override + // public String getModelPath() { + // return "techreborn:cable"; + // } -// @Override -// public String getModelPath() { -// return "techreborn:cable"; -// } + @Override + public float getHardness(PartMOP hit) + { + return 0.5F; + } - @Override - public float getHardness(PartMOP hit) { - return 0.5F; - } + public Material getMaterial() + { + return Material.cloth; + } - public Material getMaterial() { - return Material.cloth; - } + @Override + public List getDrops() + { + List list = new ArrayList<>(); + list.add(new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal())); + return list; + } - @Override - public List getDrops() { - List list = new ArrayList<>(); - list.add(new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal())); - return list; - } + @Override + public void onEntityCollided(Entity entity) + { + if (getCableType().canKill && entity instanceof EntityLivingBase) + { + if (network != null) + { + if (network.getEnergy() != 0) + { + if (ConfigTechReborn.UninsulatedElectocutionDamage) + { + if (getCableType() == EnumCableType.HV) + { + entity.setFire(1); + } + network.setEnergy(-1); + entity.attackEntityFrom(new ElectrialShockSource(), 1F); + } + if (ConfigTechReborn.UninsulatedElectocutionSound) + { + getWorld().playSound(entity.posX, entity.posY, entity.posZ, ModSounds.shock, + SoundCategory.BLOCKS, 0.6F, 1F, false); + } + if (ConfigTechReborn.UninsulatedElectocutionParticle) + { + getWorld().spawnParticle(EnumParticleTypes.CRIT, entity.posX, entity.posY, entity.posZ, 0, 0, + 0); + } + } + } + } + } + @Override + public void onEntityStanding(Entity entity) + { - @Override - public void onEntityCollided(Entity entity) { - if (getCableType().canKill && entity instanceof EntityLivingBase) { - if(network != null){ - if(network.getEnergy() != 0){ - if(ConfigTechReborn.UninsulatedElectocutionDamage){ - if(getCableType() == EnumCableType.HV){ - entity.setFire(1); - } - network.setEnergy(-1); - entity.attackEntityFrom(new ElectrialShockSource(), 1F); - } - if(ConfigTechReborn.UninsulatedElectocutionSound){ - getWorld().playSound(entity.posX, entity.posY, entity.posZ, ModSounds.shock, SoundCategory.BLOCKS, 0.6F, 1F, false); - } - if(ConfigTechReborn.UninsulatedElectocutionParticle){ - getWorld().spawnParticle(EnumParticleTypes.CRIT, entity.posX, entity.posY, entity.posZ, 0, 0, 0); - } - } - } - } - } + } - @Override - public void onEntityStanding(Entity entity) { + @Override + public ItemStack getPickBlock(EntityPlayer player, PartMOP hit) + { + return new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal()); + } - } + private TRPowerNet network; - @Override - public ItemStack getPickBlock(EntityPlayer player, PartMOP hit) { - return new ItemStack(TechRebornParts.cables, 1, getCableType().ordinal()); - } + public final void findAndJoinNetwork(World world, BlockPos pos) + { + for (EnumFacing dir : EnumFacing.VALUES) + { + CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); + if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) + { + TRPowerNet net = cableMultipart.getNetwork(); + if (net != null) + { + network = net; + network.addElement(this); + break; + } + } + } + if (network == null) + { + network = new TRPowerNet(getCableType()); + network.addElement(this); + } + network.endpoints.clear(); + for (EnumFacing dir : EnumFacing.VALUES) + { + TileEntity te = getNeighbourTile(dir); + if (te != null && te instanceof IEnergyInterfaceTile) + { + network.addConnection((IEnergyInterfaceTile) te, dir.getOpposite()); + } + } + } - private TRPowerNet network; + public final TRPowerNet getNetwork() + { + return network; + } - public final void findAndJoinNetwork(World world, BlockPos pos) { - for (EnumFacing dir : EnumFacing.VALUES) { - CableMultipart cableMultipart = getPartFromWorld(getWorld(), getPos().offset(dir), dir); - if (cableMultipart != null && cableMultipart.getCableType() == getCableType()) { - TRPowerNet net = cableMultipart.getNetwork(); - if (net != null) { - network = net; - network.addElement(this); - break; - } - } - } - if(network == null){ - network = new TRPowerNet(getCableType()); - network.addElement(this); - } - network.endpoints.clear(); - for (EnumFacing dir : EnumFacing.VALUES) { - TileEntity te = getNeighbourTile(dir); - if (te != null && te instanceof IEnergyInterfaceTile) { - network.addConnection((IEnergyInterfaceTile) te, dir.getOpposite()); - } - } - } + public final void setNetwork(TRPowerNet n) + { + if (n == null) + { + } else + { + network = n; + network.addElement(this); + } + } - public final TRPowerNet getNetwork() { - return network; - } + public final void removeFromNetwork() + { + if (network == null) + { + } else + network.removeElement(this); + } - public final void setNetwork(TRPowerNet n) { - if (n == null) { - } else { - network = n; - network.addElement(this); - } - } + public final void rebuildNetwork() + { + this.removeFromNetwork(); + this.resetNetwork(); + this.findAndJoinNetwork(getWorld(), getPos()); + } - public final void removeFromNetwork() { - if (network == null) { - } else - network.removeElement(this); - } + public final void resetNetwork() + { + if (network != null) + { + network.removeElement(this); + } - public final void rebuildNetwork() { - this.removeFromNetwork(); - this.resetNetwork(); - this.findAndJoinNetwork(getWorld(), getPos()); - } + network = null; + } - public final void resetNetwork() { - if(network != null){ - network.removeElement(this); - } + // @Override + // public void addInfo(List info) { + // info.add(EnumChatFormatting.GREEN + "EU Transfer: " + + // EnumChatFormatting.LIGHT_PURPLE + getCableType().transferRate); + // if (getCableType().canKill) { + // info.add(EnumChatFormatting.RED + "Damages entity's!"); + // } + // } - network = null; - } + @Override + public ResourceLocation getModelPath() + { + return new ResourceLocation("techreborn:cable"); + } -// @Override -// public void addInfo(List info) { -// info.add(EnumChatFormatting.GREEN + "EU Transfer: " + EnumChatFormatting.LIGHT_PURPLE + getCableType().transferRate); -// if (getCableType().canKill) { -// info.add(EnumChatFormatting.RED + "Damages entity's!"); -// } -// } - - - @Override - public ResourceLocation getModelPath() { - return new ResourceLocation("techreborn:cable"); - } - - @Override - public boolean canRenderInLayer(BlockRenderLayer layer) { - return layer == BlockRenderLayer.CUTOUT; - } + @Override + public boolean canRenderInLayer(BlockRenderLayer layer) + { + return layer == BlockRenderLayer.CUTOUT; + } } diff --git a/src/main/java/techreborn/parts/EnumCableType.java b/src/main/java/techreborn/parts/EnumCableType.java index 775eb7a02..bc3abef9b 100644 --- a/src/main/java/techreborn/parts/EnumCableType.java +++ b/src/main/java/techreborn/parts/EnumCableType.java @@ -11,36 +11,48 @@ import techreborn.parts.types.InsulatedGoldCable; import techreborn.parts.types.InsulatedHVCable; import techreborn.parts.types.TinCable; -public enum EnumCableType implements IStringSerializable { - COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, EnumPowerTier.LOW, CopperCable.class), - TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, EnumPowerTier.MEDIUM, TinCable.class), - GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true, EnumPowerTier.MEDIUM, GoldCable.class), - HV("hv", "techreborn:blocks/cables/hv_cable", 2048, 12.0, true, EnumPowerTier.HIGH, HVCable.class), - GLASSFIBER("glassfiber", "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, EnumPowerTier.HIGH, GlassFiberCable.class), - ICOPPER("insulatedcopper", "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, EnumPowerTier.LOW, InsulatedCopperCable.class), - IGOLD("insulatedgold", "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, false, EnumPowerTier.MEDIUM, InsulatedGoldCable.class), - IHV("insulatedhv", "techreborn:blocks/cables/hv_insulated_cable", 2048, 10.0, false, EnumPowerTier.HIGH, InsulatedHVCable.class); +public enum EnumCableType implements IStringSerializable +{ + COPPER("copper", "techreborn:blocks/cables/copper_cable", 128, 12.0, true, EnumPowerTier.LOW, + CopperCable.class), TIN("tin", "techreborn:blocks/cables/tin_cable", 32, 12.0, true, EnumPowerTier.MEDIUM, + TinCable.class), GOLD("gold", "techreborn:blocks/cables/gold_cable", 512, 12.0, true, + EnumPowerTier.MEDIUM, GoldCable.class), HV("hv", "techreborn:blocks/cables/hv_cable", 2048, + 12.0, true, EnumPowerTier.HIGH, HVCable.class), GLASSFIBER("glassfiber", + "techreborn:blocks/cables/glass_fiber_cable", 8192, 12.0, false, + EnumPowerTier.HIGH, GlassFiberCable.class), ICOPPER("insulatedcopper", + "techreborn:blocks/cables/copper_insulated_cable", 128, 10.0, false, + EnumPowerTier.LOW, + InsulatedCopperCable.class), IGOLD("insulatedgold", + "techreborn:blocks/cables/gold_insulated_cable", 512, 10.0, + false, EnumPowerTier.MEDIUM, + InsulatedGoldCable.class), IHV("insulatedhv", + "techreborn:blocks/cables/hv_insulated_cable", 2048, + 10.0, false, EnumPowerTier.HIGH, + InsulatedHVCable.class); - private String friendlyName; - public String textureName = "minecraft:blocks/iron_block"; - public int transferRate = 128; - public double cableThickness = 3.0; - public boolean canKill = false; - public Class cableClass; - public EnumPowerTier tier; + private String friendlyName; + public String textureName = "minecraft:blocks/iron_block"; + public int transferRate = 128; + public double cableThickness = 3.0; + public boolean canKill = false; + public Class cableClass; + public EnumPowerTier tier; - EnumCableType(String friendlyName, String textureName, int transferRate, double cableThickness, boolean canKill, EnumPowerTier tier, Class cableClass) { - this.friendlyName = friendlyName; - this.textureName = textureName; - this.transferRate = transferRate; - this.cableThickness = cableThickness / 2; - this.canKill = canKill; - this.cableClass = cableClass; - this.tier = tier; - } + EnumCableType(String friendlyName, String textureName, int transferRate, double cableThickness, boolean canKill, + EnumPowerTier tier, Class cableClass) + { + this.friendlyName = friendlyName; + this.textureName = textureName; + this.transferRate = transferRate; + this.cableThickness = cableThickness / 2; + this.canKill = canKill; + this.cableClass = cableClass; + this.tier = tier; + } - @Override - public String getName() { - return friendlyName.toLowerCase(); - } + @Override + public String getName() + { + return friendlyName.toLowerCase(); + } } diff --git a/src/main/java/techreborn/parts/ICableType.java b/src/main/java/techreborn/parts/ICableType.java index 2253f0b99..451999d6e 100644 --- a/src/main/java/techreborn/parts/ICableType.java +++ b/src/main/java/techreborn/parts/ICableType.java @@ -3,8 +3,9 @@ package techreborn.parts; /** * Created by modmuss50 on 05/03/2016. */ -public interface ICableType { +public interface ICableType +{ - EnumCableType getCableType(); + EnumCableType getCableType(); } diff --git a/src/main/java/techreborn/parts/ItemCables.java b/src/main/java/techreborn/parts/ItemCables.java index 89abeaebc..c0a2b4005 100644 --- a/src/main/java/techreborn/parts/ItemCables.java +++ b/src/main/java/techreborn/parts/ItemCables.java @@ -1,5 +1,7 @@ package techreborn.parts; +import java.util.List; + import mcmultipart.item.ItemMultiPart; import mcmultipart.multipart.IMultipart; import me.modmuss50.jsonDestroyer.api.ITexturedItem; @@ -19,74 +21,86 @@ import reborncore.RebornCore; import techreborn.client.TechRebornCreativeTab; import techreborn.lib.ModInfo; -import java.util.List; - /** * Created by modmuss50 on 27/02/2016. */ -public class ItemCables extends ItemMultiPart implements ITexturedItem { +public class ItemCables extends ItemMultiPart implements ITexturedItem +{ - public ItemCables() { - setCreativeTab(TechRebornCreativeTab.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.cable"); - setNoRepair(); - RebornCore.jsonDestroyer.registerObject(this); - ItemStandaloneCables.mcPartCable = this; - } + public ItemCables() + { + setCreativeTab(TechRebornCreativeTab.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.cable"); + setNoRepair(); + RebornCore.jsonDestroyer.registerObject(this); + ItemStandaloneCables.mcPartCable = this; + } - @Override - public IMultipart createPart(World world, BlockPos pos, EnumFacing side, Vec3d hit, ItemStack stack, EntityPlayer player) { - try { - return TechRebornParts.multipartHashMap.get(EnumCableType.values()[stack.getItemDamage()]).newInstance(); - } catch (InstantiationException | IllegalAccessException e) { - e.printStackTrace(); - } - return null; - } + @Override + public IMultipart createPart(World world, BlockPos pos, EnumFacing side, Vec3d hit, ItemStack stack, + EntityPlayer player) + { + try + { + return TechRebornParts.multipartHashMap.get(EnumCableType.values()[stack.getItemDamage()]).newInstance(); + } catch (InstantiationException | IllegalAccessException e) + { + e.printStackTrace(); + } + return null; + } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= EnumCableType.values().length) + { + meta = 0; + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= EnumCableType.values().length) { - meta = 0; - } + return super.getUnlocalizedName() + "." + EnumCableType.values()[meta]; + } - return super.getUnlocalizedName() + "." + EnumCableType.values()[meta]; - } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < EnumCableType.values().length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < EnumCableType.values().length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/cables/" + EnumCableType.values()[damage].getName(); + } - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/cables/" + EnumCableType.values()[damage].getName(); - } + @Override + public int getMaxMeta() + { + return EnumCableType.values().length; + } - @Override - public int getMaxMeta() { - return EnumCableType.values().length; - } + @Override + @SideOnly(Side.CLIENT) + public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) + { + return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); + } - @Override - @SideOnly(Side.CLIENT) - public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { - return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); - } - - @Override - public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { - EnumCableType type = EnumCableType.values()[stack.getItemDamage()]; - tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate); - if (type.canKill) { - tooltip.add(TextFormatting.RED + "Damages entity's!"); - } - tooltip.add(TextFormatting.GREEN + "Tier: " + TextFormatting.LIGHT_PURPLE + type.tier); - } + @Override + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + EnumCableType type = EnumCableType.values()[stack.getItemDamage()]; + tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate); + if (type.canKill) + { + tooltip.add(TextFormatting.RED + "Damages entity's!"); + } + tooltip.add(TextFormatting.GREEN + "Tier: " + TextFormatting.LIGHT_PURPLE + type.tier); + } } \ No newline at end of file diff --git a/src/main/java/techreborn/parts/ItemStandaloneCables.java b/src/main/java/techreborn/parts/ItemStandaloneCables.java index 6db69c6bb..f48b51db4 100644 --- a/src/main/java/techreborn/parts/ItemStandaloneCables.java +++ b/src/main/java/techreborn/parts/ItemStandaloneCables.java @@ -1,5 +1,8 @@ package techreborn.parts; +import java.security.InvalidParameterException; +import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -10,76 +13,90 @@ import techreborn.client.TechRebornCreativeTab; import techreborn.items.ItemTextureBase; import techreborn.lib.ModInfo; -import java.security.InvalidParameterException; -import java.util.List; - /** * Created by modmuss50 on 06/03/2016. */ -public class ItemStandaloneCables extends ItemTextureBase { +public class ItemStandaloneCables extends ItemTextureBase +{ - public static Item mcPartCable; + public static Item mcPartCable; - public static ItemStack getCableByName(String name, int count) { - for (int i = 0; i < EnumCableType.values().length; i++) { - if (EnumCableType.values()[i].getName().equalsIgnoreCase(name)) { - return new ItemStack(mcPartCable != null ? mcPartCable : StandalonePartCompact.itemStandaloneCable, count, i); - } - } - throw new InvalidParameterException("The cable " + name + " could not be found."); - } + public static ItemStack getCableByName(String name, int count) + { + for (int i = 0; i < EnumCableType.values().length; i++) + { + if (EnumCableType.values()[i].getName().equalsIgnoreCase(name)) + { + return new ItemStack(mcPartCable != null ? mcPartCable : StandalonePartCompact.itemStandaloneCable, + count, i); + } + } + throw new InvalidParameterException("The cable " + name + " could not be found."); + } - public static ItemStack getCableByName(String name) { - return getCableByName(name, 1); - } + public static ItemStack getCableByName(String name) + { + return getCableByName(name, 1); + } - public ItemStandaloneCables() { - setCreativeTab(TechRebornCreativeTab.instance); - setHasSubtypes(true); - setUnlocalizedName("techreborn.cable"); - setNoRepair(); - RebornCore.jsonDestroyer.registerObject(this); - } + public ItemStandaloneCables() + { + setCreativeTab(TechRebornCreativeTab.instance); + setHasSubtypes(true); + setUnlocalizedName("techreborn.cable"); + setNoRepair(); + RebornCore.jsonDestroyer.registerObject(this); + } - @Override - // gets Unlocalized Name depending on meta data - public String getUnlocalizedName(ItemStack itemStack) { - int meta = itemStack.getItemDamage(); - if (meta < 0 || meta >= EnumCableType.values().length) { - meta = 0; - } + @Override + // gets Unlocalized Name depending on meta data + public String getUnlocalizedName(ItemStack itemStack) + { + int meta = itemStack.getItemDamage(); + if (meta < 0 || meta >= EnumCableType.values().length) + { + meta = 0; + } - return super.getUnlocalizedName() + "." + EnumCableType.values()[meta]; - } + return super.getUnlocalizedName() + "." + EnumCableType.values()[meta]; + } - // Adds Dusts SubItems To Creative Tab - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - for (int meta = 0; meta < EnumCableType.values().length; ++meta) { - list.add(new ItemStack(item, 1, meta)); - } - } + // Adds Dusts SubItems To Creative Tab + public void getSubItems(Item item, CreativeTabs creativeTabs, List list) + { + for (int meta = 0; meta < EnumCableType.values().length; ++meta) + { + list.add(new ItemStack(item, 1, meta)); + } + } - @Override - public String getTextureName(int damage) { - return ModInfo.MOD_ID + ":items/cables/" + EnumCableType.values()[damage].getName(); - } + @Override + public String getTextureName(int damage) + { + return ModInfo.MOD_ID + ":items/cables/" + EnumCableType.values()[damage].getName(); + } - @Override - public int getMaxMeta() { - return EnumCableType.values().length; - } + @Override + public int getMaxMeta() + { + return EnumCableType.values().length; + } -// @Override -// public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) { -// return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5), "inventory"); -// } + // @Override + // public ModelResourceLocation getModel(ItemStack stack, EntityPlayer + // player, int useRemaining) { + // return new ModelResourceLocation(ModInfo.MOD_ID + ":" + + // getUnlocalizedName(stack).substring(5), "inventory"); + // } - @Override - public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) { - EnumCableType type = EnumCableType.values()[stack.getItemDamage()]; - tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate); - if (type.canKill) { - tooltip.add(TextFormatting.RED + "Damages entity's!"); - } - } + @Override + public void addInformation(ItemStack stack, EntityPlayer playerIn, List tooltip, boolean advanced) + { + EnumCableType type = EnumCableType.values()[stack.getItemDamage()]; + tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate); + if (type.canKill) + { + tooltip.add(TextFormatting.RED + "Damages entity's!"); + } + } } diff --git a/src/main/java/techreborn/parts/StandalonePartCompact.java b/src/main/java/techreborn/parts/StandalonePartCompact.java index a385f2af2..663353230 100644 --- a/src/main/java/techreborn/parts/StandalonePartCompact.java +++ b/src/main/java/techreborn/parts/StandalonePartCompact.java @@ -10,28 +10,33 @@ import techreborn.compat.ICompatModule; /** * Created by modmuss50 on 06/03/2016. */ -public class StandalonePartCompact implements ICompatModule { +public class StandalonePartCompact implements ICompatModule +{ - public static ItemStandaloneCables itemStandaloneCable; + public static ItemStandaloneCables itemStandaloneCable; - @Override - public void preInit(FMLPreInitializationEvent event) { + @Override + public void preInit(FMLPreInitializationEvent event) + { - } + } - @Override - public void init(FMLInitializationEvent event) { - itemStandaloneCable = new ItemStandaloneCables(); - GameRegistry.registerItem(itemStandaloneCable, "cables"); - } + @Override + public void init(FMLInitializationEvent event) + { + itemStandaloneCable = new ItemStandaloneCables(); + GameRegistry.registerItem(itemStandaloneCable, "cables"); + } - @Override - public void postInit(FMLPostInitializationEvent event) { + @Override + public void postInit(FMLPostInitializationEvent event) + { - } + } - @Override - public void serverStarting(FMLServerStartingEvent event) { + @Override + public void serverStarting(FMLServerStartingEvent event) + { - } + } } diff --git a/src/main/java/techreborn/parts/TechRebornParts.java b/src/main/java/techreborn/parts/TechRebornParts.java index 9751d9d2d..fe0a2eaa2 100644 --- a/src/main/java/techreborn/parts/TechRebornParts.java +++ b/src/main/java/techreborn/parts/TechRebornParts.java @@ -1,5 +1,9 @@ package techreborn.parts; +import java.util.HashMap; + +import javax.annotation.Nullable; + import mcmultipart.multipart.MultipartRegistry; import net.minecraft.item.Item; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @@ -9,42 +13,44 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import techreborn.compat.ICompatModule; -import javax.annotation.Nullable; -import java.util.HashMap; - - /** * Created by modmuss50 on 02/03/2016. */ -public class TechRebornParts implements ICompatModule { +public class TechRebornParts implements ICompatModule +{ - @Nullable - public static Item cables; + @Nullable + public static Item cables; - public static HashMap> multipartHashMap = new HashMap<>(); + public static HashMap> multipartHashMap = new HashMap<>(); - @Override - public void preInit(FMLPreInitializationEvent event) { + @Override + public void preInit(FMLPreInitializationEvent event) + { - } + } - @Override - public void init(FMLInitializationEvent event) { - for (EnumCableType cableType : EnumCableType.values()) { - multipartHashMap.put(cableType, cableType.cableClass); - MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name()); - } - cables = new ItemCables(); - GameRegistry.registerItem(cables, "cables"); - } + @Override + public void init(FMLInitializationEvent event) + { + for (EnumCableType cableType : EnumCableType.values()) + { + multipartHashMap.put(cableType, cableType.cableClass); + MultipartRegistry.registerPart(cableType.cableClass, "techreborn:cable." + cableType.name()); + } + cables = new ItemCables(); + GameRegistry.registerItem(cables, "cables"); + } - @Override - public void postInit(FMLPostInitializationEvent event) { + @Override + public void postInit(FMLPostInitializationEvent event) + { - } + } - @Override - public void serverStarting(FMLServerStartingEvent event) { + @Override + public void serverStarting(FMLServerStartingEvent event) + { - } + } } diff --git a/src/main/java/techreborn/parts/types/CopperCable.java b/src/main/java/techreborn/parts/types/CopperCable.java index 0df264a53..b0608923e 100644 --- a/src/main/java/techreborn/parts/types/CopperCable.java +++ b/src/main/java/techreborn/parts/types/CopperCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class CopperCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.COPPER; - } +public class CopperCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.COPPER; + } } diff --git a/src/main/java/techreborn/parts/types/GlassFiberCable.java b/src/main/java/techreborn/parts/types/GlassFiberCable.java index f428b20f2..77c29d595 100644 --- a/src/main/java/techreborn/parts/types/GlassFiberCable.java +++ b/src/main/java/techreborn/parts/types/GlassFiberCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class GlassFiberCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.GLASSFIBER; - } +public class GlassFiberCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.GLASSFIBER; + } } diff --git a/src/main/java/techreborn/parts/types/GoldCable.java b/src/main/java/techreborn/parts/types/GoldCable.java index 70623a621..a7ad7c2b5 100644 --- a/src/main/java/techreborn/parts/types/GoldCable.java +++ b/src/main/java/techreborn/parts/types/GoldCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class GoldCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.GOLD; - } +public class GoldCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.GOLD; + } } diff --git a/src/main/java/techreborn/parts/types/HVCable.java b/src/main/java/techreborn/parts/types/HVCable.java index d10c6aff0..9a4974d3a 100644 --- a/src/main/java/techreborn/parts/types/HVCable.java +++ b/src/main/java/techreborn/parts/types/HVCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class HVCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.HV; - } +public class HVCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.HV; + } } diff --git a/src/main/java/techreborn/parts/types/InsulatedCopperCable.java b/src/main/java/techreborn/parts/types/InsulatedCopperCable.java index 47b08ae35..b06be64cc 100644 --- a/src/main/java/techreborn/parts/types/InsulatedCopperCable.java +++ b/src/main/java/techreborn/parts/types/InsulatedCopperCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class InsulatedCopperCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.ICOPPER; - } +public class InsulatedCopperCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.ICOPPER; + } } diff --git a/src/main/java/techreborn/parts/types/InsulatedGoldCable.java b/src/main/java/techreborn/parts/types/InsulatedGoldCable.java index 2c6380334..c33ec6368 100644 --- a/src/main/java/techreborn/parts/types/InsulatedGoldCable.java +++ b/src/main/java/techreborn/parts/types/InsulatedGoldCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class InsulatedGoldCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.IGOLD; - } +public class InsulatedGoldCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.IGOLD; + } } diff --git a/src/main/java/techreborn/parts/types/InsulatedHVCable.java b/src/main/java/techreborn/parts/types/InsulatedHVCable.java index b12005c48..a8cebde02 100644 --- a/src/main/java/techreborn/parts/types/InsulatedHVCable.java +++ b/src/main/java/techreborn/parts/types/InsulatedHVCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class InsulatedHVCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.IHV; - } +public class InsulatedHVCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.IHV; + } } diff --git a/src/main/java/techreborn/parts/types/TinCable.java b/src/main/java/techreborn/parts/types/TinCable.java index d609d556b..2893072b0 100644 --- a/src/main/java/techreborn/parts/types/TinCable.java +++ b/src/main/java/techreborn/parts/types/TinCable.java @@ -6,9 +6,11 @@ import techreborn.parts.EnumCableType; /** * Created by modmuss50 on 05/03/2016. */ -public class TinCable extends CableMultipart { - @Override - public EnumCableType getCableType() { - return EnumCableType.COPPER; - } +public class TinCable extends CableMultipart +{ + @Override + public EnumCableType getCableType() + { + return EnumCableType.COPPER; + } } diff --git a/src/main/java/techreborn/parts/walia/IPartWaliaProvider.java b/src/main/java/techreborn/parts/walia/IPartWaliaProvider.java index c750a2578..a3395bae9 100644 --- a/src/main/java/techreborn/parts/walia/IPartWaliaProvider.java +++ b/src/main/java/techreborn/parts/walia/IPartWaliaProvider.java @@ -5,7 +5,8 @@ import java.util.List; /** * Created by modmuss50 on 07/03/2016. */ -public interface IPartWaliaProvider { +public interface IPartWaliaProvider +{ - void addInfo(List info); + void addInfo(List info); } diff --git a/src/main/java/techreborn/parts/walia/WailaMcMultiPartCompact.java b/src/main/java/techreborn/parts/walia/WailaMcMultiPartCompact.java index 2bb01cb4a..ac1bb1db9 100644 --- a/src/main/java/techreborn/parts/walia/WailaMcMultiPartCompact.java +++ b/src/main/java/techreborn/parts/walia/WailaMcMultiPartCompact.java @@ -12,29 +12,34 @@ import techreborn.compat.ICompatModule; /** * Created by modmuss50 on 07/03/2016. */ -public class WailaMcMultiPartCompact implements ICompatModule { - @Override - public void preInit(FMLPreInitializationEvent event) { +public class WailaMcMultiPartCompact implements ICompatModule +{ + @Override + public void preInit(FMLPreInitializationEvent event) + { - } + } - @Override - public void init(FMLInitializationEvent event) { - FMLInterModComms.sendMessage("Waila", "register", getClass().getName() - + ".callbackRegister"); - } + @Override + public void init(FMLInitializationEvent event) + { + FMLInterModComms.sendMessage("Waila", "register", getClass().getName() + ".callbackRegister"); + } - @Override - public void postInit(FMLPostInitializationEvent event) { + @Override + public void postInit(FMLPostInitializationEvent event) + { - } + } - @Override - public void serverStarting(FMLServerStartingEvent event) { + @Override + public void serverStarting(FMLServerStartingEvent event) + { - } + } - public static void callbackRegister(IWailaRegistrar registrar) { - registrar.registerBodyProvider(new WaliaPartProvider(), TileMultipartContainer.class); - } + public static void callbackRegister(IWailaRegistrar registrar) + { + registrar.registerBodyProvider(new WaliaPartProvider(), TileMultipartContainer.class); + } } diff --git a/src/main/java/techreborn/parts/walia/WaliaPartProvider.java b/src/main/java/techreborn/parts/walia/WaliaPartProvider.java index 4114b38b8..2cf5882a2 100644 --- a/src/main/java/techreborn/parts/walia/WaliaPartProvider.java +++ b/src/main/java/techreborn/parts/walia/WaliaPartProvider.java @@ -23,56 +23,75 @@ import techreborn.parts.CableMultipart; /** * Created by modmuss50 on 07/03/2016. */ -public class WaliaPartProvider implements IWailaDataProvider { - @Override - public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) { - PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer()); - if (mop != null) { - if (mop.partHit instanceof CableMultipart) { - return mop.partHit.getDrops().get(0); - } - } - return null; - } +public class WaliaPartProvider implements IWailaDataProvider +{ + @Override + public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) + { + PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer()); + if (mop != null) + { + if (mop.partHit instanceof CableMultipart) + { + return mop.partHit.getDrops().get(0); + } + } + return null; + } - @Override - public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return null; - } + @Override + public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + return null; + } - @Override - public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer()); - List data = new ArrayList<>(); - if (mop != null) { - if (mop.partHit instanceof IPartWaliaProvider) { - ((IPartWaliaProvider) mop.partHit).addInfo(data); - } - } - return data; - } + @Override + public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + PartMOP mop = reTrace(accessor.getWorld(), accessor.getPosition(), accessor.getPlayer()); + List data = new ArrayList<>(); + if (mop != null) + { + if (mop.partHit instanceof IPartWaliaProvider) + { + ((IPartWaliaProvider) mop.partHit).addInfo(data); + } + } + return data; + } - @Override - public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { - return null; - } + @Override + public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) + { + return null; + } - @Override - public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) { - return null; - } + @Override + public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, + BlockPos pos) + { + return null; + } - //Stolen from https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java - private PartMOP reTrace(World world, BlockPos pos, EntityPlayer player) { - Vec3d start = RayTraceUtils.getStart(player); - Vec3d end = RayTraceUtils.getEnd(player); - RayTraceUtils.AdvancedRayTraceResultPart result = getMultipartTile(world, pos).getPartContainer().collisionRayTrace(start, end); - return result == null ? null : result.hit; - } + // Stolen from + // https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java + private PartMOP reTrace(World world, BlockPos pos, EntityPlayer player) + { + Vec3d start = RayTraceUtils.getStart(player); + Vec3d end = RayTraceUtils.getEnd(player); + RayTraceUtils.AdvancedRayTraceResultPart result = getMultipartTile(world, pos).getPartContainer() + .collisionRayTrace(start, end); + return result == null ? null : result.hit; + } - //Stolen from https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java - private TileMultipartContainer getMultipartTile(IBlockAccess world, BlockPos pos) { - TileEntity tile = world.getTileEntity(pos); - return tile instanceof TileMultipartContainer ? (TileMultipartContainer) tile : null; - } + // Stolen from + // https://github.com/amadornes/MCMultiPart/blob/master/src/main/java/mcmultipart/block/BlockMultipart.java + private TileMultipartContainer getMultipartTile(IBlockAccess world, BlockPos pos) + { + TileEntity tile = world.getTileEntity(pos); + return tile instanceof TileMultipartContainer ? (TileMultipartContainer) tile : null; + } } diff --git a/src/main/java/techreborn/power/PowerTickEvent.java b/src/main/java/techreborn/power/PowerTickEvent.java index dd83502d0..1e755a1f0 100644 --- a/src/main/java/techreborn/power/PowerTickEvent.java +++ b/src/main/java/techreborn/power/PowerTickEvent.java @@ -1,9 +1,10 @@ package techreborn.power; - import net.minecraftforge.fml.common.eventhandler.Event; -public class PowerTickEvent extends Event { - public PowerTickEvent() { +public class PowerTickEvent extends Event +{ + public PowerTickEvent() + { } } diff --git a/src/main/java/techreborn/power/TRPowerNet.java b/src/main/java/techreborn/power/TRPowerNet.java index 265a94d04..2add90a4e 100644 --- a/src/main/java/techreborn/power/TRPowerNet.java +++ b/src/main/java/techreborn/power/TRPowerNet.java @@ -1,5 +1,8 @@ package techreborn.power; +import java.util.ArrayList; +import java.util.List; + import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -10,277 +13,346 @@ import reborncore.api.power.IEnergyInterfaceTile; import techreborn.parts.CableMultipart; import techreborn.parts.EnumCableType; -import java.util.ArrayList; -import java.util.List; +public class TRPowerNet +{ + int tick = 0; + private ArrayList cables = new ArrayList(); + public ArrayList endpoints = new ArrayList(); + private int energy = 0; + EnumCableType cableType; -public class TRPowerNet { - int tick = 0; - private ArrayList cables = new ArrayList(); - public ArrayList endpoints = new ArrayList(); - private int energy = 0; - EnumCableType cableType; + public TRPowerNet(EnumCableType cableType) + { + this.cableType = cableType; + MinecraftForge.EVENT_BUS.register(this); + } - public TRPowerNet(EnumCableType cableType) { - this.cableType = cableType; - MinecraftForge.EVENT_BUS.register(this); - } + public int getIOLimit() + { + return cableType.transferRate; + } - public int getIOLimit() { - return cableType.transferRate; - } + @SubscribeEvent + public void tick(PowerTickEvent evt) + { + if (tick < 20) + { + tick++; + return; + } + if (tick % 80 == 0) + { + List oldCables = new ArrayList<>(); + for (CableMultipart cableMultipart : cables) + { + if (cableMultipart.getWorld() == null || cableMultipart.getPos() == null) + { + oldCables.add(cableMultipart); + } + CableMultipart mp = cableMultipart.getPartFromWorld(cableMultipart.getWorld(), cableMultipart.getPos(), + null); + if (mp == null) + { + oldCables.add(cableMultipart); + } + } + cables.removeAll(oldCables); + } + if (!cables.isEmpty()) + { + ArrayList collectibles = new ArrayList(); + ArrayList insertibles = new ArrayList(); + for (EnergyHandler ei : endpoints) + { + if (ei.isCollectible()) + { + collectibles.add(ei); + } + if (ei.isInsertible()) + { + insertibles.add(ei); + } + } - @SubscribeEvent - public void tick(PowerTickEvent evt) { - if (tick < 20) { - tick++; - return; - } - if (tick % 80 == 0) { - List oldCables = new ArrayList<>(); - for (CableMultipart cableMultipart : cables) { - if (cableMultipart.getWorld() == null || cableMultipart.getPos() == null) { - oldCables.add(cableMultipart); - } - CableMultipart mp = cableMultipart.getPartFromWorld(cableMultipart.getWorld(), cableMultipart.getPos(), null); - if (mp == null) { - oldCables.add(cableMultipart); - } - } - cables.removeAll(oldCables); - } - if (!cables.isEmpty()) { - ArrayList collectibles = new ArrayList(); - ArrayList insertibles = new ArrayList(); - for (EnergyHandler ei : endpoints) { - if (ei.isCollectible()) { - collectibles.add(ei); - } - if (ei.isInsertible()) { - insertibles.add(ei); - } - } + if (energy < cableType.transferRate * cables.size()) + { + for (EnergyHandler handler : collectibles) + { + energy += handler.collectEnergy(cableType.transferRate); + } + } - if(energy < cableType.transferRate * cables.size()){ - for (EnergyHandler handler : collectibles) { - energy += handler.collectEnergy(cableType.transferRate); - } - } + for (EnergyHandler handler : insertibles) + { + energy -= handler.addEnergy(Math.min(energy, cableType.transferRate)); + } + } else + { + MinecraftForge.EVENT_BUS.unregister(this); + } + tick++; + } - for (EnergyHandler handler : insertibles) { - energy -= handler.addEnergy(Math.min(energy, cableType.transferRate)); - } - } else { - MinecraftForge.EVENT_BUS.unregister(this); - } - tick++; - } + public void addElement(CableMultipart te) + { + if (!cables.contains(te)) + { + cables.add(te); + } + } - public void addElement(CableMultipart te) { - if (!cables.contains(te)) { - cables.add(te); - } - } + public void removeElement(CableMultipart te) + { + cables.remove(te); + this.rebuild(); + this.checkAndRemoveOldEndpoints(); + } - public void removeElement(CableMultipart te) { - cables.remove(te); - this.rebuild(); - this.checkAndRemoveOldEndpoints(); - } + public static void buildEndpoint(TRPowerNet net) + { + ArrayList parts = new ArrayList<>(); + ArrayList partsToMerge = new ArrayList<>(); + parts.addAll(net.cables); + for (CableMultipart cable : parts) + { + for (EnumFacing facing : EnumFacing.VALUES) + { + BlockPos pos = cable.getPos().offset(facing); + TileEntity tile = cable.getWorld().getTileEntity(pos); + if (tile != null && tile instanceof IEnergyInterfaceTile) + { + IEnergyInterfaceTile eit = (IEnergyInterfaceTile) tile; + net.addConnection(eit, facing); + } + CableMultipart cableMultipart = CableMultipart.getPartFromWorld(cable.getWorld(), pos, null); + if (cableMultipart != null) + { + if (cableMultipart.getNetwork() != net) + { + partsToMerge.add(cableMultipart); + } + } + } + } + for (CableMultipart cableMultipart : partsToMerge) + { + cableMultipart.mergeWith = net; + } + net.checkAndRemoveOldEndpoints(); + } - public static void buildEndpoint(TRPowerNet net){ - ArrayList parts = new ArrayList<>(); - ArrayList partsToMerge = new ArrayList<>(); - parts.addAll(net.cables); - for(CableMultipart cable : parts){ - for(EnumFacing facing : EnumFacing.VALUES){ - BlockPos pos = cable.getPos().offset(facing); - TileEntity tile = cable.getWorld().getTileEntity(pos); - if(tile != null && tile instanceof IEnergyInterfaceTile){ - IEnergyInterfaceTile eit = (IEnergyInterfaceTile) tile; - net.addConnection(eit, facing); - } - CableMultipart cableMultipart = CableMultipart.getPartFromWorld(cable.getWorld(), pos, null); - if(cableMultipart != null){ - if(cableMultipart.getNetwork() != net){ - partsToMerge.add(cableMultipart); - } - } - } - } - for(CableMultipart cableMultipart : partsToMerge){ - cableMultipart.mergeWith = net; - } - net.checkAndRemoveOldEndpoints(); - } + public void checkAndRemoveOldEndpoints() + { + List deadHandlers = new ArrayList<>(); + for (EnergyHandler energyHandler : endpoints) + { + TileEntity tile = (TileEntity) energyHandler.tile; + if (tile.getWorld().getTileEntity(tile.getPos()) == null) + { + deadHandlers.add(energyHandler); + } else + { + boolean hasNet = false; + for (EnumFacing facing : EnumFacing.VALUES) + { + BlockPos pos = tile.getPos().offset(facing); + CableMultipart multipart = CableMultipart.getPartFromWorld(tile.getWorld(), pos, facing); + if (multipart != null && multipart.getNetwork() == this) + { + hasNet = true; + } + } + if (!hasNet) + { + deadHandlers.add(energyHandler); + } + } - public void checkAndRemoveOldEndpoints(){ - List deadHandlers = new ArrayList<>(); - for(EnergyHandler energyHandler : endpoints){ - TileEntity tile = (TileEntity) energyHandler.tile; - if(tile.getWorld().getTileEntity(tile.getPos()) == null){ - deadHandlers.add(energyHandler); - } else { - boolean hasNet = false; - for(EnumFacing facing : EnumFacing.VALUES){ - BlockPos pos = tile.getPos().offset(facing); - CableMultipart multipart = CableMultipart.getPartFromWorld(tile.getWorld(), pos, facing); - if(multipart != null && multipart.getNetwork() == this){ - hasNet = true; - } - } - if(!hasNet){ - deadHandlers.add(energyHandler); - } - } + } + endpoints.removeAll(deadHandlers); + } - } - endpoints.removeAll(deadHandlers); - } + public void rebuild() + { + for (int i = 0; i < cables.size(); i++) + { + CableMultipart te = cables.get(i); + te.setNetwork(null); + te.findAndJoinNetwork(te.getWorld(), te.getPos()); + } + this.clear(true); + MinecraftForge.EVENT_BUS.unregister(this); + } - public void rebuild() { - for (int i = 0; i < cables.size(); i++) { - CableMultipart te = cables.get(i); - te.setNetwork(null); - te.findAndJoinNetwork(te.getWorld(), te.getPos()); - } - this.clear(true); - MinecraftForge.EVENT_BUS.unregister(this); - } + public int getEnergy() + { + return energy; + } - public int getEnergy() { - return energy; - } + public void setEnergy(int energy) + { + energy += energy; + if (energy < 0) + { + energy = 0; + } + } - public void setEnergy(int energy){ - energy += energy; - if(energy < 0){ - energy = 0; - } - } + public void addConnection(IEnergyInterfaceTile ih, EnumFacing dir) + { + if (ih instanceof CableMultipart) + return; + EnergyHandler has = this.getHandleFrom(ih); + if (has == null) + { + endpoints.add(new EnergyHandler(ih, cableType, dir)); + } else + { + has.side = dir; + } + } - public void addConnection(IEnergyInterfaceTile ih, EnumFacing dir) { - if (ih instanceof CableMultipart) - return; - EnergyHandler has = this.getHandleFrom(ih); - if (has == null) { - endpoints.add(new EnergyHandler(ih, cableType, dir)); - } else { - has.side = dir; - } - } + public void merge(TRPowerNet n) + { + if (n != this) + { + ArrayList li = new ArrayList(); + for (int i = 0; i < n.cables.size(); i++) + { + CableMultipart wire = n.cables.get(i); + li.add(wire); + } + for (EnergyHandler ei : endpoints) + { + endpoints.add(ei); + } + n.clear(false); + for (int i = 0; i < li.size(); i++) + { + CableMultipart wire = li.get(i); + wire.setNetwork(this); + } + checkAndRemoveOldEndpoints(); + MinecraftForge.EVENT_BUS.unregister(n); + } + } - public void merge(TRPowerNet n) { - if (n != this) { - ArrayList li = new ArrayList(); - for (int i = 0; i < n.cables.size(); i++) { - CableMultipart wire = n.cables.get(i); - li.add(wire); - } - for (EnergyHandler ei : endpoints) { - endpoints.add(ei); - } - n.clear(false); - for (int i = 0; i < li.size(); i++) { - CableMultipart wire = li.get(i); - wire.setNetwork(this); - } - checkAndRemoveOldEndpoints(); - MinecraftForge.EVENT_BUS.unregister(n); - } - } + private EnergyHandler getHandleFrom(IEnergyInterfaceTile tile) + { + for (EnergyHandler ei : endpoints) + { + if (ei.tile == tile) + return ei; + } + return null; + } - private EnergyHandler getHandleFrom(IEnergyInterfaceTile tile) { - for (EnergyHandler ei : endpoints) { - if (ei.tile == tile) - return ei; - } - return null; - } + private void clear(boolean clearTiles) + { + if (clearTiles) + { + for (int i = 0; i < cables.size(); i++) + { + cables.get(i).resetNetwork(); + } + } - private void clear(boolean clearTiles) { - if (clearTiles) { - for (int i = 0; i < cables.size(); i++) { - cables.get(i).resetNetwork(); - } - } + cables.clear(); + endpoints.clear(); + energy = 0; - cables.clear(); - endpoints.clear(); - energy = 0; + MinecraftForge.EVENT_BUS.unregister(this); + } - MinecraftForge.EVENT_BUS.unregister(this); - } + public int addEnergy(int maxAdd, boolean simulate) + { + if (energy >= this.getIOLimit()) + return 0; + maxAdd = Math.min(this.getIOLimit(), maxAdd); + if (!simulate) + energy += maxAdd; + return maxAdd; + } - public int addEnergy(int maxAdd, boolean simulate) { - if (energy >= this.getIOLimit()) - return 0; - maxAdd = Math.min(this.getIOLimit(), maxAdd); - if (!simulate) - energy += maxAdd; - return maxAdd; - } + private static class EnergyHandler + { + private final IEnergyInterfaceTile tile; + private EnumFacing side; + private final EnumCableType type; - private static class EnergyHandler { - private final IEnergyInterfaceTile tile; - private EnumFacing side; - private final EnumCableType type; + private EnergyHandler(IEnergyInterfaceTile ih, EnumCableType type, EnumFacing dir) + { + tile = ih; + this.type = type; + this.side = dir; + } - private EnergyHandler(IEnergyInterfaceTile ih, EnumCableType type, EnumFacing dir) { - tile = ih; - this.type = type; - this.side = dir; - } + public boolean isInsertible() + { + return this.getTotalInsertible() > 0; + } - public boolean isInsertible() { - return this.getTotalInsertible() > 0; - } + public boolean isCollectible() + { + return this.getTotalCollectible() > 0; + } - public boolean isCollectible() { - return this.getTotalCollectible() > 0; - } + public boolean contains(IEnergyInterfaceTile tile) + { + return tile == this.tile; + } - public boolean contains(IEnergyInterfaceTile tile) { - return tile == this.tile; - } + public int collectEnergy(int max) + { + int total = 0; + if (tile.canProvideEnergy(side.getOpposite())) + { + int collect = (int) Math.min(max, Math.min(tile.getMaxOutput(), tile.getEnergy())); + total = (int) tile.useEnergy(collect, false); + } + return total; + } - public int collectEnergy(int max) { - int total = 0; - if (tile.canProvideEnergy(side.getOpposite())) { - int collect = (int) Math.min(max, Math.min(tile.getMaxOutput(), tile.getEnergy())); - total = (int) tile.useEnergy(collect, false); - } - return total; - } + public int addEnergy(int max) + { + int total = 0; + if (tile.canAcceptEnergy(side) && max > 0) + { + if (type.tier.ordinal() > tile.getTier().ordinal()) + { + if (tile instanceof TileEntity) + { + ((TileEntity) tile).getWorld().createExplosion( + new EntityTNTPrimed(((TileEntity) tile).getWorld()), + ((TileEntity) tile).getPos().getX(), ((TileEntity) tile).getPos().getY(), + ((TileEntity) tile).getPos().getZ(), 2.5F, true); + } + return 0; + } + int add = max - total; + total += tile.addEnergy(add, false); + } + return total; + } - public int addEnergy(int max) { - int total = 0; - if (tile.canAcceptEnergy(side) && max > 0) { - if (type.tier.ordinal() > tile.getTier().ordinal()) { - if (tile instanceof TileEntity) { - ((TileEntity) tile).getWorld().createExplosion(new EntityTNTPrimed(((TileEntity) tile).getWorld()), ((TileEntity) tile).getPos().getX(), ((TileEntity) tile).getPos().getY(), ((TileEntity) tile).getPos().getZ(), 2.5F, true); - } - return 0; - } - int add = max - total; - total += tile.addEnergy(add, false); - } - return total; - } + public int getTotalCollectible() + { + if (tile.canProvideEnergy(side.getOpposite()) && tile.getEnergy() != 0) + { + return (int) Math.min(tile.getMaxOutput(), tile.getEnergy()); + } + return 0; + } - public int getTotalCollectible() { - if (tile.canProvideEnergy(side.getOpposite()) && tile.getEnergy() != 0) { - return (int) Math.min(tile.getMaxOutput(), tile.getEnergy()); - } - return 0; - } + public int getTotalInsertible() + { + int total = 0; + if (tile.canAcceptEnergy(side.getOpposite()) && tile.getMaxPower() - tile.getEnergy() != 0) + { + total += tile.addEnergy(type.transferRate, true); + } - public int getTotalInsertible() { - int total = 0; - if (tile.canAcceptEnergy(side.getOpposite()) && tile.getMaxPower() - tile.getEnergy() != 0) { - total += tile.addEnergy(type.transferRate, true); - } - - return total; - } - } + return total; + } + } } diff --git a/src/main/java/techreborn/proxies/ClientProxy.java b/src/main/java/techreborn/proxies/ClientProxy.java index b07e5a75d..365b9f784 100644 --- a/src/main/java/techreborn/proxies/ClientProxy.java +++ b/src/main/java/techreborn/proxies/ClientProxy.java @@ -9,43 +9,52 @@ import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import reborncore.client.multiblock.MultiblockRenderEvent; -import techreborn.client.*; +import techreborn.client.ClientMultiBlocks; +import techreborn.client.IconSupplier; +import techreborn.client.RegisterItemJsons; +import techreborn.client.StackToolTipEvent; +import techreborn.client.VersionCheckerClient; import techreborn.client.hud.ChargeHud; import techreborn.client.keybindings.KeyBindings; import techreborn.client.render.entitys.RenderNukePrimed; import techreborn.entitys.EntityNukePrimed; -public class ClientProxy extends CommonProxy { +public class ClientProxy extends CommonProxy +{ - public static MultiblockRenderEvent multiblockRenderEvent; + public static MultiblockRenderEvent multiblockRenderEvent; - @Override - public void preInit(FMLPreInitializationEvent event) { - super.preInit(event); - RenderingRegistry.registerEntityRenderingHandler(EntityNukePrimed.class, new RenderManagerNuke()); - } + @Override + public void preInit(FMLPreInitializationEvent event) + { + super.preInit(event); + RenderingRegistry.registerEntityRenderingHandler(EntityNukePrimed.class, new RenderManagerNuke()); + } - @Override - public void init(FMLInitializationEvent event) { - super.init(event); - RegisterItemJsons.registerModels(); - MinecraftForge.EVENT_BUS.register(new IconSupplier()); - MinecraftForge.EVENT_BUS.register(new ChargeHud()); - MinecraftForge.EVENT_BUS.register(new VersionCheckerClient()); - MinecraftForge.EVENT_BUS.register(new StackToolTipEvent()); - multiblockRenderEvent = new MultiblockRenderEvent(); - //MinecraftForge.EVENT_BUS.register(multiblockRenderEvent); - //TODO FIX ME - ClientRegistry.registerKeyBinding(KeyBindings.config); - ClientMultiBlocks.init(); - } + @Override + public void init(FMLInitializationEvent event) + { + super.init(event); + RegisterItemJsons.registerModels(); + MinecraftForge.EVENT_BUS.register(new IconSupplier()); + MinecraftForge.EVENT_BUS.register(new ChargeHud()); + MinecraftForge.EVENT_BUS.register(new VersionCheckerClient()); + MinecraftForge.EVENT_BUS.register(new StackToolTipEvent()); + multiblockRenderEvent = new MultiblockRenderEvent(); + // MinecraftForge.EVENT_BUS.register(multiblockRenderEvent); + // TODO FIX ME + ClientRegistry.registerKeyBinding(KeyBindings.config); + ClientMultiBlocks.init(); + } - public class RenderManagerNuke implements IRenderFactory{ + public class RenderManagerNuke implements IRenderFactory + { - @Override - public Render createRenderFor(RenderManager manager) { - return new RenderNukePrimed(manager); - } - } + @Override + public Render createRenderFor(RenderManager manager) + { + return new RenderNukePrimed(manager); + } + } } diff --git a/src/main/java/techreborn/proxies/CommonProxy.java b/src/main/java/techreborn/proxies/CommonProxy.java index 00075971c..e99681d8d 100644 --- a/src/main/java/techreborn/proxies/CommonProxy.java +++ b/src/main/java/techreborn/proxies/CommonProxy.java @@ -6,26 +6,30 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import techreborn.compat.ICompatModule; -public class CommonProxy implements ICompatModule{ +public class CommonProxy implements ICompatModule +{ + @Override + public void preInit(FMLPreInitializationEvent event) + { - @Override - public void preInit(FMLPreInitializationEvent event) { + } - } + @Override + public void init(FMLInitializationEvent event) + { - @Override - public void init(FMLInitializationEvent event) { + } - } + @Override + public void postInit(FMLPostInitializationEvent event) + { - @Override - public void postInit(FMLPostInitializationEvent event) { + } - } + @Override + public void serverStarting(FMLServerStartingEvent event) + { - @Override - public void serverStarting(FMLServerStartingEvent event) { - - } + } } diff --git a/src/main/java/techreborn/tiles/TileAesu.java b/src/main/java/techreborn/tiles/TileAesu.java index 5143db972..872c6a8dd 100644 --- a/src/main/java/techreborn/tiles/TileAesu.java +++ b/src/main/java/techreborn/tiles/TileAesu.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -10,151 +9,183 @@ import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileAesu extends TilePowerAcceptor implements IWrenchable { +public class TileAesu extends TilePowerAcceptor implements IWrenchable +{ - public static final int MAX_OUTPUT = ConfigTechReborn.aesuMaxOutput; - public static final int MAX_STORAGE = ConfigTechReborn.aesuMaxStorage; - public Inventory inventory = new Inventory(4, "TileAesu", 64, this); - private int OUTPUT = 64; //The current output - private double euLastTick = 0; - private double euChange; - private int ticks; + public static final int MAX_OUTPUT = ConfigTechReborn.aesuMaxOutput; + public static final int MAX_STORAGE = ConfigTechReborn.aesuMaxStorage; + public Inventory inventory = new Inventory(4, "TileAesu", 64, this); + private int OUTPUT = 64; // The current output + private double euLastTick = 0; + private double euChange; + private int ticks; - public TileAesu() { - super(5); - } + public TileAesu() + { + super(5); + } - @Override - public void updateEntity() { - super.updateEntity(); - if (ticks == ConfigTechReborn.aveargeEuOutTickTime) { - euChange = -1; - ticks = 0; + @Override + public void updateEntity() + { + super.updateEntity(); + if (ticks == ConfigTechReborn.aveargeEuOutTickTime) + { + euChange = -1; + ticks = 0; - } else { - ticks++; - euChange += getEnergy() - euLastTick; - if (euLastTick == getEnergy()) { - euChange = 0; - } - } + } else + { + ticks++; + euChange += getEnergy() - euLastTick; + if (euLastTick == getEnergy()) + { + euChange = 0; + } + } - euLastTick = getEnergy(); - } + euLastTick = getEnergy(); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return getDropWithNBT(); - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - public boolean isComplete() { - return false; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return getDropWithNBT(); + } - public void handleGuiInputFromClient(int id) { - if (id == 0) { - OUTPUT += 256; - } - if (id == 1) { - OUTPUT += 64; - } - if (id == 2) { - OUTPUT -= 64; - } - if (id == 3) { - OUTPUT -= 256; - } - if (OUTPUT > MAX_OUTPUT) { - OUTPUT = MAX_OUTPUT; - } - if (OUTPUT <= -1) { - OUTPUT = 0; - } - } + public boolean isComplete() + { + return false; + } - public double getEuChange() { - if (euChange == -1) { - return -1; - } - return (euChange / ticks); - } + public void handleGuiInputFromClient(int id) + { + if (id == 0) + { + OUTPUT += 256; + } + if (id == 1) + { + OUTPUT += 64; + } + if (id == 2) + { + OUTPUT -= 64; + } + if (id == 3) + { + OUTPUT -= 256; + } + if (OUTPUT > MAX_OUTPUT) + { + OUTPUT = MAX_OUTPUT; + } + if (OUTPUT <= -1) + { + OUTPUT = 0; + } + } - public ItemStack getDropWithNBT() { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1); - writeToNBTWithoutCoords(tileEntity); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } + public double getEuChange() + { + if (euChange == -1) + { + return -1; + } + return (euChange / ticks); + } - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tagCompound.setDouble("euChange", euChange); - tagCompound.setDouble("euLastTick", euLastTick); - tagCompound.setInteger("output", OUTPUT); - inventory.writeToNBT(tagCompound); - } + public ItemStack getDropWithNBT() + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.Aesu, 1); + writeToNBTWithoutCoords(tileEntity); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.euChange = nbttagcompound.getDouble("euChange"); - this.euLastTick = nbttagcompound.getDouble("euLastTick"); - this.OUTPUT = nbttagcompound.getInteger("output"); - inventory.readFromNBT(nbttagcompound); - } + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tagCompound.setDouble("euChange", euChange); + tagCompound.setDouble("euLastTick", euLastTick); + tagCompound.setInteger("output", OUTPUT); + inventory.writeToNBT(tagCompound); + } + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.euChange = nbttagcompound.getDouble("euChange"); + this.euLastTick = nbttagcompound.getDouble("euLastTick"); + this.OUTPUT = nbttagcompound.getInteger("output"); + inventory.readFromNBT(nbttagcompound); + } - @Override - public double getMaxPower() { - return TileAesu.MAX_STORAGE; - } + @Override + public double getMaxPower() + { + return TileAesu.MAX_STORAGE; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return getFacingEnum() != direction; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return getFacingEnum() != direction; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return getFacingEnum() == direction; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return getFacingEnum() == direction; + } - @Override - public double getMaxOutput() { - return OUTPUT; - } + @Override + public double getMaxOutput() + { + return OUTPUT; + } - @Override - public double getMaxInput() { - return 4096 * 2; - } + @Override + public double getMaxInput() + { + return 4096 * 2; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } } diff --git a/src/main/java/techreborn/tiles/TileAlloyFurnace.java b/src/main/java/techreborn/tiles/TileAlloyFurnace.java index 8003df2d5..51b94b63c 100644 --- a/src/main/java/techreborn/tiles/TileAlloyFurnace.java +++ b/src/main/java/techreborn/tiles/TileAlloyFurnace.java @@ -1,13 +1,11 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; -import net.minecraft.item.*; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.text.ITextComponent; @@ -19,344 +17,439 @@ import techreborn.api.recipe.IBaseRecipeType; import techreborn.api.recipe.RecipeHandler; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, IInventory { +public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, IInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(4, "TileAlloyFurnace", 64, this); + public int tickTime; + public Inventory inventory = new Inventory(4, "TileAlloyFurnace", 64, this); - int input1 = 0; - int input2 = 1; + int input1 = 0; + int input2 = 1; - int output = 2; + int output = 2; - int fuel = 3; + int fuel = 3; + public int burnTime; - public int burnTime; + public int currentItemBurnTime; + public int cookTime; - public int currentItemBurnTime; - public int cookTime; + public TileAlloyFurnace() + { - public TileAlloyFurnace() { + } - } + @Override + public void updateEntity() + { + super.updateEntity(); + boolean flag = this.burnTime > 0; + boolean flag1 = false; + if (this.burnTime > 0) + { + --this.burnTime; + } + if (!this.worldObj.isRemote) + { + if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null) + { + if (this.burnTime == 0 && this.canSmelt()) + { + this.currentItemBurnTime = this.burnTime = getItemBurnTime(getStackInSlot(fuel)); + if (this.burnTime > 0) + { + flag1 = true; + if (this.getStackInSlot(fuel) != null) + { + decrStackSize(fuel, 1); + } + } + } + if (this.isBurning() && this.canSmelt()) + { + ++this.cookTime; + if (this.cookTime == 200) + { + this.cookTime = 0; + this.smeltItem(); + flag1 = true; + } + } else + { + this.cookTime = 0; + } + } + if (flag != this.burnTime > 0) + { + flag1 = true; + // TODO sync on/off + } + } + if (flag1) + { + this.markDirty(); + } + } - @Override - public void updateEntity() { - super.updateEntity(); - boolean flag = this.burnTime > 0; - boolean flag1 = false; - if (this.burnTime > 0) { - --this.burnTime; - } - if (!this.worldObj.isRemote) { - if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null) { - if (this.burnTime == 0 && this.canSmelt()) { - this.currentItemBurnTime = this.burnTime = getItemBurnTime(getStackInSlot(fuel)); - if (this.burnTime > 0) { - flag1 = true; - if (this.getStackInSlot(fuel) != null) { - decrStackSize(fuel, 1); - } - } - } - if (this.isBurning() && this.canSmelt()) { - ++this.cookTime; - if (this.cookTime == 200) { - this.cookTime = 0; - this.smeltItem(); - flag1 = true; - } - } else { - this.cookTime = 0; - } - } - if (flag != this.burnTime > 0) { - flag1 = true; - //TODO sync on/off - } - } - if (flag1) { - this.markDirty(); - } - } + public boolean hasAllInputs(IBaseRecipeType recipeType) + { + if (recipeType == null) + { + return false; + } + for (ItemStack input : recipeType.getInputs()) + { + Boolean hasItem = false; + for (int inputslot = 0; inputslot < 2; inputslot++) + { + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true, + recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) + { + hasItem = true; + } + } + if (!hasItem) + return false; + } + return true; + } - public boolean hasAllInputs(IBaseRecipeType recipeType) { - if (recipeType == null) { - return false; - } - for (ItemStack input : recipeType.getInputs()) { - Boolean hasItem = false; - for (int inputslot = 0; inputslot < 2; inputslot++) { - if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputslot), true, true, recipeType.useOreDic()) && inventory.getStackInSlot(inputslot).stackSize >= input.stackSize) { - hasItem = true; - } - } - if (!hasItem) - return false; - } - return true; - } + private boolean canSmelt() + { + if (this.getStackInSlot(input1) == null || this.getStackInSlot(input2) == null) + { + return false; + } else + { + ItemStack itemstack = null; + for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) + { + if (hasAllInputs(recipeType)) + { + itemstack = recipeType.getOutput(0); + break; + } + } - private boolean canSmelt() { - if (this.getStackInSlot(input1) == null || this.getStackInSlot(input2) == null) { - return false; - } else { - ItemStack itemstack = null; - for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) { - if (hasAllInputs(recipeType)) { - itemstack = recipeType.getOutput(0); - break; - } - } + if (itemstack == null) + return false; + if (this.getStackInSlot(output) == null) + return true; + if (!this.getStackInSlot(output).isItemEqual(itemstack)) + return false; + int result = getStackInSlot(output).stackSize + itemstack.stackSize; + return result <= getInventoryStackLimit() && result <= this.getStackInSlot(output).getMaxStackSize(); // Forge + // BugFix: + // Make + // it + // respect + // stack + // sizes + // properly. + } + } - if (itemstack == null) return false; - if (this.getStackInSlot(output) == null) return true; - if (!this.getStackInSlot(output).isItemEqual(itemstack)) return false; - int result = getStackInSlot(output).stackSize + itemstack.stackSize; - return result <= getInventoryStackLimit() && result <= this.getStackInSlot(output).getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. - } - } + /** + * Turn one item from the furnace source stack into the appropriate smelted + * item in the furnace result stack + */ + public void smeltItem() + { + if (this.canSmelt()) + { + ItemStack itemstack = null; + for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) + { + for (ItemStack input : recipeType.getInputs()) + { + if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) + || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) + { + itemstack = recipeType.getOutput(0); + break; + } + } + if (itemstack != null) + { + break; + } + } - /** - * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack - */ - public void smeltItem() { - if (this.canSmelt()) { - ItemStack itemstack = null; - for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) { - for (ItemStack input : recipeType.getInputs()) { - if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) { - itemstack = recipeType.getOutput(0); - break; - } - } - if (itemstack != null) { - break; - } - } + if (this.getStackInSlot(output) == null) + { + setInventorySlotContents(output, itemstack.copy()); + } else if (this.getStackInSlot(output).getItem() == itemstack.getItem()) + { + decrStackSize(output, -itemstack.stackSize); + } - if (this.getStackInSlot(output) == null) { - setInventorySlotContents(output, itemstack.copy()); - } else if (this.getStackInSlot(output).getItem() == itemstack.getItem()) { - decrStackSize(output, -itemstack.stackSize); - } + for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) + { + boolean hasAllRecipes = true; + for (ItemStack input : recipeType.getInputs()) + { + if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) + || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) + { - for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) { - boolean hasAllRecipes = true; - for (ItemStack input : recipeType.getInputs()) { - if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) { + } else + { + hasAllRecipes = false; + } + } + if (hasAllRecipes) + { + for (ItemStack input : recipeType.getInputs()) + { + for (int inputSlot = 0; inputSlot < 2; inputSlot++) + { + if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, + recipeType.useOreDic())) + { + inventory.decrStackSize(inputSlot, input.stackSize); + break; + } + } + } + } + } - } else { - hasAllRecipes = false; - } - } - if(hasAllRecipes){ - for (ItemStack input : recipeType.getInputs()) { - for (int inputSlot = 0; inputSlot < 2; inputSlot++) { - if (ItemUtils.isItemEqual(input, inventory.getStackInSlot(inputSlot), true, true, recipeType.useOreDic())) { - inventory.decrStackSize(inputSlot, input.stackSize); - break; - } - } - } - } - } + } + } - } - } + /** + * Furnace isBurning + */ + public boolean isBurning() + { + return this.burnTime > 0; + } - /** - * Furnace isBurning - */ - public boolean isBurning() { - return this.burnTime > 0; - } + public int getBurnTimeRemainingScaled(int scale) + { + if (this.currentItemBurnTime == 0) + { + this.currentItemBurnTime = 200; + } - public int getBurnTimeRemainingScaled(int scale) { - if (this.currentItemBurnTime == 0) { - this.currentItemBurnTime = 200; - } + return this.burnTime * scale / this.currentItemBurnTime; + } - return this.burnTime * scale / this.currentItemBurnTime; - } + public int getCookProgressScaled(int scale) + { + return this.cookTime * scale / 200; + } - public int getCookProgressScaled(int scale) { - return this.cookTime * scale / 200; - } + /** + * Returns the number of ticks that the supplied fuel item will keep the + * furnace burning, or 0 if the item isn't fuel + */ + public static int getItemBurnTime(ItemStack stack) + { + if (stack == null) + { + return 0; + } else + { + Item item = stack.getItem(); + if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) + { + Block block = Block.getBlockFromItem(item); - /** - * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't - * fuel - */ - public static int getItemBurnTime(ItemStack stack) { - if (stack == null) { - return 0; - } else { - Item item = stack.getItem(); + if (block == Blocks.wooden_slab) + { + return 150; + } - if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) { - Block block = Block.getBlockFromItem(item); + if (block.getMaterial(block.getDefaultState()) == Material.wood) + { + return 300; + } - if (block == Blocks.wooden_slab) { - return 150; - } + if (block == Blocks.coal_block) + { + return 16000; + } + } - if (block.getMaterial(block.getDefaultState()) == Material.wood) { - return 300; - } + if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) + return 200; + if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) + return 200; + // if (item instanceof ItemHoe && ((ItemHoe) + // item).getToolMaterialName().equals("WOOD")) return 200; + if (item == Items.stick) + return 100; + if (item == Items.coal) + return 1600; + if (item == Items.lava_bucket) + return 20000; + if (item == Item.getItemFromBlock(Blocks.sapling)) + return 100; + if (item == Items.blaze_rod) + return 2400; + return GameRegistry.getFuelValue(stack); + } + } - if (block == Blocks.coal_block) { - return 16000; - } - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200; - if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200; - //if (item instanceof ItemHoe && ((ItemHoe) item).getToolMaterialName().equals("WOOD")) return 200; - if (item == Items.stick) return 100; - if (item == Items.coal) return 1600; - if (item == Items.lava_bucket) return 20000; - if (item == Item.getItemFromBlock(Blocks.sapling)) return 100; - if (item == Items.blaze_rod) return 2400; - return GameRegistry.getFuelValue(stack); - } - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.AlloyFurnace, 1); + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + public boolean isComplete() + { + return false; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.AlloyFurnace, 1); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); - public boolean isComplete() { - return false; - } + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); - } + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public String getName() + { + return inventory.getName(); + } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } - - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } - - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } - - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileAlloySmelter.java b/src/main/java/techreborn/tiles/TileAlloySmelter.java index 7181fe6fc..9077b7419 100644 --- a/src/main/java/techreborn/tiles/TileAlloySmelter.java +++ b/src/main/java/techreborn/tiles/TileAlloySmelter.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -15,231 +14,269 @@ import techreborn.api.recipe.RecipeCrafter; import techreborn.api.upgrade.UpgradeHandler; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(8, "TileAlloySmelter", 64, this); - public RecipeCrafter crafter; - public int capacity = 1000; - UpgradeHandler upgrades; + public int tickTime; + public Inventory inventory = new Inventory(8, "TileAlloySmelter", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; + UpgradeHandler upgrades; - public TileAlloySmelter() { - super(1); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[1]; - outputs[0] = 2; - crafter = new RecipeCrafter(Reference.alloySmelteRecipe, this, 2, 1, inventory, inputs, outputs); - upgrades = new UpgradeHandler(crafter, inventory, 4, 5, 6, 7); - } + public TileAlloySmelter() + { + super(1); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[1]; + outputs[0] = 2; + crafter = new RecipeCrafter(Reference.alloySmelteRecipe, this, 2, 1, inventory, inputs, outputs); + upgrades = new UpgradeHandler(crafter, inventory, 4, 5, 6, 7); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - upgrades.tick(); - charge(3); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + upgrades.tick(); + charge(3); + } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.AlloySmelter, 1); - } + public boolean isComplete() + { + return false; + } - public boolean isComplete() { - return false; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + // @Override + // public void addWailaInfo(List info){ + // super.addWailaInfo(info); + // info.add("Power Stored " + energy.getEnergyStored() + "/" + + // energy.getCapacity() +" EU"); + // if(crafter.currentRecipe !=null){ + // info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); + // } + // } -// @Override -// public void addWailaInfo(List info){ -// super.addWailaInfo(info); -// info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU"); -// if(crafter.currentRecipe !=null){ -// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); -// } -// } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0 && crafter.currentNeededTicks != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0 && crafter.currentNeededTicks != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } - - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileAssemblingMachine.java b/src/main/java/techreborn/tiles/TileAssemblingMachine.java index 722dc7bdb..28fad14b0 100644 --- a/src/main/java/techreborn/tiles/TileAssemblingMachine.java +++ b/src/main/java/techreborn/tiles/TileAssemblingMachine.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,227 +13,265 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(8, "TileAssemblingMachine", 64, this); - public RecipeCrafter crafter; + public int tickTime; + public Inventory inventory = new Inventory(8, "TileAssemblingMachine", 64, this); + public RecipeCrafter crafter; - public TileAssemblingMachine() { - super(2); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[1]; - outputs[0] = 2; - crafter = new RecipeCrafter(Reference.assemblingMachineRecipe, this, 2, 2, inventory, inputs, outputs); - } + public TileAssemblingMachine() + { + super(2); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[1]; + outputs[0] = 2; + crafter = new RecipeCrafter(Reference.assemblingMachineRecipe, this, 2, 2, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - charge(3); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + charge(3); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.AssemblyMachine, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.AssemblyMachine, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + // @Override + // public void addWailaInfo(List info) + // { + // super.addWailaInfo(info); + // info.add("Power Stored " + energy.getEnergyStored() +" EU"); + // if(crafter.currentRecipe !=null){ + // info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); + // } + // } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } -// @Override -// public void addWailaInfo(List info) -// { -// super.addWailaInfo(info); -// info.add("Power Stored " + energy.getEnergyStored() +" EU"); -// if(crafter.currentRecipe !=null){ -// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); -// } -// } + @Override + public double getMaxPower() + { + return 10000; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public double getMaxInput() { - return 128; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileBlastFurnace.java b/src/main/java/techreborn/tiles/TileBlastFurnace.java index e9c20ce44..8d161edcf 100644 --- a/src/main/java/techreborn/tiles/TileBlastFurnace.java +++ b/src/main/java/techreborn/tiles/TileBlastFurnace.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -24,260 +23,317 @@ import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.lib.Reference; import techreborn.multiblocks.MultiBlockCasing; +import ic2.api.tile.IWrenchable; -public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(4, "TileBlastFurnace", 64, this); - public RecipeCrafter crafter; - public int capacity = 1000; - public static int euTick = 5; + public int tickTime; + public Inventory inventory = new Inventory(4, "TileBlastFurnace", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; + public static int euTick = 5; - public TileBlastFurnace() { - super(ConfigTechReborn.CentrifugeTier); - //TODO configs - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[2]; - outputs[0] = 2; - outputs[1] = 3; - crafter = new RecipeCrafter(Reference.blastFurnaceRecipe, this, 2, 2, inventory, inputs, outputs); - } + public TileBlastFurnace() + { + super(ConfigTechReborn.CentrifugeTier); + // TODO configs + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[2]; + outputs[0] = 2; + outputs[1] = 3; + crafter = new RecipeCrafter(Reference.blastFurnaceRecipe, this, 2, 2, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.BlastFurnace, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.BlastFurnace, 1); + } - public int getHeat() { - for (EnumFacing direction : EnumFacing.values()) { - TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); - if (tileEntity instanceof TileMachineCasing) { - if (((TileMachineCasing) tileEntity).isConnected() && ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled()) { - MultiBlockCasing casing = ((TileMachineCasing) tileEntity).getMultiblockController(); - Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); - location.modifyPositionFromSide(direction, 1); - int heat = 0; - if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY() - 1, location.getZ())).getBlock() == tileEntity.getBlockType()) { - return 0; - } + public int getHeat() + { + for (EnumFacing direction : EnumFacing.values()) + { + TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); + if (tileEntity instanceof TileMachineCasing) + { + if (((TileMachineCasing) tileEntity).isConnected() + && ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled()) + { + MultiBlockCasing casing = ((TileMachineCasing) tileEntity).getMultiblockController(); + Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); + location.modifyPositionFromSide(direction, 1); + int heat = 0; + if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY() - 1, location.getZ())) + .getBlock() == tileEntity.getBlockType()) + { + return 0; + } - for (IMultiblockPart part : casing.connectedParts) { - BlockMachineCasing casing1 = (BlockMachineCasing) worldObj.getBlockState(part.getPos()).getBlock(); - heat += casing1.getHeatFromState(part.getWorld().getBlockState(part.getWorldLocation().toBlockPos())); - //TODO meta fix - } + for (IMultiblockPart part : casing.connectedParts) + { + BlockMachineCasing casing1 = (BlockMachineCasing) worldObj.getBlockState(part.getPos()) + .getBlock(); + heat += casing1 + .getHeatFromState(part.getWorld().getBlockState(part.getWorldLocation().toBlockPos())); + // TODO meta fix + } - if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava") && worldObj.getBlockState(new BlockPos(location.getX(), location.getY() + 1, location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) { - heat += 500; - } - return heat; - } - } - } - return 0; - } + if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())) + .getBlock().getUnlocalizedName().equals("tile.lava") + && worldObj + .getBlockState(new BlockPos(location.getX(), location.getY() + 1, location.getZ())) + .getBlock().getUnlocalizedName().equals("tile.lava")) + { + heat += 500; + } + return heat; + } + } + } + return 0; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + tickTime = tagCompound.getInteger("tickTime"); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - tickTime = tagCompound.getInteger("tickTime"); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + writeUpdateToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - writeUpdateToNBT(tagCompound); - } + public void writeUpdateToNBT(NBTTagCompound tagCompound) + { + tagCompound.setInteger("tickTime", tickTime); + } - public void writeUpdateToNBT(NBTTagCompound tagCompound) { - tagCompound.setInteger("tickTime", tickTime); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3 } : new int[] { 0, 1, 2, 3 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - public double getMaxInput() { - return 128; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.HIGH; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.HIGH; - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileCentrifuge.java b/src/main/java/techreborn/tiles/TileCentrifuge.java index 71f7b0df9..2f9607f08 100644 --- a/src/main/java/techreborn/tiles/TileCentrifuge.java +++ b/src/main/java/techreborn/tiles/TileCentrifuge.java @@ -1,6 +1,7 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -16,230 +17,269 @@ import techreborn.api.recipe.RecipeCrafter; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -import java.util.List; +public class TileCentrifuge extends TilePowerAcceptor + implements IWrenchable, IInventory, ISidedInventory, IListInfoProvider +{ -public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory, IListInfoProvider { + public int tickTime; + public Inventory inventory = new Inventory(11, "TileCentrifuge", 64, this); + public RecipeCrafter crafter; - public int tickTime; - public Inventory inventory = new Inventory(11, "TileCentrifuge", 64, this); - public RecipeCrafter crafter; + public int euTick = ConfigTechReborn.CentrifugeInputTick; - public int euTick = ConfigTechReborn.CentrifugeInputTick; + public TileCentrifuge() + { + super(2); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[4]; + outputs[0] = 2; + outputs[1] = 3; + outputs[2] = 4; + outputs[3] = 5; - public TileCentrifuge() { - super(2); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[4]; - outputs[0] = 2; - outputs[1] = 3; - outputs[2] = 4; - outputs[3] = 5; + crafter = new RecipeCrafter(Reference.centrifugeRecipe, this, 2, 4, inventory, inputs, outputs); + } - crafter = new RecipeCrafter(Reference.centrifugeRecipe, this, 2, 4, inventory, inputs, outputs); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + charge(6); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - charge(6); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.centrifuge, 1); + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + public boolean isComplete() + { + return false; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.centrifuge, 1); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - public boolean isComplete() { - return false; - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void addInfo(List info, boolean isRealTile) + { + super.addInfo(info, isRealTile); + info.add("Round and round it goes"); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public void addInfo(List info, boolean isRealTile) { - super.addInfo(info, isRealTile); - info.add("Round and round it goes"); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 }; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; - } + @Override + public double getMaxPower() + { + return 10000; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } \ No newline at end of file diff --git a/src/main/java/techreborn/tiles/TileChargeBench.java b/src/main/java/techreborn/tiles/TileChargeBench.java index 139ac6ff0..7f03f7995 100644 --- a/src/main/java/techreborn/tiles/TileChargeBench.java +++ b/src/main/java/techreborn/tiles/TileChargeBench.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -13,216 +12,258 @@ import reborncore.api.power.IEnergyInterfaceItem; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileChargeBench", 64, this); - public int capacity = 100000; + public Inventory inventory = new Inventory(6, "TileChargeBench", 64, this); + public int capacity = 100000; - public TileChargeBench() { - super(4); - } + public TileChargeBench() + { + super(4); + } - @Override - public void updateEntity() { - super.updateEntity(); + @Override + public void updateEntity() + { + super.updateEntity(); - for (int i = 0; i < 6; i++) { - if (inventory.getStackInSlot(i) != null) { - if (getEnergy() > 0) { - ItemStack stack = inventory.getStackInSlot(i); - if (stack.getItem() instanceof IEnergyInterfaceItem) { - IEnergyInterfaceItem interfaceItem = (IEnergyInterfaceItem) stack.getItem(); - double trans = Math.min(interfaceItem.getMaxPower(stack) - interfaceItem.getEnergy(stack), Math.min(interfaceItem.getMaxTransfer(stack), getEnergy())); - interfaceItem.setEnergy(trans + interfaceItem.getEnergy(stack), stack); - useEnergy(trans); - } - } - } - } - } + for (int i = 0; i < 6; i++) + { + if (inventory.getStackInSlot(i) != null) + { + if (getEnergy() > 0) + { + ItemStack stack = inventory.getStackInSlot(i); + if (stack.getItem() instanceof IEnergyInterfaceItem) + { + IEnergyInterfaceItem interfaceItem = (IEnergyInterfaceItem) stack.getItem(); + double trans = Math.min(interfaceItem.getMaxPower(stack) - interfaceItem.getEnergy(stack), + Math.min(interfaceItem.getMaxTransfer(stack), getEnergy())); + interfaceItem.setEnergy(trans + interfaceItem.getEnergy(stack), stack); + useEnergy(trans); + } + } + } + } + } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.chargeBench, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.chargeBench, 1); - } + public boolean isComplete() + { + return false; + } - public boolean isComplete() { - return false; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 }; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return isItemValidForSlot(slotIndex, itemStack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + // if (itemStack.getItem() instanceof IElectricItem) { + // double CurrentCharge = ElectricItem.manager.getCharge(itemStack); + // double MaxCharge = ((IElectricItem) + // itemStack.getItem()).getMaxCharge(itemStack); + // if (CurrentCharge == MaxCharge) + // return true; + // } + return false; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { -// if (itemStack.getItem() instanceof IElectricItem) { -// double CurrentCharge = ElectricItem.manager.getCharge(itemStack); -// double MaxCharge = ((IElectricItem) itemStack.getItem()).getMaxCharge(itemStack); -// if (CurrentCharge == MaxCharge) -// return true; -// } - return false; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 512; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } - @Override - public double getMaxInput() { - return 512; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileChemicalReactor.java b/src/main/java/techreborn/tiles/TileChemicalReactor.java index eda3059f9..c02057313 100644 --- a/src/main/java/techreborn/tiles/TileChemicalReactor.java +++ b/src/main/java/techreborn/tiles/TileChemicalReactor.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,226 +13,265 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(8, "TileChemicalReactor", 64, this); - public RecipeCrafter crafter; + public int tickTime; + public Inventory inventory = new Inventory(8, "TileChemicalReactor", 64, this); + public RecipeCrafter crafter; - public TileChemicalReactor() { - super(2); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[1]; - outputs[0] = 2; - crafter = new RecipeCrafter(Reference.chemicalReactorRecipe, this, 2, 2, inventory, inputs, outputs); - } + public TileChemicalReactor() + { + super(2); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[1]; + outputs[0] = 2; + crafter = new RecipeCrafter(Reference.chemicalReactorRecipe, this, 2, 2, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - charge(3); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + charge(3); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.ChemicalReactor, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.ChemicalReactor, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + // @Override + // public void addWailaInfo(List info) + // { + // super.addWailaInfo(info); + // info.add("Power Stored " + energy.getEnergyStored() +" EU"); + // if(crafter.currentRecipe !=null){ + // info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); + // } + // } -// @Override -// public void addWailaInfo(List info) -// { -// super.addWailaInfo(info); -// info.add("Power Stored " + energy.getEnergyStored() +" EU"); -// if(crafter.currentRecipe !=null){ -// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); -// } -// } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - public double getMaxInput() { - return 128; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileChunkLoader.java b/src/main/java/techreborn/tiles/TileChunkLoader.java index a92125396..dab3d8afe 100644 --- a/src/main/java/techreborn/tiles/TileChunkLoader.java +++ b/src/main/java/techreborn/tiles/TileChunkLoader.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,166 +9,197 @@ import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventory { +public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventory +{ - public Inventory inventory = new Inventory(1, "TileChunkLoader", 64, this); + public Inventory inventory = new Inventory(1, "TileChunkLoader", 64, this); - public boolean isRunning; - public int tickTime; + public boolean isRunning; + public int tickTime; - public int euTick = 32; + public int euTick = 32; - public TileChunkLoader() { - super(1); - } + public TileChunkLoader() + { + super(1); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.ChunkLoader, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.ChunkLoader, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileDigitalChest.java b/src/main/java/techreborn/tiles/TileDigitalChest.java index d3253c88e..1f1c9b421 100644 --- a/src/main/java/techreborn/tiles/TileDigitalChest.java +++ b/src/main/java/techreborn/tiles/TileDigitalChest.java @@ -1,6 +1,7 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -15,55 +16,52 @@ import reborncore.common.tile.TileMachineBase; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -import java.util.List; +public class TileDigitalChest extends TileMachineBase implements IInventory, IWrenchable, IListInfoProvider +{ -public class TileDigitalChest extends TileMachineBase implements IInventory, - IWrenchable, IListInfoProvider { + // Slot 0 = Input + // Slot 1 = Output + // Slot 2 = Fake Item - // Slot 0 = Input - // Slot 1 = Output - // Slot 2 = Fake Item + // TODO use long so we can have 9,223,372,036,854,775,807 items instead of + // 2,147,483,647 + int storage = 32767; - //TODO use long so we can have 9,223,372,036,854,775,807 items instead of 2,147,483,647 - int storage = 32767; + public Inventory inventory = new Inventory(3, "TileDigitalChest", storage, this); - public Inventory inventory = new Inventory(3, "TileDigitalChest", storage, this); - - public ItemStack storedItem; + public ItemStack storedItem; @Override - public void updateEntity() + public void updateEntity() { - if (!worldObj.isRemote) + if (!worldObj.isRemote) { - if (storedItem != null) + if (storedItem != null) { ItemStack fakeStack = storedItem.copy(); fakeStack.stackSize = 1; setInventorySlotContents(2, fakeStack); - } - else if (storedItem == null && getStackInSlot(1) != null) + } else if (storedItem == null && getStackInSlot(1) != null) { ItemStack fakeStack = getStackInSlot(1).copy(); fakeStack.stackSize = 1; setInventorySlotContents(2, fakeStack); - } - else + } else { setInventorySlotContents(2, null); } - if (getStackInSlot(0) != null) + if (getStackInSlot(0) != null) { - if (storedItem == null) + if (storedItem == null) { storedItem = getStackInSlot(0); setInventorySlotContents(0, null); - } - else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) + } else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) { - if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) + if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) { storedItem.stackSize += getStackInSlot(0).stackSize; decrStackSize(0, getStackInSlot(0).stackSize); @@ -71,22 +69,20 @@ public class TileDigitalChest extends TileMachineBase implements IInventory, } } - if (storedItem != null && getStackInSlot(1) == null) + if (storedItem != null && getStackInSlot(1) == null) { ItemStack itemStack = storedItem.copy(); itemStack.stackSize = itemStack.getMaxStackSize(); setInventorySlotContents(1, itemStack); storedItem.stackSize -= itemStack.getMaxStackSize(); - } - else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) + } else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) { int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize; - if (storedItem.stackSize >= wanted) + if (storedItem.stackSize >= wanted) { decrStackSize(1, -wanted); storedItem.stackSize -= wanted; - } - else + } else { decrStackSize(1, -storedItem.stackSize); storedItem = null; @@ -95,196 +91,226 @@ public class TileDigitalChest extends TileMachineBase implements IInventory, } } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - readFromNBTWithoutCoords(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + readFromNBTWithoutCoords(tagCompound); + } - public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { - inventory.readFromNBT(tagCompound); + public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) + { + inventory.readFromNBT(tagCompound); - storedItem = null; + storedItem = null; - if (tagCompound.hasKey("storedStack")) { - storedItem = ItemStack - .loadItemStackFromNBT((NBTTagCompound) tagCompound - .getTag("storedStack")); - } + if (tagCompound.hasKey("storedStack")) + { + storedItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) tagCompound.getTag("storedStack")); + } - if (storedItem != null) { - storedItem.stackSize = tagCompound.getInteger("storedQuantity"); - } - } + if (storedItem != null) + { + storedItem.stackSize = tagCompound.getInteger("storedQuantity"); + } + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - writeToNBTWithoutCoords(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + writeToNBTWithoutCoords(tagCompound); + } - public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) { - inventory.writeToNBT(tagCompound); - if (storedItem != null) { - tagCompound.setTag("storedStack", - storedItem.writeToNBT(new NBTTagCompound())); - tagCompound.setInteger("storedQuantity", storedItem.stackSize); - } else - tagCompound.setInteger("storedQuantity", 0); - } + public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) + { + inventory.writeToNBT(tagCompound); + if (storedItem != null) + { + tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound())); + tagCompound.setInteger("storedQuantity", storedItem.stackSize); + } else + tagCompound.setInteger("storedQuantity", 0); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slotId, int count) { - return inventory.decrStackSize(slotId, count); - } + @Override + public ItemStack decrStackSize(int slotId, int count) + { + return inventory.decrStackSize(slotId, count); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1F; + } - @Override - public float getWrenchDropRate() { - return 1F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return getDropWithNBT(); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return getDropWithNBT(); - } + public ItemStack getDropWithNBT() + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.digitalChest, 1); + writeToNBTWithoutCoords(tileEntity); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } - public ItemStack getDropWithNBT() { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.digitalChest, 1); - writeToNBTWithoutCoords(tileEntity); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } + @Override + public void addInfo(List info, boolean isRealTile) + { + int size = 0; + String name = "of nothing"; + if (storedItem != null) + { + name = storedItem.getDisplayName(); + size += storedItem.stackSize; + } + if (getStackInSlot(1) != null) + { + name = getStackInSlot(1).getDisplayName(); + size += getStackInSlot(1).stackSize; + } + info.add(size + " " + name); - @Override - public void addInfo(List info, boolean isRealTile) { - int size = 0; - String name = "of nothing"; - if (storedItem != null) { - name = storedItem.getDisplayName(); - size += storedItem.stackSize; - } - if (getStackInSlot(1) != null) { - name = getStackInSlot(1).getDisplayName(); - size += getStackInSlot(1).stackSize; - } - info.add(size + " " + name); + } - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileImplosionCompressor.java b/src/main/java/techreborn/tiles/TileImplosionCompressor.java index f19e2c01a..0397074bd 100644 --- a/src/main/java/techreborn/tiles/TileImplosionCompressor.java +++ b/src/main/java/techreborn/tiles/TileImplosionCompressor.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -18,246 +17,294 @@ import techreborn.api.recipe.RecipeCrafter; import techreborn.blocks.BlockMachineCasing; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(4, "TileImplosionCompressor", 64,this); - public RecipeCrafter crafter; + public int tickTime; + public Inventory inventory = new Inventory(4, "TileImplosionCompressor", 64, this); + public RecipeCrafter crafter; - public TileImplosionCompressor() { - super(1); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[2]; - outputs[0] = 2; - outputs[1] = 3; - crafter = new RecipeCrafter(Reference.implosionCompressorRecipe, this, 2, 2, inventory, inputs, outputs); - } + public TileImplosionCompressor() + { + super(1); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[2]; + outputs[0] = 2; + outputs[1] = 3; + crafter = new RecipeCrafter(Reference.implosionCompressorRecipe, this, 2, 2, inventory, inputs, outputs); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.ImplosionCompressor, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.ImplosionCompressor, 1); + } - public boolean getMutliBlock() { - for (EnumFacing direction : EnumFacing.values()) { - TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); - if (tileEntity instanceof TileMachineCasing) { - if(!((TileMachineCasing) tileEntity).isConnected()){ - return false; - } - if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) { - int heat; - BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType(); - heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos())); - Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); - location.modifyPositionFromSide(direction, 1); - if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) { - heat += 500; - } - return true; - } - } - } - return false; - } + public boolean getMutliBlock() + { + for (EnumFacing direction : EnumFacing.values()) + { + TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); + if (tileEntity instanceof TileMachineCasing) + { + if (!((TileMachineCasing) tileEntity).isConnected()) + { + return false; + } + if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) + { + int heat; + BlockMachineCasing machineCasing = (BlockMachineCasing) tileEntity.getBlockType(); + heat = machineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos())); + Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); + location.modifyPositionFromSide(direction, 1); + if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())) + .getBlock().getUnlocalizedName().equals("tile.lava")) + { + heat += 500; + } + return true; + } + } + } + return false; + } - @Override - public void updateEntity() { - super.updateEntity(); - if (getMutliBlock()) { - crafter.updateEntity(); - } - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (getMutliBlock()) + { + crafter.updateEntity(); + } + } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + // @Override + // public void addWailaInfo(List info) + // { + // super.addWailaInfo(info); + // info.add("Power Stored " + energy.getEnergyStored() +" EU"); + // if(crafter.currentRecipe !=null){ + // info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); + // } + // } -// @Override -// public void addWailaInfo(List info) -// { -// super.addWailaInfo(info); -// info.add("Power Stored " + energy.getEnergyStored() +" EU"); -// if(crafter.currentRecipe !=null){ -// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); -// } -// } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3 } : new int[] { 0, 1, 2, 3 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public double getMaxPower() + { + return 100000; + } - @Override - public double getMaxPower() { - return 100000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 64; + } - @Override - public double getMaxInput() { - return 64; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java index d600f39e3..b5dd6fe9f 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/tiles/TileIndustrialElectrolyzer.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,228 +13,268 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(8, "TileIndustrialElectrolyzer", 64, this); - public RecipeCrafter crafter; + public int tickTime; + public Inventory inventory = new Inventory(8, "TileIndustrialElectrolyzer", 64, this); + public RecipeCrafter crafter; - public TileIndustrialElectrolyzer() { - super(2); - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[4]; - outputs[0] = 2; - outputs[1] = 3; - outputs[2] = 4; - outputs[3] = 5; - crafter = new RecipeCrafter(Reference.industrialElectrolyzerRecipe, this, 2, 4, inventory, inputs, outputs); - } + public TileIndustrialElectrolyzer() + { + super(2); + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[4]; + outputs[0] = 2; + outputs[1] = 3; + outputs[2] = 4; + outputs[3] = 5; + crafter = new RecipeCrafter(Reference.industrialElectrolyzerRecipe, this, 2, 4, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - charge(6); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + charge(6); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.IndustrialElectrolyzer, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.IndustrialElectrolyzer, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } -// @Override -// public void addWailaInfo(List info) -// { -// super.addWailaInfo(info); -// info.add("Power Stored " + energy.getEnergyStored() +" EU"); -// if(crafter.currentRecipe !=null){ -// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); -// } -// } + // @Override + // public void addWailaInfo(List info) + // { + // super.addWailaInfo(info); + // info.add("Power Stored " + energy.getEnergyStored() +" EU"); + // if(crafter.currentRecipe !=null){ + // info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); + // } + // } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 1) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 1) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public double getMaxPower() + { + return 1000; + } - @Override - public double getMaxPower() { - return 1000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - public double getMaxInput() { - return 128; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/TileIndustrialGrinder.java b/src/main/java/techreborn/tiles/TileIndustrialGrinder.java index dde750c78..4adf5460e 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialGrinder.java +++ b/src/main/java/techreborn/tiles/TileIndustrialGrinder.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -10,7 +9,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.FluidUtils; @@ -21,296 +19,358 @@ import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; import techreborn.init.ModFluids; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileIndustrialGrinder extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory { - public static final int TANK_CAPACITY = 16000; +public class TileIndustrialGrinder extends TilePowerAcceptor + implements IWrenchable, IFluidHandler, IInventory, ISidedInventory +{ + public static final int TANK_CAPACITY = 16000; - public int tickTime; - public Inventory inventory = new Inventory(6, "TileGrinder", 64, this); - public Tank tank = new Tank("TileGrinder", TANK_CAPACITY, this); - public RecipeCrafter crafter; - public int connectionStatus; + public int tickTime; + public Inventory inventory = new Inventory(6, "TileGrinder", 64, this); + public Tank tank = new Tank("TileGrinder", TANK_CAPACITY, this); + public RecipeCrafter crafter; + public int connectionStatus; - public TileIndustrialGrinder() { - super(ConfigTechReborn.CentrifugeTier); - //TODO configs + public TileIndustrialGrinder() + { + super(ConfigTechReborn.CentrifugeTier); + // TODO configs - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[4]; - outputs[0] = 2; - outputs[1] = 3; - outputs[2] = 4; - outputs[3] = 5; - crafter = new RecipeCrafter(Reference.industrialGrinderRecipe, this, 1, 4, inventory, inputs, outputs); - } + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[4]; + outputs[0] = 2; + outputs[1] = 3; + outputs[2] = 4; + outputs[3] = 5; + crafter = new RecipeCrafter(Reference.industrialGrinderRecipe, this, 1, 4, inventory, inputs, outputs); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.IndustrialGrinder, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.IndustrialGrinder, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - public boolean getMutliBlock() { - for (EnumFacing direction : EnumFacing.values()) { - TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); - if (tileEntity instanceof TileMachineCasing) { - if(((TileMachineCasing) tileEntity).isConnected() && ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled() && ((TileMachineCasing) tileEntity).getMultiblockController().height == 3){ - connectionStatus = 1; - return true; - } - } - } - connectionStatus = 0; - return false; - } + public boolean getMutliBlock() + { + for (EnumFacing direction : EnumFacing.values()) + { + TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); + if (tileEntity instanceof TileMachineCasing) + { + if (((TileMachineCasing) tileEntity).isConnected() + && ((TileMachineCasing) tileEntity).getMultiblockController().isAssembled() + && ((TileMachineCasing) tileEntity).getMultiblockController().height == 3) + { + connectionStatus = 1; + return true; + } + } + } + connectionStatus = 0; + return false; + } - @Override - public void updateEntity() { - super.updateEntity(); - if (getMutliBlock()) { - crafter.updateEntity(); - } - FluidUtils.drainContainers(this, inventory, 0, 5); - FluidUtils.drainContainers(this, inventory, 1, 5); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (getMutliBlock()) + { + crafter.updateEntity(); + } + FluidUtils.drainContainers(this, inventory, 0, 5); + FluidUtils.drainContainers(this, inventory, 1, 5); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public void invalidate() { - super.invalidate(); - } + @Override + public void invalidate() + { + super.invalidate(); + } - @Override - public void onChunkUnload() { - super.onChunkUnload(); - } + @Override + public void onChunkUnload() + { + super.onChunkUnload(); + } - /* IFluidHandler */ - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury || resource.getFluid() == ModFluids.fluidSodiumpersulfate) { - int filled = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return filled; - } - return 0; - } + /* IFluidHandler */ + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury + || resource.getFluid() == ModFluids.fluidSodiumpersulfate) + { + int filled = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return filled; + } + return 0; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) { - if (resource == null || !resource.isFluidEqual(tank.getFluid())) { - return null; - } - FluidStack fluidStack = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return fluidStack; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + FluidStack fluidStack = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return fluidStack; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drained = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drained; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drained = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drained; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - if (fluid == FluidRegistry.WATER || fluid == ModFluids.fluidMercury || fluid == ModFluids.fluidSodiumpersulfate) { - return true; - } - return false; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + if (fluid == FluidRegistry.WATER || fluid == ModFluids.fluidMercury || fluid == ModFluids.fluidSodiumpersulfate) + { + return true; + } + return false; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return false; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return false; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5}; - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 }; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/TileIndustrialSawmill.java b/src/main/java/techreborn/tiles/TileIndustrialSawmill.java index 33fbf46e0..53033219c 100644 --- a/src/main/java/techreborn/tiles/TileIndustrialSawmill.java +++ b/src/main/java/techreborn/tiles/TileIndustrialSawmill.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -10,7 +9,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.IListInfoProvider; import reborncore.api.power.EnumPowerTier; import reborncore.common.misc.Location; @@ -23,292 +21,351 @@ import techreborn.blocks.BlockMachineCasing; import techreborn.init.ModBlocks; import techreborn.init.ModFluids; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider { - public static final int TANK_CAPACITY = 16000; +public class TileIndustrialSawmill extends TilePowerAcceptor + implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider +{ + public static final int TANK_CAPACITY = 16000; - public int tickTime; - public Inventory inventory = new Inventory(5, "TileIndustrialSawmill", 64, this); - public Tank tank = new Tank("TileSawmill", TANK_CAPACITY, this); - public RecipeCrafter crafter; + public int tickTime; + public Inventory inventory = new Inventory(5, "TileIndustrialSawmill", 64, this); + public Tank tank = new Tank("TileSawmill", TANK_CAPACITY, this); + public RecipeCrafter crafter; - public TileIndustrialSawmill() { - super(2); - //TODO configs - //Input slots - int[] inputs = new int[2]; - inputs[0] = 0; - inputs[1] = 1; - int[] outputs = new int[3]; - outputs[0] = 2; - outputs[1] = 3; - outputs[2] = 4; - crafter = new RecipeCrafter(Reference.industrialSawmillRecipe, this, 2, 3, inventory, inputs, outputs); - } + public TileIndustrialSawmill() + { + super(2); + // TODO configs + // Input slots + int[] inputs = new int[2]; + inputs[0] = 0; + inputs[1] = 1; + int[] outputs = new int[3]; + outputs[0] = 2; + outputs[1] = 3; + outputs[2] = 4; + crafter = new RecipeCrafter(Reference.industrialSawmillRecipe, this, 2, 3, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - if (getMutliBlock()) { - crafter.updateEntity(); - } - FluidUtils.drainContainers(this, inventory, 0, 4); - FluidUtils.drainContainers(this, inventory, 1, 4); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (getMutliBlock()) + { + crafter.updateEntity(); + } + FluidUtils.drainContainers(this, inventory, 0, 4); + FluidUtils.drainContainers(this, inventory, 1, 4); + } - public boolean getMutliBlock() { - for (EnumFacing direction : EnumFacing.values()) { - TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); - if (tileEntity instanceof TileMachineCasing) { - if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) { - int heat; - BlockMachineCasing blockMachineCasing = (BlockMachineCasing) tileEntity.getBlockType(); - heat = blockMachineCasing.getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos())); - Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); - location.modifyPositionFromSide(direction, 1); - if (worldObj.getBlockState(location.getBlockPos()).getBlock().getUnlocalizedName().equals("tile.lava")) { - heat += 500; - } - return true; - } - } - } - return false; - } + public boolean getMutliBlock() + { + for (EnumFacing direction : EnumFacing.values()) + { + TileEntity tileEntity = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())); + if (tileEntity instanceof TileMachineCasing) + { + if ((tileEntity.getBlockType() instanceof BlockMachineCasing)) + { + int heat; + BlockMachineCasing blockMachineCasing = (BlockMachineCasing) tileEntity.getBlockType(); + heat = blockMachineCasing + .getHeatFromState(tileEntity.getWorld().getBlockState(tileEntity.getPos())); + Location location = new Location(getPos().getX(), getPos().getY(), getPos().getZ(), direction); + location.modifyPositionFromSide(direction, 1); + if (worldObj.getBlockState(location.getBlockPos()).getBlock().getUnlocalizedName() + .equals("tile.lava")) + { + heat += 500; + } + return true; + } + } + } + return false; + } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.industrialSawmill, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.industrialSawmill, 1); - } + public boolean isComplete() + { + return false; + } - public boolean isComplete() { - return false; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + /* IFluidHandler */ + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury + || resource.getFluid() == ModFluids.fluidSodiumpersulfate) + { + int filled = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return filled; + } + return 0; + } - /* IFluidHandler */ - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - if (resource.getFluid() == FluidRegistry.WATER || resource.getFluid() == ModFluids.fluidMercury || resource.getFluid() == ModFluids.fluidSodiumpersulfate) { - int filled = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return filled; - } - return 0; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + FluidStack fluidStack = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return fluidStack; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) { - if (resource == null || !resource.isFluidEqual(tank.getFluid())) { - return null; - } - FluidStack fluidStack = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return fluidStack; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drained = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drained; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drained = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drained; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + if (fluid == FluidRegistry.WATER) + { + return true; + } + return false; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - if (fluid == FluidRegistry.WATER) { - return true; - } - return false; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return false; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return false; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4 } : new int[] { 0, 1, 2, 3, 4 }; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex >= 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4}; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2 || slotIndex == 3 || slotIndex == 4; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex >= 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2 || slotIndex == 3 || slotIndex == 4; - } + @Override + public double getMaxPower() + { + return 10000; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 64; + } - @Override - public double getMaxOutput() { - return 0; - } - - @Override - public double getMaxInput() { - return 64; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/TileIronFurnace.java b/src/main/java/techreborn/tiles/TileIronFurnace.java index 8542d1dde..83704abb9 100644 --- a/src/main/java/techreborn/tiles/TileIronFurnace.java +++ b/src/main/java/techreborn/tiles/TileIronFurnace.java @@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; -import net.minecraft.item.*; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.text.ITextComponent; @@ -16,315 +15,330 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.tile.TileMachineBase; import reborncore.common.util.Inventory; -public class TileIronFurnace extends TileMachineBase implements IInventory { +public class TileIronFurnace extends TileMachineBase implements IInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(3, "TileIronFurnace", 64, this); + public int tickTime; + public Inventory inventory = new Inventory(3, "TileIronFurnace", 64, this); - int input1 = 0; - int output = 1; - int fuelslot = 2; + int input1 = 0; + int output = 1; + int fuelslot = 2; - boolean active = false; - public int fuel; - public int fuelGague; - public int progress; - public int fuelScale = 200; + boolean active = false; + public int fuel; + public int fuelGague; + public int progress; + public int fuelScale = 200; - public int gaugeProgressScaled (int scale) - { - return (progress * scale) / fuelScale; - } + public int gaugeProgressScaled(int scale) + { + return (progress * scale) / fuelScale; + } - public int gaugeFuelScaled (int scale) - { - if (fuelGague == 0) - { - fuelGague = fuel; - if (fuelGague == 0) - { - fuelGague = fuelScale; - } - } - return (fuel * scale) / fuelGague; - } + public int gaugeFuelScaled(int scale) + { + if (fuelGague == 0) + { + fuelGague = fuel; + if (fuelGague == 0) + { + fuelGague = fuelScale; + } + } + return (fuel * scale) / fuelGague; + } - @Override - public void updateEntity () - { - boolean burning = isBurning(); - boolean updateInventory = false; - if (fuel > 0) - { - fuel--; - updateState(); - } - if (fuel <= 0 && canSmelt()) - { - fuel = fuelGague = (int) (getItemBurnTime(getStackInSlot(fuelslot))); - if (fuel > 0) - { - if (getStackInSlot(fuelslot).getItem().hasContainerItem()) // Fuel slot - { - setInventorySlotContents(fuelslot, new ItemStack(getStackInSlot(fuelslot).getItem().getContainerItem())); - } - else if(getStackInSlot(fuelslot).stackSize > 1) - { - decrStackSize(fuelslot, 1); - } - else if (getStackInSlot(fuelslot).stackSize == 1) - { - setInventorySlotContents(fuelslot, null); - } - updateInventory = true; - } - } - if (isBurning() && canSmelt()) - { - progress++; - if (progress >= fuelScale) - { - progress = 0; - cookItems(); - updateInventory = true; - } - } - else - { - progress = 0; - } - if (burning != isBurning()) - { - updateInventory = true; - } - if (updateInventory) - { - markDirty(); - } - } + @Override + public void updateEntity() + { + boolean burning = isBurning(); + boolean updateInventory = false; + if (fuel > 0) + { + fuel--; + updateState(); + } + if (fuel <= 0 && canSmelt()) + { + fuel = fuelGague = (int) (getItemBurnTime(getStackInSlot(fuelslot))); + if (fuel > 0) + { + if (getStackInSlot(fuelslot).getItem().hasContainerItem()) // Fuel + // slot + { + setInventorySlotContents(fuelslot, + new ItemStack(getStackInSlot(fuelslot).getItem().getContainerItem())); + } else if (getStackInSlot(fuelslot).stackSize > 1) + { + decrStackSize(fuelslot, 1); + } else if (getStackInSlot(fuelslot).stackSize == 1) + { + setInventorySlotContents(fuelslot, null); + } + updateInventory = true; + } + } + if (isBurning() && canSmelt()) + { + progress++; + if (progress >= fuelScale) + { + progress = 0; + cookItems(); + updateInventory = true; + } + } else + { + progress = 0; + } + if (burning != isBurning()) + { + updateInventory = true; + } + if (updateInventory) + { + markDirty(); + } + } - public void cookItems () - { - if (this.canSmelt()) - { - ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); + public void cookItems() + { + if (this.canSmelt()) + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); - if (getStackInSlot(output) == null) - { - setInventorySlotContents(output, itemstack.copy()); - } - else if (getStackInSlot(output).isItemEqual(itemstack)) - { - getStackInSlot(output).stackSize += itemstack.stackSize; - } - if(getStackInSlot(input1).stackSize > 1) - { - this.decrStackSize(input1, 1); - } - else - { - setInventorySlotContents(input1, null); - } - } - } + if (getStackInSlot(output) == null) + { + setInventorySlotContents(output, itemstack.copy()); + } else if (getStackInSlot(output).isItemEqual(itemstack)) + { + getStackInSlot(output).stackSize += itemstack.stackSize; + } + if (getStackInSlot(input1).stackSize > 1) + { + this.decrStackSize(input1, 1); + } else + { + setInventorySlotContents(input1, null); + } + } + } - public boolean canSmelt () - { - if (getStackInSlot(input1) == null) - { - return false; - } - else - { - ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); - if (itemstack == null) - return false; - if (getStackInSlot(output) == null) - return true; - if (!getStackInSlot(output).isItemEqual(itemstack)) - return false; - int result = getStackInSlot(output).stackSize + itemstack.stackSize; - return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); - } - } + public boolean canSmelt() + { + if (getStackInSlot(input1) == null) + { + return false; + } else + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); + if (itemstack == null) + return false; + if (getStackInSlot(output) == null) + return true; + if (!getStackInSlot(output).isItemEqual(itemstack)) + return false; + int result = getStackInSlot(output).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + } - public boolean isBurning () - { - return fuel > 0; - } + public boolean isBurning() + { + return fuel > 0; + } - public ItemStack getResultFor (ItemStack stack) - { - ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); - if (result != null) - { - return result.copy(); - } - return null; - } + public ItemStack getResultFor(ItemStack stack) + { + ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); + if (result != null) + { + return result.copy(); + } + return null; + } - public static int getItemBurnTime (ItemStack stack) - { - if (stack == null) - { - return 0; - } - else - { - Item item = stack.getItem(); + public static int getItemBurnTime(ItemStack stack) + { + if (stack == null) + { + return 0; + } else + { + Item item = stack.getItem(); - if (stack.getItem() instanceof ItemBlock && Block.getBlockFromItem(item) != null) - { - Block block = Block.getBlockFromItem(item); + if (stack.getItem() instanceof ItemBlock && Block.getBlockFromItem(item) != null) + { + Block block = Block.getBlockFromItem(item); - if (block == Blocks.wooden_slab) - { - return 150; - } + if (block == Blocks.wooden_slab) + { + return 150; + } - if (block == Blocks.log) - { - return 1200; - } + if (block == Blocks.log) + { + return 1200; + } - if (block.getMaterial(block.getDefaultState()) == Material.wood) - { - return 300; - } + if (block.getMaterial(block.getDefaultState()) == Material.wood) + { + return 300; + } - if (block == Blocks.coal_block) - { - return 16000; - } - } + if (block == Blocks.coal_block) + { + return 16000; + } + } - if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) - return 200; - if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) - return 200; - if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) - return 200; - if (item == Items.stick) - return 100; - if (item == Items.coal) - return 1600; - if (item == Items.lava_bucket) - return 20000; - if (item == new ItemStack(Blocks.sapling).getItem()) - return 100; - if (item == Items.blaze_rod) - return 2400; - return GameRegistry.getFuelValue(stack); - } - } - - public void updateState(){ - IBlockState BlockStateContainer = worldObj.getBlockState(pos); - if(BlockStateContainer.getBlock() instanceof BlockMachineBase){ - BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); - if(BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != fuel > 0) - blockMachineBase.setActive(fuel > 0, worldObj, pos); - } - } + if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) + return 200; + if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) + return 200; + if (item instanceof ItemHoe && ((ItemHoe) item).getMaterialName().equals("WOOD")) + return 200; + if (item == Items.stick) + return 100; + if (item == Items.coal) + return 1600; + if (item == Items.lava_bucket) + return 20000; + if (item == new ItemStack(Blocks.sapling).getItem()) + return 100; + if (item == Items.blaze_rod) + return 2400; + return GameRegistry.getFuelValue(stack); + } + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); + public void updateState() + { + IBlockState BlockStateContainer = worldObj.getBlockState(pos); + if (BlockStateContainer.getBlock() instanceof BlockMachineBase) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); + if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != fuel > 0) + blockMachineBase.setActive(fuel > 0, worldObj, pos); + } + } - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); + } - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/TileMachineCasing.java b/src/main/java/techreborn/tiles/TileMachineCasing.java index 7c468ca1f..097010546 100644 --- a/src/main/java/techreborn/tiles/TileMachineCasing.java +++ b/src/main/java/techreborn/tiles/TileMachineCasing.java @@ -5,60 +5,71 @@ import reborncore.common.multiblock.MultiblockValidationException; import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase; import techreborn.multiblocks.MultiBlockCasing; -public class TileMachineCasing extends RectangularMultiblockTileEntityBase { +public class TileMachineCasing extends RectangularMultiblockTileEntityBase +{ + @Override + public void onMachineActivated() + { - @Override - public void onMachineActivated() { + } - } + @Override + public void onMachineDeactivated() + { - @Override - public void onMachineDeactivated() { + } - } + @Override + public MultiblockControllerBase createNewMultiblock() + { + return new MultiBlockCasing(worldObj); + } - @Override - public MultiblockControllerBase createNewMultiblock() { - return new MultiBlockCasing(worldObj); - } + @Override + public Class getMultiblockControllerType() + { + return MultiBlockCasing.class; + } - @Override - public Class getMultiblockControllerType() { - return MultiBlockCasing.class; - } + @Override + public void isGoodForFrame() throws MultiblockValidationException + { - @Override - public void isGoodForFrame() throws MultiblockValidationException { + } - } + @Override + public void isGoodForSides() throws MultiblockValidationException + { - @Override - public void isGoodForSides() throws MultiblockValidationException { + } - } + @Override + public void isGoodForTop() throws MultiblockValidationException + { - @Override - public void isGoodForTop() throws MultiblockValidationException { + } - } + @Override + public void isGoodForBottom() throws MultiblockValidationException + { - @Override - public void isGoodForBottom() throws MultiblockValidationException { + } - } + @Override + public void isGoodForInterior() throws MultiblockValidationException + { - @Override - public void isGoodForInterior() throws MultiblockValidationException { + } - } + public MultiBlockCasing getMultiblockController() + { + return (MultiBlockCasing) super.getMultiblockController(); + } - public MultiBlockCasing getMultiblockController() { - return (MultiBlockCasing) super.getMultiblockController(); - } + @Override + public void update() + { - @Override - public void update() { - - } + } } diff --git a/src/main/java/techreborn/tiles/TileMatterFabricator.java b/src/main/java/techreborn/tiles/TileMatterFabricator.java index ac7cb4901..d592479ac 100644 --- a/src/main/java/techreborn/tiles/TileMatterFabricator.java +++ b/src/main/java/techreborn/tiles/TileMatterFabricator.java @@ -1,7 +1,5 @@ package techreborn.tiles; - -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -15,279 +13,339 @@ import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.init.ModBlocks; import techreborn.init.ModItems; +import ic2.api.tile.IWrenchable; -public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public static int fabricationRate = 2666656; - public int tickTime; - public Inventory inventory = new Inventory(7, "TileMatterFabricator", 64, this); - private int amplifier = 0; - public int progresstime = 0; + public static int fabricationRate = 2666656; + public int tickTime; + public Inventory inventory = new Inventory(7, "TileMatterFabricator", 64, this); + private int amplifier = 0; + public int progresstime = 0; - public TileMatterFabricator() { - super(6); - //TODO configs - } + public TileMatterFabricator() + { + super(6); + // TODO configs + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.MatterFabricator, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.MatterFabricator, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5, 6 } : new int[] { 0, 1, 2, 3, 4, 5, 6 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 6) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 6) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 6; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 6; - } + public int maxProgresstime() + { + return fabricationRate; + } - public int maxProgresstime() { - return fabricationRate; - } + @Override + public void updateEntity() + { + super.updateEntity(); - @Override - public void updateEntity() { - super.updateEntity(); + if (!super.worldObj.isRemote) + { + for (int i = 0; i < 6; i++) + { + ItemStack stack = inventory.getStackInSlot(i); + if (this.amplifier < 100000 && stack != null) + { + int amp = (int) ((long) (getValue(stack) / 32)); + if (ItemUtils.isItemEqual(stack, inventory.getStackInSlot(i), true, true)) + { + if (canUseEnergy(1)) + { + useEnergy(1); + this.amplifier += amp; + inventory.decrStackSize(i, 1); + } + } + } + } - if (!super.worldObj.isRemote) { - for (int i = 0; i < 6; i++) { - ItemStack stack = inventory.getStackInSlot(i); - if (this.amplifier < 100000 && stack != null) { - int amp = (int) ((long) (getValue(stack) / 32)); - if (ItemUtils.isItemEqual(stack, inventory.getStackInSlot(i), true, true)) { - if (canUseEnergy(1)) { - useEnergy(1); - this.amplifier += amp; - inventory.decrStackSize(i, 1); - } - } - } - } + if (this.amplifier > 0) + { + if (this.amplifier > this.getEnergy()) + { + this.progresstime += this.getEnergy(); + this.amplifier -= this.getEnergy(); + this.decreaseStoredEnergy(this.getEnergy(), true); + } else + { + this.progresstime += this.amplifier; + this.decreaseStoredEnergy(this.amplifier, true); + this.amplifier = 0; + } + } + if (this.progresstime > this.maxProgresstime() && this.spaceForOutput()) + { + this.progresstime -= this.maxProgresstime(); + this.addOutputProducts(); + } - if (this.amplifier > 0) { - if (this.amplifier > this.getEnergy()) { - this.progresstime += this.getEnergy(); - this.amplifier -= this.getEnergy(); - this.decreaseStoredEnergy(this.getEnergy(), true); - } else { - this.progresstime += this.amplifier; - this.decreaseStoredEnergy(this.amplifier, true); - this.amplifier = 0; - } - } - if (this.progresstime > this.maxProgresstime() && this.spaceForOutput()) { - this.progresstime -= this.maxProgresstime(); - this.addOutputProducts(); - } + } - } + } - } + private boolean spaceForOutput() + { + return inventory.getStackInSlot(6) == null + || ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true) + && inventory.getStackInSlot(6).stackSize < 64; + } - private boolean spaceForOutput() { - return inventory.getStackInSlot(6) == null || ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true) && inventory.getStackInSlot(6).stackSize < 64; - } + private void addOutputProducts() + { - private void addOutputProducts() { + if (inventory.getStackInSlot(6) == null) + { + inventory.setInventorySlotContents(6, new ItemStack(ModItems.uuMatter)); + } else if (ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true)) + { + inventory.getStackInSlot(6).stackSize = Math.min(64, 1 + inventory.getStackInSlot(6).stackSize); + } + } - if (inventory.getStackInSlot(6) == null) { - inventory.setInventorySlotContents(6, new ItemStack(ModItems.uuMatter)); - } else if (ItemUtils.isItemEqual(inventory.getStackInSlot(6), new ItemStack(ModItems.uuMatter), true, true)) { - inventory.getStackInSlot(6).stackSize = Math.min(64, 1 + inventory.getStackInSlot(6).stackSize); - } - } + public boolean decreaseStoredEnergy(double aEnergy, boolean aIgnoreTooLessEnergy) + { + if (this.getEnergy() - aEnergy < 0 && !aIgnoreTooLessEnergy) + { + return false; + } else + { + setEnergy(this.getEnergy() - aEnergy); + if (this.getEnergy() < 0) + { + setEnergy(0); + return false; + } else + { + return true; + } + } + } + // TODO ic2 + public int getValue(ItemStack itemStack) + { + // int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, + // false)); + return 0; + } - public boolean decreaseStoredEnergy(double aEnergy, boolean aIgnoreTooLessEnergy) { - if (this.getEnergy() - aEnergy < 0 && !aIgnoreTooLessEnergy) { - return false; - } else { - setEnergy(this.getEnergy() - aEnergy); - if (this.getEnergy() < 0) { - setEnergy(0); - return false; - } else { - return true; - } - } - } + // private static Integer getValue(RecipeOutput output) { + // if (output != null && output.metadata != null) { + // return output.metadata.getInteger("amplification"); + // } + // return 0; + // } - //TODO ic2 - public int getValue(ItemStack itemStack) { - // int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, false)); - return 0; - } + @Override + public double getMaxPower() + { + return 100000000; + } - // private static Integer getValue(RecipeOutput output) { -// if (output != null && output.metadata != null) { -// return output.metadata.getInteger("amplification"); -// } - // return 0; - // } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return 100000000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 4096; + } - @Override - public double getMaxOutput() { - return 0; - } - - @Override - public double getMaxInput() { - return 4096; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } } diff --git a/src/main/java/techreborn/tiles/TilePlayerDectector.java b/src/main/java/techreborn/tiles/TilePlayerDectector.java index 1d0344ab8..67d7979d5 100644 --- a/src/main/java/techreborn/tiles/TilePlayerDectector.java +++ b/src/main/java/techreborn/tiles/TilePlayerDectector.java @@ -1,5 +1,7 @@ package techreborn.tiles; +import java.util.Iterator; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; @@ -8,97 +10,117 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.WorldUtils; -import java.util.Iterator; +public class TilePlayerDectector extends TilePowerAcceptor +{ + boolean redstone = false; + public String owenerUdid = ""; -public class TilePlayerDectector extends TilePowerAcceptor { + public TilePlayerDectector() + { + super(1); + } - boolean redstone = false; - public String owenerUdid = ""; + @Override + public double getMaxPower() + { + return 10000; + } - public TilePlayerDectector() { - super(1); - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) + { + boolean lastRedstone = redstone; + redstone = false; + if (canUseEnergy(50)) + { + Iterator tIterator = super.worldObj.playerEntities.iterator(); + while (tIterator.hasNext()) + { + EntityPlayer player = (EntityPlayer) tIterator.next(); + if (player.getDistanceSq((double) super.getPos().getX() + 0.5D, + (double) super.getPos().getY() + 0.5D, (double) super.getPos().getZ() + 0.5D) <= 256.0D) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) worldObj.getBlockState(pos).getBlock(); + int meta = blockMachineBase.getMetaFromState(worldObj.getBlockState(pos)); + if (meta == 0) + {// ALL + redstone = true; + } else if (meta == 1) + {// Others + if (!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())) + { + redstone = true; + } + } else + {// You + if (!owenerUdid.isEmpty() && owenerUdid.equals(player.getUniqueID().toString())) + { + redstone = true; + } + } + redstone = true; + } + } + useEnergy(50); + } + if (lastRedstone != redstone) + { + WorldUtils.updateBlock(worldObj, getPos()); + worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock()); + } + } + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + public boolean isProvidingPower() + { + return redstone; + } - @Override - public void updateEntity() { - super.updateEntity(); - if(!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0){ - boolean lastRedstone = redstone; - redstone = false; - if(canUseEnergy(50)){ - Iterator tIterator = super.worldObj.playerEntities.iterator(); - while (tIterator.hasNext()) { - EntityPlayer player = (EntityPlayer) tIterator.next(); - if (player.getDistanceSq((double) super.getPos().getX() + 0.5D, (double) super.getPos().getY() + 0.5D, (double) super.getPos().getZ() + 0.5D) <= 256.0D) { - BlockMachineBase blockMachineBase = (BlockMachineBase) worldObj.getBlockState(pos).getBlock(); - int meta = blockMachineBase.getMetaFromState(worldObj.getBlockState(pos)); - if(meta == 0){//ALL - redstone = true; - } else if (meta == 1){//Others - if(!owenerUdid.isEmpty() && !owenerUdid.equals(player.getUniqueID().toString())){ - redstone = true; - } - } else {//You - if(!owenerUdid.isEmpty() &&owenerUdid.equals(player.getUniqueID().toString())){ - redstone = true; - } - } - redstone = true; - } - } - useEnergy(50); - } - if(lastRedstone != redstone){ - WorldUtils.updateBlock(worldObj, getPos()); - worldObj.notifyNeighborsOfStateChange(getPos(), worldObj.getBlockState(getPos()).getBlock()); - } - } - } + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + owenerUdid = tag.getString("ownerID"); + } - public boolean isProvidingPower(){ - return redstone; - } - - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - owenerUdid = tag.getString("ownerID"); - } - - @Override - public void writeToNBT(NBTTagCompound tag) { - super.writeToNBT(tag); - tag.setString("ownerID", owenerUdid); - } + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + tag.setString("ownerID", owenerUdid); + } } diff --git a/src/main/java/techreborn/tiles/TileQuantumChest.java b/src/main/java/techreborn/tiles/TileQuantumChest.java index ecc3f4915..1b5eeeaef 100644 --- a/src/main/java/techreborn/tiles/TileQuantumChest.java +++ b/src/main/java/techreborn/tiles/TileQuantumChest.java @@ -1,6 +1,7 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -16,55 +17,53 @@ import reborncore.common.tile.TileMachineBase; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -import java.util.List; +public class TileQuantumChest extends TileMachineBase + implements IInventory, IWrenchable, IDeepStorageUnit, IListInfoProvider +{ -public class TileQuantumChest extends TileMachineBase implements IInventory, - IWrenchable, IDeepStorageUnit, IListInfoProvider { + // Slot 0 = Input + // Slot 1 = Output + // Slot 2 = Fake Item - // Slot 0 = Input - // Slot 1 = Output - // Slot 2 = Fake Item + // TODO use long so we can have 9,223,372,036,854,775,807 items instead of + // 2,147,483,647 + int storage = (int) Double.MAX_VALUE; - //TODO use long so we can have 9,223,372,036,854,775,807 items instead of 2,147,483,647 - int storage = (int) Double.MAX_VALUE; + public Inventory inventory = new Inventory(3, "TileQuantumChest", storage, this); - public Inventory inventory = new Inventory(3, "TileQuantumChest", storage, this); - - public ItemStack storedItem; + public ItemStack storedItem; @Override - public void updateEntity() + public void updateEntity() { - if (!worldObj.isRemote) + if (!worldObj.isRemote) { - if (storedItem != null) + if (storedItem != null) { ItemStack fakeStack = storedItem.copy(); fakeStack.stackSize = 1; setInventorySlotContents(2, fakeStack); - } - else if (storedItem == null && getStackInSlot(1) != null) + } else if (storedItem == null && getStackInSlot(1) != null) { ItemStack fakeStack = getStackInSlot(1).copy(); fakeStack.stackSize = 1; setInventorySlotContents(2, fakeStack); - } - else + } else { setInventorySlotContents(2, null); } - if (getStackInSlot(0) != null) + if (getStackInSlot(0) != null) { - if (storedItem == null) + if (storedItem == null) { storedItem = getStackInSlot(0); setInventorySlotContents(0, null); - } - else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) + } else if (ItemUtils.isItemEqual(storedItem, getStackInSlot(0), true, true)) { - if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) + if (storedItem.stackSize <= storage - getStackInSlot(0).stackSize) { storedItem.stackSize += getStackInSlot(0).stackSize; decrStackSize(0, getStackInSlot(0).stackSize); @@ -72,21 +71,20 @@ public class TileQuantumChest extends TileMachineBase implements IInventory, } } - if (storedItem != null && getStackInSlot(1) == null) + if (storedItem != null && getStackInSlot(1) == null) { ItemStack itemStack = storedItem.copy(); itemStack.stackSize = itemStack.getMaxStackSize(); setInventorySlotContents(1, itemStack); storedItem.stackSize -= itemStack.getMaxStackSize(); - } - else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) + } else if (ItemUtils.isItemEqual(getStackInSlot(1), storedItem, true, true)) { int wanted = getStackInSlot(1).getMaxStackSize() - getStackInSlot(1).stackSize; - if (storedItem.stackSize >= wanted) + if (storedItem.stackSize >= wanted) { decrStackSize(1, -wanted); storedItem.stackSize -= wanted; - } else + } else { decrStackSize(1, -storedItem.stackSize); storedItem = null; @@ -95,217 +93,255 @@ public class TileQuantumChest extends TileMachineBase implements IInventory, } } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - @Override - public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - readFromNBTWithoutCoords(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + readFromNBTWithoutCoords(tagCompound); + } - public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { - inventory.readFromNBT(tagCompound); + public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) + { + inventory.readFromNBT(tagCompound); - storedItem = null; + storedItem = null; - if (tagCompound.hasKey("storedStack")) { - storedItem = ItemStack - .loadItemStackFromNBT((NBTTagCompound) tagCompound - .getTag("storedStack")); - } + if (tagCompound.hasKey("storedStack")) + { + storedItem = ItemStack.loadItemStackFromNBT((NBTTagCompound) tagCompound.getTag("storedStack")); + } - if (storedItem != null) { - storedItem.stackSize = tagCompound.getInteger("storedQuantity"); - } - } + if (storedItem != null) + { + storedItem.stackSize = tagCompound.getInteger("storedQuantity"); + } + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - writeToNBTWithoutCoords(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + writeToNBTWithoutCoords(tagCompound); + } - public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) { - inventory.writeToNBT(tagCompound); - if (storedItem != null) { - tagCompound.setTag("storedStack", - storedItem.writeToNBT(new NBTTagCompound())); - tagCompound.setInteger("storedQuantity", storedItem.stackSize); - } else - tagCompound.setInteger("storedQuantity", 0); - } + public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) + { + inventory.writeToNBT(tagCompound); + if (storedItem != null) + { + tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound())); + tagCompound.setInteger("storedQuantity", storedItem.stackSize); + } else + tagCompound.setInteger("storedQuantity", 0); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slotId, int count) { - return inventory.decrStackSize(slotId, count); - } + @Override + public ItemStack decrStackSize(int slotId, int count) + { + return inventory.decrStackSize(slotId, count); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1F; - } + @Override + public float getWrenchDropRate() + { + return 1F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return getDropWithNBT(); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return getDropWithNBT(); + } - public ItemStack getDropWithNBT() { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.quantumChest, 1); - writeToNBTWithoutCoords(tileEntity); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } + public ItemStack getDropWithNBT() + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.quantumChest, 1); + writeToNBTWithoutCoords(tileEntity); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } + @Override + public ItemStack getStoredItemType() + { + return this.storedItem; + } - @Override - public ItemStack getStoredItemType() { - return this.storedItem; - } + @Override + public void setStoredItemCount(int amount) + { + this.storedItem.stackSize = 0; + this.storedItem.stackSize += (amount); + this.markDirty(); + } - @Override - public void setStoredItemCount(int amount) { - this.storedItem.stackSize = 0; - this.storedItem.stackSize += (amount); - this.markDirty(); - } + @Override + public void setStoredItemType(ItemStack type, int amount) + { + this.storedItem = type; + this.storedItem.stackSize = amount; + this.markDirty(); + } - @Override - public void setStoredItemType(ItemStack type, int amount) { - this.storedItem = type; - this.storedItem.stackSize = amount; - this.markDirty(); - } + @Override + public int getMaxStoredCount() + { + return this.storage; + } - @Override - public int getMaxStoredCount() { - return this.storage; - } - - @Override - public void addInfo(List info, boolean isRealTile) { - if (isRealTile) { - int size = 0; - String name = "of nothing"; - if (storedItem != null) { - name = storedItem.getDisplayName(); - size += storedItem.stackSize; - } - if (getStackInSlot(1) != null) { - name = getStackInSlot(1).getDisplayName(); - size += getStackInSlot(1).stackSize; - } - info.add(size + " " + name); - } - } + @Override + public void addInfo(List info, boolean isRealTile) + { + if (isRealTile) + { + int size = 0; + String name = "of nothing"; + if (storedItem != null) + { + name = storedItem.getDisplayName(); + size += storedItem.stackSize; + } + if (getStackInSlot(1) != null) + { + name = getStackInSlot(1).getDisplayName(); + size += getStackInSlot(1).stackSize; + } + info.add(size + " " + name); + } + } } diff --git a/src/main/java/techreborn/tiles/TileQuantumTank.java b/src/main/java/techreborn/tiles/TileQuantumTank.java index c1ce1060d..f936297e5 100644 --- a/src/main/java/techreborn/tiles/TileQuantumTank.java +++ b/src/main/java/techreborn/tiles/TileQuantumTank.java @@ -1,6 +1,7 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; +import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -20,243 +21,282 @@ import reborncore.common.util.FluidUtils; import reborncore.common.util.Inventory; import reborncore.common.util.Tank; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -import java.util.List; +public class TileQuantumTank extends TileMachineBase + implements IFluidHandler, IInventory, IWrenchable, IListInfoProvider +{ -public class TileQuantumTank extends TileMachineBase implements IFluidHandler, - IInventory, IWrenchable, IListInfoProvider { + public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this); + public Inventory inventory = new Inventory(3, "TileQuantumTank", 64, this); - public Tank tank = new Tank("TileQuantumTank", Integer.MAX_VALUE, this); - public Inventory inventory = new Inventory(3, "TileQuantumTank", 64, this); + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + readFromNBTWithoutCoords(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - readFromNBTWithoutCoords(tagCompound); - } + public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) + { + tank.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) { - tank.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + writeToNBTWithoutCoords(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - writeToNBTWithoutCoords(tagCompound); - } + public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) + { + tank.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - public void writeToNBTWithoutCoords(NBTTagCompound tagCompound) { - tank.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote) + { + FluidUtils.drainContainers(this, inventory, 0, 1); + FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType()); + if (tank.getFluidType() != null && getStackInSlot(2) == null) + { + inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock())); + } else if (tank.getFluidType() == null && getStackInSlot(2) != null) + { + setInventorySlotContents(2, null); + } + tank.compareAndUpdate(); + } + } - @Override - public void updateEntity() { - super.updateEntity(); - if (!worldObj.isRemote) { - FluidUtils.drainContainers(this, inventory, 0, 1); - FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType()); - if (tank.getFluidType() != null && getStackInSlot(2) == null) { - inventory.setInventorySlotContents(2, new ItemStack(tank - .getFluidType().getBlock())); - } else if (tank.getFluidType() == null && getStackInSlot(2) != null) { - setInventorySlotContents(2, null); - } - tank.compareAndUpdate(); - } - } + // IFluidHandler + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + int fill = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return fill; + } - // IFluidHandler - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - int fill = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return fill; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + FluidStack drain = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, - boolean doDrain) { - FluidStack drain = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drain = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drain = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + // IInventory + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - // IInventory - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slotId, int count) + { + ItemStack stack = inventory.decrStackSize(slotId, count); + syncWithAll(); + return stack; + } - @Override - public ItemStack decrStackSize(int slotId, int count) { - ItemStack stack = inventory.decrStackSize(slotId, count); - syncWithAll(); - return stack; - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + syncWithAll(); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - syncWithAll(); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public float getWrenchDropRate() + { + return 1F; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return getDropWithNBT(); + } - @Override - public float getWrenchDropRate() { - return 1F; - } + public ItemStack getDropWithNBT() + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.quantumTank, 1); + writeToNBTWithoutCoords(tileEntity); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return getDropWithNBT(); - } + @Override + public void addInfo(List info, boolean isRealTile) + { + if (isRealTile) + { + if (tank.getFluid() != null) + { + info.add(tank.getFluidAmount() + " of " + tank.getFluidType().getName()); + } else + { + info.add("Empty"); + } + } + info.add("Capacity " + tank.getCapacity() + " mb"); - public ItemStack getDropWithNBT() { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.quantumTank, 1); - writeToNBTWithoutCoords(tileEntity); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } - - @Override - public void addInfo(List info, boolean isRealTile) { - if (isRealTile) { - if (tank.getFluid() != null) { - info.add(tank.getFluidAmount() + " of " - + tank.getFluidType().getName()); - } else { - info.add("Empty"); - } - } - info.add("Capacity " + tank.getCapacity() + " mb"); - - } + } } diff --git a/src/main/java/techreborn/tiles/TileRollingMachine.java b/src/main/java/techreborn/tiles/TileRollingMachine.java index 1d1570059..17995c2cd 100644 --- a/src/main/java/techreborn/tiles/TileRollingMachine.java +++ b/src/main/java/techreborn/tiles/TileRollingMachine.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; @@ -15,274 +14,322 @@ import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.api.RollingMachineRecipe; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; //TODO add tick and power bars. -public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IInventory { +public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IInventory +{ - public Inventory inventory = new Inventory(3, "TileRollingMachine", 64, this); - public final InventoryCrafting craftMatrix = new InventoryCrafting( - new RollingTileContainer(), 3, 3); + public Inventory inventory = new Inventory(3, "TileRollingMachine", 64, this); + public final InventoryCrafting craftMatrix = new InventoryCrafting(new RollingTileContainer(), 3, 3); - public boolean isRunning; - public int tickTime; - public int runTime = 250; - public ItemStack currentRecipe; + public boolean isRunning; + public int tickTime; + public int runTime = 250; + public ItemStack currentRecipe; - public int euTick = 5; + public int euTick = 5; - @Override - public double getMaxPower() { - return 100000; - } + @Override + public double getMaxPower() + { + return 100000; + } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 64; + } - @Override - public double getMaxInput() { - return 64; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + private static class RollingTileContainer extends Container + { - private static class RollingTileContainer extends Container { + @Override + public boolean canInteractWith(EntityPlayer entityplayer) + { + return true; + } - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return true; - } + } - } + public TileRollingMachine() + { + super(1); + } - public TileRollingMachine() { - super(1); - } + @Override + public void updateEntity() + { + super.updateEntity(); + charge(2); + if (!worldObj.isRemote) + { + currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj); + if (currentRecipe != null && canMake()) + { + if (tickTime >= runTime) + { + currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj); + if (currentRecipe != null) + { + boolean hasCrafted = false; + if (inventory.getStackInSlot(0) == null) + { + inventory.setInventorySlotContents(0, currentRecipe); + tickTime = -1; + hasCrafted = true; + } else + { + if (inventory.getStackInSlot(0).stackSize + currentRecipe.stackSize <= currentRecipe + .getMaxStackSize()) + { + ItemStack stack = inventory.getStackInSlot(0); + stack.stackSize = stack.stackSize + currentRecipe.stackSize; + inventory.setInventorySlotContents(0, stack); + tickTime = -1; + hasCrafted = true; + } + } + if (hasCrafted) + { + for (int i = 0; i < craftMatrix.getSizeInventory(); i++) + { + craftMatrix.decrStackSize(i, 1); + } + currentRecipe = null; + } + } + } + } + if (currentRecipe != null) + { + if (canUseEnergy(euTick) && tickTime < runTime) + { + useEnergy(euTick); + tickTime++; + } + } + if (currentRecipe == null) + { + tickTime = -1; + } + } else + { + currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj); + if (currentRecipe != null) + { + inventory.setInventorySlotContents(1, currentRecipe); + } else + { + inventory.setInventorySlotContents(1, null); + } + } + } - @Override - public void updateEntity() { - super.updateEntity(); - charge(2); - if (!worldObj.isRemote) { - currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe( - craftMatrix, worldObj); - if (currentRecipe != null && canMake()) { - if (tickTime >= runTime) { - currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj); - if (currentRecipe != null) { - boolean hasCrafted = false; - if (inventory.getStackInSlot(0) == null) { - inventory - .setInventorySlotContents(0, currentRecipe); - tickTime = -1; - hasCrafted = true; - } else { - if (inventory.getStackInSlot(0).stackSize - + currentRecipe.stackSize <= currentRecipe - .getMaxStackSize()) { - ItemStack stack = inventory.getStackInSlot(0); - stack.stackSize = stack.stackSize - + currentRecipe.stackSize; - inventory.setInventorySlotContents(0, stack); - tickTime = -1; - hasCrafted = true; - } - } - if (hasCrafted) { - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - craftMatrix.decrStackSize(i, 1); - } - currentRecipe = null; - } - } - } - } - if (currentRecipe != null) { - if (canUseEnergy(euTick) && tickTime < runTime) { - useEnergy(euTick); - tickTime++; - } - } - if (currentRecipe == null) { - tickTime = -1; - } - } else { - currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe( - craftMatrix, worldObj); - if (currentRecipe != null) { - inventory.setInventorySlotContents(1, currentRecipe); - } else { - inventory.setInventorySlotContents(1, null); - } - } - } + public boolean canMake() + { + if (RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, worldObj) == null) + { + return false; + } + return true; + } - public boolean canMake() { - if (RollingMachineRecipe.instance.findMatchingRecipe(craftMatrix, - worldObj) == null) { - return false; - } - return true; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.RollingMachine, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.RollingMachine, 1); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + ItemUtils.readInvFromNBT(craftMatrix, "Crafting", tagCompound); + isRunning = tagCompound.getBoolean("isRunning"); + tickTime = tagCompound.getInteger("tickTime"); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - ItemUtils.readInvFromNBT(craftMatrix, "Crafting", tagCompound); - isRunning = tagCompound.getBoolean("isRunning"); - tickTime = tagCompound.getInteger("tickTime"); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + ItemUtils.writeInvToNBT(craftMatrix, "Crafting", tagCompound); + writeUpdateToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - ItemUtils.writeInvToNBT(craftMatrix, "Crafting", tagCompound); - writeUpdateToNBT(tagCompound); - } + public void writeUpdateToNBT(NBTTagCompound tagCompound) + { + tagCompound.setBoolean("isRunning", isRunning); + tagCompound.setInteger("tickTime", tickTime); + } - public void writeUpdateToNBT(NBTTagCompound tagCompound) { - tagCompound.setBoolean("isRunning", isRunning); - tagCompound.setInteger("tickTime", tickTime); - } + @Override + public void invalidate() + { + super.invalidate(); + } - @Override - public void invalidate() { - super.invalidate(); - } + @Override + public void onChunkUnload() + { + super.onChunkUnload(); + } - @Override - public void onChunkUnload() { - super.onChunkUnload(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } } diff --git a/src/main/java/techreborn/tiles/TileScrapboxinator.java b/src/main/java/techreborn/tiles/TileScrapboxinator.java index 991a176fc..65d1ea971 100644 --- a/src/main/java/techreborn/tiles/TileScrapboxinator.java +++ b/src/main/java/techreborn/tiles/TileScrapboxinator.java @@ -1,6 +1,7 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; +import java.util.Random; + import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -16,10 +17,10 @@ import reborncore.common.util.Inventory; import techreborn.api.ScrapboxList; import techreborn.init.ModBlocks; import techreborn.init.ModItems; +import ic2.api.tile.IWrenchable; -import java.util.Random; - -public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ public Inventory inventory = new Inventory(6, "TileScrapboxinator", 64, this); public int capacity = 1000; @@ -31,77 +32,97 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable public int input1 = 0; public int output = 1; - public TileScrapboxinator() { + public TileScrapboxinator() + { super(1); } - public int gaugeProgressScaled(int scale) { + public int gaugeProgressScaled(int scale) + { return (progress * scale) / time; } @Override - public void updateEntity() { + public void updateEntity() + { boolean burning = isBurning(); boolean updateInventory = false; - if (getEnergy() <= cost && canOpen()) { - if (getEnergy() > cost) { + if (getEnergy() <= cost && canOpen()) + { + if (getEnergy() > cost) + { updateInventory = true; } } - if (isBurning() && canOpen()) { + if (isBurning() && canOpen()) + { updateState(); progress++; - if (progress >= time) { + if (progress >= time) + { progress = 0; recycleItems(); updateInventory = true; } - } else { + } else + { progress = 0; updateState(); } - if (burning != isBurning()) { + if (burning != isBurning()) + { updateInventory = true; } - if (updateInventory) { + if (updateInventory) + { markDirty(); } } - public void recycleItems() { - if (this.canOpen() && !worldObj.isRemote) { + public void recycleItems() + { + if (this.canOpen() && !worldObj.isRemote) + { int random = new Random().nextInt(ScrapboxList.stacks.size()); ItemStack out = ScrapboxList.stacks.get(random).copy(); - if (getStackInSlot(output) == null) { + if (getStackInSlot(output) == null) + { useEnergy(cost); setInventorySlotContents(output, out); } - if (getStackInSlot(input1).stackSize > 1) { + if (getStackInSlot(input1).stackSize > 1) + { useEnergy(cost); this.decrStackSize(input1, 1); - } else { + } else + { useEnergy(cost); setInventorySlotContents(input1, null); } } } - public boolean canOpen() { - if (getStackInSlot(input1) != null && getStackInSlot(output) == null) { + public boolean canOpen() + { + if (getStackInSlot(input1) != null && getStackInSlot(output) == null) + { return true; } return false; } - public boolean isBurning() { + public boolean isBurning() + { return getEnergy() > cost; } - public void updateState() { + public void updateState() + { IBlockState blockState = worldObj.getBlockState(pos); - if (blockState.getBlock() instanceof BlockMachineBase) { + if (blockState.getBlock() instanceof BlockMachineBase) + { BlockMachineBase blockMachineBase = (BlockMachineBase) blockState.getBlock(); if (blockState.getValue(BlockMachineBase.ACTIVE) != progress > 0) blockMachineBase.setActive(progress > 0, worldObj, pos); @@ -109,101 +130,122 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable } @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { return false; } @Override - public EnumFacing getFacing() { + public EnumFacing getFacing() + { return getFacingEnum(); } @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { return true; } return false; } @Override - public float getWrenchDropRate() { + public float getWrenchDropRate() + { return 1.0F; } @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { return new ItemStack(ModBlocks.scrapboxinator, 1); } - public boolean isComplete() { + public boolean isComplete() + { return false; } @Override - public void readFromNBT(NBTTagCompound tagCompound) { + public void readFromNBT(NBTTagCompound tagCompound) + { super.readFromNBT(tagCompound); inventory.readFromNBT(tagCompound); } @Override - public void writeToNBT(NBTTagCompound tagCompound) { + public void writeToNBT(NBTTagCompound tagCompound) + { super.writeToNBT(tagCompound); inventory.writeToNBT(tagCompound); } @Override - public int getSizeInventory() { + public int getSizeInventory() + { return inventory.getSizeInventory(); } @Override - public ItemStack getStackInSlot(int slot) { + public ItemStack getStackInSlot(int slot) + { return inventory.getStackInSlot(slot); } @Override - public ItemStack decrStackSize(int slot, int amount) { + public ItemStack decrStackSize(int slot, int amount) + { return inventory.decrStackSize(slot, amount); } @Override - public ItemStack removeStackFromSlot(int slot) { + public ItemStack removeStackFromSlot(int slot) + { return inventory.removeStackFromSlot(slot); } @Override - public void setInventorySlotContents(int slot, ItemStack stack) { + public void setInventorySlotContents(int slot, ItemStack stack) + { inventory.setInventorySlotContents(slot, stack); } @Override - public int getInventoryStackLimit() { + public int getInventoryStackLimit() + { return inventory.getInventoryStackLimit(); } @Override - public boolean isUseableByPlayer(EntityPlayer player) { + public boolean isUseableByPlayer(EntityPlayer player) + { return inventory.isUseableByPlayer(player); } @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { + public boolean isItemValidForSlot(int slot, ItemStack stack) + { return inventory.isItemValidForSlot(slot, stack); } // ISidedInventory @Override - public int[] getSlotsForFace(EnumFacing side) { + public int[] getSlotsForFace(EnumFacing side) + { return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; } @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { if (slotIndex == 2) return false; - if (slotIndex == 1) { - if (itemStack.getItem() == ModItems.scrapBox) { + if (slotIndex == 1) + { + if (itemStack.getItem() == ModItems.scrapBox) + { return true; } } @@ -211,82 +253,98 @@ public class TileScrapboxinator extends TilePowerAcceptor implements IWrenchable } @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { return slotIndex == 2; } @Override - public double getMaxPower() { + public double getMaxPower() + { return capacity; } @Override - public boolean canAcceptEnergy(EnumFacing direction) { + public boolean canAcceptEnergy(EnumFacing direction) + { return true; } @Override - public boolean canProvideEnergy(EnumFacing direction) { + public boolean canProvideEnergy(EnumFacing direction) + { return false; } @Override - public double getMaxOutput() { + public double getMaxOutput() + { return 0; } @Override - public double getMaxInput() { + public double getMaxInput() + { return 32; } @Override - public EnumPowerTier getTier() { + public EnumPowerTier getTier() + { return EnumPowerTier.MEDIUM; } @Override - public void openInventory(EntityPlayer player) { + public void openInventory(EntityPlayer player) + { inventory.openInventory(player); } @Override - public void closeInventory(EntityPlayer player) { + public void closeInventory(EntityPlayer player) + { inventory.closeInventory(player); } @Override - public int getField(int id) { + public int getField(int id) + { return inventory.getField(id); } @Override - public void setField(int id, int value) { + public void setField(int id, int value) + { inventory.setField(id, value); } @Override - public int getFieldCount() { + public int getFieldCount() + { return inventory.getFieldCount(); } @Override - public void clear() { + public void clear() + { inventory.clear(); } @Override - public String getName() { + public String getName() + { return inventory.getName(); } @Override - public boolean hasCustomName() { + public boolean hasCustomName() + { return inventory.hasCustomName(); } @Override - public ITextComponent getDisplayName() { + public ITextComponent getDisplayName() + { return inventory.getDisplayName(); } } diff --git a/src/main/java/techreborn/tiles/TileVacuumFreezer.java b/src/main/java/techreborn/tiles/TileVacuumFreezer.java index 591d4d081..7129f469e 100644 --- a/src/main/java/techreborn/tiles/TileVacuumFreezer.java +++ b/src/main/java/techreborn/tiles/TileVacuumFreezer.java @@ -1,6 +1,5 @@ package techreborn.tiles; -import ic2.api.tile.IWrenchable; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -16,228 +15,278 @@ import techreborn.api.recipe.RecipeCrafter; import techreborn.blocks.BlockMachineCasing; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable, IInventory { +public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable, IInventory +{ - public int tickTime; - public Inventory inventory = new Inventory(3, "TileVacuumFreezer", 64, this); - public RecipeCrafter crafter; - public int multiBlockStatus = 0; + public int tickTime; + public Inventory inventory = new Inventory(3, "TileVacuumFreezer", 64, this); + public RecipeCrafter crafter; + public int multiBlockStatus = 0; - public TileVacuumFreezer() { - super(2); - //Input slots - int[] inputs = new int[1]; - inputs[0] = 0; - int[] outputs = new int[1]; - outputs[0] = 1; - crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, inventory, inputs, outputs); - } + public TileVacuumFreezer() + { + super(2); + // Input slots + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, inventory, inputs, outputs); + } - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); - if (worldObj.getTotalWorldTime() % 20 == 0) { - multiBlockStatus = checkMachine() ? 1 : 0; - } - } + if (worldObj.getTotalWorldTime() % 20 == 0) + { + multiBlockStatus = checkMachine() ? 1 : 0; + } + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxInput() { - return 128; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.AlloySmelter, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } - - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } - - public boolean checkMachine() { - int xDir = EnumFacing.UP.getFrontOffsetX() * 2; - int yDir = EnumFacing.UP.getFrontOffsetY() * 2; - int zDir = EnumFacing.UP.getFrontOffsetZ() * 2; - for (int i = -1; i < 2; i++) { - for (int j = -1; j < 2; j++) { - for (int k = -1; k < 2; k++) { - if ((i != 0) || (j != 0) || (k != 0)) { - if (worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k)).getBlock() != ModBlocks.MachineCasing) { - return false; - } - IBlockState BlockStateContainer = worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k)); - BlockMachineCasing blockMachineCasing = (BlockMachineCasing) BlockStateContainer.getBlock(); - if (blockMachineCasing.getMetaFromState(BlockStateContainer) != (((i == 0) && (j == 0) && (k != 0)) || ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2 : 1)) { - return false; - } - } else if (!worldObj.isAirBlock(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k))) { - return false; - } - } - } - } - return true; - } + public boolean checkMachine() + { + int xDir = EnumFacing.UP.getFrontOffsetX() * 2; + int yDir = EnumFacing.UP.getFrontOffsetY() * 2; + int zDir = EnumFacing.UP.getFrontOffsetZ() * 2; + for (int i = -1; i < 2; i++) + { + for (int j = -1; j < 2; j++) + { + for (int k = -1; k < 2; k++) + { + if ((i != 0) || (j != 0) || (k != 0)) + { + if (worldObj.getBlockState(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, + getPos().getZ() - zDir + k)).getBlock() != ModBlocks.MachineCasing) + { + return false; + } + IBlockState BlockStateContainer = worldObj.getBlockState(new BlockPos( + getPos().getX() - xDir + i, getPos().getY() - yDir + j, getPos().getZ() - zDir + k)); + BlockMachineCasing blockMachineCasing = (BlockMachineCasing) BlockStateContainer.getBlock(); + if (blockMachineCasing + .getMetaFromState(BlockStateContainer) != (((i == 0) && (j == 0) && (k != 0)) + || ((i == 0) && (j != 0) && (k == 0)) || ((i != 0) && (j == 0) && (k == 0)) ? 2 + : 1)) + { + return false; + } + } else if (!worldObj.isAirBlock(new BlockPos(getPos().getX() - xDir + i, getPos().getY() - yDir + j, + getPos().getZ() - zDir + k))) + { + return false; + } + } + } + } + return true; + } } diff --git a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java index 81e057201..c4169455f 100644 --- a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java +++ b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java @@ -15,345 +15,428 @@ import techreborn.api.reactor.FusionReactorRecipe; import techreborn.api.reactor.FusionReactorRecipeHelper; import techreborn.init.ModBlocks; +public class TileEntityFusionController extends TilePowerAcceptor implements IInventory +{ -public class TileEntityFusionController extends TilePowerAcceptor implements IInventory { + public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); - public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); + // 0= no coils, 1 = coils + public int coilStatus = 0; - //0= no coils, 1 = coils - public int coilStatus = 0; + int topStackSlot = 0; + int bottomStackSlot = 1; + int outputStackSlot = 2; - int topStackSlot = 0; - int bottomStackSlot = 1; - int outputStackSlot = 2; + public int crafingTickTime = 0; + public int finalTickTime = 0; + public int neededPower = 0; - public int crafingTickTime = 0; - public int finalTickTime = 0; - public int neededPower = 0; + FusionReactorRecipe currentRecipe = null; + boolean hasStartedCrafting = false; - FusionReactorRecipe currentRecipe = null; - boolean hasStartedCrafting = false; + public TileEntityFusionController() + { + super(4); + } - public TileEntityFusionController() { - super(4); - } + @Override + public double getMaxPower() + { + return 100000000; + } - @Override - public double getMaxPower() { - return 100000000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + if (direction == EnumFacing.DOWN || direction == EnumFacing.UP) + { + return false; + } + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - if(direction == EnumFacing.DOWN || direction == EnumFacing.UP){ - return false; - } - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + if (direction == EnumFacing.DOWN || direction == EnumFacing.UP) + { + return true; + } + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - if(direction == EnumFacing.DOWN || direction == EnumFacing.UP){ - return true; - } - return false; - } + @Override + public double getMaxOutput() + { + if (!hasStartedCrafting) + { + return 0; + } + return 1000000; + } - @Override - public double getMaxOutput() { - if(!hasStartedCrafting){ - return 0; - } - return 1000000; - } + @Override + public double getMaxInput() + { + if (hasStartedCrafting) + { + return 0; + } + return 8192; + } - @Override - public double getMaxInput() { - if(hasStartedCrafting){ - return 0; - } - return 8192; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafingTickTime = tagCompound.getInteger("crafingTickTime"); + finalTickTime = tagCompound.getInteger("finalTickTime"); + neededPower = tagCompound.getInteger("neededPower"); + hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting"); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafingTickTime = tagCompound.getInteger("crafingTickTime"); - finalTickTime = tagCompound.getInteger("finalTickTime"); - neededPower = tagCompound.getInteger("neededPower"); - hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting"); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); + if (crafingTickTime == -1) + { + crafingTickTime = 0; + } + if (finalTickTime == -1) + { + finalTickTime = 0; + } + if (neededPower == -1) + { + neededPower = 0; + } + tagCompound.setInteger("crafingTickTime", crafingTickTime); + tagCompound.setInteger("finalTickTime", finalTickTime); + tagCompound.setInteger("neededPower", neededPower); + tagCompound.setBoolean("hasStartedCrafting", hasStartedCrafting); + } - if(crafingTickTime == -1){ - crafingTickTime = 0; - } - if(finalTickTime == -1){ - finalTickTime = 0; - } - if(neededPower == -1){ - neededPower = 0; - } - tagCompound.setInteger("crafingTickTime", crafingTickTime); - tagCompound.setInteger("finalTickTime", finalTickTime); - tagCompound.setInteger("neededPower", neededPower); - tagCompound.setBoolean("hasStartedCrafting", hasStartedCrafting); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + public boolean checkCoils() + { + if ((isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1)) + && (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ())) + && (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1)) + && (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() + 1)) + && (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ())) + && (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() - 1)) + && (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 2)) + && (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 1)) + && (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 1)) + && (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 2)) + && (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 2)) + && (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 1)) + && (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 1)) + && (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 2)) + && (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 3)) + && (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 2)) + && (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 2)) + && (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 3)) + && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 3)) + && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 2)) + && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2)) + && (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3)) + && (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3)) + && (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3))) + { + coilStatus = 1; + return true; + } + coilStatus = 0; + return false; + } - @Override - public void clear() { - inventory.clear(); - } + private boolean isCoil(int x, int y, int z) + { + return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil; + } + @Override + public void updateEntity() + { + super.updateEntity(); + // TODO improve this code a lot - public boolean checkCoils() { - if ((isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1)) && - (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ())) && - (isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() - 1)) && - (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() + 1)) && - (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ())) && - (isCoil(this.getPos().getX() - 3, this.getPos().getY(), this.getPos().getZ() - 1)) && - (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 2)) && - (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() + 1)) && - (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 1)) && - (isCoil(this.getPos().getX() + 2, this.getPos().getY(), this.getPos().getZ() - 2)) && - (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 2)) && - (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() + 1)) && - (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 1)) && - (isCoil(this.getPos().getX() - 2, this.getPos().getY(), this.getPos().getZ() - 2)) && - (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 3)) && - (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() + 2)) && - (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 2)) && - (isCoil(this.getPos().getX() + 1, this.getPos().getY(), this.getPos().getZ() - 3)) && - (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 3)) && - (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() + 2)) && - (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 2)) && - (isCoil(this.getPos().getX() - 1, this.getPos().getY(), this.getPos().getZ() - 3)) && - (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() + 3)) && - (isCoil(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ() - 3))) { - coilStatus = 1; - return true; - } - coilStatus = 0; - return false; - } + if (worldObj.getTotalWorldTime() % 20 == 0) + { + checkCoils(); + } - private boolean isCoil(int x, int y, int z) { - return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil; - } + if (!worldObj.isRemote) + { + if (coilStatus == 1) + { + if (currentRecipe == null) + { + if (inventory.hasChanged || crafingTickTime != 0) + { + for (FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) + { + if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), reactorRecipe.getTopInput(), true, + true, true)) + { + if (reactorRecipe.getBottomInput() != null) + { + if (ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot), + reactorRecipe.getBottomInput(), true, true, true) == false) + { + break; + } + } + if (canFitStack(reactorRecipe.getOutput(), outputStackSlot, true)) + { + currentRecipe = reactorRecipe; + if (crafingTickTime != 0) + { + finalTickTime = currentRecipe.getTickTime(); + neededPower = (int) currentRecipe.getStartEU(); + } + hasStartedCrafting = false; + crafingTickTime = 0; + finalTickTime = currentRecipe.getTickTime(); + neededPower = (int) currentRecipe.getStartEU(); + break; + } + } + } + } + } else + { + if (inventory.hasChanged) + { + if (!validateRecipe()) + { + resetCrafter(); + return; + } + } + if (!hasStartedCrafting) + { + if (canUseEnergy(currentRecipe.getStartEU() + 64)) + { + useEnergy(currentRecipe.getStartEU()); + hasStartedCrafting = true; + } + } else + { + if (crafingTickTime < currentRecipe.getTickTime()) + { + if (currentRecipe.getEuTick() > 0) + { // Power gen + addEnergy(currentRecipe.getEuTick()); // Waste + // power + // if it + // has + // no + // where + // to go + crafingTickTime++; + } else + { // Power user + if (canUseEnergy(currentRecipe.getEuTick() * -1)) + { + setEnergy(getEnergy() - (currentRecipe.getEuTick() * -1)); + crafingTickTime++; + } + } + } else + { + if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true)) + { + if (getStackInSlot(outputStackSlot) == null) + { + setInventorySlotContents(outputStackSlot, currentRecipe.getOutput().copy()); + } else + { + decrStackSize(outputStackSlot, -currentRecipe.getOutput().stackSize); + } + decrStackSize(topStackSlot, currentRecipe.getTopInput().stackSize); + if (currentRecipe.getBottomInput() != null) + { + decrStackSize(bottomStackSlot, currentRecipe.getBottomInput().stackSize); + } + resetCrafter(); + } + } + } + } + } else + { + if (currentRecipe != null) + { + resetCrafter(); + } + } + } - @Override - public void updateEntity() { - super.updateEntity(); - //TODO improve this code a lot + if (inventory.hasChanged) + { + inventory.hasChanged = false; + } + } - if (worldObj.getTotalWorldTime() % 20 == 0) { - checkCoils(); - } + private boolean validateRecipe() + { + if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), currentRecipe.getTopInput(), true, true, true)) + { + if (currentRecipe.getBottomInput() != null) + { + if (ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot), currentRecipe.getBottomInput(), true, true, + true) == false) + { + return false; + } + } + if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true)) + { + return true; + } + } + return false; + } - if (!worldObj.isRemote) { - if (coilStatus == 1) { - if (currentRecipe == null) { - if (inventory.hasChanged || crafingTickTime != 0) { - for (FusionReactorRecipe reactorRecipe : FusionReactorRecipeHelper.reactorRecipes) { - if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), reactorRecipe.getTopInput(), true, true, true)) { - if (reactorRecipe.getBottomInput() != null) { - if (ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot), reactorRecipe.getBottomInput(), true, true, true) == false) { - break; - } - } - if (canFitStack(reactorRecipe.getOutput(), outputStackSlot, true)) { - currentRecipe = reactorRecipe; - if(crafingTickTime != 0){ - finalTickTime = currentRecipe.getTickTime(); - neededPower = (int) currentRecipe.getStartEU(); - } - hasStartedCrafting = false; - crafingTickTime = 0; - finalTickTime = currentRecipe.getTickTime(); - neededPower = (int) currentRecipe.getStartEU(); - break; - } - } - } - } - } else { - if (inventory.hasChanged) { - if (!validateRecipe()) { - resetCrafter(); - return; - } - } - if (!hasStartedCrafting) { - if (canUseEnergy(currentRecipe.getStartEU() + 64)) { - useEnergy(currentRecipe.getStartEU()); - hasStartedCrafting = true; - } - } else { - if (crafingTickTime < currentRecipe.getTickTime()) { - if (currentRecipe.getEuTick() > 0) { //Power gen - addEnergy(currentRecipe.getEuTick()); //Waste power if it has no where to go - crafingTickTime++; - } else { //Power user - if (canUseEnergy(currentRecipe.getEuTick() * -1)) { - setEnergy(getEnergy() - (currentRecipe.getEuTick() * -1)); - crafingTickTime++; - } - } - } else { - if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true)) { - if (getStackInSlot(outputStackSlot) == null) { - setInventorySlotContents(outputStackSlot, currentRecipe.getOutput().copy()); - } else { - decrStackSize(outputStackSlot, -currentRecipe.getOutput().stackSize); - } - decrStackSize(topStackSlot, currentRecipe.getTopInput().stackSize); - if (currentRecipe.getBottomInput() != null) { - decrStackSize(bottomStackSlot, currentRecipe.getBottomInput().stackSize); - } - resetCrafter(); - } - } - } - } - } else { - if (currentRecipe != null) { - resetCrafter(); - } - } - } + private void resetCrafter() + { + currentRecipe = null; + crafingTickTime = -1; + finalTickTime = -1; + neededPower = -1; + hasStartedCrafting = false; + } + public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) + {// Checks to see if it can fit the stack + if (stack == null) + { + return true; + } + if (inventory.getStackInSlot(slot) == null) + { + return true; + } + if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) + { + if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) + { + return true; + } + } + return false; + } - if (inventory.hasChanged) { - inventory.hasChanged = false; - } - } + @Override + public String getName() + { + return null; + } - private boolean validateRecipe() { - if (ItemUtils.isItemEqual(getStackInSlot(topStackSlot), currentRecipe.getTopInput(), true, true, true)) { - if (currentRecipe.getBottomInput() != null) { - if (ItemUtils.isItemEqual(getStackInSlot(bottomStackSlot), currentRecipe.getBottomInput(), true, true, true) == false) { - return false; - } - } - if (canFitStack(currentRecipe.getOutput(), outputStackSlot, true)) { - return true; - } - } - return false; - } + @Override + public boolean hasCustomName() + { + return false; + } - private void resetCrafter() { - currentRecipe = null; - crafingTickTime = -1; - finalTickTime = -1; - neededPower = -1; - hasStartedCrafting = false; - } - - public boolean canFitStack(ItemStack stack, int slot, boolean oreDic) {//Checks to see if it can fit the stack - if (stack == null) { - return true; - } - if (inventory.getStackInSlot(slot) == null) { - return true; - } - if (ItemUtils.isItemEqual(inventory.getStackInSlot(slot), stack, true, true, oreDic)) { - if (stack.stackSize + inventory.getStackInSlot(slot).stackSize <= stack.getMaxStackSize()) { - return true; - } - } - return false; - } - - @Override - public String getName() { - return null; - } - - @Override - public boolean hasCustomName() { - return false; - } - - @Override - public ITextComponent getDisplayName() { - return null; - } + @Override + public ITextComponent getDisplayName() + { + return null; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java b/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java index 8cb51998e..102b63108 100644 --- a/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileDieselGenerator.java @@ -1,6 +1,5 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,7 +9,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.fuel.FluidPowerManager; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; @@ -19,254 +17,298 @@ import reborncore.common.util.Inventory; import reborncore.common.util.Tank; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable, - IFluidHandler, IInventory { +public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory +{ - public Tank tank = new Tank("TileDieselGenerator", - FluidContainerRegistry.BUCKET_VOLUME * 10, this); - public Inventory inventory = new Inventory(3, "TileDieselGenerator", 64, this); - public static final int euTick = ConfigTechReborn.ThermalGenertaorOutput; + public Tank tank = new Tank("TileDieselGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this); + public Inventory inventory = new Inventory(3, "TileDieselGenerator", 64, this); + public static final int euTick = ConfigTechReborn.ThermalGenertaorOutput; - public TileDieselGenerator() { - super(ConfigTechReborn.ThermalGeneratorTier); - } + public TileDieselGenerator() + { + super(ConfigTechReborn.ThermalGeneratorTier); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.DieselGenerator, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.DieselGenerator, 1); + } - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - int filled = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return filled; - } + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + int filled = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return filled; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) { - if (resource == null || !resource.isFluidEqual(tank.getFluid())) { - return null; - } - FluidStack fluidStack = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return fluidStack; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + FluidStack fluidStack = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return fluidStack; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drained = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drained; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drained = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drained; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - return FluidPowerManager.fluidPowerValues.containsKey(fluid); - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + return FluidPowerManager.fluidPowerValues.containsKey(fluid); + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void updateEntity() { - super.updateEntity(); - if (!worldObj.isRemote) { - FluidUtils.drainContainers(this, inventory, 0, 1); - FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType()); - if (tank.getFluidType() != null && getStackInSlot(2) == null) { - inventory.setInventorySlotContents(2, new ItemStack(tank - .getFluidType().getBlock())); - syncWithAll(); - } else if (tank.getFluidType() == null && getStackInSlot(2) != null) { - setInventorySlotContents(2, null); - syncWithAll(); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote) + { + FluidUtils.drainContainers(this, inventory, 0, 1); + FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType()); + if (tank.getFluidType() != null && getStackInSlot(2) == null) + { + inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock())); + syncWithAll(); + } else if (tank.getFluidType() == null && getStackInSlot(2) != null) + { + setInventorySlotContents(2, null); + syncWithAll(); + } - if (!tank.isEmpty() && tank.getFluidType() != null && FluidPowerManager.fluidPowerValues.containsKey(tank.getFluidType())) { - double powerIn = FluidPowerManager.fluidPowerValues.get(tank.getFluidType()); - if (getFreeSpace() >= powerIn) { - addEnergy(powerIn, false); - tank.drain(1, true); - } - } - } + if (!tank.isEmpty() && tank.getFluidType() != null + && FluidPowerManager.fluidPowerValues.containsKey(tank.getFluidType())) + { + double powerIn = FluidPowerManager.fluidPowerValues.get(tank.getFluidType()); + if (getFreeSpace() >= powerIn) + { + addEnergy(powerIn, false); + tank.drain(1, true); + } + } + } - } + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } + @Override + public double getMaxPower() + { + return ConfigTechReborn.ThermalGeneratorCharge; + } - @Override - public double getMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 64; + } - @Override - public double getMaxOutput() { - return 64; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxInput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java b/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java index c024df8ee..ffe6ac53f 100644 --- a/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java +++ b/src/main/java/techreborn/tiles/generator/TileDragonEggSiphoner.java @@ -1,6 +1,5 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -14,185 +13,222 @@ import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventory { +public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventory +{ - public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64, this); - public static final int euTick = ConfigTechReborn.DragoneggsiphonerOutput; + public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64, this); + public static final int euTick = ConfigTechReborn.DragoneggsiphonerOutput; - public TileDragonEggSiphoner() { - super(2); - } + public TileDragonEggSiphoner() + { + super(2); + } - @Override - public void updateEntity() { - super.updateEntity(); + @Override + public void updateEntity() + { + super.updateEntity(); - if (!worldObj.isRemote) { - if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())).getBlock() == Blocks.dragon_egg) { - addEnergy(euTick); - } - } - } + if (!worldObj.isRemote) + { + if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())) + .getBlock() == Blocks.dragon_egg) + { + addEnergy(euTick); + } + } + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Dragoneggenergysiphoner, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Dragoneggenergysiphoner, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } + @Override + public double getMaxPower() + { + return 1000; + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxPower() { - return 1000; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return euTick; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxOutput() { - return euTick; - } - - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.HIGH; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.HIGH; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileGasTurbine.java b/src/main/java/techreborn/tiles/generator/TileGasTurbine.java index e90f876af..b43157e70 100644 --- a/src/main/java/techreborn/tiles/generator/TileGasTurbine.java +++ b/src/main/java/techreborn/tiles/generator/TileGasTurbine.java @@ -1,6 +1,8 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,7 +12,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.FluidUtils; @@ -18,272 +19,315 @@ import reborncore.common.util.Inventory; import reborncore.common.util.Tank; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -import java.util.HashMap; -import java.util.Map; +public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory +{ -public class TileGasTurbine extends TilePowerAcceptor implements IWrenchable, - IFluidHandler, IInventory { + public Tank tank = new Tank("TileGasTurbine", FluidContainerRegistry.BUCKET_VOLUME * 10, this); + public Inventory inventory = new Inventory(3, "TileGasTurbine", 64, this); - public Tank tank = new Tank("TileGasTurbine", - FluidContainerRegistry.BUCKET_VOLUME * 10, this); - public Inventory inventory = new Inventory(3, "TileGasTurbine", 64, this); + // TODO: run this off config + public static final int euTick = 16; - //TODO: run this off config - public static final int euTick = 16; + Map fluids = new HashMap(); - Map fluids = new HashMap(); + // We use this to keep track of fractional millibuckets, allowing us to hit + // our eu/bucket targets while still only ever removing integer millibucket + // amounts. + double pendingWithdraw = 0.0; - //We use this to keep track of fractional millibuckets, allowing us to hit our eu/bucket targets while still only ever removing integer millibucket amounts. - double pendingWithdraw = 0.0; + public TileGasTurbine() + { + super(ConfigTechReborn.ThermalGeneratorTier); + // TODO: fix this to have Gas Turbine generator values - public TileGasTurbine() { - super(ConfigTechReborn.ThermalGeneratorTier); - //TODO: fix this to have Gas Turbine generator values + fluids.put("fluidhydrogen", 15000); + fluids.put("fluidmethane", 45000); + } - fluids.put("fluidhydrogen", 15000); - fluids.put("fluidmethane", 45000); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Gasturbine, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Gasturbine, 1); - } + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + int fill = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return fill; + } - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - int fill = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return fill; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + FluidStack drain = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, - boolean doDrain) { - FluidStack drain = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drain = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drain = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + if (fluid != null) + { + return fluids.containsKey(FluidRegistry.getFluidName(fluid)); + } + return false; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - if (fluid != null) { - return fluids.containsKey(FluidRegistry.getFluidName(fluid)); - } - return false; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote) + { + FluidUtils.drainContainers(this, inventory, 0, 1); + tank.compareAndUpdate(); + } - @Override - public void updateEntity() { - super.updateEntity(); - if (!worldObj.isRemote) { - FluidUtils.drainContainers(this, inventory, 0, 1); - tank.compareAndUpdate(); - } + if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) + { + Integer euPerBucket = fluids.get(tank.getFluidType().getName()); + // float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8 + // eu per tick + // float millibucketsPerTick = 1000f / totalTicks; + float millibucketsPerTick = 16000f / (float) euPerBucket; + pendingWithdraw += millibucketsPerTick; - if (tank.getFluidAmount() > 0 - && getMaxPower() - getEnergy() >= euTick) { - Integer euPerBucket = fluids.get(tank.getFluidType().getName()); - //float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8 eu per tick - //float millibucketsPerTick = 1000f / totalTicks; - float millibucketsPerTick = 16000f / (float) euPerBucket; - pendingWithdraw += millibucketsPerTick; + int currentWithdraw = (int) pendingWithdraw; // float --> int + // conversion floors + // the float + pendingWithdraw -= currentWithdraw; - int currentWithdraw = (int) pendingWithdraw; //float --> int conversion floors the float - pendingWithdraw -= currentWithdraw; + tank.drain(currentWithdraw, true); + addEnergy(euTick); + } + if (tank.getFluidType() != null && getStackInSlot(2) == null) + { + inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock())); + } else if (tank.getFluidType() == null && getStackInSlot(2) != null) + { + setInventorySlotContents(2, null); + } + } - tank.drain(currentWithdraw, true); - addEnergy(euTick); - } - if (tank.getFluidType() != null && getStackInSlot(2) == null) { - inventory.setInventorySlotContents(2, new ItemStack(tank - .getFluidType().getBlock())); - } else if (tank.getFluidType() == null && getStackInSlot(2) != null) { - setInventorySlotContents(2, null); - } - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } + @Override + public double getMaxPower() + { + return ConfigTechReborn.ThermalGeneratorCharge; + } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return euTick; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxOutput() { - return euTick; - } - - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileGenerator.java b/src/main/java/techreborn/tiles/generator/TileGenerator.java index 48d2c44a2..094fa9173 100644 --- a/src/main/java/techreborn/tiles/generator/TileGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileGenerator.java @@ -1,6 +1,5 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -14,223 +13,268 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; public class TileGenerator extends TilePowerAcceptor implements IWrenchable, IInventory { - public Inventory inventory = new Inventory(2, "TileGenerator", 64, this); - - public int fuelSlot = 0; - public int burnTime; - public int totalBurnTime = 0; - public static int outputAmount = 10; //This is in line with BC engines rf, sould properly use the conversion ratio here. - public boolean isBurning; - public boolean lastTickBurning; - ItemStack burnItem; + public Inventory inventory = new Inventory(2, "TileGenerator", 64, this); - public TileGenerator(){ + public int fuelSlot = 0; + public int burnTime; + public int totalBurnTime = 0; + public static int outputAmount = 10; // This is in line with BC engines rf, + // sould properly use the conversion + // ratio here. + public boolean isBurning; + public boolean lastTickBurning; + ItemStack burnItem; + + public TileGenerator() + { super(1); } - @Override - public void updateEntity() { - super.updateEntity(); - if(worldObj.isRemote){ - return; - } - if(getEnergy() < getMaxPower()) { - if (burnTime > 0){ - burnTime--; - addEnergy(outputAmount); - isBurning = true; - } - } else { - isBurning = false; - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (worldObj.isRemote) + { + return; + } + if (getEnergy() < getMaxPower()) + { + if (burnTime > 0) + { + burnTime--; + addEnergy(outputAmount); + isBurning = true; + } + } else + { + isBurning = false; + } - if (burnTime == 0) { - updateState(); - burnTime = totalBurnTime = getItemBurnTime(getStackInSlot(fuelSlot)); - if (burnTime > 0) { - updateState(); - burnItem = getStackInSlot(fuelSlot); - if(getStackInSlot(fuelSlot).stackSize == 1){ - setInventorySlotContents(fuelSlot, null); - } else { - decrStackSize(fuelSlot, 1); - } - } - } + if (burnTime == 0) + { + updateState(); + burnTime = totalBurnTime = getItemBurnTime(getStackInSlot(fuelSlot)); + if (burnTime > 0) + { + updateState(); + burnItem = getStackInSlot(fuelSlot); + if (getStackInSlot(fuelSlot).stackSize == 1) + { + setInventorySlotContents(fuelSlot, null); + } else + { + decrStackSize(fuelSlot, 1); + } + } + } - lastTickBurning = isBurning; - } + lastTickBurning = isBurning; + } - public void updateState(){ - IBlockState BlockStateContainer = worldObj.getBlockState(pos); - if(BlockStateContainer.getBlock() instanceof BlockMachineBase){ - BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); - if(BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != burnTime > 0) - blockMachineBase.setActive(burnTime > 0, worldObj, pos); - } - } + public void updateState() + { + IBlockState BlockStateContainer = worldObj.getBlockState(pos); + if (BlockStateContainer.getBlock() instanceof BlockMachineBase) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); + if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != burnTime > 0) + blockMachineBase.setActive(burnTime > 0, worldObj, pos); + } + } - public static int getItemBurnTime(ItemStack stack) { - return TileEntityFurnace.getItemBurnTime(stack); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } - - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } - - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } - - @Override - public float getWrenchDropRate() { - return 1.0F; - } - - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } - - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } - - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } - - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } - - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } - - - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } - - @Override - public double getMaxPower() { - return 100; - } - - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } - - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } - - @Override - public double getMaxOutput() { - return 64; - } - - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } - - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } - - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } - - - @Override - public int getField(int id) { - return inventory.getField(id); - } - - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } - - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } - - @Override - public void clear() { - inventory.clear(); - } - - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + public static int getItemBurnTime(ItemStack stack) + { + return TileEntityFurnace.getItemBurnTime(stack); + } @Override - public ItemStack getWrenchDrop(EntityPlayer p0) { + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } + + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } + + @Override + public float getWrenchDropRate() + { + return 1.0F; + } + + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } + + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } + + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } + + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } + + @Override + public double getMaxPower() + { + return 100; + } + + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } + + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } + + @Override + public double getMaxOutput() + { + return 64; + } + + @Override + public double getMaxInput() + { + return 0; + } + + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } + + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } + + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + + @Override + public int getField(int id) + { + return inventory.getField(id); + } + + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } + + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } + + @Override + public void clear() + { + inventory.clear(); + } + + @Override + public String getName() + { + return inventory.getName(); + } + + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } + + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer p0) + { return new ItemStack(ModBlocks.Generator); } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } } diff --git a/src/main/java/techreborn/tiles/generator/TileHeatGenerator.java b/src/main/java/techreborn/tiles/generator/TileHeatGenerator.java index 9ced9fb22..060bf64d4 100644 --- a/src/main/java/techreborn/tiles/generator/TileHeatGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileHeatGenerator.java @@ -1,6 +1,5 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -10,104 +9,131 @@ import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable { +public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable +{ - public static final int euTick = ConfigTechReborn.heatGeneratorOutput; + public static final int euTick = ConfigTechReborn.heatGeneratorOutput; - public TileHeatGenerator() { - super(1); - } + public TileHeatGenerator() + { + super(1); + } - @Override - public void updateEntity() { - super.updateEntity(); + @Override + public void updateEntity() + { + super.updateEntity(); - if (!worldObj.isRemote) { - if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) { - addEnergy(euTick); - } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1)).getBlock() == Blocks.lava) { - addEnergy(euTick); - } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1)).getBlock() == Blocks.lava) { - addEnergy(euTick); - } else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) { - addEnergy(euTick); - } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() == Blocks.lava) { - addEnergy(euTick); - } + if (!worldObj.isRemote) + { + if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ())) + .getBlock() == Blocks.lava) + { + addEnergy(euTick); + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1)) + .getBlock() == Blocks.lava) + { + addEnergy(euTick); + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1)) + .getBlock() == Blocks.lava) + { + addEnergy(euTick); + } else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ())) + .getBlock() == Blocks.lava) + { + addEnergy(euTick); + } else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())) + .getBlock() == Blocks.lava) + { + addEnergy(euTick); + } - } - } + } + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.heatGenerator, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.heatGenerator, 1); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 64; + } - @Override - public double getMaxOutput() { - return 64; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxInput() { - return 0; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } - -// @Override -// public void addWailaInfo(List info) -// { -// super.addWailaInfo(info); -// info.add("Power Generarating " + euTick +" EU/t"); -// -// } + // @Override + // public void addWailaInfo(List info) + // { + // super.addWailaInfo(info); + // info.add("Power Generarating " + euTick +" EU/t"); + // + // } } diff --git a/src/main/java/techreborn/tiles/generator/TileSemifluidGenerator.java b/src/main/java/techreborn/tiles/generator/TileSemifluidGenerator.java index 3d814d737..94daa6f8d 100644 --- a/src/main/java/techreborn/tiles/generator/TileSemifluidGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileSemifluidGenerator.java @@ -1,6 +1,8 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; +import java.util.HashMap; +import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -10,7 +12,6 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.FluidUtils; @@ -18,277 +19,318 @@ import reborncore.common.util.Inventory; import reborncore.common.util.Tank; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -import java.util.HashMap; -import java.util.Map; +public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory +{ -public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrenchable, - IFluidHandler, IInventory { + public Tank tank = new Tank("TileSemifluidGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this); + public Inventory inventory = new Inventory(3, "TileSemifluidGenerator", 64, this); - public Tank tank = new Tank("TileSemifluidGenerator", - FluidContainerRegistry.BUCKET_VOLUME * 10, this); - public Inventory inventory = new Inventory(3, "TileSemifluidGenerator", 64, this); + // TODO: run this off config + public static final int euTick = 8; - //TODO: run this off config - public static final int euTick = 8; + Map fluids = new HashMap(); - Map fluids = new HashMap(); + // We use this to keep track of fractional millibuckets, allowing us to hit + // our eu/bucket targets while still only ever removing integer millibucket + // amounts. + double pendingWithdraw = 0.0; - //We use this to keep track of fractional millibuckets, allowing us to hit our eu/bucket targets while still only ever removing integer millibucket amounts. - double pendingWithdraw = 0.0; + public TileSemifluidGenerator() + { + super(ConfigTechReborn.ThermalGeneratorTier); + // TODO: fix this to have SemiFluid generator values - public TileSemifluidGenerator() { - super(ConfigTechReborn.ThermalGeneratorTier); - //TODO: fix this to have SemiFluid generator values + fluids.put("creosote", 3000); + fluids.put("biomass", 8000); + fluids.put("oil", 64000); + fluids.put("fluidsodium", 30000); + fluids.put("fluidlithium", 60000); + fluids.put("biofuel", 32000); + fluids.put("bioethanol", 32000); + fluids.put("fuel", 128000); + } - fluids.put("creosote", 3000); - fluids.put("biomass", 8000); - fluids.put("oil", 64000); - fluids.put("fluidsodium", 30000); - fluids.put("fluidlithium", 60000); - fluids.put("biofuel", 32000); - fluids.put("bioethanol", 32000); - fluids.put("fuel", 128000); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Semifluidgenerator, 1); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Semifluidgenerator, 1); - } + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + int fill = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return fill; + } - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - int fill = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return fill; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + FluidStack drain = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, - boolean doDrain) { - FluidStack drain = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drain = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drain = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + if (fluid != null) + { + return fluids.containsKey(FluidRegistry.getFluidName(fluid)); + } + return false; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - if (fluid != null) { - return fluids.containsKey(FluidRegistry.getFluidName(fluid)); - } - return false; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (!worldObj.isRemote) + FluidUtils.drainContainers(this, inventory, 0, 1); - @Override - public void updateEntity() { - super.updateEntity(); - if (!worldObj.isRemote) - FluidUtils.drainContainers(this, inventory, 0, 1); + if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) + { + Integer euPerBucket = fluids.get(tank.getFluidType().getName()); + // float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8 + // eu per tick + // float millibucketsPerTick = 1000f / totalTicks; + float millibucketsPerTick = 8000f / (float) euPerBucket; + pendingWithdraw += millibucketsPerTick; - if (tank.getFluidAmount() > 0 - && getMaxPower() - getEnergy() >= euTick) { - Integer euPerBucket = fluids.get(tank.getFluidType().getName()); - //float totalTicks = (float)euPerBucket / 8f; //x eu per bucket / 8 eu per tick - //float millibucketsPerTick = 1000f / totalTicks; - float millibucketsPerTick = 8000f / (float) euPerBucket; - pendingWithdraw += millibucketsPerTick; + int currentWithdraw = (int) pendingWithdraw; // float --> int + // conversion floors + // the float + pendingWithdraw -= currentWithdraw; - int currentWithdraw = (int) pendingWithdraw; //float --> int conversion floors the float - pendingWithdraw -= currentWithdraw; + tank.drain(currentWithdraw, true); + addEnergy(euTick); + } + if (tank.getFluidType() != null && getStackInSlot(2) == null) + { + inventory.setInventorySlotContents(2, new ItemStack(tank.getFluidType().getBlock())); + } else if (tank.getFluidType() == null && getStackInSlot(2) != null) + { + setInventorySlotContents(2, null); + } + } - tank.drain(currentWithdraw, true); - addEnergy(euTick); - } - if (tank.getFluidType() != null && getStackInSlot(2) == null) { - inventory.setInventorySlotContents(2, new ItemStack(tank - .getFluidType().getBlock())); - } else if (tank.getFluidType() == null && getStackInSlot(2) != null) { - setInventorySlotContents(2, null); - } - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } + @Override + public double getMaxPower() + { + return ConfigTechReborn.ThermalGeneratorCharge; + } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; - } + @Override + public double getMaxOutput() + { + return euTick; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } - - @Override - public double getMaxOutput() { - return euTick; - } - - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java index 543ae5b64..3b07709b8 100644 --- a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java @@ -1,85 +1,105 @@ package techreborn.tiles.generator; +import java.util.List; + import net.minecraft.util.EnumFacing; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.blocks.generator.BlockSolarPanel; -import java.util.List; - /** * Created by modmuss50 on 25/02/2016. */ -public class TileSolarPanel extends TilePowerAcceptor { +public class TileSolarPanel extends TilePowerAcceptor +{ - boolean shouldMakePower = false; - boolean lastTickSate = false; + boolean shouldMakePower = false; + boolean lastTickSate = false; - int powerToAdd; + int powerToAdd; - @Override - public void updateEntity() { - super.updateEntity(); - if(worldObj.getTotalWorldTime() % 60 == 0){ - shouldMakePower = isSunOut(); - } - if(shouldMakePower){ - powerToAdd = 10; - addEnergy(powerToAdd); - } else { - powerToAdd = 0; - } - if(shouldMakePower != lastTickSate){ - if(worldObj != null) - worldObj.setBlockState(pos, worldObj.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, shouldMakePower)); - } - lastTickSate = shouldMakePower; - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (worldObj.getTotalWorldTime() % 60 == 0) + { + shouldMakePower = isSunOut(); + } + if (shouldMakePower) + { + powerToAdd = 10; + addEnergy(powerToAdd); + } else + { + powerToAdd = 0; + } + if (shouldMakePower != lastTickSate) + { + if (worldObj != null) + worldObj.setBlockState(pos, + worldObj.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, shouldMakePower)); + } + lastTickSate = shouldMakePower; + } - @Override - public void addInfo(List info, boolean isRealTile) { - super.addInfo(info, isRealTile); - if(isRealTile){ - // FIXME: 25/02/2016 - //info.add(ChatFormatting.LIGHT_PURPLE + "Power gen/tick " + ChatFormatting.GREEN + PowerSystem.getLocaliszedPower( powerToAdd)) ; - } - } + @Override + public void addInfo(List info, boolean isRealTile) + { + super.addInfo(info, isRealTile); + if (isRealTile) + { + // FIXME: 25/02/2016 + // info.add(ChatFormatting.LIGHT_PURPLE + "Power gen/tick " + + // ChatFormatting.GREEN + PowerSystem.getLocaliszedPower( + // powerToAdd)) ; + } + } - public boolean isSunOut() { - return worldObj.canBlockSeeSky(pos.up()) && !worldObj.isRaining() && !worldObj.isThundering() && worldObj.isDaytime(); - } + public boolean isSunOut() + { + return worldObj.canBlockSeeSky(pos.up()) && !worldObj.isRaining() && !worldObj.isThundering() + && worldObj.isDaytime(); + } - public TileSolarPanel() { - super(1); - } + public TileSolarPanel() + { + super(1); + } - @Override - public double getMaxPower() { - return 1000; - } + @Override + public double getMaxPower() + { + return 1000; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxOutput() { - return 32; - } + @Override + public double getMaxOutput() + { + return 32; + } - @Override - public double getMaxInput() { - return 0; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java index b0980069f..da3620a6b 100644 --- a/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java +++ b/src/main/java/techreborn/tiles/generator/TileThermalGenerator.java @@ -1,6 +1,5 @@ package techreborn.tiles.generator; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.IInventory; @@ -12,7 +11,6 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; -import net.minecraftforge.fluids.*; import reborncore.api.power.EnumPowerTier; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; @@ -21,266 +19,318 @@ import reborncore.common.util.Inventory; import reborncore.common.util.Tank; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable, - IFluidHandler, IInventory { +public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory +{ - public Tank tank = new Tank("TileThermalGenerator", - FluidContainerRegistry.BUCKET_VOLUME * 10, this); - public Inventory inventory = new Inventory(3, "TileThermalGenerator", 64, this); - public static final int euTick = ConfigTechReborn.ThermalGenertaorOutput; + public Tank tank = new Tank("TileThermalGenerator", FluidContainerRegistry.BUCKET_VOLUME * 10, this); + public Inventory inventory = new Inventory(3, "TileThermalGenerator", 64, this); + public static final int euTick = ConfigTechReborn.ThermalGenertaorOutput; - public TileThermalGenerator() { - super(ConfigTechReborn.ThermalGeneratorTier); - } + public TileThermalGenerator() + { + super(ConfigTechReborn.ThermalGeneratorTier); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.thermalGenerator, 1); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.thermalGenerator, 1); + } - @Override - public int fill(EnumFacing from, FluidStack resource, boolean doFill) { - int fill = tank.fill(resource, doFill); - tank.compareAndUpdate(); - return fill; - } + @Override + public int fill(EnumFacing from, FluidStack resource, boolean doFill) + { + int fill = tank.fill(resource, doFill); + tank.compareAndUpdate(); + return fill; + } - @Override - public FluidStack drain(EnumFacing from, FluidStack resource, - boolean doDrain) { - FluidStack drain = tank.drain(resource.amount, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public FluidStack drain(EnumFacing from, FluidStack resource, boolean doDrain) + { + FluidStack drain = tank.drain(resource.amount, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) { - FluidStack drain = tank.drain(maxDrain, doDrain); - tank.compareAndUpdate(); - return drain; - } + @Override + public FluidStack drain(EnumFacing from, int maxDrain, boolean doDrain) + { + FluidStack drain = tank.drain(maxDrain, doDrain); + tank.compareAndUpdate(); + return drain; + } - @Override - public boolean canFill(EnumFacing from, Fluid fluid) { - if (fluid != null) { - if (fluid == FluidRegistry.LAVA) { - return true; - } - } - return false; - } + @Override + public boolean canFill(EnumFacing from, Fluid fluid) + { + if (fluid != null) + { + if (fluid == FluidRegistry.LAVA) + { + return true; + } + } + return false; + } - @Override - public boolean canDrain(EnumFacing from, Fluid fluid) { - return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; - } + @Override + public boolean canDrain(EnumFacing from, Fluid fluid) + { + return tank.getFluid() == null || tank.getFluid().getFluid() == fluid; + } - @Override - public FluidTankInfo[] getTankInfo(EnumFacing from) { - return new FluidTankInfo[]{tank.getInfo()}; - } + @Override + public FluidTankInfo[] getTankInfo(EnumFacing from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - tank.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + tank.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - tank.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + tank.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - public Packet getDescriptionPacket() { - NBTTagCompound nbtTag = new NBTTagCompound(); - writeToNBT(nbtTag); - return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); - } + public Packet getDescriptionPacket() + { + NBTTagCompound nbtTag = new NBTTagCompound(); + writeToNBT(nbtTag); + return new SPacketUpdateTileEntity(this.getPos(), 1, nbtTag); + } - @Override - public void onDataPacket(NetworkManager net, - SPacketUpdateTileEntity packet) { - worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), - getPos().getY(), getPos().getZ()); - readFromNBT(packet.getNbtCompound()); - } + @Override + public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) + { + worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(), + getPos().getY(), getPos().getZ()); + readFromNBT(packet.getNbtCompound()); + } - @Override - //TODO optimise this code - public void updateEntity() { - super.updateEntity(); - FluidUtils.drainContainers(this, inventory, 0, 1); - if (!worldObj.isRemote) { - for (EnumFacing direction : EnumFacing.values()) { - if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.lava) { - addEnergy(1); - } - } + @Override + // TODO optimise this code + public void updateEntity() + { + super.updateEntity(); + FluidUtils.drainContainers(this, inventory, 0, 1); + if (!worldObj.isRemote) + { + for (EnumFacing direction : EnumFacing.values()) + { + if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())) + .getBlock() == Blocks.lava) + { + addEnergy(1); + } + } - if(worldObj.getTotalWorldTime() % 40 == 0){ - BlockMachineBase bmb = (BlockMachineBase) worldObj.getBlockState(pos).getBlock(); - boolean didFindLava = false; - for (EnumFacing direction : EnumFacing.values()) { - if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.lava) { - didFindLava = true; - } - } - bmb.setActive(didFindLava, worldObj, pos); - } - } - if (tank.getFluidAmount() > 0 - && getMaxPower() - getEnergy() >= euTick) { - tank.drain(1, true); - addEnergy(euTick); - } - if (tank.getFluidType() != null && getStackInSlot(2) == null) { -// inventory.setInventorySlotContents(2, new ItemStack(tank -// .getFluidType().getBlock())); - } else if (tank.getFluidType() == null && getStackInSlot(2) != null) { - setInventorySlotContents(2, null); - } - } + if (worldObj.getTotalWorldTime() % 40 == 0) + { + BlockMachineBase bmb = (BlockMachineBase) worldObj.getBlockState(pos).getBlock(); + boolean didFindLava = false; + for (EnumFacing direction : EnumFacing.values()) + { + if (worldObj.getBlockState(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), + getPos().getY() + direction.getFrontOffsetY(), + getPos().getZ() + direction.getFrontOffsetZ())).getBlock() == Blocks.lava) + { + didFindLava = true; + } + } + bmb.setActive(didFindLava, worldObj, pos); + } + } + if (tank.getFluidAmount() > 0 && getMaxPower() - getEnergy() >= euTick) + { + tank.drain(1, true); + addEnergy(euTick); + } + if (tank.getFluidType() != null && getStackInSlot(2) == null) + { + // inventory.setInventorySlotContents(2, new ItemStack(tank + // .getFluidType().getBlock())); + } else if (tank.getFluidType() == null && getStackInSlot(2) != null) + { + setInventorySlotContents(2, null); + } + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack getStackInSlot(int p_70301_1_) { - return inventory.getStackInSlot(p_70301_1_); - } + @Override + public ItemStack getStackInSlot(int p_70301_1_) + { + return inventory.getStackInSlot(p_70301_1_); + } - @Override - public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) { - return inventory.decrStackSize(p_70298_1_, p_70298_2_); - } + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + return inventory.decrStackSize(p_70298_1_, p_70298_2_); + } - @Override - public ItemStack removeStackFromSlot(int p_70304_1_) { - return inventory.removeStackFromSlot(p_70304_1_); - } + @Override + public ItemStack removeStackFromSlot(int p_70304_1_) + { + return inventory.removeStackFromSlot(p_70304_1_); + } - @Override - public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { - inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); - } + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + inventory.setInventorySlotContents(p_70299_1_, p_70299_2_); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return inventory.isUseableByPlayer(p_70300_1_); + } - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return inventory.isUseableByPlayer(p_70300_1_); - } + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); + } - @Override - public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) { - return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_); - } + @Override + public double getMaxPower() + { + return ConfigTechReborn.ThermalGeneratorCharge; + } - @Override - public double getMaxPower() { - return ConfigTechReborn.ThermalGeneratorCharge; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 128; + } - @Override - public double getMaxOutput() { - return 128; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileWaterMill.java b/src/main/java/techreborn/tiles/generator/TileWaterMill.java index 76f6400be..b35c8bb06 100644 --- a/src/main/java/techreborn/tiles/generator/TileWaterMill.java +++ b/src/main/java/techreborn/tiles/generator/TileWaterMill.java @@ -8,62 +8,75 @@ import reborncore.common.powerSystem.TilePowerAcceptor; /** * Created by modmuss50 on 25/02/2016. */ -public class TileWaterMill extends TilePowerAcceptor { +public class TileWaterMill extends TilePowerAcceptor +{ - public TileWaterMill() { - super(1); - } + public TileWaterMill() + { + super(1); + } - int waterblocks = 0; + int waterblocks = 0; - @Override - public void updateEntity() { - super.updateEntity(); - if(worldObj.getTotalWorldTime() % 20 == 0){ - checkForWater(); - } - if(waterblocks > 0){ - addEnergy(waterblocks); - } - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (worldObj.getTotalWorldTime() % 20 == 0) + { + checkForWater(); + } + if (waterblocks > 0) + { + addEnergy(waterblocks); + } + } - public void checkForWater(){ - waterblocks = 0; - for(EnumFacing facing : EnumFacing.HORIZONTALS){ - if(worldObj.getBlockState(getPos().offset(facing)).getBlock() == Blocks.water){ - waterblocks ++; - } - } - } + public void checkForWater() + { + waterblocks = 0; + for (EnumFacing facing : EnumFacing.HORIZONTALS) + { + if (worldObj.getBlockState(getPos().offset(facing)).getBlock() == Blocks.water) + { + waterblocks++; + } + } + } + @Override + public double getMaxPower() + { + return 1000; + } - @Override - public double getMaxPower() { - return 1000; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public double getMaxOutput() + { + return 32; + } - @Override - public double getMaxOutput() { - return 32; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public double getMaxInput() { - return 0; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/generator/TileWindMill.java b/src/main/java/techreborn/tiles/generator/TileWindMill.java index 7796b0503..ac64142c1 100644 --- a/src/main/java/techreborn/tiles/generator/TileWindMill.java +++ b/src/main/java/techreborn/tiles/generator/TileWindMill.java @@ -7,53 +7,66 @@ import reborncore.common.powerSystem.TilePowerAcceptor; /** * Created by modmuss50 on 25/02/2016. */ -public class TileWindMill extends TilePowerAcceptor { +public class TileWindMill extends TilePowerAcceptor +{ - public TileWindMill() { - super(2); - } + public TileWindMill() + { + super(2); + } - int basePower = 4; + int basePower = 4; - @Override - public void updateEntity() { - super.updateEntity(); - if(pos.getY() > 64){ - int actualPower = basePower; - if(worldObj.isThundering()){ - actualPower *= 1.25; - } - addEnergy(actualPower); //Value taken from http://wiki.industrial-craft.net/?title=Wind_Mill Not worth making more complicated - } - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (pos.getY() > 64) + { + int actualPower = basePower; + if (worldObj.isThundering()) + { + actualPower *= 1.25; + } + addEnergy(actualPower); // Value taken from + // http://wiki.industrial-craft.net/?title=Wind_Mill + // Not worth making more complicated + } + } - @Override - public double getMaxPower() { - return 10000; - } + @Override + public double getMaxPower() + { + return 10000; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxOutput() { - return 128; - } + @Override + public double getMaxOutput() + { + return 128; + } - @Override - public double getMaxInput() { - return 0; - } + @Override + public double getMaxInput() + { + return 0; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } diff --git a/src/main/java/techreborn/tiles/idsu/IDSUManager.java b/src/main/java/techreborn/tiles/idsu/IDSUManager.java index df3121b31..2d963a36e 100644 --- a/src/main/java/techreborn/tiles/idsu/IDSUManager.java +++ b/src/main/java/techreborn/tiles/idsu/IDSUManager.java @@ -1,201 +1,252 @@ package techreborn.tiles.idsu; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.TreeMap; + import net.minecraft.world.World; import net.minecraft.world.storage.ISaveHandler; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import java.io.*; -import java.lang.reflect.Type; -import java.util.HashMap; -import java.util.TreeMap; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +public class IDSUManager +{ -public class IDSUManager { + public static IDSUManager INSTANCE; - public static IDSUManager INSTANCE; + public static final String savename = "idsu.json"; - public static final String savename = "idsu.json"; + public HashMap worldData = new HashMap(); - public HashMap worldData = new HashMap(); + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void worldSave(WorldEvent.Save event) + { + if (event.world != null && event.world.getSaveHandler() != null + && event.world.getSaveHandler().getWorldDirectory() != null) + { + if (worldData.containsKey(event.world)) + { + worldData.get(event.world).save(); + } + } + } - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void worldSave(WorldEvent.Save event) { - if (event.world != null && event.world.getSaveHandler() != null && event.world.getSaveHandler().getWorldDirectory() != null) { - if (worldData.containsKey(event.world)) { - worldData.get(event.world).save(); - } - } - } + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void worldLoad(WorldEvent.Load event) + { + if (event.world != null && event.world.getSaveHandler() != null + && event.world.getSaveHandler().getWorldDirectory() != null) + { + if (worldData.containsKey(event.world)) + { + worldData.get(event.world).load(); + } else + { + IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(event.world); + worldData.put(event.world, worldSaveData); + worldSaveData.load(); + } + } + } - @SubscribeEvent(priority = EventPriority.HIGHEST) - public void worldLoad(WorldEvent.Load event) { - if (event.world != null && event.world.getSaveHandler() != null && event.world.getSaveHandler().getWorldDirectory() != null) { - if (worldData.containsKey(event.world)) { - worldData.get(event.world).load(); - } else { - IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(event.world); - worldData.put(event.world, worldSaveData); - worldSaveData.load(); - } - } - } + @SubscribeEvent(priority = EventPriority.LOWEST) + public void worldClosed(WorldEvent.Unload event) + { + if (event.world != null && event.world.getSaveHandler() != null + && event.world.getSaveHandler().getWorldDirectory() != null) + { + if (worldData.containsKey(event.world)) + { + worldData.get(event.world).save(); + } + } + // this clears the data ready for a new world + worldData.clear(); + } - @SubscribeEvent(priority = EventPriority.LOWEST) - public void worldClosed(WorldEvent.Unload event) { - if (event.world != null && event.world.getSaveHandler() != null && event.world.getSaveHandler().getWorldDirectory() != null) { - if (worldData.containsKey(event.world)) { - worldData.get(event.world).save(); - } - } - //this clears the data ready for a new world - worldData.clear(); - } + public IDSUValueSaveData getSaveDataForWorld(World world, String channel) + { + if (worldData.containsKey(world)) + { + return worldData.get(world).getSaves(channel); + } else + { + IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(world); + worldData.put(world, worldSaveData); + worldSaveData.load(); + return worldSaveData.getSaves(channel); + } + } - public IDSUValueSaveData getSaveDataForWorld(World world, String channel) { - if (worldData.containsKey(world)) { - return worldData.get(world).getSaves(channel); - } else { - IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(world); - worldData.put(world, worldSaveData); - worldSaveData.load(); - return worldSaveData.getSaves(channel); - } - } + public IDSUWorldSaveData getWorldDataFormWorld(World world) + { + if (worldData.containsKey(world)) + { + return worldData.get(world); + } else + { + IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(world); + worldData.put(world, worldSaveData); + worldSaveData.load(); + return worldSaveData; + } + } + public void loadFromString(String json, World world) + { + if (json.equals("EMPTY")) + { + return; + } + IDSUWorldSaveData worldSaveData; + if (worldData.containsKey(world)) + { + worldSaveData = worldData.get(world); + } else + { + worldSaveData = new IDSUWorldSaveData(world); + worldData.put(world, worldSaveData); + } + Gson gson = new Gson(); + Type typeOfHashMap = new TypeToken>() + { + }.getType(); + worldSaveData.idsuValues.clear(); + worldSaveData.idsuValues = gson.fromJson(json, typeOfHashMap); + } - public IDSUWorldSaveData getWorldDataFormWorld(World world) { - if (worldData.containsKey(world)) { - return worldData.get(world); - } else { - IDSUWorldSaveData worldSaveData = new IDSUWorldSaveData(world); - worldData.put(world, worldSaveData); - worldSaveData.load(); - return worldSaveData; - } - } + public class IDSUWorldSaveData + { + public TreeMap idsuValues = new TreeMap(); - public void loadFromString(String json, World world) { - if (json.equals("EMPTY")) { - return; - } - IDSUWorldSaveData worldSaveData; - if (worldData.containsKey(world)) { - worldSaveData = worldData.get(world); - } else { - worldSaveData = new IDSUWorldSaveData(world); - worldData.put(world, worldSaveData); - } - Gson gson = new Gson(); - Type typeOfHashMap = new TypeToken>() { - }.getType(); - worldSaveData.idsuValues.clear(); - worldSaveData.idsuValues = gson.fromJson(json, typeOfHashMap); - } + public World world; + ISaveHandler saveHandler; - public class IDSUWorldSaveData { + File folder; - public TreeMap idsuValues = new TreeMap(); + File file; - public World world; + public IDSUWorldSaveData(World world) + { + this.world = world; + this.saveHandler = world.getSaveHandler(); + folder = new File(saveHandler.getWorldDirectory(), "idsuData"); + file = new File(folder, savename); + } - ISaveHandler saveHandler; + public IDSUValueSaveData getSaves(String udid) + { + if (udid == null) + { + return null; + } + if (idsuValues.containsKey(udid)) + { + return idsuValues.get(udid); + } else + { + IDSUValueSaveData data = new IDSUValueSaveData(); + idsuValues.put(udid, data); + return data; + } + } - File folder; + public void load() + { + if (!file.exists()) + { + return; + } + try + { + Gson gson = new Gson(); + BufferedReader reader = new BufferedReader(new FileReader(file)); + Type typeOfHashMap = new TypeToken>() + { + }.getType(); + idsuValues.clear(); + idsuValues = gson.fromJson(reader, typeOfHashMap); + } catch (Exception e) + { + e.printStackTrace(); + } + } - File file; + public void save() + { + if (idsuValues.isEmpty()) + { + return; + } + if (!file.exists()) + { + if (!folder.exists()) + { + folder.mkdirs(); + } + try + { + file.createNewFile(); + } catch (IOException e) + { + e.printStackTrace(); + } + } - public IDSUWorldSaveData(World world) { - this.world = world; - this.saveHandler = world.getSaveHandler(); - folder = new File(saveHandler.getWorldDirectory(), "idsuData"); - file = new File(folder, savename); - } + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String json = gson.toJson(idsuValues); + try + { + FileWriter writer = new FileWriter(file); + writer.write(json); + writer.close(); + } catch (IOException e) + { + e.printStackTrace(); + } + } - public IDSUValueSaveData getSaves(String udid) { - if (udid == null) { - return null; - } - if (idsuValues.containsKey(udid)) { - return idsuValues.get(udid); - } else { - IDSUValueSaveData data = new IDSUValueSaveData(); - idsuValues.put(udid, data); - return data; - } - } + } - public void load() { - if (!file.exists()) { - return; - } - try { - Gson gson = new Gson(); - BufferedReader reader = new BufferedReader(new FileReader(file)); - Type typeOfHashMap = new TypeToken>() { - }.getType(); - idsuValues.clear(); - idsuValues = gson.fromJson(reader, typeOfHashMap); - } catch (Exception e) { - e.printStackTrace(); - } - } + public class IDSUValueSaveData + { - public void save() { - if (idsuValues.isEmpty()) { - return; - } - if (!file.exists()) { - if (!folder.exists()) { - folder.mkdirs(); - } - try { - file.createNewFile(); - } catch (IOException e) { - e.printStackTrace(); - } - } + public double storedPower = 0; - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(idsuValues); - try { - FileWriter writer = new FileWriter(file); - writer.write(json); - writer.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } + public IDSUValueSaveData(double storedPower) + { + this.storedPower = storedPower; + } - } + public IDSUValueSaveData() + { + } - public class IDSUValueSaveData { + public double getStoredPower() + { + return storedPower; + } - public double storedPower = 0; + public void setStoredPower(double storedPower) + { + this.storedPower = storedPower; + } - public IDSUValueSaveData(double storedPower) { - this.storedPower = storedPower; - } - - public IDSUValueSaveData() { - } - - public double getStoredPower() { - return storedPower; - } - - public void setStoredPower(double storedPower) { - this.storedPower = storedPower; - } - - public void addEnergy(double storedPower) { - this.storedPower += storedPower; - } - } + public void addEnergy(double storedPower) + { + this.storedPower += storedPower; + } + } } diff --git a/src/main/java/techreborn/tiles/idsu/TileIDSU.java b/src/main/java/techreborn/tiles/idsu/TileIDSU.java index 66900e6ab..6fbaf15a6 100644 --- a/src/main/java/techreborn/tiles/idsu/TileIDSU.java +++ b/src/main/java/techreborn/tiles/idsu/TileIDSU.java @@ -4,180 +4,213 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import org.apache.commons.lang3.StringUtils; + import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.config.ConfigTechReborn; import techreborn.init.ModBlocks; -public class TileIDSU extends TilePowerAcceptor { +public class TileIDSU extends TilePowerAcceptor +{ - public String ownerUdid; + public String ownerUdid; - @Override - public double getEnergy() { - if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) { - return 0.0; - } - return IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower; - } + @Override + public double getEnergy() + { + if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) + { + return 0.0; + } + return IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower; + } - @Override - public void setEnergy(double energy) { - if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) { - return; - } - IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower = energy; - } + @Override + public void setEnergy(double energy) + { + if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) + { + return; + } + IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower = energy; + } - @Override - public void readFromNBTWithoutCoords(NBTTagCompound tag) { + @Override + public void readFromNBTWithoutCoords(NBTTagCompound tag) + { - } + } - @Override - public void writeToNBTWithoutCoords(NBTTagCompound tag) { + @Override + public void writeToNBTWithoutCoords(NBTTagCompound tag) + { - } + } - @Override - public double getMaxPower() { - return 1000000000; - } + @Override + public double getMaxPower() + { + return 1000000000; + } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return getFacingEnum() != direction; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return getFacingEnum() != direction; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return getFacingEnum() == direction; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return getFacingEnum() == direction; - } + @Override + public double getMaxOutput() + { + return output; + } + @Override + public double getMaxInput() + { + return maxStorage; + } - @Override - public double getMaxOutput() { - return output; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } - @Override - public double getMaxInput() { - return maxStorage; - } + public int tier; + public int output; + public double maxStorage; + private double euLastTick = 0; + private double euChange; + private int ticks; - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + public TileIDSU(int tier1, int output1, int maxStorage1) + { + super(tier1); + this.tier = tier1; + this.output = output1; + this.maxStorage = maxStorage1; + } - public int tier; - public int output; - public double maxStorage; - private double euLastTick = 0; - private double euChange; - private int ticks; + public TileIDSU() + { + this(5, 2048, 100000000); + } - public TileIDSU(int tier1, int output1, int maxStorage1) { - super(tier1); - this.tier = tier1; - this.output = output1; - this.maxStorage = maxStorage1; - } + public float getChargeLevel() + { + float ret = (float) this.getEnergy() / (float) this.maxStorage; + if (ret > 1.0F) + { + ret = 1.0F; + } - public TileIDSU() { - this(5, 2048, 100000000); - } + return ret; + } - public float getChargeLevel() { - float ret = (float) this.getEnergy() / (float) this.maxStorage; - if (ret > 1.0F) { - ret = 1.0F; - } + public void readFromNBT(NBTTagCompound nbttagcompound) + { + super.readFromNBT(nbttagcompound); + this.ownerUdid = nbttagcompound.getString("ownerUdid"); + } - return ret; - } + public void writeToNBT(NBTTagCompound nbttagcompound) + { + super.writeToNBT(nbttagcompound); + if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) + { + return; + } + nbttagcompound.setString("ownerUdid", this.ownerUdid); + } - public void readFromNBT(NBTTagCompound nbttagcompound) { - super.readFromNBT(nbttagcompound); - this.ownerUdid = nbttagcompound.getString("ownerUdid"); - } + public void updateEntity() + { + super.updateEntity(); - public void writeToNBT(NBTTagCompound nbttagcompound) { - super.writeToNBT(nbttagcompound); - if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) { - return; - } - nbttagcompound.setString("ownerUdid", this.ownerUdid); - } + if (ticks == ConfigTechReborn.aveargeEuOutTickTime) + { + euChange = -1; + ticks = 0; - public void updateEntity() { - super.updateEntity(); + } else + { + ticks++; + euChange += getEnergy() - euLastTick; + if (euLastTick == getEnergy()) + { + euChange = 0; + } + } - if (ticks == ConfigTechReborn.aveargeEuOutTickTime) { - euChange = -1; - ticks = 0; + euLastTick = getEnergy(); - } else { - ticks++; - euChange += getEnergy() - euLastTick; - if (euLastTick == getEnergy()) { - euChange = 0; - } - } + boolean needsInvUpdate = false; - euLastTick = getEnergy(); + if (needsInvUpdate) + { + this.markDirty(); + } - boolean needsInvUpdate = false; + } + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) + { + return false; + } - if (needsInvUpdate) { - this.markDirty(); - } + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + NBTTagCompound tileEntity = new NBTTagCompound(); + ItemStack dropStack = new ItemStack(ModBlocks.Idsu, 1); + writeToNBT(tileEntity); + dropStack.setTagCompound(new NBTTagCompound()); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); + return dropStack; + } - } + public double getEuChange() + { + if (euChange == -1) + { + return -1; + } + return (euChange / ticks); + } - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) { - return false; - } - - - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - NBTTagCompound tileEntity = new NBTTagCompound(); - ItemStack dropStack = new ItemStack(ModBlocks.Idsu, 1); - writeToNBT(tileEntity); - dropStack.setTagCompound(new NBTTagCompound()); - dropStack.getTagCompound().setTag("tileEntity", tileEntity); - return dropStack; - } - - - public double getEuChange() { - if (euChange == -1) { - return -1; - } - return (euChange / ticks); - } - - public void handleGuiInputFromClient(int id) { - if (id == 0) { - output += 256; - } - if (id == 1) { - output += 64; - } - if (id == 2) { - output -= 64; - } - if (id == 3) { - output -= 256; - } - if (output > 4096) { - output = 4096; - } - if (output <= -1) { - output = 0; - } - } + public void handleGuiInputFromClient(int id) + { + if (id == 0) + { + output += 256; + } + if (id == 1) + { + output += 64; + } + if (id == 2) + { + output -= 64; + } + if (id == 3) + { + output -= 256; + } + if (output > 4096) + { + output = 4096; + } + if (output <= -1) + { + output = 0; + } + } } diff --git a/src/main/java/techreborn/tiles/lesu/LesuNetwork.java b/src/main/java/techreborn/tiles/lesu/LesuNetwork.java index e82b2bd7d..0efb0beb8 100644 --- a/src/main/java/techreborn/tiles/lesu/LesuNetwork.java +++ b/src/main/java/techreborn/tiles/lesu/LesuNetwork.java @@ -2,51 +2,65 @@ package techreborn.tiles.lesu; import java.util.ArrayList; -public class LesuNetwork { +public class LesuNetwork +{ - public ArrayList storages = new ArrayList(); + public ArrayList storages = new ArrayList(); - public TileLesu master; + public TileLesu master; - public void addElement(TileLesuStorage lesuStorage) { - if (!storages.contains(lesuStorage) && storages.size() < 5000) { - storages.add(lesuStorage); - } - } + public void addElement(TileLesuStorage lesuStorage) + { + if (!storages.contains(lesuStorage) && storages.size() < 5000) + { + storages.add(lesuStorage); + } + } - public void removeElement(TileLesuStorage lesuStorage) { - storages.remove(lesuStorage); - rebuild(); - } + public void removeElement(TileLesuStorage lesuStorage) + { + storages.remove(lesuStorage); + rebuild(); + } - private void rebuild() { - master = null; - for (TileLesuStorage lesuStorage : storages) { - lesuStorage.findAndJoinNetwork(lesuStorage.getWorld(), lesuStorage.getPos().getX(), lesuStorage.getPos().getY(), lesuStorage.getPos().getZ()); - } - } + private void rebuild() + { + master = null; + for (TileLesuStorage lesuStorage : storages) + { + lesuStorage.findAndJoinNetwork(lesuStorage.getWorld(), lesuStorage.getPos().getX(), + lesuStorage.getPos().getY(), lesuStorage.getPos().getZ()); + } + } - public void merge(LesuNetwork network) { - if (network != this) { - ArrayList tileLesuStorages = new ArrayList(); - tileLesuStorages.addAll(network.storages); - network.clear(false); - for (TileLesuStorage lesuStorage : tileLesuStorages) { - lesuStorage.setNetwork(this); - } - if (network.master != null && this.master == null) { - this.master = network.master; - } - } - } + public void merge(LesuNetwork network) + { + if (network != this) + { + ArrayList tileLesuStorages = new ArrayList(); + tileLesuStorages.addAll(network.storages); + network.clear(false); + for (TileLesuStorage lesuStorage : tileLesuStorages) + { + lesuStorage.setNetwork(this); + } + if (network.master != null && this.master == null) + { + this.master = network.master; + } + } + } - private void clear(boolean clearTiles) { - if (clearTiles) { - for (TileLesuStorage tileLesuStorage : storages) { - tileLesuStorage.resetNetwork(); - } - } - storages.clear(); - } + private void clear(boolean clearTiles) + { + if (clearTiles) + { + for (TileLesuStorage tileLesuStorage : storages) + { + tileLesuStorage.resetNetwork(); + } + } + storages.clear(); + } } diff --git a/src/main/java/techreborn/tiles/lesu/TileLesu.java b/src/main/java/techreborn/tiles/lesu/TileLesu.java index e7c9c403d..38eca9f1c 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLesu.java +++ b/src/main/java/techreborn/tiles/lesu/TileLesu.java @@ -1,5 +1,6 @@ package techreborn.tiles.lesu; +import java.util.ArrayList; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; @@ -8,103 +9,127 @@ import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.config.ConfigTechReborn; -import java.util.ArrayList; +public class TileLesu extends TilePowerAcceptor +{// TODO wrench -public class TileLesu extends TilePowerAcceptor {//TODO wrench + private ArrayList countedNetworks = new ArrayList(); + public int connectedBlocks = 0; - private ArrayList countedNetworks = new ArrayList(); - public int connectedBlocks = 0; + private double euLastTick = 0; + private double euChange; + private int ticks; + private int output; + private int maxStorage; - private double euLastTick = 0; - private double euChange; - private int ticks; - private int output; - private int maxStorage; + public Inventory inventory = new Inventory(4, "TileAesu", 64, this); - public Inventory inventory = new Inventory(4, "TileAesu", 64, this); + public TileLesu() + { + super(5); + } - public TileLesu() { - super(5); - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (worldObj.isRemote) + { + return; + } + countedNetworks.clear(); + connectedBlocks = 0; + for (EnumFacing dir : EnumFacing.values()) + { + if (worldObj.getTileEntity( + new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), + getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage) + { + if (((TileLesuStorage) worldObj.getTileEntity( + new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), + getPos().getZ() + dir.getFrontOffsetZ()))).network != null) + { + LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(new BlockPos( + getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), + getPos().getZ() + dir.getFrontOffsetZ()))).network; + if (!countedNetworks.contains(network)) + { + if (network.master == null || network.master == this) + { + connectedBlocks += network.storages.size(); + countedNetworks.add(network); + network.master = this; + break; + } + } + } + } + } + maxStorage = ((connectedBlocks + 1) * ConfigTechReborn.lesuStoragePerBlock); + output = (connectedBlocks * ConfigTechReborn.extraOutputPerLesuBlock) + ConfigTechReborn.baseLesuOutput; - @Override - public void updateEntity() { - super.updateEntity(); - if (worldObj.isRemote) { - return; - } - countedNetworks.clear(); - connectedBlocks = 0; - for (EnumFacing dir : EnumFacing.values()) { - if (worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage) { - if (((TileLesuStorage) worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ()))).network != null) { - LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ()))).network; - if (!countedNetworks.contains(network)) { - if (network.master == null || network.master == this) { - connectedBlocks += network.storages.size(); - countedNetworks.add(network); - network.master = this; - break; - } - } - } - } - } - maxStorage = ((connectedBlocks + 1) * ConfigTechReborn.lesuStoragePerBlock); - output = (connectedBlocks * ConfigTechReborn.extraOutputPerLesuBlock) + ConfigTechReborn.baseLesuOutput; + if (ticks == ConfigTechReborn.aveargeEuOutTickTime) + { + euChange = -1; + ticks = 0; + } else + { + ticks++; + if (euChange == -1) + { + euChange = 0; + } + euChange += getEnergy() - euLastTick; + if (euLastTick == getEnergy()) + { + euChange = 0; + } + } - if (ticks == ConfigTechReborn.aveargeEuOutTickTime) { - euChange = -1; - ticks = 0; - } else { - ticks++; - if (euChange == -1) { - euChange = 0; - } - euChange += getEnergy() - euLastTick; - if (euLastTick == getEnergy()) { - euChange = 0; - } - } + euLastTick = getEnergy(); + } - euLastTick = getEnergy(); - } + public double getEuChange() + { + if (euChange == -1) + { + return 0; + } + return (euChange / ticks); + } + @Override + public double getMaxPower() + { + return maxStorage; + } - public double getEuChange() { - if (euChange == -1) { - return 0; - } - return (euChange / ticks); - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return direction != getFacingEnum(); + } - @Override - public double getMaxPower() { - return maxStorage; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return direction == getFacingEnum(); + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return direction != getFacingEnum(); - } + @Override + public double getMaxOutput() + { + return output; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return direction == getFacingEnum(); - } + @Override + public double getMaxInput() + { + return 8192; + } - @Override - public double getMaxOutput() { - return output; - } - - @Override - public double getMaxInput() { - return 8192; - } - - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } } diff --git a/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java b/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java index 68d23e995..24e8884f7 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java +++ b/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java @@ -5,56 +5,77 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import reborncore.common.tile.TileMachineBase; -public class TileLesuStorage extends TileMachineBase { +public class TileLesuStorage extends TileMachineBase +{ - public LesuNetwork network; + public LesuNetwork network; - @Override - public void updateEntity() { - super.updateEntity(); - if (network == null) { - findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ()); - } else { - if (network.master != null && network.master.getWorld().getTileEntity(new BlockPos(network.master.getPos().getX(), network.master.getPos().getY(), network.master.getPos().getZ())) != network.master) { - network.master = null; - } - } - } + @Override + public void updateEntity() + { + super.updateEntity(); + if (network == null) + { + findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ()); + } else + { + if (network.master != null + && network.master.getWorld().getTileEntity(new BlockPos(network.master.getPos().getX(), + network.master.getPos().getY(), network.master.getPos().getZ())) != network.master) + { + network.master = null; + } + } + } - public final void findAndJoinNetwork(World world, int x, int y, int z) { - network = new LesuNetwork(); - network.addElement(this); - for (EnumFacing direction : EnumFacing.values()) { - if (world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), z + direction.getFrontOffsetZ())) instanceof TileLesuStorage) { - TileLesuStorage lesu = (TileLesuStorage) world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), z + direction.getFrontOffsetZ())); - if (lesu.network != null) { - lesu.network.merge(network); - } - } - } - } + public final void findAndJoinNetwork(World world, int x, int y, int z) + { + network = new LesuNetwork(); + network.addElement(this); + for (EnumFacing direction : EnumFacing.values()) + { + if (world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), + z + direction.getFrontOffsetZ())) instanceof TileLesuStorage) + { + TileLesuStorage lesu = (TileLesuStorage) world + .getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), + z + direction.getFrontOffsetZ())); + if (lesu.network != null) + { + lesu.network.merge(network); + } + } + } + } - public final void setNetwork(LesuNetwork n) { - if (n == null) { - } else { - network = n; - network.addElement(this); - } - } + public final void setNetwork(LesuNetwork n) + { + if (n == null) + { + } else + { + network = n; + network.addElement(this); + } + } - public final void resetNetwork() { - network = null; - } + public final void resetNetwork() + { + network = null; + } - public final void removeFromNetwork() { - if (network == null) { - } else - network.removeElement(this); - } + public final void removeFromNetwork() + { + if (network == null) + { + } else + network.removeElement(this); + } - public final void rebuildNetwork() { - this.removeFromNetwork(); - this.resetNetwork(); - this.findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ()); - } + public final void rebuildNetwork() + { + this.removeFromNetwork(); + this.resetNetwork(); + this.findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ()); + } } diff --git a/src/main/java/techreborn/tiles/storage/TileBatBox.java b/src/main/java/techreborn/tiles/storage/TileBatBox.java index c4c3cf28d..e36162c69 100644 --- a/src/main/java/techreborn/tiles/storage/TileBatBox.java +++ b/src/main/java/techreborn/tiles/storage/TileBatBox.java @@ -1,81 +1,96 @@ package techreborn.tiles.storage; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import reborncore.api.power.EnumPowerTier; import reborncore.common.powerSystem.TilePowerAcceptor; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; /** * Created by modmuss50 on 14/03/2016. */ -public class TileBatBox extends TilePowerAcceptor implements IWrenchable { +public class TileBatBox extends TilePowerAcceptor implements IWrenchable +{ - public TileBatBox() { - super(1); - } + public TileBatBox() + { + super(1); + } - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return true; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return true; + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.batBox); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.batBox); + } - public boolean isComplete() { - return false; - } + public boolean isComplete() + { + return false; + } - @Override - public double getMaxPower() { - return 40000; - } + @Override + public double getMaxPower() + { + return 40000; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return getFacingEnum() != direction; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return getFacingEnum() != direction; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return getFacingEnum() == direction; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return getFacingEnum() == direction; + } - @Override - public double getMaxOutput() { - return 32; - } + @Override + public double getMaxOutput() + { + return 32; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } } \ No newline at end of file diff --git a/src/main/java/techreborn/tiles/storage/TileMFE.java b/src/main/java/techreborn/tiles/storage/TileMFE.java index 4b486a5f5..cf9496f21 100644 --- a/src/main/java/techreborn/tiles/storage/TileMFE.java +++ b/src/main/java/techreborn/tiles/storage/TileMFE.java @@ -8,30 +8,36 @@ import techreborn.init.ModBlocks; /** * Created by modmuss50 on 14/03/2016. */ -public class TileMFE extends TileBatBox { +public class TileMFE extends TileBatBox +{ - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.mfe); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.mfe); + } - @Override - public double getMaxPower() { - return 4000000; - } + @Override + public double getMaxPower() + { + return 4000000; + } - @Override - public double getMaxOutput() { - return 512; - } + @Override + public double getMaxOutput() + { + return 512; + } - @Override - public double getMaxInput() { - return 512; - } + @Override + public double getMaxInput() + { + return 512; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } } diff --git a/src/main/java/techreborn/tiles/storage/TileMFSU.java b/src/main/java/techreborn/tiles/storage/TileMFSU.java index efb69112f..c2e50e463 100644 --- a/src/main/java/techreborn/tiles/storage/TileMFSU.java +++ b/src/main/java/techreborn/tiles/storage/TileMFSU.java @@ -8,30 +8,36 @@ import techreborn.init.ModBlocks; /** * Created by modmuss50 on 14/03/2016. */ -public class TileMFSU extends TileBatBox { +public class TileMFSU extends TileBatBox +{ - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.mfsu); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.mfsu); + } - @Override - public double getMaxPower() { - return 40000000; - } + @Override + public double getMaxPower() + { + return 40000000; + } - @Override - public double getMaxOutput() { - return 2048; - } + @Override + public double getMaxOutput() + { + return 2048; + } - @Override - public double getMaxInput() { - return 2048; - } + @Override + public double getMaxInput() + { + return 2048; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.HIGH; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.HIGH; + } } diff --git a/src/main/java/techreborn/tiles/teir1/TileCompressor.java b/src/main/java/techreborn/tiles/teir1/TileCompressor.java index 49c813ae9..2a11d0765 100644 --- a/src/main/java/techreborn/tiles/teir1/TileCompressor.java +++ b/src/main/java/techreborn/tiles/teir1/TileCompressor.java @@ -1,6 +1,5 @@ package techreborn.tiles.teir1; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,216 +13,254 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ +public class TileCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileCompressor", 64, this); - public RecipeCrafter crafter; - public int capacity = 1000; + public Inventory inventory = new Inventory(6, "TileCompressor", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; - public TileCompressor() { + public TileCompressor() + { super(1); - int[] inputs = new int[1]; - inputs[0] = 0; - int[] outputs = new int[1]; - outputs[0] = 1; - crafter = new RecipeCrafter(Reference.compressorRecipe, this, 2, 1, inventory, inputs, outputs); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.compressorRecipe, this, 2, 1, inventory, inputs, outputs); } - - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); -// upgrades.tick(); - charge(3); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + // upgrades.tick(); + charge(3); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Compressor, 1); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - public boolean isComplete() { - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Compressor, 1); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + public boolean isComplete() + { + return false; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java index f5bbc7055..0d76db60e 100644 --- a/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java +++ b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java @@ -1,6 +1,5 @@ package techreborn.tiles.teir1; -import ic2.api.tile.IWrenchable; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -15,315 +14,348 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.init.ModBlocks; +import ic2.api.tile.IWrenchable; -public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this); - int input1 = 0; - int output = 1; - public int capacity = 1000; - public int progress; - public int fuelScale = 100; - public int cost = 10; + public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this); + int input1 = 0; + int output = 1; + public int capacity = 1000; + public int progress; + public int fuelScale = 100; + public int cost = 10; - public TileElectricFurnace() { + public TileElectricFurnace() + { super(1); } - - public int gaugeProgressScaled (int scale) - { - return (progress * scale) / fuelScale; - } - - @Override - public void updateEntity () - { - boolean burning = isBurning(); - boolean updateInventory = false; - if (getEnergy() <= cost && canSmelt()) - { - if (getEnergy() > cost) - { - updateInventory = true; - } - } - if (isBurning() && canSmelt()) - { - updateState(); - progress++; - if (progress >= fuelScale) - { - progress = 0; - cookItems(); - updateInventory = true; - } - } - else - { - progress = 0; - updateState(); - } - if (burning != isBurning()) - { - updateInventory = true; - } - if (updateInventory) - { - markDirty(); - } - } + public int gaugeProgressScaled(int scale) + { + return (progress * scale) / fuelScale; + } - public void cookItems () - { - if (this.canSmelt()) - { - ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); + @Override + public void updateEntity() + { + boolean burning = isBurning(); + boolean updateInventory = false; + if (getEnergy() <= cost && canSmelt()) + { + if (getEnergy() > cost) + { + updateInventory = true; + } + } + if (isBurning() && canSmelt()) + { + updateState(); - if (getStackInSlot(output) == null) - { - useEnergy(cost); - setInventorySlotContents(output, itemstack.copy()); - } - else if (getStackInSlot(output).isItemEqual(itemstack)) - { - useEnergy(cost); - getStackInSlot(output).stackSize += itemstack.stackSize; - } - if(getStackInSlot(input1).stackSize > 1) - { - useEnergy(cost); - this.decrStackSize(input1, 1); - } - else - { - useEnergy(cost); - setInventorySlotContents(input1, null); - } - } - } + progress++; + if (progress >= fuelScale) + { + progress = 0; + cookItems(); + updateInventory = true; + } + } else + { + progress = 0; + updateState(); + } + if (burning != isBurning()) + { + updateInventory = true; + } + if (updateInventory) + { + markDirty(); + } + } - public boolean canSmelt () - { - if (getStackInSlot(input1) == null) - { - return false; - } - else - { - ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); - if (itemstack == null) - return false; - if (getStackInSlot(output) == null) - return true; - if (!getStackInSlot(output).isItemEqual(itemstack)) - return false; - int result = getStackInSlot(output).stackSize + itemstack.stackSize; - return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); - } - } + public void cookItems() + { + if (this.canSmelt()) + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); - public boolean isBurning () - { - return getEnergy() > cost; - } + if (getStackInSlot(output) == null) + { + useEnergy(cost); + setInventorySlotContents(output, itemstack.copy()); + } else if (getStackInSlot(output).isItemEqual(itemstack)) + { + useEnergy(cost); + getStackInSlot(output).stackSize += itemstack.stackSize; + } + if (getStackInSlot(input1).stackSize > 1) + { + useEnergy(cost); + this.decrStackSize(input1, 1); + } else + { + useEnergy(cost); + setInventorySlotContents(input1, null); + } + } + } - public ItemStack getResultFor (ItemStack stack) - { - ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); - if (result != null) - { - return result.copy(); - } - return null; - } - - public void updateState(){ - IBlockState BlockStateContainer = worldObj.getBlockState(pos); - if(BlockStateContainer.getBlock() instanceof BlockMachineBase){ - BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); - if(BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0) - blockMachineBase.setActive(progress > 0, worldObj, pos); - } - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + public boolean canSmelt() + { + if (getStackInSlot(input1) == null) + { + return false; + } else + { + ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(getStackInSlot(input1)); + if (itemstack == null) + return false; + if (getStackInSlot(output) == null) + return true; + if (!getStackInSlot(output).isItemEqual(itemstack)) + return false; + int result = getStackInSlot(output).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + public boolean isBurning() + { + return getEnergy() > cost; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + public ItemStack getResultFor(ItemStack stack) + { + ItemStack result = FurnaceRecipes.instance().getSmeltingResult(stack); + if (result != null) + { + return result.copy(); + } + return null; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + public void updateState() + { + IBlockState BlockStateContainer = worldObj.getBlockState(pos); + if (BlockStateContainer.getBlock() instanceof BlockMachineBase) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); + if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0) + blockMachineBase.setActive(progress > 0, worldObj, pos); + } + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.AlloySmelter, 1); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - public boolean isComplete() { - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + public boolean isComplete() + { + return false; + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } + + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/teir1/TileExtractor.java b/src/main/java/techreborn/tiles/teir1/TileExtractor.java index 0d7fecbde..f7bceb986 100644 --- a/src/main/java/techreborn/tiles/teir1/TileExtractor.java +++ b/src/main/java/techreborn/tiles/teir1/TileExtractor.java @@ -1,6 +1,5 @@ package techreborn.tiles.teir1; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,216 +13,254 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileExtractor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ +public class TileExtractor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileExtractor", 64, this); - public RecipeCrafter crafter; - public int capacity = 1000; + public Inventory inventory = new Inventory(6, "TileExtractor", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; - public TileExtractor() { + public TileExtractor() + { super(1); - int[] inputs = new int[1]; - inputs[0] = 0; - int[] outputs = new int[1]; - outputs[0] = 1; - crafter = new RecipeCrafter(Reference.extractorRecipe, this, 2, 1, inventory, inputs, outputs); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.extractorRecipe, this, 2, 1, inventory, inputs, outputs); } - - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); -// upgrades.tick(); - charge(3); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + // upgrades.tick(); + charge(3); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Extractor, 1); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - public boolean isComplete() { - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Extractor, 1); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + public boolean isComplete() + { + return false; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/teir1/TileGrinder.java b/src/main/java/techreborn/tiles/teir1/TileGrinder.java index e466dfd6a..e30edd2b8 100644 --- a/src/main/java/techreborn/tiles/teir1/TileGrinder.java +++ b/src/main/java/techreborn/tiles/teir1/TileGrinder.java @@ -1,6 +1,5 @@ package techreborn.tiles.teir1; -import ic2.api.tile.IWrenchable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -14,215 +13,253 @@ import reborncore.common.util.Inventory; import techreborn.api.recipe.RecipeCrafter; import techreborn.init.ModBlocks; import techreborn.lib.Reference; +import ic2.api.tile.IWrenchable; -public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ +public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileGrinder", 64, this); - public RecipeCrafter crafter; - public int capacity = 1000; + public Inventory inventory = new Inventory(6, "TileGrinder", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; - public TileGrinder() { + public TileGrinder() + { super(1); - int[] inputs = new int[1]; - inputs[0] = 0; - int[] outputs = new int[1]; - outputs[0] = 1; - crafter = new RecipeCrafter(Reference.grinderRecipe, this, 2, 1, inventory, inputs, outputs); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.grinderRecipe, this, 2, 1, inventory, inputs, outputs); } - - @Override - public void updateEntity() { - super.updateEntity(); - crafter.updateEntity(); - charge(3); - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public void updateEntity() + { + super.updateEntity(); + crafter.updateEntity(); + charge(3); + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.Grinder, 1); - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - public boolean isComplete() { - return false; - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - crafter.readFromNBT(tagCompound); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.Grinder, 1); + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - crafter.writeToNBT(tagCompound); - } + public boolean isComplete() + { + return false; + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - public int getProgressScaled(int scale) { - if (crafter.currentTickTime != 0) { - return crafter.currentTickTime * scale / crafter.currentNeededTicks; - } - return 0; - } + public int getProgressScaled(int scale) + { + if (crafter.currentTickTime != 0) + { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.LOW; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.LOW; + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } + @Override + public int getField(int id) + { + return inventory.getField(id); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public String getName() { - return inventory.getName(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/teir1/TileRecycler.java b/src/main/java/techreborn/tiles/teir1/TileRecycler.java index ee079e462..1554be8a9 100644 --- a/src/main/java/techreborn/tiles/teir1/TileRecycler.java +++ b/src/main/java/techreborn/tiles/teir1/TileRecycler.java @@ -1,6 +1,5 @@ package techreborn.tiles.teir1; -import ic2.api.tile.IWrenchable; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -15,314 +14,349 @@ import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.Inventory; import techreborn.init.ModBlocks; import techreborn.items.ItemParts; +import ic2.api.tile.IWrenchable; -public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory { +public class TileRecycler extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory +{ - public Inventory inventory = new Inventory(6, "TileRecycler", 64, this); - public int capacity = 1000; - public int cost = 20; - public int progress; - public int time = 200; - public int chance = 4; - public int random; - public int input1 = 0; - public int output = 1; + public Inventory inventory = new Inventory(6, "TileRecycler", 64, this); + public int capacity = 1000; + public int cost = 20; + public int progress; + public int time = 200; + public int chance = 4; + public int random; + public int input1 = 0; + public int output = 1; - public TileRecycler() { + public TileRecycler() + { super(1); } - - public int gaugeProgressScaled (int scale) - { - return (progress * scale) / time; - } - - @Override - public void updateEntity () - { - boolean burning = isBurning(); - boolean updateInventory = false; - if (getEnergy() <= cost && canRecycle()) - { - if (getEnergy() > cost) - { - updateInventory = true; - } - } - if (isBurning() && canRecycle()) - { - updateState(); - progress++; - if (progress >= time) - { - progress = 0; - recycleItems(); - updateInventory = true; - } - } - else - { - progress = 0; - updateState(); - } - if (burning != isBurning()) - { - updateInventory = true; - } - if (updateInventory) - { - markDirty(); - } - } + public int gaugeProgressScaled(int scale) + { + return (progress * scale) / time; + } - public void recycleItems () - { - if (this.canRecycle()) - { - ItemStack itemstack = ItemParts.getPartByName("scrap"); - int randomchance = worldObj.rand.nextInt(chance); + @Override + public void updateEntity() + { + boolean burning = isBurning(); + boolean updateInventory = false; + if (getEnergy() <= cost && canRecycle()) + { + if (getEnergy() > cost) + { + updateInventory = true; + } + } + if (isBurning() && canRecycle()) + { + updateState(); - if (getStackInSlot(output) == null) - { - useEnergy(cost); - if(randomchance == 1) - { - setInventorySlotContents(output, itemstack.copy()); - } - } - else if (getStackInSlot(output).isItemEqual(itemstack)) - { - useEnergy(cost); - if(randomchance == 1) - { - getStackInSlot(output).stackSize += itemstack.stackSize; - } - } - if(getStackInSlot(input1).stackSize > 1) - { - useEnergy(cost); - this.decrStackSize(input1, 1); - } - else - { - useEnergy(cost); - setInventorySlotContents(input1, null); - } - } - } + progress++; + if (progress >= time) + { + progress = 0; + recycleItems(); + updateInventory = true; + } + } else + { + progress = 0; + updateState(); + } + if (burning != isBurning()) + { + updateInventory = true; + } + if (updateInventory) + { + markDirty(); + } + } - public boolean canRecycle () - { - if (getStackInSlot(input1) != null && hasSlotGotSpace(input1)) - { - return true; - } - return false; - } + public void recycleItems() + { + if (this.canRecycle()) + { + ItemStack itemstack = ItemParts.getPartByName("scrap"); + int randomchance = worldObj.rand.nextInt(chance); - public boolean hasSlotGotSpace(int slot){ - if(getStackInSlot(slot) == null){ - return true; - } else if(getStackInSlot(slot).stackSize < getStackInSlot(slot).getMaxStackSize()){ - return true; - } - return true; - } + if (getStackInSlot(output) == null) + { + useEnergy(cost); + if (randomchance == 1) + { + setInventorySlotContents(output, itemstack.copy()); + } + } else if (getStackInSlot(output).isItemEqual(itemstack)) + { + useEnergy(cost); + if (randomchance == 1) + { + getStackInSlot(output).stackSize += itemstack.stackSize; + } + } + if (getStackInSlot(input1).stackSize > 1) + { + useEnergy(cost); + this.decrStackSize(input1, 1); + } else + { + useEnergy(cost); + setInventorySlotContents(input1, null); + } + } + } + public boolean canRecycle() + { + if (getStackInSlot(input1) != null && hasSlotGotSpace(input1)) + { + return true; + } + return false; + } + public boolean hasSlotGotSpace(int slot) + { + if (getStackInSlot(slot) == null) + { + return true; + } else if (getStackInSlot(slot).stackSize < getStackInSlot(slot).getMaxStackSize()) + { + return true; + } + return true; + } - public boolean isBurning () - { - return getEnergy() > cost; - } + public boolean isBurning() + { + return getEnergy() > cost; + } - public void updateState(){ - IBlockState BlockStateContainer = worldObj.getBlockState(pos); - if(BlockStateContainer.getBlock() instanceof BlockMachineBase){ - BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); - if(BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0) - blockMachineBase.setActive(progress > 0, worldObj, pos); - } - } - - @Override - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { - return false; - } + public void updateState() + { + IBlockState BlockStateContainer = worldObj.getBlockState(pos); + if (BlockStateContainer.getBlock() instanceof BlockMachineBase) + { + BlockMachineBase blockMachineBase = (BlockMachineBase) BlockStateContainer.getBlock(); + if (BlockStateContainer.getValue(BlockMachineBase.ACTIVE) != progress > 0) + blockMachineBase.setActive(progress > 0, worldObj, pos); + } + } - @Override - public EnumFacing getFacing() { - return getFacingEnum(); - } + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) + { + return false; + } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) { - if (entityPlayer.isSneaking()) { - return true; - } - return false; - } + @Override + public EnumFacing getFacing() + { + return getFacingEnum(); + } - @Override - public float getWrenchDropRate() { - return 1.0F; - } + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) + { + if (entityPlayer.isSneaking()) + { + return true; + } + return false; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(ModBlocks.recycler, 1); - } + @Override + public float getWrenchDropRate() + { + return 1.0F; + } - public boolean isComplete() { - return false; - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(ModBlocks.recycler, 1); + } - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - inventory.readFromNBT(tagCompound); - } + public boolean isComplete() + { + return false; + } - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - inventory.writeToNBT(tagCompound); - } + @Override + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + } - @Override - public int getSizeInventory() { - return inventory.getSizeInventory(); - } + @Override + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + } - @Override - public ItemStack getStackInSlot(int slot) { - return inventory.getStackInSlot(slot); - } + @Override + public int getSizeInventory() + { + return inventory.getSizeInventory(); + } - @Override - public ItemStack decrStackSize(int slot, int amount) { - return inventory.decrStackSize(slot, amount); - } + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory.getStackInSlot(slot); + } - @Override - public ItemStack removeStackFromSlot(int slot) { - return inventory.removeStackFromSlot(slot); - } + @Override + public ItemStack decrStackSize(int slot, int amount) + { + return inventory.decrStackSize(slot, amount); + } - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory.setInventorySlotContents(slot, stack); - } + @Override + public ItemStack removeStackFromSlot(int slot) + { + return inventory.removeStackFromSlot(slot); + } + @Override + public void setInventorySlotContents(int slot, ItemStack stack) + { + inventory.setInventorySlotContents(slot, stack); + } - @Override - public int getInventoryStackLimit() { - return inventory.getInventoryStackLimit(); - } + @Override + public int getInventoryStackLimit() + { + return inventory.getInventoryStackLimit(); + } - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return inventory.isUseableByPlayer(player); - } + @Override + public boolean isUseableByPlayer(EntityPlayer player) + { + return inventory.isUseableByPlayer(player); + } + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) + { + return inventory.isItemValidForSlot(slot, stack); + } - @Override - public boolean isItemValidForSlot(int slot, ItemStack stack) { - return inventory.isItemValidForSlot(slot, stack); - } + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) + { + return side == EnumFacing.DOWN ? new int[] { 0, 1, 2 } : new int[] { 0, 1, 2 }; + } - // ISidedInventory - @Override - public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; - } + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } - @Override - public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - if (slotIndex == 2) - return false; - return isItemValidForSlot(slotIndex, itemStack); - } + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) + { + return slotIndex == 2; + } - @Override - public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { - return slotIndex == 2; - } + @Override + public double getMaxPower() + { + return capacity; + } - @Override - public double getMaxPower() { - return capacity; - } + @Override + public boolean canAcceptEnergy(EnumFacing direction) + { + return true; + } - @Override - public boolean canAcceptEnergy(EnumFacing direction) { - return true; - } + @Override + public boolean canProvideEnergy(EnumFacing direction) + { + return false; + } - @Override - public boolean canProvideEnergy(EnumFacing direction) { - return false; - } + @Override + public double getMaxOutput() + { + return 0; + } - @Override - public double getMaxOutput() { - return 0; - } + @Override + public double getMaxInput() + { + return 32; + } - @Override - public double getMaxInput() { - return 32; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + public void openInventory(EntityPlayer player) + { + inventory.openInventory(player); + } - @Override - public void openInventory(EntityPlayer player) { - inventory.openInventory(player); - } + @Override + public void closeInventory(EntityPlayer player) + { + inventory.closeInventory(player); + } - @Override - public void closeInventory(EntityPlayer player) { - inventory.closeInventory(player); - } + @Override + public int getField(int id) + { + return inventory.getField(id); + } + @Override + public void setField(int id, int value) + { + inventory.setField(id, value); + } - @Override - public int getField(int id) { - return inventory.getField(id); - } + @Override + public int getFieldCount() + { + return inventory.getFieldCount(); + } - @Override - public void setField(int id, int value) { - inventory.setField(id, value); - } + @Override + public void clear() + { + inventory.clear(); + } - @Override - public int getFieldCount() { - return inventory.getFieldCount(); - } + @Override + public String getName() + { + return inventory.getName(); + } - @Override - public void clear() { - inventory.clear(); - } + @Override + public boolean hasCustomName() + { + return inventory.hasCustomName(); + } - @Override - public String getName() { - return inventory.getName(); - } - - @Override - public boolean hasCustomName() { - return inventory.hasCustomName(); - } - - @Override - public ITextComponent getDisplayName() { - return inventory.getDisplayName(); - } + @Override + public ITextComponent getDisplayName() + { + return inventory.getDisplayName(); + } } diff --git a/src/main/java/techreborn/tiles/transformers/TileHVTransformer.java b/src/main/java/techreborn/tiles/transformers/TileHVTransformer.java index 3fd98b75a..279f6ffe1 100644 --- a/src/main/java/techreborn/tiles/transformers/TileHVTransformer.java +++ b/src/main/java/techreborn/tiles/transformers/TileHVTransformer.java @@ -5,20 +5,24 @@ import reborncore.api.power.EnumPowerTier; /** * Created by modmuss50 on 16/03/2016. */ -public class TileHVTransformer extends TileLVTransformer { +public class TileHVTransformer extends TileLVTransformer +{ - @Override - public double getMaxOutput() { - return 512; - } + @Override + public double getMaxOutput() + { + return 512; + } - @Override - public double getMaxInput() { - return 2048; - } + @Override + public double getMaxInput() + { + return 2048; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.EXTREME; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.EXTREME; + } } diff --git a/src/main/java/techreborn/tiles/transformers/TileLVTransformer.java b/src/main/java/techreborn/tiles/transformers/TileLVTransformer.java index 6e8b2f222..e535ead12 100644 --- a/src/main/java/techreborn/tiles/transformers/TileLVTransformer.java +++ b/src/main/java/techreborn/tiles/transformers/TileLVTransformer.java @@ -3,38 +3,43 @@ package techreborn.tiles.transformers; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import reborncore.api.power.EnumPowerTier; -import techreborn.init.ModBlocks; import techreborn.tiles.storage.TileBatBox; /** * Created by modmuss50 on 16/03/2016. */ -public class TileLVTransformer extends TileBatBox { +public class TileLVTransformer extends TileBatBox +{ - @Override - public double getMaxOutput() { - return 32; - } + @Override + public double getMaxOutput() + { + return 32; + } - @Override - public double getMaxInput() { - return 128; - } + @Override + public double getMaxInput() + { + return 128; + } - @Override - //Can take medium power in - public EnumPowerTier getTier() { - return EnumPowerTier.MEDIUM; - } + @Override + // Can take medium power in + public EnumPowerTier getTier() + { + return EnumPowerTier.MEDIUM; + } - @Override - public double getMaxPower() { - return getMaxInput() * 2; - } + @Override + public double getMaxPower() + { + return getMaxInput() * 2; + } - @Override - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { - return new ItemStack(worldObj.getBlockState(pos).getBlock()); - } + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) + { + return new ItemStack(worldObj.getBlockState(pos).getBlock()); + } } diff --git a/src/main/java/techreborn/tiles/transformers/TileMVTransformer.java b/src/main/java/techreborn/tiles/transformers/TileMVTransformer.java index 24ca802b8..18107e331 100644 --- a/src/main/java/techreborn/tiles/transformers/TileMVTransformer.java +++ b/src/main/java/techreborn/tiles/transformers/TileMVTransformer.java @@ -5,20 +5,24 @@ import reborncore.api.power.EnumPowerTier; /** * Created by modmuss50 on 16/03/2016. */ -public class TileMVTransformer extends TileLVTransformer { +public class TileMVTransformer extends TileLVTransformer +{ - @Override - public double getMaxOutput() { - return 128; - } + @Override + public double getMaxOutput() + { + return 128; + } - @Override - public double getMaxInput() { - return 512; - } + @Override + public double getMaxInput() + { + return 512; + } - @Override - public EnumPowerTier getTier() { - return EnumPowerTier.HIGH; - } + @Override + public EnumPowerTier getTier() + { + return EnumPowerTier.HIGH; + } } diff --git a/src/main/java/techreborn/utils/OreDictUtils.java b/src/main/java/techreborn/utils/OreDictUtils.java index 878a8e6ef..e450a2f1d 100644 --- a/src/main/java/techreborn/utils/OreDictUtils.java +++ b/src/main/java/techreborn/utils/OreDictUtils.java @@ -6,27 +6,37 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; -public class OreDictUtils { +public class OreDictUtils +{ - public static boolean isOre(Block block, String oreName) { + public static boolean isOre(Block block, String oreName) + { return isOre(new ItemStack(Item.getItemFromBlock(block)), oreName); } - public static boolean isOre(IBlockState state, String oreName) { - return isOre(new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)), oreName); + public static boolean isOre(IBlockState state, String oreName) + { + return isOre( + new ItemStack(Item.getItemFromBlock(state.getBlock()), 1, state.getBlock().getMetaFromState(state)), + oreName); } - public static boolean isOre(Item item, String oreName) { + public static boolean isOre(Item item, String oreName) + { return isOre(new ItemStack(item), oreName); } - public static boolean isOre(ItemStack stack, String oreName) { - if (stack != null && stack.getItem() != null && oreName != null) { + public static boolean isOre(ItemStack stack, String oreName) + { + if (stack != null && stack.getItem() != null && oreName != null) + { int id = OreDictionary.getOreID(oreName); int[] ids = OreDictionary.getOreIDs(stack); - for (int i : ids) { - if (id == i) { + for (int i : ids) + { + if (id == i) + { return true; } } diff --git a/src/main/java/techreborn/utils/RecipeUtils.java b/src/main/java/techreborn/utils/RecipeUtils.java index 483b0e960..7116e2f71 100644 --- a/src/main/java/techreborn/utils/RecipeUtils.java +++ b/src/main/java/techreborn/utils/RecipeUtils.java @@ -3,15 +3,16 @@ package techreborn.utils; import net.minecraft.item.ItemStack; import techreborn.items.ItemCells; - -public class RecipeUtils { - public static ItemStack getEmptyCell(int stackSize) { //TODO ic2 -// if (Loader.isModLoaded("IC2")) { -// ItemStack cell = IC2Items.getItem("cell").copy(); -// cell.stackSize = stackSize; -// return cell; -// } else { - return ItemCells.getCellByName("empty", stackSize); - // } - } +public class RecipeUtils +{ + public static ItemStack getEmptyCell(int stackSize) + { // TODO ic2 + // if (Loader.isModLoaded("IC2")) { + // ItemStack cell = IC2Items.getItem("cell").copy(); + // cell.stackSize = stackSize; + // return cell; + // } else { + return ItemCells.getCellByName("empty", stackSize); + // } + } } diff --git a/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java b/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java index c5cf93995..28287ffee 100644 --- a/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java +++ b/src/main/java/techreborn/utils/damageSources/ElectrialShockSource.java @@ -5,8 +5,10 @@ import net.minecraft.util.DamageSource; /** * Created by modmuss50 on 06/03/2016. */ -public class ElectrialShockSource extends DamageSource { - public ElectrialShockSource() { - super("shock"); - } +public class ElectrialShockSource extends DamageSource +{ + public ElectrialShockSource() + { + super("shock"); + } } diff --git a/src/main/java/techreborn/utils/damageSources/FusionDamageSource.java b/src/main/java/techreborn/utils/damageSources/FusionDamageSource.java index 2e15a6201..51bc6f5cb 100644 --- a/src/main/java/techreborn/utils/damageSources/FusionDamageSource.java +++ b/src/main/java/techreborn/utils/damageSources/FusionDamageSource.java @@ -5,8 +5,10 @@ import net.minecraft.util.DamageSource; /** * Created by modmuss50 on 05/03/2016. */ -public class FusionDamageSource extends DamageSource { - public FusionDamageSource() { - super("fusion"); - } +public class FusionDamageSource extends DamageSource +{ + public FusionDamageSource() + { + super("fusion"); + } } diff --git a/src/main/java/techreborn/world/RubberTreeGenerator.java b/src/main/java/techreborn/world/RubberTreeGenerator.java index 61f402bc9..b91b109d5 100644 --- a/src/main/java/techreborn/world/RubberTreeGenerator.java +++ b/src/main/java/techreborn/world/RubberTreeGenerator.java @@ -1,5 +1,7 @@ package techreborn.world; +import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing; @@ -12,139 +14,180 @@ import techreborn.blocks.BlockRubberLeaves; import techreborn.blocks.BlockRubberLog; import techreborn.init.ModBlocks; -import java.util.Random; +public class RubberTreeGenerator extends WorldGenerator +{ -public class RubberTreeGenerator extends WorldGenerator { + boolean isWorldGen = true; - boolean isWorldGen = true; + public RubberTreeGenerator() + { + super(); + } - public RubberTreeGenerator() { - super(); - } + public RubberTreeGenerator(boolean isWorldGen) + { + super(!isWorldGen); + this.isWorldGen = isWorldGen; + } - public RubberTreeGenerator(boolean isWorldGen) { - super(!isWorldGen); - this.isWorldGen = isWorldGen; - } + @Override + public boolean generate(World worldIn, Random rand, BlockPos position) + { + int x = position.getX(); + int z = position.getZ(); + int retries = rand.nextInt(3) + 2; + if (isWorldGen) + { + for (int c = 0; c < retries; c++) + { + int y = worldIn.getActualHeight() - 1; + while (worldIn.isAirBlock(new BlockPos(x, y, z)) && y > 0) + { + y--; + } + if (!growTree(worldIn, rand, x, y + 1, z)) + { + retries--; + } + x += rand.nextInt(16) - 8; + z += rand.nextInt(16) - 8; + } + } else + { + int y = worldIn.getActualHeight() - 1; + while (worldIn.isAirBlock(new BlockPos(x, y, z)) && y > 0) + { + y--; + } + return growTree(worldIn, rand, x, y + 1, z); + } - @Override - public boolean generate(World worldIn, Random rand, BlockPos position) { - int x = position.getX(); - int z = position.getZ(); - int retries = rand.nextInt(3) + 2; - if (isWorldGen) { - for (int c = 0; c < retries; c++) { - int y = worldIn.getActualHeight() - 1; - while (worldIn.isAirBlock(new BlockPos(x, y, z)) && y > 0) { - y--; - } - if (!growTree(worldIn, rand, x, y + 1, z)) { - retries--; - } - x += rand.nextInt(16) - 8; - z += rand.nextInt(16) - 8; - } - } else { - int y = worldIn.getActualHeight() - 1; - while (worldIn.isAirBlock(new BlockPos(x, y, z)) && y > 0) { - y--; - } - return growTree(worldIn, rand, x, y + 1, z); - } + return false; + } - return false; - } + public boolean growTree(World world, Random rand, int x, int y, int z) + { + int treeHeight = rand.nextInt(5) + Core.worldGen.config.rubberTreeConfig.treeBaseHeight; + int worldHeight = world.getHeight(); + if (y >= 1 && y + treeHeight + 1 <= worldHeight) + { + int xOffset; + int yOffset; + int zOffset; + IBlockState baseSate = world.getBlockState(new BlockPos(x, y - 1, z)); + Block baseBlock = baseSate.getBlock(); + boolean hasPlacedBlock = false; + if (baseBlock != null && baseBlock.canSustainPlant(baseSate, world, new BlockPos(x, y - 1, z), + EnumFacing.UP, (IPlantable) ModBlocks.rubberSapling) && y < worldHeight - treeHeight - 1) + { + for (yOffset = y; yOffset <= y + 1 + treeHeight; ++yOffset) + { + byte radius = 1; + if (yOffset == y) + { + radius = 0; + } + if (yOffset >= y + 1 + treeHeight - 2) + { + radius = 2; + } + if (yOffset >= 0 & yOffset < worldHeight) + { + for (xOffset = x - radius; xOffset <= x + radius; ++xOffset) + { + for (zOffset = z - radius; zOffset <= z + radius; ++zOffset) + { + IBlockState state = world.getBlockState(new BlockPos(xOffset, yOffset, zOffset)); + Block block = state.getBlock(); - public boolean growTree(World world, Random rand, int x, int y, int z) { - int treeHeight = rand.nextInt(5) + Core.worldGen.config.rubberTreeConfig.treeBaseHeight; - int worldHeight = world.getHeight(); - if (y >= 1 && y + treeHeight + 1 <= worldHeight) { - int xOffset; - int yOffset; - int zOffset; - IBlockState baseSate = world.getBlockState(new BlockPos(x, y - 1, z)); - Block baseBlock = baseSate.getBlock(); - boolean hasPlacedBlock = false; - if (baseBlock != null && baseBlock.canSustainPlant(baseSate, world, new BlockPos(x, y - 1, z), EnumFacing.UP, (IPlantable) ModBlocks.rubberSapling) && y < worldHeight - treeHeight - 1) { - for (yOffset = y; yOffset <= y + 1 + treeHeight; ++yOffset) { - byte radius = 1; - if (yOffset == y) { - radius = 0; - } - if (yOffset >= y + 1 + treeHeight - 2) { - radius = 2; - } - if (yOffset >= 0 & yOffset < worldHeight) { - for (xOffset = x - radius; xOffset <= x + radius; ++xOffset) { - for (zOffset = z - radius; zOffset <= z + radius; ++zOffset) { - IBlockState state = world.getBlockState(new BlockPos(xOffset, yOffset, zOffset)); - Block block = state.getBlock(); + if (block != null + && !(block.isLeaves(state, world, new BlockPos(xOffset, yOffset, zOffset)) + || block.isAir(state, world, new BlockPos(xOffset, yOffset, zOffset)) + || block.canBeReplacedByLeaves(state, world, + new BlockPos(xOffset, yOffset, zOffset)))) + { + return false; + } + } + } + } else + { + return false; + } + } - if (block != null && !(block.isLeaves(state, world, new BlockPos(xOffset, yOffset, zOffset)) || - block.isAir(state, world, new BlockPos(xOffset, yOffset, zOffset)) || - block.canBeReplacedByLeaves(state, world, new BlockPos(xOffset, yOffset, zOffset)))) { - return false; - } - } - } - } else { - return false; - } - } + BlockPos treeBase = new BlockPos(x, y, z); + BlockPos treeRoot = treeBase.down(); + IBlockState state = world.getBlockState(treeRoot); + state.getBlock().onPlantGrow(state, world, treeRoot, treeBase); + for (yOffset = y - 3 + treeHeight; yOffset <= y + treeHeight; ++yOffset) + { + int var12 = yOffset - (y + treeHeight), center = 1 - var12 / 2; + for (xOffset = x - center; xOffset <= x + center; ++xOffset) + { + int xPos = xOffset - x, t = xPos >> 15; + xPos = (xPos + t) ^ t; + for (zOffset = z - center; zOffset <= z + center; ++zOffset) + { + int zPos = zOffset - z; + zPos = (zPos + (t = zPos >> 31)) ^ t; + IBlockState state1 = world.getBlockState(new BlockPos(xOffset, yOffset, zOffset)); + Block block = state1.getBlock(); + if (((xPos != center | zPos != center) || rand.nextInt(2) != 0 && var12 != 0) + && (block == null + || block.isLeaves(state1, world, new BlockPos(xOffset, yOffset, zOffset)) + || block.isAir(state1, world, new BlockPos(xOffset, yOffset, zOffset)) + || block.canBeReplacedByLeaves(state1, world, + new BlockPos(xOffset, yOffset, zOffset)))) + { + this.setBlockAndNotifyAdequately(world, new BlockPos(xOffset, yOffset, zOffset), + ModBlocks.rubberLeaves.getDefaultState()); + hasPlacedBlock = true; + } + } + } + } - BlockPos treeBase = new BlockPos(x, y, z); - BlockPos treeRoot = treeBase.down(); - IBlockState state = world.getBlockState(treeRoot); - state.getBlock().onPlantGrow(state, world, treeRoot, treeBase); - for (yOffset = y - 3 + treeHeight; yOffset <= y + treeHeight; ++yOffset) { - int var12 = yOffset - (y + treeHeight), - center = 1 - var12 / 2; - for (xOffset = x - center; xOffset <= x + center; ++xOffset) { - int xPos = xOffset - x, t = xPos >> 15; - xPos = (xPos + t) ^ t; - for (zOffset = z - center; zOffset <= z + center; ++zOffset) { - int zPos = zOffset - z; - zPos = (zPos + (t = zPos >> 31)) ^ t; - IBlockState state1 = world.getBlockState(new BlockPos(xOffset, yOffset, zOffset)); - Block block = state1.getBlock(); - if (((xPos != center | zPos != center) || rand.nextInt(2) != 0 && var12 != 0) && (block == null || block.isLeaves(state1, world, new BlockPos(xOffset, yOffset, zOffset)) || block.isAir(state1, world, new BlockPos(xOffset, yOffset, zOffset)) || block.canBeReplacedByLeaves(state1, world, new BlockPos(xOffset, yOffset, zOffset)))) { - this.setBlockAndNotifyAdequately(world, new BlockPos(xOffset, yOffset, zOffset), ModBlocks.rubberLeaves.getDefaultState()); - hasPlacedBlock = true; - } - } - } - } - - BlockPos topLogPos = null; - for (yOffset = 0; yOffset < treeHeight; ++yOffset) { - BlockPos blockpos = new BlockPos(x, y + yOffset, z); - IBlockState state1 = world.getBlockState(blockpos); - Block block = state1.getBlock(); - if (block == null || block.isAir(state1, world, blockpos) || block.isLeaves(state1,world, blockpos) || block.isReplaceable(world, blockpos)) { - IBlockState newState = ModBlocks.rubberLog.getDefaultState(); - boolean isAddingSap = false; - if (rand.nextInt(Core.worldGen.config.rubberTreeConfig.sapRarity) == 0) { - newState = newState.withProperty(BlockRubberLog.HAS_SAP, true).withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(rand.nextInt(4))); - isAddingSap = true; - } - if (isAddingSap) { - world.setBlockState(blockpos, newState, 2); - } else { - this.setBlockAndNotifyAdequately(world, blockpos, newState); - } - hasPlacedBlock = true; - topLogPos = blockpos; - } - } - if (topLogPos != null) { - for (int i = 0; i < Core.worldGen.config.rubberTreeConfig.spireHeight; i++) { - BlockPos spikePos = topLogPos.up(i); - this.setBlockAndNotifyAdequately(world, spikePos, ModBlocks.rubberLeaves.getDefaultState().withProperty(BlockRubberLeaves.DECAYABLE, true)); - } - } - } - return hasPlacedBlock; - } - return false; - } + BlockPos topLogPos = null; + for (yOffset = 0; yOffset < treeHeight; ++yOffset) + { + BlockPos blockpos = new BlockPos(x, y + yOffset, z); + IBlockState state1 = world.getBlockState(blockpos); + Block block = state1.getBlock(); + if (block == null || block.isAir(state1, world, blockpos) || block.isLeaves(state1, world, blockpos) + || block.isReplaceable(world, blockpos)) + { + IBlockState newState = ModBlocks.rubberLog.getDefaultState(); + boolean isAddingSap = false; + if (rand.nextInt(Core.worldGen.config.rubberTreeConfig.sapRarity) == 0) + { + newState = newState.withProperty(BlockRubberLog.HAS_SAP, true) + .withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(rand.nextInt(4))); + isAddingSap = true; + } + if (isAddingSap) + { + world.setBlockState(blockpos, newState, 2); + } else + { + this.setBlockAndNotifyAdequately(world, blockpos, newState); + } + hasPlacedBlock = true; + topLogPos = blockpos; + } + } + if (topLogPos != null) + { + for (int i = 0; i < Core.worldGen.config.rubberTreeConfig.spireHeight; i++) + { + BlockPos spikePos = topLogPos.up(i); + this.setBlockAndNotifyAdequately(world, spikePos, ModBlocks.rubberLeaves.getDefaultState() + .withProperty(BlockRubberLeaves.DECAYABLE, true)); + } + } + } + return hasPlacedBlock; + } + return false; + } } diff --git a/src/main/java/techreborn/world/TechRebornRetroGen.java b/src/main/java/techreborn/world/TechRebornRetroGen.java index 9da011e4c..49f24c701 100644 --- a/src/main/java/techreborn/world/TechRebornRetroGen.java +++ b/src/main/java/techreborn/world/TechRebornRetroGen.java @@ -1,7 +1,10 @@ package techreborn.world; -import com.google.common.base.Objects; -import com.google.common.collect.Sets; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Random; +import java.util.Set; + import net.minecraft.world.World; import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -10,75 +13,83 @@ import net.minecraftforge.fml.relauncher.Side; import reborncore.common.misc.ChunkCoord; import techreborn.Core; -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.Random; -import java.util.Set; +import com.google.common.base.Objects; +import com.google.common.collect.Sets; /** * Based off https://github.com/SteamNSteel/SteamNSteel */ -public class TechRebornRetroGen { - private static final String RETROGEN_TAG = "techrebonr:retogen"; - private static final Set completedChunks = Sets.newHashSet(); - private final Deque chunksToRetroGen = new ArrayDeque(64); +public class TechRebornRetroGen +{ + private static final String RETROGEN_TAG = "techrebonr:retogen"; + private static final Set completedChunks = Sets.newHashSet(); + private final Deque chunksToRetroGen = new ArrayDeque(64); - private boolean isChunkEligibleForRetroGen(ChunkDataEvent.Load event) { - return Core.worldGen.config.retroGenOres && event.world.provider.getDimension() == 0 - && event.getData().getString(RETROGEN_TAG).isEmpty(); - } + private boolean isChunkEligibleForRetroGen(ChunkDataEvent.Load event) + { + return Core.worldGen.config.retroGenOres && event.world.provider.getDimension() == 0 + && event.getData().getString(RETROGEN_TAG).isEmpty(); + } - public void markChunk(ChunkCoord coord) { - completedChunks.add(coord); - } + public void markChunk(ChunkCoord coord) + { + completedChunks.add(coord); + } - private boolean isTickEligibleForRetroGen(TickEvent.WorldTickEvent event) { - return event.phase == TickEvent.Phase.END || event.side == Side.SERVER; - } + private boolean isTickEligibleForRetroGen(TickEvent.WorldTickEvent event) + { + return event.phase == TickEvent.Phase.END || event.side == Side.SERVER; + } + @SubscribeEvent + public void onWorldTick(TickEvent.WorldTickEvent event) + { + if (isTickEligibleForRetroGen(event)) + { + if (!chunksToRetroGen.isEmpty()) + { + final ChunkCoord coord = chunksToRetroGen.pollFirst(); + Core.logHelper.info("Regenerating ore in " + coord + '.'); + final World world = event.world; + if (world.getChunkProvider().getLoadedChunk(coord.getX(), coord.getZ()) != null) + { + final long seed = world.getSeed(); + final Random rng = new Random(seed); + final long xSeed = rng.nextLong() >> 2 + 1L; + final long zSeed = rng.nextLong() >> 2 + 1L; + final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) * seed; + rng.setSeed(chunkSeed); + Core.worldGen.generate(rng, coord.getX() << 4, coord.getZ() << 4, world, null, null); + } + } + } + } - @SubscribeEvent - public void onWorldTick(TickEvent.WorldTickEvent event) { - if (isTickEligibleForRetroGen(event)) { - if (!chunksToRetroGen.isEmpty()) { - final ChunkCoord coord = chunksToRetroGen.pollFirst(); - Core.logHelper.info("Regenerating ore in " + coord + '.'); - final World world = event.world; - if (world.getChunkProvider().getLoadedChunk(coord.getX(), coord.getZ()) != null) { - final long seed = world.getSeed(); - final Random rng = new Random(seed); - final long xSeed = rng.nextLong() >> 2 + 1L; - final long zSeed = rng.nextLong() >> 2 + 1L; - final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) * seed; - rng.setSeed(chunkSeed); - Core.worldGen.generate(rng, coord.getX() << 4, coord.getZ() << 4, world, null, null); - } - } - } - } + @SubscribeEvent + public void onChunkLoad(ChunkDataEvent.Load event) + { + if (isChunkEligibleForRetroGen(event)) + { + final ChunkCoord coord = ChunkCoord.of(event); + Core.logHelper.info("Queueing retro ore gen for " + coord + '.'); + chunksToRetroGen.addLast(coord); + } + } - @SubscribeEvent - public void onChunkLoad(ChunkDataEvent.Load event) { - if (isChunkEligibleForRetroGen(event)) { - final ChunkCoord coord = ChunkCoord.of(event); - Core.logHelper.info("Queueing retro ore gen for " + coord + '.'); - chunksToRetroGen.addLast(coord); - } - } + @SubscribeEvent + public void onChunkSave(ChunkDataEvent.Save event) + { + final ChunkCoord coord = ChunkCoord.of(event); + if (completedChunks.contains(coord)) + { + event.getData().setString(RETROGEN_TAG, "X"); + completedChunks.remove(coord); + } + } - @SubscribeEvent - public void onChunkSave(ChunkDataEvent.Save event) { - final ChunkCoord coord = ChunkCoord.of(event); - if (completedChunks.contains(coord)) { - event.getData().setString(RETROGEN_TAG, "X"); - completedChunks.remove(coord); - } - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("chunksToRetroGen", chunksToRetroGen) - .toString(); - } + @Override + public String toString() + { + return Objects.toStringHelper(this).add("chunksToRetroGen", chunksToRetroGen).toString(); + } } diff --git a/src/main/java/techreborn/world/TechRebornWorldGen.java b/src/main/java/techreborn/world/TechRebornWorldGen.java index 502959e5f..4e3d93728 100644 --- a/src/main/java/techreborn/world/TechRebornWorldGen.java +++ b/src/main/java/techreborn/world/TechRebornWorldGen.java @@ -1,8 +1,15 @@ package techreborn.world; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -17,184 +24,226 @@ import techreborn.init.ModBlocks; import techreborn.world.config.OreConfig; import techreborn.world.config.WorldGenConfig; -import java.io.*; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; /** * Created by modmuss50 on 11/03/2016. */ -public class TechRebornWorldGen implements IWorldGenerator { +public class TechRebornWorldGen implements IWorldGenerator +{ - private void init() { - defaultConfig = new WorldGenConfig(); - defaultConfig.overworldOres = new ArrayList<>(); - defaultConfig.endOres = new ArrayList<>(); - defaultConfig.neatherOres = new ArrayList<>(); + private void init() + { + defaultConfig = new WorldGenConfig(); + defaultConfig.overworldOres = new ArrayList<>(); + defaultConfig.endOres = new ArrayList<>(); + defaultConfig.neatherOres = new ArrayList<>(); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Galena"), 8, 16, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Iridium"), 1, 1, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Ruby"), 6, 3, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sapphire"), 6, 3, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Bauxite"), 6, 10, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Tetrahedrite"), 6, 16, 10, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Cassiterite"), 6, 16, 20, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Lead"), 6, 16, 20, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Silver"), 6, 16, 20, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("copper"), 8, 16, 20, 60)); - defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("tin"), 8, 16, 20, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Galena"), 8, 16, 10, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Iridium"), 1, 1, 10, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Ruby"), 6, 3, 10, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sapphire"), 6, 3, 10, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Bauxite"), 6, 10, 10, 60)); + defaultConfig.overworldOres + .add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Tetrahedrite"), 6, 16, 10, 60)); + defaultConfig.overworldOres + .add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Cassiterite"), 6, 16, 20, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Lead"), 6, 16, 20, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Silver"), 6, 16, 20, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("copper"), 8, 16, 20, 60)); + defaultConfig.overworldOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("tin"), 8, 16, 20, 60)); - defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Pyrite"), 6, 3, 10, 250)); - defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Cinnabar"), 6, 3, 10, 250)); - defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sphalerite"), 6, 3, 10, 250)); + defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Pyrite"), 6, 3, 10, 250)); + defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Cinnabar"), 6, 3, 10, 250)); + defaultConfig.neatherOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sphalerite"), 6, 3, 10, 250)); - defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Tungston"), 6, 3, 10, 250)); - defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sheldonite"), 6, 3, 10, 250)); - defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Peridot"), 6, 3, 10, 250)); - defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sodalite"), 6, 3, 10, 250)); - } + defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Tungston"), 6, 3, 10, 250)); + defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sheldonite"), 6, 3, 10, 250)); + defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Peridot"), 6, 3, 10, 250)); + defaultConfig.endOres.add(new OreConfig(ModBlocks.ore.getBlockStateFromName("Sodalite"), 6, 3, 10, 250)); + } - WorldGenConfig config; - WorldGenConfig defaultConfig; - public File configFile; - public static RubberTreeGenerator treeGenerator = new RubberTreeGenerator(); - public boolean jsonInvalid = false; - public final TechRebornRetroGen retroGen = new TechRebornRetroGen(); + WorldGenConfig config; + WorldGenConfig defaultConfig; + public File configFile; + public static RubberTreeGenerator treeGenerator = new RubberTreeGenerator(); + public boolean jsonInvalid = false; + public final TechRebornRetroGen retroGen = new TechRebornRetroGen(); - public void load() { - init(); - if (configFile.exists()) { - loadFromJson(); - } else { - config = defaultConfig; - } - config.overworldOres.addAll(getMissingOres(config.overworldOres, defaultConfig.overworldOres)); - config.neatherOres.addAll(getMissingOres(config.neatherOres, defaultConfig.neatherOres)); - config.endOres.addAll(getMissingOres(config.endOres, defaultConfig.endOres)); - if(!jsonInvalid){ - save(); - } - } + public void load() + { + init(); + if (configFile.exists()) + { + loadFromJson(); + } else + { + config = defaultConfig; + } + config.overworldOres.addAll(getMissingOres(config.overworldOres, defaultConfig.overworldOres)); + config.neatherOres.addAll(getMissingOres(config.neatherOres, defaultConfig.neatherOres)); + config.endOres.addAll(getMissingOres(config.endOres, defaultConfig.endOres)); + if (!jsonInvalid) + { + save(); + } + } - private List getMissingOres(List config, List defaultOres) { - List missingOres = new ArrayList<>(); - for (OreConfig defaultOre : defaultOres) { - boolean hasFoundOre = false; - for (OreConfig ore : config) { - if (ore.blockName.equals(defaultOre.blockName) && ore.meta == defaultOre.meta) { - hasFoundOre = true; - ore.state = defaultOre.state; //Should allow for states to be saved/loaded - } - } - if (!hasFoundOre) { - missingOres.add(defaultOre); - } - } - return missingOres; - } + private List getMissingOres(List config, List defaultOres) + { + List missingOres = new ArrayList<>(); + for (OreConfig defaultOre : defaultOres) + { + boolean hasFoundOre = false; + for (OreConfig ore : config) + { + if (ore.blockName.equals(defaultOre.blockName) && ore.meta == defaultOre.meta) + { + hasFoundOre = true; + ore.state = defaultOre.state; // Should allow for states to + // be saved/loaded + } + } + if (!hasFoundOre) + { + missingOres.add(defaultOre); + } + } + return missingOres; + } - private void loadFromJson() { - try { - Gson gson = new Gson(); - BufferedReader reader = new BufferedReader(new FileReader(configFile)); - Type typeOfHashMap = new TypeToken() { - }.getType(); - config = gson.fromJson(reader, typeOfHashMap); - } catch (Exception e) { - Core.logHelper.error("The ores.json file was invalid, bad things are about to happen, I will try and save the world now :"); - config = defaultConfig; - jsonInvalid = true; - Core.logHelper.error("The ores.json file was ignored and the default values loaded, you file will NOT be over written"); - e.printStackTrace(); - } - } + private void loadFromJson() + { + try + { + Gson gson = new Gson(); + BufferedReader reader = new BufferedReader(new FileReader(configFile)); + Type typeOfHashMap = new TypeToken() + { + }.getType(); + config = gson.fromJson(reader, typeOfHashMap); + } catch (Exception e) + { + Core.logHelper.error( + "The ores.json file was invalid, bad things are about to happen, I will try and save the world now :"); + config = defaultConfig; + jsonInvalid = true; + Core.logHelper.error( + "The ores.json file was ignored and the default values loaded, you file will NOT be over written"); + e.printStackTrace(); + } + } - private void save() { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(config); - try { - FileWriter writer = new FileWriter(configFile); - writer.write(json); - writer.close(); - } catch (IOException e) { - Core.logHelper.error("The ores.json file was invalid, something bad happened"); - e.printStackTrace(); - } - } + private void save() + { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String json = gson.toJson(config); + try + { + FileWriter writer = new FileWriter(configFile); + writer.write(json); + writer.close(); + } catch (IOException e) + { + Core.logHelper.error("The ores.json file was invalid, something bad happened"); + e.printStackTrace(); + } + } - public List getAllGenOresFromList(List configList) { - List list = new ArrayList<>(); - for (OreConfig config : configList) { - if (config.veinSize != 0 && config.veinsPerChunk != 0 && config.shouldSpawn) { - list.add(config); - } - } - return list; - } + public List getAllGenOresFromList(List configList) + { + List list = new ArrayList<>(); + for (OreConfig config : configList) + { + if (config.veinSize != 0 && config.veinsPerChunk != 0 && config.shouldSpawn) + { + list.add(config); + } + } + return list; + } - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { - //TODO this could be optimised to not run every chunk gen - if(!config.generateTechRebornFeatures){ - return; - } - boolean genTree = false; - List list = new ArrayList<>(); - if (world.provider.isSurfaceWorld()) { - list.addAll(getAllGenOresFromList(config.overworldOres)); - genTree = true; - } else if (world.provider.getDimension() == 0) { - list.addAll(getAllGenOresFromList(config.neatherOres)); - } else if (world.provider.getDimension() == 1) { - list.addAll(getAllGenOresFromList(config.endOres)); - } + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, + IChunkProvider chunkProvider) + { + // TODO this could be optimised to not run every chunk gen + if (!config.generateTechRebornFeatures) + { + return; + } + boolean genTree = false; + List list = new ArrayList<>(); + if (world.provider.isSurfaceWorld()) + { + list.addAll(getAllGenOresFromList(config.overworldOres)); + genTree = true; + } else if (world.provider.getDimension() == 0) + { + list.addAll(getAllGenOresFromList(config.neatherOres)); + } else if (world.provider.getDimension() == 1) + { + list.addAll(getAllGenOresFromList(config.endOres)); + } - if (!list.isEmpty() && config.generateOres) { - int xPos, yPos, zPos; - for (OreConfig ore : list) { - WorldGenMinable worldGenMinable = new WorldGenMinable(ore.state, ore.veinSize); - for (int i = 0; i < ore.veinsPerChunk; i++) { - xPos = chunkX * 16 + random.nextInt(16); - yPos = 10 + random.nextInt(ore.maxYHeight - ore.minYHeight); - zPos = chunkZ * 16 + random.nextInt(16); - BlockPos pos = new BlockPos(xPos, yPos, zPos); - worldGenMinable.generate(world, random, pos); - } - } - } - if (genTree && config.rubberTreeConfig.shouldSpawn) { - int chance = config.rubberTreeConfig.chance; - boolean isValidSpawn = false; - BiomeGenBase biomeGenBase = world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 72, chunkZ * 16)); - if (BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.SWAMP)) { - //TODO check the config file for bounds on this, might cause issues - chance -= random.nextInt(10) + 10; - isValidSpawn = true; - } - if (BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.FOREST) || BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.JUNGLE)) { - chance -= random.nextInt(5) + 3; - isValidSpawn = true; - } - if (!isValidSpawn) { - return; - } - if (random.nextInt(chance) == 0) { - int x = (chunkX * 16) + random.nextInt(15); - int z = (chunkZ * 16) + random.nextInt(15); - for (int i = 0; i < config.rubberTreeConfig.clusterSize; i++) { - int y = world.getActualHeight() - 1; - while (world.isAirBlock(new BlockPos(x, y, z)) && y > 0) { - y--; - } - treeGenerator.generate(world, random, new BlockPos(x, 72, z)); - x += random.nextInt(16) - 8; - z += random.nextInt(16) - 8; - } + if (!list.isEmpty() && config.generateOres) + { + int xPos, yPos, zPos; + for (OreConfig ore : list) + { + WorldGenMinable worldGenMinable = new WorldGenMinable(ore.state, ore.veinSize); + for (int i = 0; i < ore.veinsPerChunk; i++) + { + xPos = chunkX * 16 + random.nextInt(16); + yPos = 10 + random.nextInt(ore.maxYHeight - ore.minYHeight); + zPos = chunkZ * 16 + random.nextInt(16); + BlockPos pos = new BlockPos(xPos, yPos, zPos); + worldGenMinable.generate(world, random, pos); + } + } + } + if (genTree && config.rubberTreeConfig.shouldSpawn) + { + int chance = config.rubberTreeConfig.chance; + boolean isValidSpawn = false; + BiomeGenBase biomeGenBase = world.getBiomeGenForCoords(new BlockPos(chunkX * 16, 72, chunkZ * 16)); + if (BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.SWAMP)) + { + // TODO check the config file for bounds on this, might cause + // issues + chance -= random.nextInt(10) + 10; + isValidSpawn = true; + } + if (BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.FOREST) + || BiomeDictionary.isBiomeOfType(biomeGenBase, BiomeDictionary.Type.JUNGLE)) + { + chance -= random.nextInt(5) + 3; + isValidSpawn = true; + } + if (!isValidSpawn) + { + return; + } + if (random.nextInt(chance) == 0) + { + int x = (chunkX * 16) + random.nextInt(15); + int z = (chunkZ * 16) + random.nextInt(15); + for (int i = 0; i < config.rubberTreeConfig.clusterSize; i++) + { + int y = world.getActualHeight() - 1; + while (world.isAirBlock(new BlockPos(x, y, z)) && y > 0) + { + y--; + } + treeGenerator.generate(world, random, new BlockPos(x, 72, z)); + x += random.nextInt(16) - 8; + z += random.nextInt(16) - 8; + } - } - retroGen.markChunk(ChunkCoord.of(chunkX, chunkZ)); - } - } + } + retroGen.markChunk(ChunkCoord.of(chunkX, chunkZ)); + } + } } diff --git a/src/main/java/techreborn/world/config/IOreNameProvider.java b/src/main/java/techreborn/world/config/IOreNameProvider.java index 3b7751a29..38e7852eb 100644 --- a/src/main/java/techreborn/world/config/IOreNameProvider.java +++ b/src/main/java/techreborn/world/config/IOreNameProvider.java @@ -5,8 +5,9 @@ import net.minecraft.block.state.IBlockState; /** * Created by modmuss50 on 11/03/2016. */ -public interface IOreNameProvider { +public interface IOreNameProvider +{ - public String getUserLoclisedName(IBlockState state); + public String getUserLoclisedName(IBlockState state); } diff --git a/src/main/java/techreborn/world/config/OreConfig.java b/src/main/java/techreborn/world/config/OreConfig.java index 2e2fbb2c6..3efe7d8a7 100644 --- a/src/main/java/techreborn/world/config/OreConfig.java +++ b/src/main/java/techreborn/world/config/OreConfig.java @@ -5,40 +5,43 @@ import net.minecraft.block.state.IBlockState; /** * Created by modmuss50 on 11/03/2016. */ -public class OreConfig { +public class OreConfig +{ - public String blockName; + public String blockName; - public String blockNiceName; + public String blockNiceName; - public int meta; + public int meta; - //This doesn't get written to the json file - public transient IBlockState state; + // This doesn't get written to the json file + public transient IBlockState state; - public int veinSize; + public int veinSize; - public int veinsPerChunk; + public int veinsPerChunk; - public int minYHeight; + public int minYHeight; - public int maxYHeight; + public int maxYHeight; - public boolean shouldSpawn = true; + public boolean shouldSpawn = true; - - public OreConfig(IBlockState blockSate, int veinSize, int veinsPerChunk, int minYHeight, int maxYHeight) { - this.meta = blockSate.getBlock().getMetaFromState(blockSate); - this.state = blockSate; - this.blockName = blockSate.getBlock().getUnlocalizedName(); - if(blockSate.getBlock() instanceof IOreNameProvider){ - this.blockNiceName = ((IOreNameProvider) blockSate.getBlock()).getUserLoclisedName(blockSate); - } else { - this.blockNiceName = "unknown"; - } - this.veinSize = veinSize; - this.veinsPerChunk = veinsPerChunk; - this.minYHeight = minYHeight; - this.maxYHeight = maxYHeight; - } + public OreConfig(IBlockState blockSate, int veinSize, int veinsPerChunk, int minYHeight, int maxYHeight) + { + this.meta = blockSate.getBlock().getMetaFromState(blockSate); + this.state = blockSate; + this.blockName = blockSate.getBlock().getUnlocalizedName(); + if (blockSate.getBlock() instanceof IOreNameProvider) + { + this.blockNiceName = ((IOreNameProvider) blockSate.getBlock()).getUserLoclisedName(blockSate); + } else + { + this.blockNiceName = "unknown"; + } + this.veinSize = veinSize; + this.veinsPerChunk = veinsPerChunk; + this.minYHeight = minYHeight; + this.maxYHeight = maxYHeight; + } } diff --git a/src/main/java/techreborn/world/config/RubberTreeConfig.java b/src/main/java/techreborn/world/config/RubberTreeConfig.java index 235e8893b..549c9a883 100644 --- a/src/main/java/techreborn/world/config/RubberTreeConfig.java +++ b/src/main/java/techreborn/world/config/RubberTreeConfig.java @@ -3,18 +3,19 @@ package techreborn.world.config; /** * Created by modmuss50 on 11/03/2016. */ -//TODO add some sanity checks to this -public class RubberTreeConfig { +// TODO add some sanity checks to this +public class RubberTreeConfig +{ - public boolean shouldSpawn = true; + public boolean shouldSpawn = true; - public int chance = 75; + public int chance = 75; - public int clusterSize = 7; + public int clusterSize = 7; - public int sapRarity = 10; + public int sapRarity = 10; - public int spireHeight = 4; + public int spireHeight = 4; - public int treeBaseHeight = 5; + public int treeBaseHeight = 5; } diff --git a/src/main/java/techreborn/world/config/WorldGenConfig.java b/src/main/java/techreborn/world/config/WorldGenConfig.java index 46eef200c..6b16f47a6 100644 --- a/src/main/java/techreborn/world/config/WorldGenConfig.java +++ b/src/main/java/techreborn/world/config/WorldGenConfig.java @@ -5,19 +5,20 @@ import java.util.List; /** * Created by modmuss50 on 11/03/2016. */ -public class WorldGenConfig { +public class WorldGenConfig +{ - public boolean generateTechRebornFeatures = true; + public boolean generateTechRebornFeatures = true; - public boolean generateOres = true; + public boolean generateOres = true; - public boolean retroGenOres = false; + public boolean retroGenOres = false; - public List overworldOres; + public List overworldOres; - public List neatherOres; + public List neatherOres; - public List endOres; + public List endOres; - public RubberTreeConfig rubberTreeConfig = new RubberTreeConfig(); + public RubberTreeConfig rubberTreeConfig = new RubberTreeConfig(); }