From 67b48690b1078b489bcb017e8db9200f26b77a0c Mon Sep 17 00:00:00 2001 From: miozune Date: Fri, 26 May 2023 14:41:09 +0900 Subject: Deprecation cleanup (#637) --- .../xmod/gregtech/api/enums/GregtechItemList.java | 37 - .../gregtech/api/enums/GregtechOrePrefixes.java | 2 +- .../interfaces/internal/IGregtech_RecipeAdder.java | 13 - .../xmod/gregtech/api/items/Gregtech_MetaTool.java | 2 +- .../custom/power/GTPP_MTE_TieredMachineBlock.java | 7 - .../custom/power/MetaTileEntityCustomPower.java | 10 +- .../GT_MetaTileEntity_Hatch_AirIntake.java | 4 +- .../GT_MetaTileEntity_Hatch_AirIntake_Extreme.java | 8 +- .../GT_MetaTileEntity_Hatch_ControlCore.java | 4 +- .../GT_MetaTileEntity_Hatch_DynamoBuffer.java | 13 +- ...etaTileEntity_Hatch_ElementalDataOrbHolder.java | 6 - .../GT_MetaTileEntity_Hatch_FluidGenerator.java | 2 +- .../GT_MetaTileEntity_Hatch_InputBattery.java | 8 +- .../GT_MetaTileEntity_Hatch_Naquadah.java | 9 +- .../GT_MetaTileEntity_Hatch_OutputBattery.java | 8 +- .../GT_MetaTileEntity_Hatch_Reservoir.java | 4 +- .../GT_MetaTileEntity_Hatch_Steam_BusInput.java | 10 +- .../GT_MetaTileEntity_Hatch_Turbine.java | 12 +- .../GT_MetaTileEntity_Hatch_TurbineProvider.java | 13 +- .../GT_MetaTileEntity_SuperBus_Input.java | 7 +- .../GT_MetaTileEntity_SuperBus_Output.java | 7 +- .../GregtechMetaPipeEntityFluid.java | 18 +- .../GregtechMetaTreeFarmerStructural.java | 14 +- .../GT_MetaTileEntity_Hatch_CustomFluidBase.java | 9 +- .../base/GregtechMetaTransformerHiAmp.java | 13 +- .../base/GregtechMeta_MultiBlockBase.java | 10 +- .../base/generators/GregtechMetaBoilerBase.java | 7 +- .../generators/GregtechMetaSolarGenerator.java | 6 +- .../GregtechRocketFuelGeneratorBase.java | 11 +- .../base/machines/GregtechMetaSafeBlockBase.java | 3 +- .../base/machines/GregtechMetaTreeFarmerBase.java | 5 +- .../GT_MetaTileEntity_Hatch_Catalysts.java | 10 +- .../GT_MetaTileEntity_Hatch_MillingBalls.java | 10 +- .../GT_MetaTileEntity_Hatch_NbtConsumable.java | 8 - .../xmod/gregtech/common/Meta_GT_Proxy.java | 25 - .../common/covers/GTPP_Cover_Overflow.java | 7 +- .../common/covers/GTPP_Cover_ToggleVisual.java | 16 +- .../gregtech/common/helpers/TreeFarmHelper.java | 1015 -------------------- .../common/items/MetaGeneratedGregtechItems.java | 40 +- .../behaviours/Behaviour_Electric_Lighter.java | 22 +- .../items/behaviours/Behaviour_Prospecting_Ex.java | 19 +- .../gregtech/common/render/GTPP_CapeRenderer.java | 54 -- .../GT_MetaTileEntity_ElectricAutoWorkbench.java | 10 +- ...GT_MetaTileEntity_ElectricInventoryManager.java | 9 +- .../GT_MetaTileEntity_TesseractGenerator.java | 12 +- .../GT_MetaTileEntity_TesseractTerminal.java | 15 +- .../generators/GT_MetaTileEntity_Boiler_Base.java | 15 +- .../generators/GT_MetaTileEntity_Boiler_HV.java | 4 +- .../generators/GT_MetaTileEntity_Boiler_LV.java | 4 +- .../generators/GT_MetaTileEntity_Boiler_MV.java | 4 +- .../GT_MetaTileEntity_SemiFluidGenerator.java | 20 +- .../GregtechMetaTileEntityGeothermalGenerator.java | 19 +- .../GregtechMetaTileEntityRocketFuelGenerator.java | 11 +- .../GregtechMetaTileEntitySolarGenerator.java | 13 +- .../generators/GregtechMetaTileEntity_RTG.java | 14 +- .../GT_MetaTileEntity_ULV_CombustionGenerator.java | 17 +- .../ULV/GT_MetaTileEntity_ULV_GasTurbine.java | 21 +- .../basic/GT_MetaTileEntity_CropHarvestor.java | 15 +- .../basic/GT_MetaTileEntity_WorldAccelerator.java | 311 ------ .../GregtechMetaAtmosphericReconditioner.java | 30 +- .../machines/basic/GregtechMetaCondensor.java | 13 +- .../basic/GregtechMetaTileEntityChunkLoader.java | 4 +- .../basic/GregtechMetaTileEntity_AutoChisel.java | 13 +- .../basic/GregtechMetaTileEntity_BasicWasher.java | 15 +- .../GregtechMetaTileEntity_ReactorColdTrap.java | 8 +- ...egtechMetaTileEntity_ReactorProcessingUnit.java | 8 +- .../machines/multi/misc/GMTE_AmazonPackager.java | 6 +- .../multi/misc/GregtechMTE_TeslaTower.java | 2 +- ...gtechMetaTileEntity_IndustrialAlloySmelter.java | 4 +- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 12 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 2 +- .../GregtechMetaTileEntity_IndustrialChisel.java | 7 +- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 8 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 6 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 2 +- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 8 +- .../GregtechMetaTileEntity_IndustrialExtruder.java | 6 +- ...egtechMetaTileEntity_IndustrialFluidHeater.java | 4 +- ...egtechMetaTileEntity_IndustrialForgeHammer.java | 6 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 7 +- .../GregtechMetaTileEntity_IndustrialMixer.java | 11 +- ...aTileEntity_IndustrialMolecularTransformer.java | 11 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 8 +- ...regtechMetaTileEntity_IndustrialPlatePress.java | 6 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 9 +- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 4 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 2 +- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 8 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 11 +- .../GregtechMetaTileEntity_IronBlastFurnace.java | 2 +- .../processing/GregtechMetaTileEntity_IsaMill.java | 2 +- .../GregtechMetaTileEntity_SpargeTower.java | 2 +- ...egtechMetaTileEntity_Adv_DistillationTower.java | 4 +- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 2 +- .../GregtechMetaTileEntity_Adv_Fusion_MK4.java | 3 +- .../GregtechMetaTileEntity_Adv_Fusion_MK5.java | 3 +- .../GregtechMetaTileEntity_Adv_HeatExchanger.java | 2 +- .../GregtechMetaTileEntity_Adv_Implosion.java | 9 +- .../GregtechMetaTileEntity_SteamCompressor.java | 4 +- .../GregtechMetaTileEntity_SteamMacerator.java | 4 +- .../multi/production/GT4Entity_ThermalBoiler.java | 2 +- .../GregtechMTE_ElementalDuplicator.java | 18 +- .../production/GregtechMTE_FrothFlotationCell.java | 10 +- .../production/GregtechMTE_NuclearReactor.java | 20 +- .../GregtechMetaTileEntityGeneratorArray.java | 2 +- .../production/GregtechMetaTileEntityTreeFarm.java | 7 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 8 +- .../GregtechMetaTileEntity_Cyclotron.java | 38 +- ...egtechMetaTileEntity_IndustrialFishingPond.java | 6 +- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 11 +- .../GregtechMetaTileEntity_LargeRocketEngine.java | 7 +- ...techMetaTileEntity_LargeSemifluidGenerator.java | 9 +- .../GregtechMetaTileEntity_MassFabricator.java | 10 +- ...techMetaTileEntity_QuantumForceTransformer.java | 17 +- .../GregtechMetaTileEntity_Refinery.java | 7 +- .../GregtechMetaTileEntity_SolarTower.java | 14 +- .../algae/GregtechMTE_AlgaePondBase.java | 10 +- .../chemplant/GregtechMTE_ChemicalPlant.java | 3 +- .../GregtechMetaTileEntity_LargerTurbineBase.java | 2 +- ...chMetaTileEntity_PowerSubStationController.java | 2 +- .../tileentities/misc/TileEntitySolarHeater.java | 8 +- .../redstone/GT_MetaTileEntity_RedstoneBase.java | 9 +- .../GT_MetaTileEntity_RedstoneButtonPanel.java | 4 +- .../GT_MetaTileEntity_RedstoneCircuitBlock.java | 9 +- .../redstone/GT_MetaTileEntity_RedstoneLamp.java | 4 +- .../GT_MetaTileEntity_RedstoneStrengthDisplay.java | 4 +- .../GT_MetaTileEntity_RedstoneStrengthScale.java | 4 +- .../GT_MetaTileEntity_AdvancedCraftingTable.java | 17 +- .../GT_MetaTileEntity_BronzeCraftingTable.java | 11 +- .../GT_MetaTileEntity_ConnectableCrate.java | 7 +- .../storage/GT_MetaTileEntity_TieredChest.java | 13 +- .../storage/GT_MetaTileEntity_TieredTank.java | 24 +- .../storage/GregtechMetaEnergyBuffer.java | 28 - .../storage/GregtechMetaSafeBlock.java | 13 +- .../GT_MetaTileEntity_InfiniteItemHolder.java | 10 +- .../storage/shelving/GT4Entity_Shelf.java | 21 +- .../shelving/GT4Entity_Shelf_Compartment.java | 4 +- .../storage/shelving/GT4Entity_Shelf_Desk.java | 4 +- .../shelving/GT4Entity_Shelf_FileCabinet.java | 4 +- .../storage/shelving/GT4Entity_Shelf_Iron.java | 4 +- .../storage/shelving/GT4Entity_Shelf_Large.java | 8 +- .../common/tools/TOOL_Gregtech_AngleGrinder.java | 11 +- .../common/tools/TOOL_Gregtech_Choocher.java | 11 +- .../tools/TOOL_Gregtech_ElectricButcherKnife.java | 11 +- .../tools/TOOL_Gregtech_ElectricLighter.java | 11 +- .../loaders/ProcessingToolHeadChoocher.java | 15 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 7 - .../gregtech/GregtechBufferDynamos.java | 2 +- .../gregtech/GregtechComponentAssembler.java | 665 ------------- .../registration/gregtech/GregtechConduits.java | 30 +- .../gregtech/GregtechEnergyBuffer.java | 2 +- .../GregtechGeothermalThermalGenerator.java | 2 +- .../registration/gregtech/GregtechSafeBlock.java | 2 +- .../gregtech/GregtechThreadedBuffers.java | 78 -- 154 files changed, 611 insertions(+), 2949 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java (limited to 'src/main/java/gtPlusPlus/xmod/gregtech') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index e51b27f974..2343b6e76e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -651,18 +651,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Auto TC Research Creator Thaumcraft_Researcher, - // Threaded Buffers - Automation_Threaded_SuperBuffer_ULV, - Automation_Threaded_SuperBuffer_LV, - Automation_Threaded_SuperBuffer_MV, - Automation_Threaded_SuperBuffer_HV, - Automation_Threaded_SuperBuffer_EV, - Automation_Threaded_SuperBuffer_IV, - Automation_Threaded_SuperBuffer_LuV, - Automation_Threaded_SuperBuffer_ZPM, - Automation_Threaded_SuperBuffer_UV, - Automation_Threaded_SuperBuffer_MAX, - // infinite Items Infinite_Item_Chest, @@ -769,19 +757,6 @@ public enum GregtechItemList implements GregtechItemContainer { Charger_UV, Charger_MAX, - // Tiny Fusion - /* Miniature_Fusion, */ - - // Component Makers - Machine_LV_Component_Maker, - Machine_MV_Component_Maker, - Machine_HV_Component_Maker, - Machine_EV_Component_Maker, - Machine_IV_Component_Maker, - Machine_LuV_Component_Maker, - Machine_ZPM_Component_Maker, - Machine_UV_Component_Maker, - // Reactor Processing Unit ReactorProcessingUnit_IV, ReactorProcessingUnit_ZPM, @@ -969,18 +944,6 @@ public enum GregtechItemList implements GregtechItemContainer { Cover_Overflow_Item_EV, Cover_Overflow_Item_IV, - // Fake Hull Covers - FakeMachineCasingPlate_ULV, - FakeMachineCasingPlate_LV, - FakeMachineCasingPlate_MV, - FakeMachineCasingPlate_HV, - FakeMachineCasingPlate_EV, - FakeMachineCasingPlate_IV, - FakeMachineCasingPlate_LuV, - FakeMachineCasingPlate_ZPM, - FakeMachineCasingPlate_UV, - FakeMachineCasingPlate_MAX, - // ---------------------------------------------------------------------------- ; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 96ff9f6aef..8812043cfe 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -350,7 +350,7 @@ public enum GregtechOrePrefixes { + "' with the Prefix '" + this.name() + "' and the Material '" - + aMaterial.name() + + aMaterial.mName + "' at " + GT_Utility.getClassName(tRegistrator)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index 680206596b..e194a4b3f5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -216,19 +216,6 @@ public interface IGregtech_RecipeAdder { FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aDuration, int aEUt); - /** - * Adds a Recipe for the Machine Component Assembler. (up to 6 Inputs) - * - * @param aInputs = ItemStack[] (not null, and respects StackSize) - * @param aFluidInput = Input of a fluid (can be null, and respects StackSize) - * @param aOutput1 = Output ItemStack (not null, and respects StackSize) - * @param aDuration = Duration (must be >= 0) - * @param aEUt = EU per tick needed for heating up (must be >= 0) - * @return true if the Recipe got added, otherwise false. - */ - boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, - int aEUt); - boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, int aSpecial); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java index b5dd1ba16c..a66cce394d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java @@ -69,7 +69,7 @@ public abstract class Gregtech_MetaTool extends GT_MetaGenerated_Tool */ public Gregtech_MetaTool(final String aUnlocalized) { super(aUnlocalized); - GT_ModHandler.registerBoxableItemToToolBox(this); + GT_ModHandler.registerBoxableItemToToolBox(new ItemStack(this)); this.setCreativeTab(AddToCreativeTab.tabMachines); this.setMaxStackSize(1); sInstances.put(this.getUnlocalizedName(), this); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java index 51596dd8cd..9a09ad6538 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java @@ -12,9 +12,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo */ public final byte mTier; - @Deprecated - public final String mDescription; - /** * A simple Description. */ @@ -30,7 +27,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 9)); mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; - mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; // must always be the last call! if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null; @@ -41,7 +37,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo super(aID, aName, aNameRegional, aInvSlotCount); mTier = (byte) Math.max(0, Math.min(aTier, 9)); mDescriptionArray = aDescription == null ? new String[0] : aDescription; - mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; // must always be the last call! if (GT.isClientSide()) mTextures = getTextureSet(aTextures); @@ -53,7 +48,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo super(aName, aInvSlotCount); mTier = (byte) aTier; mDescriptionArray = aDescription == null ? new String[0] : new String[] { aDescription }; - mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; mTextures = aTextures; } @@ -62,7 +56,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo super(aName, aInvSlotCount); mTier = (byte) aTier; mDescriptionArray = aDescription == null ? new String[0] : aDescription; - mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : ""; mTextures = aTextures; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java index cc5f1eff85..79975d3ac8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java @@ -6,6 +6,7 @@ import net.minecraft.world.World; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.SoundResource; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.CustomMetaTileBase; @@ -57,14 +58,7 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { short tY = this.getBaseMetaTileEntity().getYCoord(); int tZ = this.getBaseMetaTileEntity().getZCoord(); World tWorld = this.getBaseMetaTileEntity().getWorld(); - GT_Utility.sendSoundToPlayers( - tWorld, - (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), - 1.0F, - -1.0F, - tX, - tY, - tZ); + GT_Utility.sendSoundToPlayers(tWorld, SoundResource.IC2_MACHINES_MACHINE_OVERLOAD, 1.0F, -1.0F, tX, tY, tZ); tWorld.setBlock(tX, tY, tZ, Blocks.air); if (GregTech_API.sMachineExplosions) { tWorld.createExplosion( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java index 82174fad3a..7ceae20109 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java @@ -17,14 +17,14 @@ public class GT_MetaTileEntity_Hatch_AirIntake extends GT_MetaTileEntity_Hatch_F super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_Hatch_AirIntake(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Hatch_AirIntake(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java index d2760ef106..235354f396 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java @@ -11,14 +11,18 @@ public class GT_MetaTileEntity_Hatch_AirIntake_Extreme extends GT_MetaTileEntity super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_Hatch_AirIntake_Extreme(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_AirIntake_Extreme(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Hatch_AirIntake_Extreme( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java index dacde53cdb..e85cc1f6c2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -48,7 +50,7 @@ public class GT_MetaTileEntity_Hatch_ControlCore extends GT_MetaTileEntity_Hatch @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java index 03a188be0b..1811ee6183 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java @@ -15,16 +15,11 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - /* - * public GT_MetaTileEntity_Hatch_DynamoBuffer(final String aName, final int aTier, final String[] aDescription, - * final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - */ - @Override public ITexture[] getTexturesActive(final ITexture aBaseTexture) { return new ITexture[] { aBaseTexture, TexturesGtBlock.OVERLAYS_ENERGY_OUT_MULTI_BUFFER[this.mTier] }; @@ -47,11 +42,7 @@ public class GT_MetaTileEntity_Hatch_DynamoBuffer extends GT_MetaTileEntity_Hatc @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) new GT_MetaTileEntity_Hatch_DynamoBuffer( - this.mName, - this.mTier, - this.mDescription, - this.mTextures); + return new GT_MetaTileEntity_Hatch_DynamoBuffer(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index c1e0095726..6a8b3a9af6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -20,7 +20,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -128,11 +127,6 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {} - @Override - public String trans(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); - } - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java index cd696fbf56..34eb5ccf16 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java @@ -33,7 +33,7 @@ public abstract class GT_MetaTileEntity_Hatch_FluidGenerator extends GT_MetaTile super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_Hatch_FluidGenerator(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java index 8294e5f9b7..1fca67d295 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java @@ -6,6 +6,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -31,7 +33,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Chargeable Item Bus for Multiblocks"); } - public GT_MetaTileEntity_Hatch_InputBattery(String aName, int aTier, String aDescription, + public GT_MetaTileEntity_Hatch_InputBattery(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 4 : 16, aDescription, aTextures); } @@ -46,7 +48,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc } else { mSlots = 16; } - return new String[] { this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll(this.mDescriptionArray, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip.get()); } @Override @@ -111,7 +113,7 @@ public class GT_MetaTileEntity_Hatch_InputBattery extends GT_MetaTileEntity_Hatc @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_InputBattery(mName, mTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_InputBattery(mName, mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java index 9dae243444..232d8a8c55 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java @@ -31,13 +31,6 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In initHatch(); } - public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String aDescription, - final ITexture[][][] aTextures) { - super(aName, 6, aDescription, aTextures); - mFluidCapacity = 32000; - initHatch(); - } - public GT_MetaTileEntity_Hatch_Naquadah(final String aName, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, 6, aDescription[0], aTextures); @@ -102,7 +95,7 @@ public class GT_MetaTileEntity_Hatch_Naquadah extends GT_MetaTileEntity_Hatch_In @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return (MetaTileEntity) new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Hatch_Naquadah(this.mName, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java index f46e9feece..502dd0ee0b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java @@ -6,6 +6,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -27,7 +29,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat super(aID, aName, aNameRegional, aTier, getSlots(aTier), "Dischargeable Item Bus for Multiblocks"); } - public GT_MetaTileEntity_Hatch_OutputBattery(String aName, int aTier, String aDescription, + public GT_MetaTileEntity_Hatch_OutputBattery(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aTier < 1 ? 1 : aTier == 1 ? 4 : aTier == 2 ? 9 : 16, aDescription, aTextures); } @@ -42,7 +44,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat } else { mSlots = 16; } - return new String[] { this.mDescription, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll(this.mDescriptionArray, "Capacity: " + mSlots + " slots", CORE.GT_Tooltip.get()); } @Override @@ -102,7 +104,7 @@ public class GT_MetaTileEntity_Hatch_OutputBattery extends GT_MetaTileEntity_Hat @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_OutputBattery(mName, mTier, mDescription, mTextures); + return new GT_MetaTileEntity_Hatch_OutputBattery(mName, mTier, mDescriptionArray, mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java index eaf09ecbac..2e16d7783e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java @@ -17,14 +17,14 @@ public class GT_MetaTileEntity_Hatch_Reservoir extends GT_MetaTileEntity_Hatch_F super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_Hatch_Reservoir(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Hatch_Reservoir(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java index 9631bbab6e..47e30ab50c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java @@ -20,7 +20,6 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.lib.CORE; @@ -148,16 +147,11 @@ public class GT_MetaTileEntity_Hatch_Steam_BusInput extends GT_MetaTileEntity_Ha disableSort = !disableSort; GT_Utility.sendChatToPlayer( aPlayer, - trans("200.1", "Automatic Item Shuffling: ") - + (disableSort ? trans("087", "Disabled") : trans("088", "Enabled"))); + GT_Utility.trans("200.1", "Automatic Item Shuffling: ") + + (disableSort ? GT_Utility.trans("087", "Disabled") : GT_Utility.trans("088", "Enabled"))); } } - @Override - public String trans(String aKey, String aEnglish) { - return GT_LanguageManager.addStringLocalization("Interaction_DESCRIPTION_Index_" + aKey, aEnglish, false); - } - @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, ItemStack aStack) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java index 34501bed7a..e8ef0a454b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java @@ -8,12 +8,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.SlotWidget; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.gui.modularui.GT_UIInfos; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -54,11 +57,14 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { @Override public String[] getDescription() { - return new String[] { this.mDescription, "Right Click with a soldering iron to reset controller link", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Right Click with a soldering iron to reset controller link", "Right Click with a wrench to remove turbine", "Right Click with a screwdriver for technical information", "Sneak + Right Click with a wrench to rotate", - "Sneak + Right Click with a screwdriver to disable animations", CORE.GT_Tooltip.get() }; + "Sneak + Right Click with a screwdriver to disable animations", + CORE.GT_Tooltip.get()); } @Override @@ -391,7 +397,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { GT_Utility.sendChatToPlayer(aPlayer, tChat); GT_Utility.sendSoundToPlayers( g.getWorld(), - GregTech_API.sSoundList.get(101), + SoundResource.IC2_TOOLS_RUBBER_TRAMPOLINE, 1.0F, -1, g.getXCoord(), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java index 4ab5ccece8..226086a1ff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java @@ -31,19 +31,18 @@ public class GT_MetaTileEntity_Hatch_TurbineProvider extends GT_MetaTileEntity_H super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String aDescription, - ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); - } - public GT_MetaTileEntity_Hatch_TurbineProvider(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription[0], aTextures); + super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Hatch_TurbineProvider(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Hatch_TurbineProvider( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java index 44174b4fc6..ac6cb4319a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java @@ -9,7 +9,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.util.extensions.ArrayExt; import gtPlusPlus.core.lib.CORE; public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus { @@ -34,11 +33,7 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SuperBus_Input( - this.mName, - this.mTier, - ArrayExt.of(this.mDescription), - this.mTextures); + return new GT_MetaTileEntity_SuperBus_Input(this.mName, this.mTier, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java index 50b18382da..e109d065bd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java @@ -12,7 +12,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.util.GT_Utility; -import gregtech.api.util.extensions.ArrayExt; import gtPlusPlus.core.lib.CORE; public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_OutputBus { @@ -42,11 +41,7 @@ public class GT_MetaTileEntity_SuperBus_Output extends GT_MetaTileEntity_Hatch_O @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SuperBus_Output( - this.mName, - this.mTier, - ArrayExt.of(this.mDescription), - this.mTextures); + return new GT_MetaTileEntity_SuperBus_Output(this.mName, this.mTier, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java index 79f8c4d381..67fbb22e92 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java @@ -1,6 +1,5 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; -import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.enums.Dyes; @@ -29,7 +28,7 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { public GregtechMetaPipeEntityFluid(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { - super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof); + super(aID, aName, aNameRegional, aThickNess, null, aCapacity, aHeatResistance, aGasProof, aFluidTypes); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; this.mMaterial = aMaterial; @@ -37,7 +36,7 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof, int aFluidTypes) { - super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof); + super(aName, aThickNess, null, aCapacity, aHeatResistance, aGasProof, aFluidTypes); this.mLastReceivedFrom = 0; this.oLastReceivedFrom = 0; this.mMaterial = aMaterial; @@ -115,17 +114,4 @@ public class GregtechMetaPipeEntityFluid extends GT_MetaPipeEntity_Fluid { aMaterial.mIconSet.mTextures[OrePrefixes.pipeHuge.mTextureIndex], Dyes.getModulation(aColorIndex, aMaterial.mRGBa)); } - - @Override - public String[] getDescription() { - return new String[] { - EnumChatFormatting.BLUE + "Fluid Capacity: %%%" - + (mCapacity * 20) - + "%%% L/sec" - + EnumChatFormatting.GRAY, - EnumChatFormatting.RED + "Heat Limit: %%%" + mHeatResistance + "%%% K" + EnumChatFormatting.GRAY, - EnumChatFormatting.DARK_GREEN + "Gas Proof: " + (this.mGasProof) + EnumChatFormatting.GRAY, - // CORE.GT_Tooltip - }; - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java index acd2e316aa..627ef2d65b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaTreeFarmerStructural.java @@ -11,23 +11,13 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines public class GregtechMetaTreeFarmerStructural extends GregtechMetaTreeFarmerBase { - @Override - public String[] getDescription() { - return new String[] { this.mDescription }; - } - public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, final int aTier) { super(aID, aName, aNameRegional, aTier, 0, "Structural Blocks for the Tree Farmer."); } - public GregtechMetaTreeFarmerStructural(final int aID, final String aName, final String aNameRegional, - final int aTier, final int aInvSlotCount, final String aDescription) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); - } - public GregtechMetaTreeFarmerStructural(final String aName, final int aTier, final int aInvSlotCount, - final String aDescription, final ITexture[][][] aTextures) { + final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @@ -37,7 +27,7 @@ public class GregtechMetaTreeFarmerStructural extends GregtechMetaTreeFarmerBase this.mName, this.mTier, this.mInventory.length, - this.mDescription, + this.mDescriptionArray, this.mTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java index 69a9c67d57..1aa319652f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java @@ -43,13 +43,6 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H this.mFluidCapacity = aAmount; } - public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, - final String aDescription, final ITexture[][][] aTextures) { - super(aName, 6, 3, aDescription, aTextures); - this.mLockedFluid = aFluid; - this.mFluidCapacity = aAmount; - } - public GT_MetaTileEntity_Hatch_CustomFluidBase(Fluid aFluid, int aAmount, final String aName, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, 6, 3, aDescription[0], aTextures); @@ -202,7 +195,7 @@ public class GT_MetaTileEntity_Hatch_CustomFluidBase extends GT_MetaTileEntity_H this.mLockedFluid, this.mFluidCapacity, this.mName, - this.mDescription, + this.mDescriptionArray, this.mTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index 34afa0b440..a9dd8d3a97 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -4,6 +4,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -21,7 +23,7 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer super(aID, aName, aNameRegional, aTier, aDescription); } - public GregtechMetaTransformerHiAmp(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GregtechMetaTransformerHiAmp(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -80,13 +82,16 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMetaTransformerHiAmp(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaTransformerHiAmp(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "Accepts 4A and outputs 16A", - "Toggle 2A/8A half-mode with Screwdriver", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Accepts 4A and outputs 16A", + "Toggle 2A/8A half-mode with Screwdriver", + CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 11e2e8661b..6841f93ebb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -28,6 +28,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -435,7 +436,7 @@ public abstract class GregtechMeta_MultiBlockBase= 32120 && aDmg <= 32128) { - return ToolType.Unbreakable; - } - Logger.INFO("bad Tool in Slot 2 | " + aStack.getUnlocalizedName().toLowerCase() + " | " + aDmg); - return null; - } - - if (aStack.getItem() instanceof GT_MetaGenerated_Tool) { - if (Arrays.stream(OreDictionary.getOreIDs(aStack)).anyMatch(i -> i == sawOreId)) - return ToolType.Breakable; - } - } - Logger.INFO("bad Tool in Slot 4"); - return null; - } - - public static boolean isHumusLoaded = false; - public static boolean isForestryLogsLoaded = false; - public static boolean isForestryFenceLoaded = false; - public static boolean isForestrySaplingsLoaded = false; - public static boolean isForestryLeavesLoaded = false; - public static Block blockHumus; - - public static boolean isForestryValid() { - if (!Forestry.isModLoaded()) { - return false; - } - if (ReflectionUtils.doesClassExist("forestry.core.blocks.BlockSoil")) { - isHumusLoaded = true; - } - if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockLog")) { - isForestryLogsLoaded = true; - } - if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockArbFence")) { - isForestryFenceLoaded = true; - } - if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockSapling")) { - isForestrySaplingsLoaded = true; - } - if (ReflectionUtils.doesClassExist("forestry.arboriculture.blocks.BlockForestryLeaves")) { - isForestryLeavesLoaded = true; - } - return true; - } - - @Optional.Method(modid = Mods.Names.FORESTRY) - public static Block getHumus() { - if (blockHumus != null) { - return blockHumus; - } else if (isHumusLoaded) { - final Class humusClass = ReflectionUtils.getClass("forestry.core.blocks.BlockSoil"); - final ItemStack humusStack = ItemUtils.getCorrectStacktype("Forestry:soil", 1); - if (humusClass != null) { - blockHumus = Block.getBlockFromItem(humusStack.getItem()); - return Block.getBlockFromItem(humusStack.getItem()); - } - } - return null; - } - - public static boolean isWoodLog(final Block log) { - final String tTool = log.getHarvestTool(0); - - if ((log == Blocks.log) || (log == Blocks.log2)) { - return true; - } - - // Forestry/General Compat - if (log.getClass().getName().toLowerCase().contains("blocklog")) { - return true; - } - - // IC2 Rubber Tree Compat - if (log.getClass().getName().toLowerCase().contains("rubwood") - || log.getClass().getName().toLowerCase().contains("rubleaves")) { - return true; - } - - return (OrePrefixes.log.contains(new ItemStack(log, 1)) && ((tTool != null) && (tTool.equals("axe")))) - || (log.getMaterial() != Material.wood) ? false - : (OrePrefixes.fence.contains(new ItemStack(log, 1)) ? false : true); - } - - public static boolean isLeaves(final Block log) { - if (log.getUnlocalizedName().toLowerCase().contains("leaf")) { - return true; - } - if (log.getUnlocalizedName().toLowerCase().contains("leaves")) { - return true; - } - if (log.getLocalizedName().toLowerCase().contains("leaf")) { - return true; - } - if (log.getLocalizedName().toLowerCase().contains("leaves")) { - return true; - } - return OrePrefixes.leaves.contains(new ItemStack(log, 1)) || log.getMaterial() == Material.leaves - || OrePrefixes.treeLeaves.contains(new ItemStack(log, 1)) - || log.getMaterial() == Material.vine - || OrePrefixes.mushroom.contains(new ItemStack(log, 1)) - || log.getMaterial() == Material.cactus; - } - - public static boolean isSapling(final Block log) { - if (log != null) { - if (OrePrefixes.sapling.contains(new ItemStack(log, 1))) { - // Logger.WARNING(""+log.getLocalizedName()); - } - if (log.getLocalizedName().toLowerCase().contains("sapling")) { - // Logger.WARNING(""+log.getLocalizedName()); - return true; - } - } - return OrePrefixes.sapling.contains(new ItemStack(log, 1)); - } - - public static boolean isDirtBlock(final Block dirt) { - return (dirt == Blocks.dirt ? true - : (dirt == Blocks.grass ? true : (getHumus() == null ? false : (dirt == blockHumus ? true : false)))); - } - - public static boolean isFenceBlock(final Block fence) { - return (fence == Blocks.fence ? true - : (fence == Blocks.fence_gate ? true - : (fence == Blocks.nether_brick_fence ? true - : (OrePrefixes.fence.contains(new ItemStack(fence, 1)) ? true : false)))); - } - - public static boolean isAirBlock(final Block air) { - if (air.getLocalizedName().toLowerCase().contains("air")) { - return true; - } - if (air.getClass().getName().toLowerCase().contains("residual") - || air.getClass().getName().toLowerCase().contains("heat")) { - return true; - } - return (air == Blocks.air ? true : (air instanceof BlockAir ? true : false)); - } - - /* - * public static boolean isSaplingBlock(Block sapling){ return (sapling == Blocks.sapling ? true : (sapling == - * Blocks.)) } - */ - - public static BlockPos checkForLogsInGrowArea(final IGregTechTileEntity aBaseMetaTileEntity) { - final int xDir = aBaseMetaTileEntity.getBackFacing().offsetX * 7; - final int zDir = aBaseMetaTileEntity.getBackFacing().offsetZ * 7; - for (int i = -7; i <= 7; i++) { - for (int j = -7; j <= 7; j++) { - for (int h = 0; h <= 1; h++) { - // Farm Floor inner 14x14 - if (((i != -7) && (i != 7)) && ((j != -7) && (j != 7))) { - if (h == 1) { - if (TreeFarmHelper.isWoodLog(aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j))) { - Logger.INFO("Found a Log"); - return new BlockPos( - aBaseMetaTileEntity.getXCoord() + xDir + i, - aBaseMetaTileEntity.getYCoord() + h, - aBaseMetaTileEntity.getZCoord() + zDir + j, - aBaseMetaTileEntity.getWorld()); - } - } - } - } - } - } - return null; - } - - public static ItemStack[] findTreeFromBase(World world, BlockPos h) { - int HARD_LIMIT = 10000; - int mCount = 0; - Logger.INFO("Finding Rest of Tree."); - BlockPos mFirstSpot = h; - Set mSearchedSpaces = new HashSet(); - Set mTreeSet = getConnectedBlocks(world, mFirstSpot, mSearchedSpaces); - Set> mTreeSet2 = new HashSet>(); - Set mFinalTree = new HashSet(); - Iterator it = mTreeSet.iterator(); - - Logger.INFO("Running first iteration."); - while (it.hasNext()) { - BlockPos G = it.next(); - mSearchedSpaces.add(G); - mTreeSet2.add(getConnectedBlocks(world, G, mSearchedSpaces)); - mCount++; - Logger.INFO("First Search: " + G.getLocationString()); - if (mCount > HARD_LIMIT) { - break; - } - } - - mCount = 0; - Iterator> it2 = mTreeSet2.iterator(); - Iterator it3; - Logger.INFO("Running second iteration."); - while (it2.hasNext()) { - Set G = it2.next(); - it3 = G.iterator(); - while (it3.hasNext()) { - BlockPos G2 = it3.next(); - mSearchedSpaces.add(G2); - mFinalTree.add(G2); - mCount++; - Logger.INFO("Second Search: " + G2.getLocationString()); - if (mCount > HARD_LIMIT) { - break; - } - } - if (mCount > HARD_LIMIT) { - break; - } - } - - if (mFinalTree.size() > 0) { - Logger.INFO("Queuing " + mFinalTree.size() + " to Harvest Manager."); - TreeCutter harvestManager = new TreeCutter(world); - - Iterator ith = mFinalTree.iterator(); - while (ith.hasNext()) { - BlockPos G = ith.next(); - harvestManager.queue(G); - mCount++; - Logger.INFO("Queued: " + G.getLocationString()); - if (mCount > HARD_LIMIT) { - break; - } - } - - if (harvestManager.isValid) { - ItemStack[] loot = harvestManager.getDrops(); - if (loot.length > 0) { - // Logger.INFO("Returning Drops from harvestManager Queue."); - return loot; - } - } - } - return new ItemStack[] {}; - } - - public static Set getConnectedBlocks(World W, BlockPos P, Set checkedSpaces) { - int HARD_LIMIT = 1000; - int mCount = 0; - Logger.INFO("Finding blocks connected to " + P.getLocationString() + "."); - Set mCheckedSpaces = checkedSpaces; - Set mStartSearch = searchSixFaces(W, P, mCheckedSpaces, false); - Set mSecondSearch = new HashSet(); - Set mThirdSearch = new HashSet(); - Iterator it = mStartSearch.iterator(); - while (it.hasNext()) { - Logger.INFO("Running first iteration. [II]"); - BlockPos G = it.next(); - mCheckedSpaces.add(G); - Set mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true); - Iterator it2 = mBranchSearch.iterator(); - while (it2.hasNext()) { - Logger.INFO("Running second iteration. [II]"); - BlockPos G2 = it2.next(); - mCheckedSpaces.add(G2); - mSecondSearch.add(G2); - mCount++; - if (mCount > HARD_LIMIT) { - break; - } - } - if (mCount > HARD_LIMIT) { - break; - } - } - mCount = 0; - Iterator itx = mSecondSearch.iterator(); - while (itx.hasNext()) { - BlockPos G = itx.next(); - mCheckedSpaces.add(G); - Set mBranchSearch = searchSixFaces(W, G, mCheckedSpaces, true); - Iterator it2 = mBranchSearch.iterator(); - while (it2.hasNext()) { - BlockPos G2 = it2.next(); - mCheckedSpaces.add(G2); - mThirdSearch.add(G2); - mCount++; - if (mCount > HARD_LIMIT) { - break; - } - } - if (mCount > HARD_LIMIT) { - break; - } - } - return mThirdSearch; - } - - public static Set searchSixFaces(World W, BlockPos P, Set checkedSpaces, boolean checkLeaves) { - Set mConnected = new HashSet(); - int x = P.xPos; - int y = P.yPos; - int z = P.zPos; - if (checkLeaves) { - if (isWoodLog(W.getBlock(x - 1, y, z)) || isLeaves(W.getBlock(x - 1, y, z))) { - BlockPos L = new BlockPos(x - 1, y, z, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - if (isWoodLog(W.getBlock(x + 1, y, z)) || isLeaves(W.getBlock(x + 1, y, z))) { - BlockPos L = new BlockPos(x + 1, y, z, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - if (isWoodLog(W.getBlock(x, y - 1, z)) || isLeaves(W.getBlock(x, y - 1, z))) { - BlockPos L = new BlockPos(x, y - 1, z, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - if (isWoodLog(W.getBlock(x, y + 1, z)) || isLeaves(W.getBlock(x, y + 1, z))) { - BlockPos L = new BlockPos(x, y + 1, z, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - if (isWoodLog(W.getBlock(x, y, z - 1)) || isLeaves(W.getBlock(x, y, z - 1))) { - BlockPos L = new BlockPos(x, y, z - 1, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - if (isWoodLog(W.getBlock(x, y, z + 1)) || isLeaves(W.getBlock(x, y, z + 1))) { - BlockPos L = new BlockPos(x, y, z + 1, W); - if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - } - } - } else { - if (isWoodLog(W.getBlock(x - 1, y, z))) { - BlockPos L = new BlockPos(x - 1, y, z, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - if (isWoodLog(W.getBlock(x + 1, y, z))) { - BlockPos L = new BlockPos(x + 1, y, z, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - if (isWoodLog(W.getBlock(x, y - 1, z))) { - BlockPos L = new BlockPos(x, y - 1, z, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - if (isWoodLog(W.getBlock(x, y + 1, z))) { - BlockPos L = new BlockPos(x, y + 1, z, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - if (isWoodLog(W.getBlock(x, y, z - 1))) { - BlockPos L = new BlockPos(x, y, z - 1, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - if (isWoodLog(W.getBlock(x, y, z + 1))) { - BlockPos L = new BlockPos(x, y, z + 1, W); - // if (!checkedSpaces.contains(L)) { - mConnected.add(L); - Logger.INFO("Found Connected. [III]"); - // } - } - } - return mConnected; - } - - public enum ToolType { - Unbreakable, - Breakable - } - - /** - * Tree Cutting - */ - public static class TreeCutter { - - private final World mWorld; - private Map mQueue = new ConcurrentHashMap(); - private AutoMap mDrops = new AutoMap(); - private boolean isValid = true; - - public TreeCutter(World world) { - this.mWorld = world; - } - - public boolean queue(BlockPos pos) { - if (isValid && pos != null) { - // Logger.INFO("Queued: "+pos.getLocationString()); - String hash = Utils.calculateChecksumMD5(pos); - if (hash != null && !mQueue.containsKey(hash)) { - mQueue.put(hash, pos); - return true; - } - } - return false; - } - - private boolean emptyQueue() { - if (isValid) { - Logger.INFO("Emptying Queue."); - if (this.mQueue.size() > 0) { - int totalRemoved = 0; - for (BlockPos h : mQueue.values()) { - final Block block = mWorld.getBlock(h.xPos, h.yPos, h.zPos); - if (block != null) { - final int dropMeta = mWorld.getBlockMetadata(h.xPos, h.yPos, h.zPos); - final ArrayList blockDrops = block - .getDrops(mWorld, h.xPos, h.yPos, h.zPos, dropMeta, 0); - final ItemStack[] drops = ItemUtils.getBlockDrops(blockDrops); - mDrops.put(drops); - // Remove drop that was added to the bus. - mWorld.setBlockToAir(h.xPos, h.yPos, h.zPos); - // new BlockBreakParticles(mWorld, h.xPos, h.yPos, h.zPos, block); - totalRemoved++; - } - } - if (totalRemoved > 0 && mDrops.size() > 0) { - return true; - } - } - } - return false; - } - - public ItemStack[] getDrops() { - // If Queue is successfully cleared and drops are created, let us continue. - if (isValid && emptyQueue()) { - AutoMap mCollective = new AutoMap(); - // Iterate ALL of the arrays, add output to a collective. - for (ItemStack[] i : this.mDrops) { - // Array is not null. - if (i != null) { - // Iterate this array. - for (int d = 0; d < i.length; d++) { - // Put Output into collective if valid - if (i[d] != null && i[d].stackSize > 0) { - mCollective.put(i[d]); - } - } - } - } - // Build an ItemStack array. - ItemStack[] drops = new ItemStack[mCollective.size()]; - for (int m = 0; m < drops.length; m++) { - drops[m] = mCollective.get(m); - } - // Return drops array if it's valid. - if (drops.length > 0) { - isValid = false; - return drops; - } - } - // Invalid or no drops, return empty array. - isValid = false; - return new ItemStack[] {}; - } - } - - /** - * Farm AI - */ - private static EntityPlayerMP farmerAI; - - public EntityPlayerMP getFakePlayer(World world) { - return farmerAI = checkFakePlayer(world); - } - - public static EntityPlayerMP checkFakePlayer(World world) { - if (farmerAI == null) { - return new FakeFarmer(MinecraftServer.getServer().worldServerForDimension(world.provider.dimensionId)); - } - return farmerAI; - } - - public static boolean onBlockStartBreak(int x, int y, int z, World world) { - final Block wood = world.getBlock(x, y, z); - if (wood == null) { - return false; - } - if (wood.isWood(world, x, y, z) || wood.getMaterial() == Material.sponge) if (detectTree(world, x, y, z)) { - TreeChopTask chopper = new TreeChopTask(new ChunkPosition(x, y, z), checkFakePlayer(world), 128); - FMLCommonHandler.instance().bus().register(chopper); - // custom block breaking code, don't call vanilla code - return true; - } - // return onBlockStartBreak(stack, x, y, z, player); - return false; - } - - public static boolean detectTree(World world, int pX, int pY, int pZ) { - ChunkPosition pos = null; - Stack candidates = new Stack<>(); - candidates.add(new ChunkPosition(pX, pY, pZ)); - - while (!candidates.isEmpty()) { - ChunkPosition candidate = candidates.pop(); - int curX = candidate.chunkPosX, curY = candidate.chunkPosY, curZ = candidate.chunkPosZ; - - Block block = world.getBlock(curX, curY, curZ); - if ((pos == null || candidate.chunkPosY > pos.chunkPosY) && block.isWood(world, curX, curY, curZ)) { - pos = new ChunkPosition(curX, candidate.chunkPosY + 1, curZ); - // go up - while (world.getBlock(curX, pos.chunkPosY, curZ).isWood(world, curX, pos.chunkPosY, curZ)) { - pos = new ChunkPosition(curX, pos.chunkPosY + 1, curZ); - } - // check if we still have a way diagonally up - candidates.add(new ChunkPosition(curX + 1, pos.chunkPosY + 1, curZ)); - candidates.add(new ChunkPosition(curX, pos.chunkPosY + 1, curZ + 1)); - candidates.add(new ChunkPosition(curX - 1, pos.chunkPosY + 1, curZ)); - candidates.add(new ChunkPosition(curX, pos.chunkPosY + 1, curZ - 1)); - } - } - - // not even one match, so there were no logs. - if (pos == null) { - return false; - } - - // check if there were enough leaves around the last position - // pos now contains the block above the topmost log - // we want at least 5 leaves in the surrounding 26 blocks - int d = 3; - int leaves = 0; - for (int offX = 0; offX < d; offX++) { - for (int offY = 0; offY < d; offY++) { - for (int offZ = 0; offZ < d; offZ++) { - int xPos = pos.chunkPosX - 1 + offX, yPos = pos.chunkPosY - 1 + offY, - zPos = pos.chunkPosZ - 1 + offZ; - Block leaf = world.getBlock(xPos, yPos, zPos); - if (leaf != null && leaf.isLeaves(world, xPos, yPos, zPos)) { - if (++leaves >= 5) { - return true; - } - } - } - } - } - - // not enough leaves. sorreh - return false; - } - - public static class TreeChopTask { - - public final World world; - public final EntityPlayer player; - public final int blocksPerTick; - - public Queue blocks = Lists.newLinkedList(); - public Set visited = new THashSet<>(); - - public TreeChopTask(ChunkPosition start, EntityPlayer player, int blocksPerTick) { - this.world = player.getEntityWorld(); - this.player = player; - this.blocksPerTick = blocksPerTick; - - this.blocks.add(start); - } - - private void queueCoordinate(int x, int y, int z) { - ChunkPosition pos = new ChunkPosition(x, y, z); - if (!visited.contains(pos)) { - blocks.add(pos); - } - } - - @SubscribeEvent - public void onWorldTick(TickEvent.WorldTickEvent event) { - if (event.side.isClient()) { - finish(); - return; - } - // only if same dimension - if (event.world.provider.dimensionId != world.provider.dimensionId) { - return; - } - - // setup - int left = blocksPerTick; - // NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); - - // continue running - ChunkPosition pos; - while (left > 0) { - // completely done or can't do our job anymore?! - if (blocks.isEmpty() /* || tags.getBoolean("Broken") */) { - finish(); - return; - } - - pos = blocks.remove(); - if (!visited.add(pos)) { - continue; - } - int x = pos.chunkPosX, y = pos.chunkPosY, z = pos.chunkPosZ; - - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - // can we harvest the block and is effective? - if (!block.isWood(world, x, y, z) || !isWoodLog(block)) { - continue; - } - - // save its neighbors - queueCoordinate(x + 1, y, z); - queueCoordinate(x, y, z + 1); - queueCoordinate(x - 1, y, z); - queueCoordinate(x, y, z - 1); - - // also add the layer above.. stupid acacia trees - for (int offX = 0; offX < 3; offX++) { - for (int offZ = 0; offZ < 3; offZ++) { - queueCoordinate(x - 1 + offX, y + 1, z - 1 + offZ); - } - } - - // break it, wooo! - breakExtraBlock(player.worldObj, x, y, z, 0, player, x, y, z); - left--; - } - } - - private void finish() { - // goodbye cruel world - FMLCommonHandler.instance().bus().unregister(this); - } - } - - public static void breakExtraBlock(World world, int x, int y, int z, int sidehit, EntityPlayer playerEntity, - int refX, int refY, int refZ) { - // prevent calling that stuff for air blocks, could lead to unexpected behaviour since it fires events - if (world.isAirBlock(x, y, z)) return; - - // what? - if (!(playerEntity instanceof EntityPlayerMP)) return; - EntityPlayerMP player = (EntityPlayerMP) playerEntity; - - // check if the block can be broken, since extra block breaks shouldn't instantly break stuff like obsidian - // or precious ores you can't harvest while mining stone - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - - // only effective materials - if (!isWoodLog(block)) return; - - Block refBlock = world.getBlock(refX, refY, refZ); - float refStrength = ForgeHooks.blockStrength(refBlock, player, world, refX, refY, refZ); - float strength = ForgeHooks.blockStrength(block, player, world, x, y, z); - - // only harvestable blocks that aren't impossibly slow to harvest - if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength / strength > 10f) return; - - // send the blockbreak event - BlockEvent.BreakEvent event = ForgeHooks - .onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); - if (event.isCanceled()) return; - - if (player.capabilities.isCreativeMode) { - block.onBlockHarvested(world, x, y, z, meta, player); - if (block.removedByPlayer(world, player, x, y, z, false)) - block.onBlockDestroyedByPlayer(world, x, y, z, meta); - - // send update to client - if (!world.isRemote) { - player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world)); - } - return; - } - - // callback to the tool the player uses. Called on both sides. This damages the tool n stuff. - player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player); - - // server sided handling - if (!world.isRemote) { - // serverside we reproduce ItemInWorldManager.tryHarvestBlock - - // ItemInWorldManager.removeBlock - block.onBlockHarvested(world, x, y, z, meta, player); - - if (block.removedByPlayer(world, player, x, y, z, true)) // boolean is if block can be harvested, checked - // above - { - block.onBlockDestroyedByPlayer(world, x, y, z, meta); - block.harvestBlock(world, player, x, y, z, meta); - block.dropXpOnBlockBreak(world, x, y, z, event.getExpToDrop()); - } - - // always send block update to client - player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world)); - } - // client sided handling - else { - // PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController; - // clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send - // any new packets - // the code above, executed on the server, sends a block-updates that give us the correct state of the block - // we destroy. - - // following code can be found in PlayerControllerMP.onPlayerDestroyBlock - world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12)); - if (block.removedByPlayer(world, player, x, y, z, true)) { - block.onBlockDestroyedByPlayer(world, x, y, z, meta); - } - // callback to the tool - ItemStack itemstack = player.getCurrentEquippedItem(); - if (itemstack != null) { - itemstack.func_150999_a(world, block, x, y, z, player); - - if (itemstack.stackSize == 0) { - player.destroyCurrentEquippedItem(); - } - } - - // send an update to the server, so we get an update back - // if(PHConstruct.extraBlockUpdates) - // Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x,y,z, - // Minecraft.getMinecraft().objectMouseOver.sideHit)); - } - } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index cc4503e46e..b53daf4f31 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.common.items; +import static gregtech.api.enums.Textures.BlockIcons.*; import static gregtech.client.GT_TooltipHandler.Tier.*; import static gregtech.client.GT_TooltipHandler.registerTieredTooltip; import static gtPlusPlus.core.util.Utils.getTcAspectStack; @@ -16,6 +17,7 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GT_MultiTexture; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_FoodStat; import gregtech.api.util.GT_ModHandler; import gregtech.common.covers.GT_Cover_Arm; @@ -35,7 +37,6 @@ import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_Overflow; -import gtPlusPlus.xmod.gregtech.common.covers.GTPP_Cover_ToggleVisual; public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { @@ -386,31 +387,6 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { getTcAspectStack(TC_Aspects.POTENTIA, 8L) })); this.setElectricStats(32000 + tLastID, GT_Values.V[9] * 10 * 60 * 20, GT_Values.V[8], 8L, -3L, false); - String aTierName; - int aFirstMachineCasingID = 130; - GregtechItemList[] mMachineCasingCovers = new GregtechItemList[] { GregtechItemList.FakeMachineCasingPlate_ULV, - GregtechItemList.FakeMachineCasingPlate_LV, GregtechItemList.FakeMachineCasingPlate_MV, - GregtechItemList.FakeMachineCasingPlate_HV, GregtechItemList.FakeMachineCasingPlate_EV, - GregtechItemList.FakeMachineCasingPlate_IV, GregtechItemList.FakeMachineCasingPlate_LuV, - GregtechItemList.FakeMachineCasingPlate_ZPM, GregtechItemList.FakeMachineCasingPlate_UV, - GregtechItemList.FakeMachineCasingPlate_MAX, }; - for (int i = 0; i < 10; i++) { - if (i == 10) { - break; - } else { - aTierName = GT_Values.VN[i]; - mMachineCasingCovers[i].set( - this.addItem( - aFirstMachineCasingID++, - aTierName + " Machine Plate Cover", - "Deprecated - Shapeless Craft to new version", - new Object[] {})); - GregTech_API.registerCover( - mMachineCasingCovers[i].get(1L), - new GT_MultiTexture(new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[i][0] }), - new GTPP_Cover_ToggleVisual()); - } - } GregtechItemList.Laser_Lens_WoodsGlass.set( this.addItem( 140, @@ -513,19 +489,19 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[5][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), - new GT_Cover_Pump(8)); + new GT_Cover_Pump(8, TextureFactory.of(OVERLAY_PUMP))); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_ULV.get(1L), new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), - new GT_Cover_Conveyor(1600)); + new GT_Cover_Conveyor(1600, 1, TextureFactory.of(OVERLAY_CONVEYOR))); GregTech_API.registerCover( GregtechItemList.Robot_Arm_ULV.get(1L), new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[1][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), - new GT_Cover_Arm(1600)); + new GT_Cover_Arm(1600, TextureFactory.of(OVERLAY_ARM))); return true; } @@ -595,19 +571,19 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[8][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PUMP) }), - new GT_Cover_Pump(524288)); + new GT_Cover_Pump(524288, TextureFactory.of(OVERLAY_PUMP))); GregTech_API.registerCover( GregtechItemList.Conveyor_Module_MAX.get(1L), new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_CONVEYOR) }), - new GT_Cover_Conveyor(4)); + new GT_Cover_Conveyor(4, 1, TextureFactory.of(OVERLAY_CONVEYOR))); GregTech_API.registerCover( GregtechItemList.Robot_Arm_MAX.get(1L), new GT_MultiTexture( new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[4][0], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_ARM) }), - new GT_Cover_Arm(4)); + new GT_Cover_Arm(4, TextureFactory.of(OVERLAY_ARM))); return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java index a5d09bcbd9..db3638a4e0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Electric_Lighter.java @@ -12,7 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import codechicken.lib.math.MathHelper; -import gregtech.api.GregTech_API; +import gregtech.api.enums.SoundResource; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Utility; @@ -46,7 +46,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { GT_Utility.sendSoundToPlayers( aPlayer.worldObj, - (String) GregTech_API.sSoundList.get(6), + SoundResource.FIRE_IGNITE, 1.0F, 1.0F, MathHelper.floor_double(aEntity.posX), @@ -102,14 +102,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { Logger.WARNING("Preparing Lighter b"); if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); - GT_Utility.sendSoundToPlayers( - aWorld, - (String) GregTech_API.sSoundList.get(6), - 1.0F, - 1.0F, - aX, - aY, - aZ); + GT_Utility.sendSoundToPlayers(aWorld, SoundResource.FIRE_IGNITE, 1.0F, 1.0F, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, Blocks.fire); rOutput = true; // ItemNBT.setLighterFuel(aStack, tFuelAmount); @@ -162,14 +155,7 @@ public class Behaviour_Electric_Lighter extends Behaviour_None { Logger.WARNING("Preparing Lighter b"); if (this.prepare(aStack) || aPlayer.capabilities.isCreativeMode) { Logger.WARNING("Preparing Lighter c"); - GT_Utility.sendSoundToPlayers( - aWorld, - (String) GregTech_API.sSoundList.get(6), - 1.0F, - 1.0F, - aX, - aY, - aZ); + GT_Utility.sendSoundToPlayers(aWorld, SoundResource.FIRE_IGNITE, 1.0F, 1.0F, aX, aY, aZ); aWorld.setBlock(aX, aY, aZ, Blocks.fire); rOutput = true; // ItemNBT.setLighterFuel(aStack, tFuelAmount); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java index 78f77a7b33..7fd7de322c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/behaviours/Behaviour_Prospecting_Ex.java @@ -13,6 +13,7 @@ import net.minecraftforge.fluids.IFluidBlock; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.objects.ItemData; @@ -52,14 +53,7 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { GT_Utility.sendChatToPlayer( aPlayer, "This is " + tAssotiation.mMaterial.mMaterial.mDefaultLocalName + " Ore."); - GT_Utility.sendSoundToPlayers( - aWorld, - GregTech_API.sSoundList.get(Integer.valueOf(1)), - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); return true; } if ((aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.stone)) @@ -69,14 +63,7 @@ public class Behaviour_Prospecting_Ex extends Behaviour_Prospecting { || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.dirt)) || (aBlock.isReplaceableOreGen(aWorld, aX, aY, aZ, Blocks.grass))) { if (GT_ModHandler.damageOrDechargeItem(aStack, this.mVanillaCosts, this.mEUCosts, aPlayer)) { - GT_Utility.sendSoundToPlayers( - aWorld, - GregTech_API.sSoundList.get(Integer.valueOf(1)), - 1.0F, - -1.0F, - aX, - aY, - aZ); + GT_Utility.sendSoundToPlayers(aWorld, SoundResource.RANDOM_ANVIL_USE, 1.0F, -1.0F, aX, aY, aZ); int tX = aX; int tY = aY; int tZ = aZ; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java index df83976033..ae3a40cff9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/GTPP_CapeRenderer.java @@ -7,14 +7,12 @@ import java.io.InputStream; import java.net.URL; import java.util.Date; import java.util.List; -import java.util.UUID; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; import net.minecraft.potion.Potion; -import net.minecraft.server.MinecraftServer; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; @@ -22,8 +20,6 @@ import net.minecraftforge.client.event.RenderPlayerEvent; import org.apache.commons.io.IOUtils; import org.lwjgl.opengl.GL11; -import com.mojang.authlib.GameProfile; - import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -233,56 +229,6 @@ public class GTPP_CapeRenderer extends RenderPlayer { return false; } - @SuppressWarnings("unused") - @Deprecated - /** - * Should be able to get the username from a UUID - * - * @param name - Players Name - * @param uuid - Players known UUID - * @return - The newest Player name - */ - private String getPlayerName(String name, String uuid) { - try { - Logger.WORLD("[Capes++] Trying to UUID check " + name + "."); - if (uuid != null) { - if (uuid.length() > 0) { - UUID g = UUID.fromString(uuid); - if (g != null) { - Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g); - if (profile != null) { - Logger.WARNING("[Capes++] Found for UUID check: " + profile.getName() + "."); - return profile.getName(); - } - } else { - g = UUID.fromString(uuid.replace("-", "")); - if (g != null) { - Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152652_a(g); - if (profile != null) { - Logger.WARNING("[Capes++] Found for UUID check 2: " + profile.getName() + "."); - return profile.getName(); - } - } - } - } - } - if (name != null) { - if (name.length() > 0) { - Logger.WORLD("[Capes++] Mojang/Cache checking for " + name + "."); - GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(name); - if (profile != null) { - Logger.WARNING("[Capes++] Found for name check: " + profile.getName() + "."); - return profile.getName(); - } - } - } - Logger.WORLD("[Capes++] Failed UUID check for " + name + "."); - } catch (Throwable t) {} - return name; - } - private static class CapeUtils { private static char SPLIT_CHARACTER = '§'; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java index e1c591f33b..8c7ca4c9e1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java @@ -55,7 +55,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; } - public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 30, aDescription, aTextures); } @@ -148,7 +148,11 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ElectricAutoWorkbench(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_ElectricAutoWorkbench( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -214,7 +218,7 @@ public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_B for (byte i = 19; i < 28; i++) { if (mInventory[i] != null && mInventory[i].isItemStackDamageable() - && mInventory[i].getItem().hasContainerItem()) { + && mInventory[i].getItem().hasContainerItem(mInventory[i])) { mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java index e797810ab8..2c9a50dfa5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java @@ -16,6 +16,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; @@ -61,7 +63,7 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; } - public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 16, aDescription, aTextures); } @@ -167,7 +169,7 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit return new GT_MetaTileEntity_ElectricInventoryManager( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures); } @@ -437,7 +439,8 @@ public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntit @Override public String[] getDescription() { - return new String[] { "It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils + .addAll(this.mDescriptionArray, "It's simpler than you think. I promise.", CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java index af20b51c20..2427cb12ae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java @@ -19,6 +19,8 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IDigitalChest; @@ -50,14 +52,14 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi super(aID, aName, aNameRegional, aTier, 3, ""); } - public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TesseractGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_TesseractGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -620,11 +622,13 @@ public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[] { this.mDescription, "Generates a Tesseract for the attached Inventory", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Generates a Tesseract for the attached Inventory", "Connect with pipes to insert items", "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip.get() }; + CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java index 0ecee3b45d..18314c059f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java @@ -12,6 +12,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -39,14 +41,14 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic super(aID, aName, aNameRegional, aTier, 3, ""); } - public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_TesseractTerminal(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TesseractTerminal(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_TesseractTerminal(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -484,11 +486,14 @@ public class GT_MetaTileEntity_TesseractTerminal extends GT_MetaTileEntity_Basic @Override public String[] getDescription() { - return new String[] { this.mDescription, "Accesses Tesseract Generators remotely", - "Connect with pipes to extract items or fluids", "Outputs from the back face", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Accesses Tesseract Generators remotely", + "Connect with pipes to extract items or fluids", + "Outputs from the back face", "Consumes " + TESSERACT_ENERGY_COST + "EU/t for same dimension transfers", "Consumes " + TESSERACT_ENERGY_COST_DIMENSIONAL + "EU/t for cross dimensional transfers", - CORE.GT_Tooltip.get() }; + CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java index 7d58df65b2..402065f7a9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Base.java @@ -5,6 +5,8 @@ import net.minecraft.tileentity.TileEntityFurnace; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidTankInfo; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.drawable.UITexture; @@ -39,7 +41,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { this.tier = tier; } - public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_Base(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.steamPerSecond = (CORE.ConfigSwitches.boilerSteamPerSecond * aTier); this.tier = aTier; @@ -47,10 +49,13 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + getPollution() + " pollution/sec", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Produces " + getPollution() + " pollution/sec", "Consumes fuel only when temperature is less than 100C", - "Fuel with burn time greater than 500 is more efficient.", "Doesn't explode if there's no water", - CORE.GT_Tooltip.get() }; + "Fuel with burn time greater than 500 is more efficient.", + "Doesn't explode if there's no water", + CORE.GT_Tooltip.get()); } public ITexture getOverlayIcon() { @@ -246,7 +251,7 @@ public class GT_MetaTileEntity_Boiler_Base extends GT_MetaTileEntity_Boiler { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Base(this.mName, tier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Boiler_Base(this.mName, tier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java index d2a924009f..da6ef21dd3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_HV.java @@ -13,13 +13,13 @@ public class GT_MetaTileEntity_Boiler_HV extends GT_MetaTileEntity_Boiler_Base { super(aID, aNameRegional, aBoilerTier); } - public GT_MetaTileEntity_Boiler_HV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_HV(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_HV(this.mName, 3, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Boiler_HV(this.mName, 3, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java index 98dd73a13c..13d3e6ae87 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_LV.java @@ -13,13 +13,13 @@ public class GT_MetaTileEntity_Boiler_LV extends GT_MetaTileEntity_Boiler_Base { super(aID, aNameRegional, aBoilerTier); } - public GT_MetaTileEntity_Boiler_LV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_LV(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_LV(this.mName, 1, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Boiler_LV(this.mName, 1, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java index cb2a5fbbd8..b8214b0bbd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_MV.java @@ -13,13 +13,13 @@ public class GT_MetaTileEntity_Boiler_MV extends GT_MetaTileEntity_Boiler_Base { super(aID, aNameRegional, aBoilerTier); } - public GT_MetaTileEntity_Boiler_MV(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_Boiler_MV(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_MV(this.mName, 2, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_Boiler_MV(this.mName, 2, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java index 9410486dff..030f000710 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_SemiFluidGenerator.java @@ -3,6 +3,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -25,17 +27,12 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi public int mEfficiency; - /* - * public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, - * aName, aNameRegional, aTier); onConfigLoad(); } - */ - public GT_MetaTileEntity_SemiFluidGenerator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, "Requires semi-fluid Fuel", new ITexture[0]); onConfigLoad(); } - public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String aDescription, + public GT_MetaTileEntity_SemiFluidGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); onConfigLoad(); @@ -61,7 +58,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_SemiFluidGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -72,8 +69,11 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi @Override public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + (this.getPollution()) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Produces " + (this.getPollution()) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", + CORE.GT_Tooltip.get()); } @Override @@ -100,7 +100,7 @@ public class GT_MetaTileEntity_SemiFluidGenerator extends GT_MetaTileEntity_Basi Logger.WARNING("Bad Fuel?"); return 0; } - int rValue = Math.max(GT_ModHandler.getFuelCanValue(aStack) * 6 / 5, super.getFuelValue(aStack)); + int rValue = Math.max(GT_ModHandler.getFuelValue(aStack) * 6 / 5, super.getFuelValue(aStack)); if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java index 50f25951be..601dddb651 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java @@ -4,6 +4,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; @@ -30,7 +32,7 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity this.onConfigLoad(); } - public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String aDescription, + public GregtechMetaTileEntityGeothermalGenerator(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); @@ -39,8 +41,11 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public String[] getDescription() { String aPollution = "Causes " + this.getPollution() + " Pollution per second"; - return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - aPollution, CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + aPollution, + CORE.GT_Tooltip.get()); } @Override @@ -69,7 +74,7 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public int getFuelValue(final ItemStack aStack) { - int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack)); + int rValue = Math.max((GT_ModHandler.getFuelValue(aStack) * 6) / 5, super.getFuelValue(aStack)); if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); } @@ -83,7 +88,11 @@ public class GregtechMetaTileEntityGeothermalGenerator extends GT_MetaTileEntity @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntityGeothermalGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaTileEntityGeothermalGenerator( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java index 25ec3468f8..53f009b430 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java @@ -28,7 +28,7 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue this.onConfigLoad(); } - public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String aDescription, + public GregtechMetaTileEntityRocketFuelGenerator(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); @@ -41,8 +41,11 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - // Logger.INFO("Valid Fuels: "+Recipe_GT.Gregtech_Recipe_Map.sRocketFuels.mRecipeList.size()); - return new GregtechMetaTileEntityRocketFuelGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaTileEntityRocketFuelGenerator( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -70,7 +73,7 @@ public class GregtechMetaTileEntityRocketFuelGenerator extends GregtechRocketFue @Override public int getFuelValue(final ItemStack aStack) { - int rValue = Math.max((GT_ModHandler.getFuelCanValue(aStack) * 6) / 5, super.getFuelValue(aStack)); + int rValue = Math.max((GT_ModHandler.getFuelValue(aStack) * 6) / 5, super.getFuelValue(aStack)); if (ItemList.Fuel_Can_Plastic_Filled.isStackEqual(aStack, false, true)) { rValue = Math.max(rValue, GameRegistry.getFuelValue(aStack) * 3); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java index 8dbcc09789..440fb72789 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java @@ -4,6 +4,8 @@ import static gregtech.api.enums.GT_Values.V; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ProgressBar; @@ -30,7 +32,7 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener this.onConfigLoad(); } - public GregtechMetaTileEntitySolarGenerator(final String aName, final int aTier, final String aDescription, + public GregtechMetaTileEntitySolarGenerator(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); this.onConfigLoad(); @@ -38,8 +40,11 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener @Override public String[] getDescription() { - return new String[] { this.mDescription, "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Generates power at " + this.getEfficiency() + "% Efficiency per tick", + "Output Voltage: " + this.getOutputTier() + " EU/t", + CORE.GT_Tooltip.get()); } @Override @@ -49,7 +54,7 @@ public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGener @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } public void onConfigLoad() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java index 9bc980b45e..51d7b4d186 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntity_RTG.java @@ -7,6 +7,8 @@ import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -173,10 +175,13 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public String[] getDescription() { - return new String[] { this.mDescription, "Fuel is measured in minecraft days (Check with Scanner)", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Fuel is measured in minecraft days (Check with Scanner)", "RTG changes output voltage depending on fuel", "Generates power at " + this.getEfficiency() + "% Efficiency per tick", - "Output Voltage: " + this.getOutputTier() + " EU/t", CORE.GT_Tooltip.get() }; + "Output Voltage: " + this.getOutputTier() + " EU/t", + CORE.GT_Tooltip.get()); } public GregtechMetaTileEntity_RTG(int aID, String aName, String aNameRegional, int aTier) { @@ -197,7 +202,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator return 0; } - public GregtechMetaTileEntity_RTG(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GregtechMetaTileEntity_RTG(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -209,7 +214,7 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_RTG(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaTileEntity_RTG(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -329,7 +334,6 @@ public class GregtechMetaTileEntity_RTG extends GT_MetaTileEntity_BasicGenerator } ReflectionUtils.setByte(this, "mTier", mTier2); this.mNewTier = mTier2; - // ReflectionUtils.setFinalStatic(mTier2, GT_Values.V[0]); } catch (Exception e) { Logger.WARNING("Failed setting mTier."); e.printStackTrace(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java index 67e00342dd..8696c97ee6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_CombustionGenerator.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; import static gregtech.api.enums.GT_Values.V; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.ITexture; @@ -16,15 +18,18 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String aDescription, + public GT_MetaTileEntity_ULV_CombustionGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", + CORE.GT_Tooltip.get()); } @Override @@ -34,7 +39,11 @@ public class GT_MetaTileEntity_ULV_CombustionGenerator extends GT_MetaTileEntity @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ULV_CombustionGenerator(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_ULV_CombustionGenerator( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java index 3de1f0c1f8..e0d13325e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/ULV/GT_MetaTileEntity_ULV_GasTurbine.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.generators.ULV; import static gregtech.api.enums.GT_Values.V; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories; import gregtech.api.interfaces.IIconContainer; @@ -15,18 +17,23 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbine { + private static final int EFFICIENCY_DEFAULT = 95; + public GT_MetaTileEntity_ULV_GasTurbine(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier); + super(aID, aName, aNameRegional, aTier, EFFICIENCY_DEFAULT); } - public GT_MetaTileEntity_ULV_GasTurbine(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, aDescription, aTextures); + public GT_MetaTileEntity_ULV_GasTurbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures, EFFICIENCY_DEFAULT); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "Produces " + (this.getPollution() * 20) + " pollution/sec", - "Fuel Efficiency: " + this.getEfficiency() + "%", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "Produces " + (this.getPollution() * 20) + " pollution/sec", + "Fuel Efficiency: " + this.getEfficiency() + "%", + CORE.GT_Tooltip.get()); } @Override @@ -36,7 +43,7 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_ULV_GasTurbine(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -47,7 +54,7 @@ public class GT_MetaTileEntity_ULV_GasTurbine extends GT_MetaTileEntity_GasTurbi @Override public void onConfigLoad() { this.mEfficiency = GregTech_API.sMachineFile - .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, 95); + .get(ConfigCategories.machineconfig, "GasTurbine.efficiency.tier." + this.mTier, EFFICIENCY_DEFAULT); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java index 9dc531edd9..db107fa5cd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -13,6 +13,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizon.gtnhlib.util.map.ItemStackMap; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -62,7 +64,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank aDescription); } - public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 21, aDescription, aTextures); } @@ -140,7 +142,7 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_CropHarvestor(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_CropHarvestor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override @@ -508,13 +510,16 @@ public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank public String[] getDescription() { int aRadius = 10 + getRange(this.mTier); int aSide = (aRadius - 1) / 2; - return new String[] { this.mDescription, "Secondary mode can Hydrate/Fertilize/Weed-EX", + return ArrayUtils.addAll( + this.mDescriptionArray, + "Secondary mode can Hydrate/Fertilize/Weed-EX", "Consumes " + powerUsage() + "eu per harvest", "Consumes " + powerUsageSecondary() + "eu per secondary operation", "Can harvest 2 blocks above and below", "Radius: " + aSide + " each side (" + aRadius + "x3x" + aRadius + ")", - "Has " + (this.mTier * 5) + "% chance for extra drops", "Holds " + this.getCapacity() + "L of Water", - CORE.GT_Tooltip.get() }; + "Has " + (this.mTier * 5) + "% chance for extra drops", + "Holds " + this.getCapacity() + "L of Water", + CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java deleted file mode 100644 index 9a26ea57ec..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_WorldAccelerator.java +++ /dev/null @@ -1,311 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.enums.Mods.GregTech; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.Textures; -import gregtech.api.enums.Textures.BlockIcons.CustomIcon; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; -import gregtech.api.objects.GT_RenderedTexture; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.PlayerUtils; - -public class GT_MetaTileEntity_WorldAccelerator extends GT_MetaTileEntity_TieredMachineBlock { - - public static String[] BlacklistedTileEntiyClassNames; - - private byte mMode = 0; // 0: RandomTicks around 1: TileEntities with range - // 1 - private static CustomIcon _mGTIco_Norm_Idle; - private static CustomIcon _mGTIco_Norm_Active; - private static CustomIcon _mGTIco_TE_Idle; - private static CustomIcon _mGTIco_TE_Active; - private static int[] mAccelerateStatic = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512, 512, 512, 512 }; - - @Override - public void registerIcons(IIconRegister aBlockIconRegister) { - super.registerIcons(aBlockIconRegister); - _mGTIco_Norm_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR"); - _mGTIco_Norm_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_ACTIVE"); - _mGTIco_TE_Idle = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE"); - _mGTIco_TE_Active = new CustomIcon("iconsets/OVERLAY_ACCELERATOR_TE_ACTIVE"); - } - - @SideOnly(Side.CLIENT) - @Override - public void onValueUpdate(byte aValue) { - mMode = aValue; - } - - @Override - public byte getUpdateData() { - return mMode; - } - - public GT_MetaTileEntity_WorldAccelerator(int pID, String pName, String pNameRegional, int pTier) { - super(pID, pName, pNameRegional, pTier, 0, ""); - } - - @Override - public String[] getDescription() { - return new String[] { - String.format( - "Accelerating things (Radius: %d EU/t: %d Speed Bonus: x%d)", - mTier, - getEnergyDemand(mTier, false), - mAccelerateStatic[mTier]), - "Use a screwdriver to change mode", "To accelerate TileEntities, this machine has to be adjacent to it", - "This machine accepts up to 8 Amps", "Accelerating TileEntities doubles Energy-Demand" }; - } - - public GT_MetaTileEntity_WorldAccelerator(String pName, int pTier, int pInvSlotCount, String pDescription, - ITexture[][][] pTextures) { - super(pName, pTier, pInvSlotCount, pDescription, pTextures); - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity pTileEntity) { - return new GT_MetaTileEntity_WorldAccelerator(mName, mTier, mInventory.length, mDescription, mTextures); - } - - @Override - public ITexture[][][] getTextureSet(ITexture[] pTextures) { - return new ITexture[0][0][0]; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity pBaseMetaTileEntity, ForgeDirection side, ForgeDirection sacing, - int pColorIndex, boolean pActive, boolean pRedstone) { - if (mMode == 0) return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], - (side.offsetY != 0) ? null - : pActive ? new GT_RenderedTexture(_mGTIco_Norm_Active) - : new GT_RenderedTexture(_mGTIco_Norm_Idle) }; - else return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][pColorIndex + 1], (side.offsetY != 0) - ? null - : pActive ? new GT_RenderedTexture(_mGTIco_TE_Active) : new GT_RenderedTexture(_mGTIco_TE_Idle) }; - } - - @Override - public boolean allowPullStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, ForgeDirection side, - ItemStack pStack) { - return false; - } - - @Override - public boolean allowPutStack(IGregTechTileEntity pBaseMetaTileEntity, int pIndex, ForgeDirection side, - ItemStack pStack) { - return false; - } - - @Override - public void saveNBTData(NBTTagCompound pNBT) { - pNBT.setByte("mAccelMode", mMode); - } - - public static long getEnergyDemand(int pTier, boolean pIsAcceleratingTEs) { - return V[pTier] * (pIsAcceleratingTEs ? 6 : 3); - } - - @Override - public void loadNBTData(NBTTagCompound pNBT) { - mMode = pNBT.getByte("mAccelMode"); - } - - @Override - public boolean isAccessAllowed(EntityPlayer pPlayer) { - return true; - } - - @Override - public boolean isSimpleMachine() { - return false; - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isInputFacing(ForgeDirection side) { - return true; - } - - @Override - public boolean isTeleporterCompatible() { - return false; - } - - @Override - public long getMinimumStoredEU() { - return 512; - } - - @Override - public long maxEUStore() { - return 512 + V[mTier] * 50; - } - - @Override - public long maxEUInput() { - return V[mTier]; - } - - @Override - public long maxAmperesIn() { - return 8; - } - - private static String[] mModeStr = { "Blocks", "TileEntities" }; - - @Override - public void onScrewdriverRightClick(ForgeDirection pSide, EntityPlayer pPlayer, float pX, float pY, float pZ) { - mMode = (byte) (mMode == 0x00 ? 0x01 : 0x00); - markDirty(); - PlayerUtils.messagePlayer(pPlayer, String.format("Switched mode to: %s", mModeStr[mMode])); - } - - @Override - public void onPostTick(IGregTechTileEntity pBaseMetaTileEntity, long pTick) { - try { - if (!pBaseMetaTileEntity.isServerSide()) return; - - long tEnergyDemand = getEnergyDemand(mTier, (mMode == 1)); - - // Do we have enough energy to run? Or are we not allowed to run? - if (pBaseMetaTileEntity.getStoredEU() < tEnergyDemand || !pBaseMetaTileEntity.isAllowedToWork()) { - // Check if machine was active before - if (pBaseMetaTileEntity.isActive()) pBaseMetaTileEntity.setActive(false); // Then disable it now - } else { - // Continue to drain power - if (pBaseMetaTileEntity.decreaseStoredEnergyUnits(tEnergyDemand, false)) { - World tWorld = pBaseMetaTileEntity.getWorld(); - // Limit the random ticks to once per second - if (mMode == 0) { - if (pTick % 20 == 0) doAccelerateNormalBlocks(pBaseMetaTileEntity, tWorld); - } else doAccelerateTileEntities(pBaseMetaTileEntity, tWorld); - - } else { - // Energy drain failed. Disable machine - if (pBaseMetaTileEntity.isActive()) pBaseMetaTileEntity.setActive(false); - } - } - } catch (Exception e) { - Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.onPostTick.crash"); - Logger.ERROR(e.getMessage()); - } - } - - private void doAccelerateTileEntities(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) { - try { - if (!pBaseMetaTileEntity.isActive()) getBaseMetaTileEntity().setActive(true); - - for (ForgeDirection tDir : ForgeDirection.VALID_DIRECTIONS) { - TileEntity tTile = pBaseMetaTileEntity.getTileEntityAtSide(tDir); - if (isTEBlackListed(tTile)) continue; - - long tMaxTime = System.nanoTime() + 1000000; - for (int j = 0; j < mAccelerateStatic[mTier]; j++) { - tTile.updateEntity(); - if (System.nanoTime() > tMaxTime) break; - } - } - } catch (Exception e) { - Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.doAccelerateTileEntities.crash"); - Logger.ERROR(e.getMessage()); - } - } - - private static List _mBlacklistedTileEntities = new ArrayList(); - - // Inspired by ChromatiCraft's TileAccelerator - private boolean isTEBlackListed(TileEntity pTile) { - if (pTile == null) return true; // Obvious - if (!pTile.canUpdate()) return true; // Skip if TE can't update at all - if (pTile.isInvalid()) return true; // Obvious - - String tSimpleClassName = pTile.getClass().getSimpleName().toLowerCase(); - String tCanonicalName = pTile.getClass().getCanonicalName().toLowerCase(); - if (tSimpleClassName.contains("conduit") || tSimpleClassName.contains("wire") - || tSimpleClassName.contains("cable")) - return true; - if (tCanonicalName.contains("appeng") || tCanonicalName.contains(GregTech.ID)) - // Don't accelerate ANY Gregtech machines! - return true; - for (String tS : BlacklistedTileEntiyClassNames) { - if (tCanonicalName.equalsIgnoreCase(tS)) return true; - } - - return false; - } - - /** - * Accelerate normal blocks. Eats some power and adds randomTicks to every block within its working area - * (Tier-Number = radius) This does only affect blocks that implement the "RandomTick" method; Which is mostly used - * for grass growth and plants. - * - * @param pBaseMetaTileEntity - */ - private void doAccelerateNormalBlocks(IGregTechTileEntity pBaseMetaTileEntity, World pWorld) { - if (!pBaseMetaTileEntity.isActive()) getBaseMetaTileEntity().setActive(true); - - Random rnd = new Random(); - int tX = pBaseMetaTileEntity.getXCoord(); - int tY = pBaseMetaTileEntity.getYCoord(); - int tZ = pBaseMetaTileEntity.getZCoord(); - - int tX1 = tX - mTier; - int tX2 = tX + mTier; - int tY1 = Math.max(tY - mTier, 0); // Limit to bedrock - int tY2 = Math.min(tY + mTier, 255); // Limit to build height - int tZ1 = tZ - mTier; - int tZ2 = tZ + mTier; - - for (int xi = tX1; xi <= tX2; xi++) for (int yi = tY1; yi <= tY2; yi++) - for (int zi = tZ1; zi <= tZ2; zi++) tryTickBlock(pWorld, xi, yi, zi, rnd); - } - - /** - * Send a tick to the target block - * - * @param pWorld - * @param pX - * @param pY - * @param pZ - * @param pRnd - */ - private void tryTickBlock(World pWorld, int pX, int pY, int pZ, Random pRnd) { - try { - for (int j = 0; j < mTier; j++) { - Block tBlock = pWorld.getBlock(pX, pY, pZ); - if (tBlock.getTickRandomly()) tBlock.updateTick(pWorld, pX, pY, pZ, pRnd); - } - } catch (Exception e) { - Logger.ERROR("GT_MetaTileEntity_WorldAccelerator.tryTickBlock.crash"); - Logger.ERROR(e.getMessage()); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java index 0e8106dd2a..2e95830a41 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaAtmosphericReconditioner.java @@ -20,8 +20,8 @@ import com.gtnewhorizons.modularui.common.widget.DrawableWidget; import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures; import gregtech.api.gui.modularui.GT_UITextures; import gregtech.api.interfaces.ITexture; @@ -89,8 +89,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } - public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - String aGUIName, String aNEIName) { + public GregtechMetaAtmosphericReconditioner(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 2, aDescription, aTextures, 2, 0, aGUIName, aNEIName); mPollutionEnabled = PollutionUtils.isPollutionEnabled(); } @@ -106,7 +106,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi return new GregtechMetaAtmosphericReconditioner( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); @@ -117,7 +117,8 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi boolean highTier = this.mTier >= 7; - String[] A = new String[] { this.mDescription, + String[] A = ArrayUtils.addAll( + this.mDescriptionArray, highTier ? "Will attempt to remove 1/4 pollution from 8 surrounding chunks" : "", highTier ? "If these chunks are not loaded, they will be ignored" : "", "Requires a turbine rotor and an Air Filter [T1/T2] to run.", @@ -126,7 +127,7 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi "Low Efficiency: Removes half pollution, Turbine takes 50% dmg", "High Efficiency: Removes full pollution, Turbine takes 100% dmg", "Turbine Rotor will not break in LE mode", - "Insert an equal tier Conveyor Module to enable automation" }; + "Insert an equal tier Conveyor Module to enable automation"); if (!mPollutionEnabled) { String[] B = new String[] { "===============================================", "Pollution is disabled, scrubbers will now have a bonus use", @@ -781,20 +782,9 @@ public class GregtechMetaAtmosphericReconditioner extends GT_MetaTileEntity_Basi @Override public void doSound(byte aIndex, double aX, double aY, double aZ) { if (aIndex == -120) { - GT_Utility.doSoundAtClient( - (String) GregTech_API.sSoundList.get(Integer.valueOf(103)), - MathUtils.randInt(5, 50), - 0.05F, - aX, - aY, - aZ); - } else if (aIndex == -121 || aIndex == -122) { - // GT_Utility.doSoundAtClient((String) GregTech_API.sSoundList.get(Integer.valueOf(108)), 0, 0.5F, aX, aY, - // aZ); - } /* - * else if (aIndex == -122) { GT_Utility.doSoundAtClient((String) - * GregTech_API.sSoundList.get(Integer.valueOf(6)), 100, 1.0F, aX, aY, aZ); } - */ else { + GT_Utility + .doSoundAtClient(SoundResource.IC2_TOOLS_BATTERY_USE, MathUtils.randInt(5, 50), 0.05F, aX, aY, aZ); + } else { super.doSound((byte) 0, aX, aY, aZ); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java index 1ff0f8eef6..910c3120b3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaCondensor.java @@ -4,6 +4,8 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -31,15 +33,18 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd super(aID, aName, aNameRegional, "A Steam condenser - [IC2->Steam]", new ITexture[0]); } - public GregtechMetaCondensor(final String aName, final int aTier, final String aDescription, + public GregtechMetaCondensor(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "IC2 Steam + Water = Normal Steam.", - "Requires no power to run, although it's not very fast.", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + "IC2 Steam + Water = Normal Steam.", + "Requires no power to run, although it's not very fast.", + CORE.GT_Tooltip.get()); } @Override @@ -80,7 +85,7 @@ public class GregtechMetaCondensor extends GregtechMetaBoilerBase implements IAd @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GregtechMetaCondensor(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java index 84cef090fc..5412f0108e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java @@ -48,7 +48,7 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa new ITexture[] {}); } - public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + public GregtechMetaTileEntityChunkLoader(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 4, aDescription, aTextures, 0, 0, aGUIName, aNEIName); } @@ -190,7 +190,7 @@ public class GregtechMetaTileEntityChunkLoader extends GT_MetaTileEntity_BasicMa return new GregtechMetaTileEntityChunkLoader( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java index d14121e116..d0c63f5aad 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_AutoChisel.java @@ -5,6 +5,8 @@ import java.util.List; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.math.Pos2d; import com.gtnewhorizons.modularui.api.math.Size; @@ -53,7 +55,7 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa new GT_RenderedTexture(BlockIcons.OVERLAY_BOTTOM_MASSFAB) }); } - public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + public GregtechMetaTileEntity_AutoChisel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } @@ -63,7 +65,7 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa return new GregtechMetaTileEntity_AutoChisel( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); @@ -71,10 +73,11 @@ public class GregtechMetaTileEntity_AutoChisel extends GT_MetaTileEntity_BasicMa @Override public String[] getDescription() { - String[] A = new String[] { this.mDescription, "What you want to chisel goes in slot 1", + return ArrayUtils.addAll( + this.mDescriptionArray, + "What you want to chisel goes in slot 1", "What you want to get goes in the special slot (bottom right)", - "If special slot is empty, first chisel result is used" }; - return A; + "If special slot is empty, first chisel result is used"); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java index f97a831590..d75730b2a0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_BasicWasher.java @@ -4,6 +4,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -38,20 +40,15 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_ROCK_BREAKER) }); } - public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String aDescription, ITexture[][][] aTextures, + public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, aNEIName); } - /* - * public GregtechMetaTileEntity_BasicWasher(String aName, int aTier, String[] aDescription, ITexture[][][] - * aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName, - * aNEIName); } - */ - @Override public String[] getDescription() { - return new String[] { this.mDescription, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip.get() }; + return ArrayUtils + .addAll(this.mDescriptionArray, "Grants no byproducts, but it is fast.", CORE.GT_Tooltip.get()); } @Override @@ -59,7 +56,7 @@ public class GregtechMetaTileEntity_BasicWasher extends GT_MetaTileEntity_BasicM return new GregtechMetaTileEntity_BasicWasher( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java index b5bbc86b7e..b6911e29f7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorColdTrap.java @@ -4,6 +4,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -38,14 +40,14 @@ public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_Ba new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_COLDTRAP_TOP) }); } - public GregtechMetaTileEntity_ReactorColdTrap(String aName, int aTier, String aDescription, + public GregtechMetaTileEntity_ReactorColdTrap(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "Does not require ice cubes", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll(this.mDescriptionArray, "Does not require ice cubes", CORE.GT_Tooltip.get()); } @Override @@ -53,7 +55,7 @@ public class GregtechMetaTileEntity_ReactorColdTrap extends GT_MetaTileEntity_Ba return new GregtechMetaTileEntity_ReactorColdTrap( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java index 22f449b0c2..c3303bf2db 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ReactorProcessingUnit.java @@ -4,6 +4,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -38,14 +40,14 @@ public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEnt new GT_RenderedTexture(TexturesGtBlock.OVERLAY_REACTOR_PROCESSINGUNIT_TOP) }); } - public GregtechMetaTileEntity_ReactorProcessingUnit(String aName, int aTier, String aDescription, + public GregtechMetaTileEntity_ReactorProcessingUnit(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, String aGUIName, String aNEIName) { super(aName, aTier, 1, aDescription, aTextures, 2, 9, aGUIName, aNEIName); } @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } @Override @@ -53,7 +55,7 @@ public class GregtechMetaTileEntity_ReactorProcessingUnit extends GT_MetaTileEnt return new GregtechMetaTileEntity_ReactorProcessingUnit( this.mName, this.mTier, - this.mDescription, + this.mDescriptionArray, this.mTextures, this.mGUIName, this.mNEIName); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index e705d0a156..c8e947fbb5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -96,9 +96,9 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase= UHV using MAX tier components.").addSeparator() - .addController("Bottom Center").addCasingInfo("Sub-Station External Casings", 10) + .addController("Bottom Center").addCasingInfoMin("Sub-Station External Casings", 10, false) .addDynamoHatch("Any Casing", 1).addEnergyHatch("Any Casing", 1) .addSubChannelUsage("capacitor", "Vanadium Capacitor Cell Tier") .addSubChannelUsage("height", "Height of structure").toolTipFinisher(CORE.GT_Tooltip_Builder.get()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java index 0a3736bee4..720fcbffff 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; @@ -29,14 +31,14 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); } - public TileEntitySolarHeater(final String aName, final int aTier, final String aDescription, + public TileEntitySolarHeater(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, "Point me at a Solar Tower", CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll(this.mDescriptionArray, "Point me at a Solar Tower", CORE.GT_Tooltip.get()); } @Override @@ -115,7 +117,7 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new TileEntitySolarHeater(this.mName, this.mTier, this.mDescription, this.mTextures, 0); + return new TileEntitySolarHeater(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, 0); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java index 3a070ec781..5b103191f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; @@ -25,11 +27,6 @@ public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_T super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String aDescription, - ITexture[][][] aTextures) { - super(aName, aTier, aInvSlotCount, aDescription, aTextures); - } - public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); @@ -109,6 +106,6 @@ public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_T @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java index f76154b1c6..2b3ec158d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java @@ -34,14 +34,14 @@ public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_Red "Right-click with Screwdriver to change Button Design"); } - public GT_MetaTileEntity_RedstoneButtonPanel(final String aName, String aDescription, + public GT_MetaTileEntity_RedstoneButtonPanel(final String aName, String[] aDescription, final ITexture[][][] aTextures) { super(aName, 5, 0, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RedstoneButtonPanel(this.mName, mDescription, this.mTextures); + return new GT_MetaTileEntity_RedstoneButtonPanel(this.mName, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java index 933e7f1b75..8fa38ac694 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java @@ -40,6 +40,7 @@ import gregtech.api.util.GT_CircuitryBehavior; import gregtech.api.util.GT_CoverBehavior; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; +import gregtech.api.util.ISerializableObject; import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -53,14 +54,14 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone"); } - public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String aDescription, + public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String[] aDescription, final ITexture[][][] aTextures) { super(aName, 1, 5, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescription, this.mTextures); + return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescriptionArray, this.mTextures); } @Override @@ -395,7 +396,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re @Override public GT_CoverBehavior getCover(ForgeDirection side) { - return getBaseMetaTileEntity().getCoverBehaviorAtSide(side); + return (GT_CoverBehavior) getBaseMetaTileEntity().getCoverBehaviorAtSideNew(side); } @Override @@ -405,7 +406,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re @Override public int getCoverVariable(ForgeDirection side) { - return getBaseMetaTileEntity().getCoverDataAtSide(side); + return ((ISerializableObject.LegacyCoverData) getBaseMetaTileEntity().getComplexCoverDataAtSide(side)).get(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java index 1180ffe6b9..5a97a6da90 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java @@ -24,13 +24,13 @@ public class GT_MetaTileEntity_RedstoneLamp extends GT_MetaTileEntity_RedstoneBa super(aID, "redstone.lamp", "Redstone Controlled Lamp", 0, 0, "Redstone Controlled Lamp"); } - public GT_MetaTileEntity_RedstoneLamp(final String aName, String aDescription, final ITexture[][][] aTextures) { + public GT_MetaTileEntity_RedstoneLamp(final String aName, String[] aDescription, final ITexture[][][] aTextures) { super(aName, 0, 0, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RedstoneLamp(this.mName, mDescription, this.mTextures); + return new GT_MetaTileEntity_RedstoneLamp(this.mName, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java index 681cc9278f..c69ccf9181 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java @@ -27,14 +27,14 @@ public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity super(aID, aUnlocal, aLocal, 5, 0, aDescription); } - public GT_MetaTileEntity_RedstoneStrengthDisplay(final String aName, String aDescription, + public GT_MetaTileEntity_RedstoneStrengthDisplay(final String aName, String[] aDescription, final ITexture[][][] aTextures) { super(aName, 5, 0, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RedstoneStrengthDisplay(this.mName, mDescription, this.mTextures); + return new GT_MetaTileEntity_RedstoneStrengthDisplay(this.mName, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java index 00c2d9cc9a..bf794650ec 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java @@ -25,14 +25,14 @@ public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_R super(aID, "redstone.display.scale", "Redstone Scale", "Redstone Strength on a Scale"); } - public GT_MetaTileEntity_RedstoneStrengthScale(final String aName, String aDescription, + public GT_MetaTileEntity_RedstoneStrengthScale(final String aName, String[] aDescription, final ITexture[][][] aTextures) { super(aName, aDescription, aTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_RedstoneStrengthScale(this.mName, mDescription, this.mTextures); + return new GT_MetaTileEntity_RedstoneStrengthScale(this.mName, mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java index 6fba128833..5927f08ca9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java @@ -12,6 +12,8 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.PacketBuffer; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.drawable.IDrawable; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; @@ -54,7 +56,7 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B mLocalName = aNameRegional; } - public GT_MetaTileEntity_AdvancedCraftingTable(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_AdvancedCraftingTable(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, 35, aDescription, aTextures); } @@ -136,7 +138,11 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_AdvancedCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_AdvancedCraftingTable( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } @Override @@ -470,8 +476,11 @@ public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_B @Override public String[] getDescription() { - return new String[] { isAdvanced() ? "For the very large Projects" : "For the smaller Projects", - "Hold Shift in GUI to see slot usage", this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.addAll( + this.mDescriptionArray, + isAdvanced() ? "For the very large Projects" : "For the smaller Projects", + "Hold Shift in GUI to see slot usage", + CORE.GT_Tooltip.get()); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java index 8899827aac..e4fdb869ab 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java @@ -21,7 +21,7 @@ public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_Adv super(aID, aName, aNameRegional, aTier, aDescription); } - public GT_MetaTileEntity_BronzeCraftingTable(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_BronzeCraftingTable(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } @@ -38,13 +38,16 @@ public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_Adv @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BronzeCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_BronzeCraftingTable( + this.mName, + this.mTier, + this.mDescriptionArray, + this.mTextures); } - @SuppressWarnings("deprecation") @Override public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aStack) { - return GregTech_API.getCoverBehavior(aStack.toStack()).isSimpleCover(); + return GregTech_API.getCoverBehaviorNew(aStack.toStack()).isSimpleCover(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java index b3aac7b33e..9a073e9e30 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_ConnectableCrate.java @@ -80,13 +80,14 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered new ITexture[0]); } - public GT_MetaTileEntity_ConnectableCrate(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_ConnectableCrate(String aName, int aTier, String[] aDescription, + ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return org.apache.commons.lang3.ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } @Override @@ -110,7 +111,7 @@ public class GT_MetaTileEntity_ConnectableCrate extends GT_MetaTileEntity_Tiered @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_ConnectableCrate(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_ConnectableCrate(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } public int getOppositeSide(int side) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java index fa4ee205ae..f0c91ec34f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredChest.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -40,18 +42,13 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi new ITexture[0]); } - public GT_MetaTileEntity_TieredChest(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 3, aDescription, aTextures); } - /* - * public GT_MetaTileEntity_TieredChest(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - * super(aName, aTier, 3, aDescription, aTextures); } - */ - @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } @Override @@ -75,7 +72,7 @@ public class GT_MetaTileEntity_TieredChest extends GT_MetaTileEntity_TieredMachi @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TieredChest(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_TieredChest(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java index 82f43aab1b..6c263b6836 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import net.minecraft.entity.player.EntityPlayer; @@ -30,24 +32,20 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { super(aID, aName, aNameRegional, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid"); } - public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String aDescription, + public GT_MetaTileEntity_TieredTank(final String aName, final int aTier, final String[] aDescription, final ITexture[][][] aTextures) { - super(aName, aTier, 3, "Stores " + ((int) (Math.pow(2, aTier) * 32000)) + "L of fluid", aTextures); + super(aName, aTier, 3, aDescription, aTextures); } @Override public String[] getDescription() { - String[] aTip; - - String aTankPortableness = "portable"; - - if (this.mFluid == null) { - aTip = new String[] { this.mDescription, "A " + aTankPortableness + " tank.", CORE.GT_Tooltip.get() }; - } else { - aTip = new String[] { this.mDescription, "A " + aTankPortableness + " tank.", - "Fluid: " + mFluid.getLocalizedName() + " " + mFluid.amount + "L", CORE.GT_Tooltip.get() }; + List description = new ArrayList<>(Arrays.asList(this.mDescriptionArray)); + description.add("A portable tank."); + if (this.mFluid != null) { + description.add("Fluid: " + mFluid.getLocalizedName() + " " + mFluid.amount + "L"); } - return aTip; + description.add(CORE.GT_Tooltip.get()); + return description.toArray(new String[0]); } @Override @@ -144,7 +142,7 @@ public class GT_MetaTileEntity_TieredTank extends GT_MetaTileEntity_BasicTank { @Override public MetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_TieredTank(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index bc9964301d..7d87d186b5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -131,34 +131,6 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Dimensional_Orange) }; } - /* - * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new - * ITexture[2][17][]; for (byte i = -1; i < 16; i++) { rTextures[0][i + 1] = new ITexture[] { new - * GT_RenderedTexture( Textures.BlockIcons.MACHINE_HEATPROOFCASING) }; rTextures[1][i + 1] = new ITexture[] { new - * GT_RenderedTexture( Textures.BlockIcons.MACHINE_HEATPROOFCASING), mInventory.length > 4 ? - * Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier] }; } return - * rTextures; } - */ - - /* - * @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new - * ITexture[5][17][]; for (byte i = -1; i < 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture( - * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = - * tmp0; ITexture[] tmp1 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) }; rTextures[1][(i + 1)] - * = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i + 1)] = tmp2; - * ITexture[] tmp4 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i + 1)] = tmp4; - * ITexture[] tmp5 = { new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i, - * Dyes._NULL.mRGBa)), new GT_RenderedTexture( Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = - * tmp5; } return rTextures; } - */ - - /* - * @Override public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte - * aColorIndex, boolean aActive, boolean aRedstone) { return mTextures[side == facing ? 1 : 0][aColorIndex+1]; } - */ - @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMetaEnergyBuffer( diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java index 7f70731e3c..9e7b7d03e5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaSafeBlock.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.api.screen.UIBuildContext; import com.gtnewhorizons.modularui.common.widget.ButtonWidget; @@ -24,19 +26,14 @@ public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase implements super(aID, aName, aNameRegional, aTier, 28, "Protecting your items from sticky fingers."); } - public GregtechMetaSafeBlock(final int aID, final String aName, final String aNameRegional, final int aTier, - final int aInvSlotCount, final String aDescription) { - super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription); - } - public GregtechMetaSafeBlock(final String aName, final int aTier, final int aInvSlotCount, - final String aDescription, final ITexture[][][] aTextures) { + final String[] aDescription, final ITexture[][][] aTextures) { super(aName, aTier, aInvSlotCount, aDescription, aTextures); } @Override public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; + return ArrayUtils.add(this.mDescriptionArray, CORE.GT_Tooltip.get()); } @Override @@ -45,7 +42,7 @@ public class GregtechMetaSafeBlock extends GregtechMetaSafeBlockBase implements this.mName, this.mTier, this.mInventory.length, - this.mDescription, + this.mDescriptionArray, this.mTextures); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java index 2e8c438221..53892cd841 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java @@ -7,7 +7,6 @@ import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; -import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest; @@ -18,16 +17,11 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier super(aID, aName, aNameRegional, aTier); } - public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String aDescription, + public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); } - @Override - public String[] getDescription() { - return new String[] { this.mDescription, CORE.GT_Tooltip.get() }; - } - @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.getWorld().isRemote) { @@ -92,6 +86,6 @@ public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_Tier @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_InfiniteItemHolder(this.mName, this.mTier, this.mDescription, this.mTextures); + return new GT_MetaTileEntity_InfiniteItemHolder(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java index 1fa208ae98..aeea5b33e8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf.java @@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; +import org.apache.commons.lang3.ArrayUtils; + import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -24,7 +26,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIco public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { public byte mType = 0; - public String mOldDesc = ""; public boolean mLocked = false; protected byte mIndex = (byte) MathUtils.randInt(1, 3); public static GT_RenderedTexture texBottom = new GT_RenderedTexture( @@ -36,12 +37,10 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { public GT4Entity_Shelf(final int aID, final String aName, final String aNameRegional, final String aDescription) { super(aID, aName, aNameRegional, 0, aDescription); - mOldDesc = aDescription; } - public GT4Entity_Shelf(final String aName, final String aDescription, final ITexture[][][] aTextures) { + public GT4Entity_Shelf(final String aName, final String[] aDescription, final ITexture[][][] aTextures) { super(aName, 0, aDescription, aTextures); - mOldDesc = aDescription; } @Override @@ -49,10 +48,6 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { return true; } - public int getInvSize() { - return 1; - } - @Override public boolean isFacingValid(ForgeDirection facing) { return facing.offsetY == 0; @@ -178,7 +173,7 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf(this.mName, this.mDescription, this.mTextures); + return new GT4Entity_Shelf(this.mName, this.mDescriptionArray, this.mTextures); } @Override @@ -213,8 +208,12 @@ public class GT4Entity_Shelf extends GT_MetaTileEntity_BasicHull_NonElectric { @Override public String[] getDescription() { - return new String[] { mOldDesc, "Decorative Item Storage", "Right click to store/remove something", - "Ctrl + Rmb to check contents", "Ctrl + Rmb with a screwdriver to lock", }; + return ArrayUtils.addAll( + mDescriptionArray, + "Decorative Item Storage", + "Right click to store/remove something", + "Ctrl + Rmb to check contents", + "Ctrl + Rmb with a screwdriver to lock"); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java index 6167bcede9..fec96cbdd4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Compartment.java @@ -16,13 +16,13 @@ public class GT4Entity_Shelf_Compartment extends GT4Entity_Shelf { super(aID, aName, aNameRegional, aDescription); } - public GT4Entity_Shelf_Compartment(String mName, String mDescriptionArray, ITexture[][][] mTextures) { + public GT4Entity_Shelf_Compartment(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Compartment(this.mName, this.mDescription, this.mTextures); + return new GT4Entity_Shelf_Compartment(this.mName, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java index b8bc4bf427..e486292995 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Desk.java @@ -13,13 +13,13 @@ public class GT4Entity_Shelf_Desk extends GT4Entity_Shelf { super(aID, aName, aNameRegional, aDescription); } - public GT4Entity_Shelf_Desk(String mName, String mDescriptionArray, ITexture[][][] mTextures) { + public GT4Entity_Shelf_Desk(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Desk(this.mName, this.mDescription, this.mTextures); + return new GT4Entity_Shelf_Desk(this.mName, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java index 502bb62b1f..60fc4d511e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_FileCabinet.java @@ -16,7 +16,7 @@ public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { super(aID, aName, aNameRegional, aDescription); } - public GT4Entity_Shelf_FileCabinet(String mName, String mDescriptionArray, ITexture[][][] mTextures) { + public GT4Entity_Shelf_FileCabinet(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { super(mName, mDescriptionArray, mTextures); } @@ -30,7 +30,7 @@ public class GT4Entity_Shelf_FileCabinet extends GT4Entity_Shelf { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescription, this.mTextures); + return new GT4Entity_Shelf_FileCabinet(this.mName, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java index 22f8aaf769..e870113951 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Iron.java @@ -11,13 +11,13 @@ public class GT4Entity_Shelf_Iron extends GT4Entity_Shelf { super(aID, aName, aNameRegional, aDescription); } - public GT4Entity_Shelf_Iron(String mName, String mDescriptionArray, ITexture[][][] mTextures) { + public GT4Entity_Shelf_Iron(String mName, String[] mDescriptionArray, ITexture[][][] mTextures) { super(mName, mDescriptionArray, mTextures); } @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Iron(this.mName, this.mDescription, this.mTextures); + return new GT4Entity_Shelf_Iron(this.mName, this.mDescriptionArray, this.mTextures); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java index 17464c5333..c2fd2674d8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java @@ -36,7 +36,7 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { this.mItemStack = null; } - public GT4Entity_Shelf_Large(String mName, String mDescriptionArray, final int aSize, ITexture[][][] mTextures) { + public GT4Entity_Shelf_Large(String mName, String[] mDescriptionArray, final int aSize, ITexture[][][] mTextures) { super(mName, mDescriptionArray, mTextures); this.mSize = aSize; this.mItemCount = 0; @@ -45,13 +45,9 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT4Entity_Shelf_Large(this.mName, this.mDescription, mSize, this.mTextures); + return new GT4Entity_Shelf_Large(this.mName, this.mDescriptionArray, mSize, this.mTextures); } - /* - * @Override public int getInvSize() { return (mSize > 0 && mSize < 255 ? mSize : 255); } - */ - @Override public boolean isGivingInformation() { return true; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java index 8fb3cd9886..357cd74cbc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_AngleGrinder.java @@ -16,8 +16,8 @@ import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures.ItemIcons; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -80,17 +80,12 @@ public class TOOL_Gregtech_AngleGrinder extends GT_Tool { @Override public String getCraftingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(1)); + return SoundResource.RANDOM_ANVIL_USE.toString(); } @Override public String getEntityHitSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(2)); - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); + return SoundResource.RANDOM_ANVIL_BREAK.toString(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java index a1d424c618..be943cd398 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java @@ -18,7 +18,7 @@ import net.minecraft.util.IChatComponent; import net.minecraftforge.event.world.BlockEvent; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; +import gregtech.api.enums.SoundResource; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.util.GT_Recipe; @@ -82,17 +82,12 @@ public class TOOL_Gregtech_Choocher extends GT_Tool { @Override public String getCraftingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(1)); + return SoundResource.RANDOM_ANVIL_USE.toString(); } @Override public String getEntityHitSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(2)); - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); + return SoundResource.RANDOM_ANVIL_BREAK.toString(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java index c7e978e5bc..dbae822abd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricButcherKnife.java @@ -16,8 +16,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures.ItemIcons; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -80,17 +80,12 @@ public class TOOL_Gregtech_ElectricButcherKnife extends GT_Tool { @Override public String getCraftingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(1)); + return SoundResource.RANDOM_ANVIL_USE.toString(); } @Override public String getEntityHitSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(2)); - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); + return SoundResource.RANDOM_ANVIL_BREAK.toString(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java index e464c41abe..46720bb4f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_ElectricLighter.java @@ -15,8 +15,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import gregtech.GT_Mod; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; +import gregtech.api.enums.SoundResource; import gregtech.api.enums.Textures.ItemIcons; import gregtech.api.interfaces.IIconContainer; import gregtech.api.items.GT_MetaGenerated_Tool; @@ -79,17 +79,12 @@ public class TOOL_Gregtech_ElectricLighter extends GT_Tool { @Override public String getCraftingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(1)); + return SoundResource.RANDOM_ANVIL_USE.toString(); } @Override public String getEntityHitSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(2)); - } - - @Override - public String getBreakingSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(0)); + return SoundResource.RANDOM_ANVIL_BREAK.toString(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java index 77b41790b9..6a0339e043 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/ProcessingToolHeadChoocher.java @@ -62,7 +62,7 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato && (!aMaterial.contains(SubTag.FLAMMABLE)) && (!aMaterial.contains(SubTag.MAGICAL)) && (!aMaterial.contains(SubTag.NO_SMELTING))) { - Logger.WARNING("Found " + aMaterial.name() + " as a valid Skookum Choocher Material."); + Logger.WARNING("Found " + aMaterial.mName + " as a valid Skookum Choocher Material."); // Input 1 final ItemStack plate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L); final ItemStack ingot = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L); @@ -93,13 +93,12 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato used++; } else { Logger.WARNING( - "" + aMaterial.name() - + " could not be used for all input compoenents. [3x" - + aMaterial.name() + aMaterial.mName + " could not be used for all input compoenents. [3x" + + aMaterial.mName + " plates, 2x" - + aMaterial.name() + + aMaterial.mName + " ingots, 1x" - + aMaterial.name() + + aMaterial.mName + " Hard Hammer Head."); } // GT_ModHandler.addCraftingRecipe(, GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | @@ -107,10 +106,10 @@ public class ProcessingToolHeadChoocher implements Interface_OreRecipeRegistrato // OrePrefixes.ingot.get(aMaterial), Character.valueOf('P'), OrePrefixes.plate.get(aMaterial), // Character.valueOf('H'), OrePrefixes.toolHeadHammer.get(aMaterial)}); } else { - Logger.WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material."); + Logger.WARNING(aMaterial.mName + " was not a valid Skookum Choocher Material."); } } else { - Logger.WARNING("" + aMaterial.name() + " was not a valid Skookum Choocher Material."); + Logger.WARNING(aMaterial.mName + " was not a valid Skookum Choocher Material."); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 88c2f90c3c..a84d5bdde0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -447,13 +447,6 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { return true; } - // Machine Component Assembler - @Override - public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, - int aDuration, int aEUt) { - return false; - } - @Override public boolean addMultiblockCentrifugeRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, ItemStack[] aOutputs, int[] aChances, int aDuration, int aEUtick, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java index eb13397bf3..7fd68be584 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechBufferDynamos.java @@ -128,6 +128,6 @@ public class GregtechBufferDynamos { GregtechItemList.Hatch_Buffer_Dynamo_MAX.get(1L, new Object[0]), bitsd, new Object[] { "TMC", 'M', ItemList.Hatch_Dynamo_MAX, 'T', CI.getTieredCircuit(9), 'C', - OrePrefixes.wireGt04.get((Object) Materials.Superconductor) }); + OrePrefixes.wireGt04.get(Materials.SuperconductorUHV) }); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java deleted file mode 100644 index 81bc9efa8b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java +++ /dev/null @@ -1,665 +0,0 @@ -package gtPlusPlus.xmod.gregtech.registration.gregtech; - -import static gtPlusPlus.core.lib.CORE.ConfigSwitches.enableMachine_ComponentAssemblers; - -import java.util.ArrayList; - -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe; -import gregtech.api.util.GTPP_Recipe; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; - -public class GregtechComponentAssembler { - - public static void run() { - - if (!enableMachine_ComponentAssemblers) { - return; - } - - GregtechItemList.Machine_LV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 985, - "basicmachine.componentmaker.tier.01", - "Basic Component Maker", - 1, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 16000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_MV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 986, - "basicmachine.componentmaker.tier.02", - "Advanced Component Maker", - 2, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 16000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_HV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 987, - "basicmachine.componentmaker.tier.03", - "Advanced Component Maker II", - 3, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 16000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_EV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 988, - "basicmachine.componentmaker.tier.04", - "Advanced Component Maker III", - 4, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 16000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_IV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 989, - "basicmachine.componentmaker.tier.05", - "Advanced Component Maker IV", - 5, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 16000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_LuV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 31012, - "basicmachine.componentmaker.tier.06", - "Advanced Component Maker V", - 6, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 24000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_ZPM_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 31013, - "basicmachine.componentmaker.tier.07", - "Advanced Component Maker VI", - 7, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 32000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - GregtechItemList.Machine_UV_Component_Maker.set( - new GT_MetaTileEntity_BasicMachine_GT_Recipe( - 31014, - "basicmachine.componentmaker.tier.08", - "Advanced Component Maker VII", - 8, - "Components, Unite!", - GTPP_Recipe.GTPP_Recipe_Map.sComponentAssemblerRecipes, - 6, - 1, - 48000, - 0, - 1, - "Assembler.png", - "", - false, - false, - 0, - "ASSEMBLER", - new Object[] { "ACA", "VMV", "WCW", 'M', GT_MetaTileEntity_BasicMachine_GT_Recipe.X.HULL, 'V', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.ROBOT_ARM, 'A', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.PISTON, 'C', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.CIRCUIT, 'W', - GT_MetaTileEntity_BasicMachine_GT_Recipe.X.WIRE4 }).getStackForm(1L)); - - // Motors - // addRecipeMotor(0, Materials.Lead, 1, Materials.RedAlloy, 1, - // Materials.WroughtIron, Materials.IronMagnetic); - addRecipeMotor(1, Materials.Copper, 1, Materials.Tin, 1, Materials.Iron, Materials.IronMagnetic); - addRecipeMotor(2, Materials.Copper, 2, Materials.Copper, 1, Materials.Aluminium, Materials.SteelMagnetic); - addRecipeMotor(3, Materials.Copper, 4, Materials.Gold, 1, Materials.StainlessSteel, Materials.SteelMagnetic); - addRecipeMotor(4, Materials.Copper, 8, Materials.Aluminium, 1, Materials.Titanium, Materials.NeodymiumMagnetic); - addRecipeMotor( - 5, - Materials.Copper, - 16, - Materials.Tungsten, - 1, - Materials.TungstenSteel, - Materials.NeodymiumMagnetic); - - // Pistons - // addRecipePiston(0, Materials.Lead, Materials.Lead); - addRecipePiston(1, Materials.Steel, Materials.Tin); - addRecipePiston(2, Materials.Aluminium, Materials.Copper); - addRecipePiston(3, Materials.StainlessSteel, Materials.Gold); - addRecipePiston(4, Materials.Titanium, Materials.Aluminium); - addRecipePiston(5, Materials.TungstenSteel, Materials.Tungsten); - - // Conveyors - // addRecipeConveyor(0, Materials.Lead); - addRecipeConveyor(1, Materials.Tin); - addRecipeConveyor(2, Materials.Copper); - addRecipeConveyor(3, Materials.Gold); - addRecipeConveyor(4, Materials.Aluminium); - addRecipeConveyor(5, Materials.Tungsten); - - // Pumps - // addRecipePump(0, Materials.Lead, Materials.Lead, Materials.Lead); - addRecipePump(1, Materials.Tin, Materials.Copper, Materials.Tin); - addRecipePump(2, Materials.Bronze, Materials.Steel, Materials.Copper); - addRecipePump(3, Materials.Steel, Materials.StainlessSteel, Materials.Gold); - addRecipePump(4, Materials.StainlessSteel, Materials.Titanium, Materials.Aluminium); - addRecipePump(5, Materials.TungstenSteel, Materials.TungstenSteel, Materials.Tungsten); - - // Robot Arms - // addRecipeRobotArm(0, Materials.Lead, Materials.Lead); - addRecipeRobotArm(1, Materials.Steel, Materials.Tin); - addRecipeRobotArm(2, Materials.Aluminium, Materials.Copper); - addRecipeRobotArm(3, Materials.StainlessSteel, Materials.Gold); - addRecipeRobotArm(4, Materials.Titanium, Materials.Aluminium); - addRecipeRobotArm(5, Materials.TungstenSteel, Materials.Tungsten); - - // Field Generators - // addRecipeFieldGenerator(0, Materials.Lead); - addRecipeFieldGenerator(1); - addRecipeFieldGenerator(2); - addRecipeFieldGenerator(3); - addRecipeFieldGenerator(4); - addRecipeFieldGenerator(5); - - // Emitters - // addRecipeEmitter(0, Materials.Lead, Materials.IronMagnetic); - addRecipeEmitter(1, Materials.Tin, Materials.Brass, Materials.Quartzite); - addRecipeEmitter(2, Materials.Copper, Materials.Electrum, Materials.NetherQuartz); - addRecipeEmitter(3, Materials.Gold, Materials.Chrome, Materials.Emerald); - addRecipeEmitter(4, Materials.Aluminium, Materials.Platinum, Materials.EnderPearl); - addRecipeEmitter(5, Materials.Tungsten, Materials.Osmium, Materials.EnderEye); - - // Sensors - // addRecipeSensor(0, Materials.WroughtIron, Materials.IronMagnetic, - // Materials.Apatite); - addRecipeSensor(1, Materials.Steel, Materials.Brass, Materials.Quartzite); - addRecipeSensor(2, Materials.Aluminium, Materials.Electrum, Materials.NetherQuartz); - addRecipeSensor(3, Materials.StainlessSteel, Materials.Chrome, Materials.Emerald); - addRecipeSensor(4, Materials.Titanium, Materials.Platinum, Materials.EnderPearl); - addRecipeSensor(5, Materials.TungstenSteel, Materials.Osmium, Materials.EnderEye); - } - - private static boolean addRecipeMotor(int tier, Materials wire, int wirethickness, Materials cable, - int cablethickness, Materials stick, Materials magstick) { - try { - String mWT = "" + wirethickness; - String mCT = "" + cablethickness; - - if (wirethickness < 10) { - mWT = "0" + wirethickness; - } - if (cablethickness < 10) { - mCT = "0" + cablethickness; - } - - OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT); - OrePrefixes prefixCable = OrePrefixes.getOrePrefix("cableGt" + mCT); - - ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, wire, 4); - ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2); - ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2); - ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, magstick, 1); - - ItemStack Input[] = { wireStack, cableStack, rodStack, magrodStack }; - - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getElectricMotor(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipePiston(int tier, Materials mat, Materials cable) { - try { - - OrePrefixes prefixCable = OrePrefixes.cableGt01; - ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 2); - ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, mat, 2); - ItemStack plateStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, mat, 3); - ItemStack gearStack = ItemUtils.getGregtechOreStack(OrePrefixes.gearGtSmall, mat, 1); - ItemStack motorStack = CI.getElectricMotor(tier, 1); - - ItemStack Input[] = { plateStack, cableStack, rodStack, gearStack, motorStack }; - - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getElectricPiston(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipeConveyor(int tier, Materials cable) { - try { - OrePrefixes prefixCable = OrePrefixes.cableGt01; - ItemStack cableStack = ItemUtils.getGregtechOreStack(prefixCable, cable, 1); - ItemStack motorStack = CI.getElectricMotor(tier, 2); - boolean mAdd[]; - final ArrayList oreDictList = OreDictionary.getOres("plateAnyRubber"); - if (!oreDictList.isEmpty()) { - int mcount = 0; - mAdd = new boolean[oreDictList.size()]; - for (ItemStack mRubberType : oreDictList) { - final ItemStack returnValue = mRubberType.copy(); - returnValue.stackSize = 6; - ItemStack Input[] = { cableStack, motorStack, returnValue }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getConveyor(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - int added = 0; - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.size() / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { cableStack, motorStack, - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateRubber", 6) }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getConveyor(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipePump(int tier, Materials main, Materials pipe, Materials cable) { - try { - ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 1); - ItemStack screwStack = ItemUtils.getGregtechOreStack(OrePrefixes.screw, main, 1); - ItemStack rotorStack = ItemUtils.getGregtechOreStack(OrePrefixes.rotor, main, 1); - ItemStack pipeStack = ItemUtils.getGregtechOreStack(OrePrefixes.pipeMedium, pipe, 1); - ItemStack motorStack = CI.getElectricMotor(tier, 1); - boolean mAdd[]; - final ArrayList oreDictList = OreDictionary.getOres("ringAnyRubber"); - if (!oreDictList.isEmpty()) { - int mcount = 0; - mAdd = new boolean[oreDictList.size()]; - for (ItemStack mRubberType : oreDictList) { - final ItemStack returnValue = mRubberType.copy(); - returnValue.stackSize = 2; - ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack, returnValue }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getElectricPump(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - int added = 0; - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.size() / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { cableStack, screwStack, rotorStack, pipeStack, motorStack, - ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ringRubber", 2) }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getElectricPump(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipeRobotArm(int tier, Materials stick, Materials cable) { - try { - ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 3); - ItemStack rodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 2); - ItemStack motorStack = CI.getElectricMotor(tier, 2); - ItemStack pistonStack = CI.getElectricPiston(tier, 1); - - boolean mAdd[]; - final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier); - if (oreDictList.length > 0) { - int mcount = 0, added = 0; - mAdd = new boolean[oreDictList.length]; - for (ItemStack mCircuitType : oreDictList) { - final ItemStack returnValue = mCircuitType.copy(); - returnValue.stackSize = 1; - ItemStack Input[] = { returnValue, cableStack, rodStack, pistonStack, motorStack }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getRobotArm(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.length / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1), cableStack, - rodStack, pistonStack, motorStack }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getRobotArm(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipeFieldGenerator(int tier) { - try { - ItemStack gem; - String mWT; - if (tier == 1) mWT = "01"; - else if (tier == 2) mWT = "02"; - else if (tier == 3) mWT = "04"; - else if (tier == 4) mWT = "08"; - else if (tier == 5) mWT = "16"; - else mWT = "01"; - - ItemStack eyeQuantum = ItemList.QuantumEye.get(1); - ItemStack starQuantum = ItemList.QuantumStar.get(1); - - if (tier == 1) gem = ItemUtils.getSimpleStack(Items.ender_pearl); - else if (tier == 2) gem = ItemUtils.getSimpleStack(Items.ender_eye); - else if (tier == 3) gem = eyeQuantum; - else if (tier == 4) gem = ItemUtils.getSimpleStack(Items.nether_star); - else if (tier == 5) gem = starQuantum; - else gem = ItemUtils.getSimpleStack(Items.ender_pearl); - - OrePrefixes prefixWire = OrePrefixes.getOrePrefix("wireGt" + mWT); - ItemStack wireStack = ItemUtils.getGregtechOreStack(prefixWire, Materials.Osmium, 4); - - boolean mAdd[]; - final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier); - if (oreDictList.length > 0) { - int mcount = 0, added = 0; - mAdd = new boolean[oreDictList.length]; - for (ItemStack mCircuitType : oreDictList) { - final ItemStack returnValue = mCircuitType.copy(); - returnValue.stackSize = 4; - ItemStack Input[] = { returnValue, wireStack, gem }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getFieldGenerator(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.length / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 4), wireStack, - gem }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getFieldGenerator(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipeEmitter(int tier, Materials cable, Materials stick, Materials gem) { - try { - ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.cableGt01, cable, 2); - ItemStack gemstack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1); - ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, stick, 4); - - boolean mAdd[]; - final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier); - if (oreDictList.length > 0) { - int mcount = 0, added = 0; - mAdd = new boolean[oreDictList.length]; - for (ItemStack mCircuitType : oreDictList) { - final ItemStack returnValue = mCircuitType.copy(); - returnValue.stackSize = 2; - ItemStack Input[] = { returnValue, cableStack, gemstack, magrodStack }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getEmitter(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.length / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 2), cableStack, - gemstack, magrodStack }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getEmitter(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } - - private static boolean addRecipeSensor(int tier, Materials plate, Materials rod, Materials gem) { - try { - ItemStack cableStack = ItemUtils.getGregtechOreStack(OrePrefixes.plate, plate, 4); - ItemStack magrodStack = ItemUtils.getGregtechOreStack(OrePrefixes.stick, rod, 1); - ItemStack gemStack = ItemUtils.getGregtechOreStack(OrePrefixes.gem, gem, 1); - - boolean mAdd[]; - final ItemStack oreDictList[] = CI.getAllCircuitsOfTier(tier); - if (oreDictList.length > 0) { - int mcount = 0, added = 0; - mAdd = new boolean[oreDictList.length]; - for (ItemStack mCircuitType : oreDictList) { - final ItemStack returnValue = mCircuitType.copy(); - returnValue.stackSize = 1; - ItemStack Input[] = { gemStack, cableStack, returnValue, magrodStack }; - mAdd[mcount++] = CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getSensor(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - for (boolean y : mAdd) { - if (y) { - added++; - } - } - if (added >= (oreDictList.length / 2)) { - return true; - } else { - return false; - } - } else { - ItemStack Input[] = { gemStack, cableStack, magrodStack, - ItemUtils.getItemStackOfAmountFromOreDict(CI.getTieredCircuitOreDictName(tier), 1) }; - return CORE.RA.addComponentMakerRecipe( - Input, - GT_Values.NF, - CI.getSensor(tier, 1), - (tier * 40), - ((int) GT_Values.V[tier] / 16) * 15); - } - - } catch (Throwable t) { - return false; - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index ca2e45ebfa..25694ac385 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -238,8 +238,7 @@ public class GregtechConduits { private static void wireFactory(final String Material, final int Voltage, final int ID, final long insulatedLoss, final long uninsulatedLoss, final long Amps, final short[] rgb) { - @SuppressWarnings("deprecation") - final Materials T = Materials.valueOf(Material); + final Materials T = Materials.get(Material); int V = GT_Utility.getTier(Voltage); if (V == -1) { Logger.ERROR("Failed to set voltage on " + Material + ". Invalid voltage of " + Voltage + "V set."); @@ -249,17 +248,16 @@ public class GregtechConduits { makeWires(T, ID, insulatedLoss, uninsulatedLoss, Amps, GT_Values.V[V], true, false, rgb); } - @SuppressWarnings("deprecation") private static void makeWires(final Materials aMaterial, final int aStartID, final long aLossInsulated, final long aLoss, final long aAmperage, final long aVoltage, final boolean aInsulatable, final boolean aAutoInsulated, final short[] aRGB) { - Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.name() + " as a new material for Wire & Cable."); + Logger.WARNING("Gregtech5u Content | Registered " + aMaterial.mName + " as a new material for Wire & Cable."); GT_OreDictUnificator.registerOre( OrePrefixes.wireGt01, aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 0, - "wire." + aMaterial.name().toLowerCase() + ".01", + "wire." + aMaterial.mName.toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Wire", 0.125F, aMaterial, @@ -274,7 +272,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 1, - "wire." + aMaterial.name().toLowerCase() + ".02", + "wire." + aMaterial.mName.toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Wire", 0.25F, aMaterial, @@ -289,7 +287,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 2, - "wire." + aMaterial.name().toLowerCase() + ".04", + "wire." + aMaterial.mName.toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Wire", 0.375F, aMaterial, @@ -304,7 +302,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 3, - "wire." + aMaterial.name().toLowerCase() + ".08", + "wire." + aMaterial.mName.toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Wire", 0.50F, aMaterial, @@ -319,7 +317,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 4, - "wire." + aMaterial.name().toLowerCase() + ".12", + "wire." + aMaterial.mName.toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Wire", 0.625F, aMaterial, @@ -334,7 +332,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 5, - "wire." + aMaterial.name().toLowerCase() + ".16", + "wire." + aMaterial.mName.toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Wire", 0.75F, aMaterial, @@ -350,7 +348,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 6, - "cable." + aMaterial.name().toLowerCase() + ".01", + "cable." + aMaterial.mName.toLowerCase() + ".01", "1x " + aMaterial.mDefaultLocalName + " Cable", 0.25F, aMaterial, @@ -365,7 +363,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 7, - "cable." + aMaterial.name().toLowerCase() + ".02", + "cable." + aMaterial.mName.toLowerCase() + ".02", "2x " + aMaterial.mDefaultLocalName + " Cable", 0.375F, aMaterial, @@ -380,7 +378,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 8, - "cable." + aMaterial.name().toLowerCase() + ".04", + "cable." + aMaterial.mName.toLowerCase() + ".04", "4x " + aMaterial.mDefaultLocalName + " Cable", 0.5F, aMaterial, @@ -395,7 +393,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 9, - "cable." + aMaterial.name().toLowerCase() + ".08", + "cable." + aMaterial.mName.toLowerCase() + ".08", "8x " + aMaterial.mDefaultLocalName + " Cable", 0.625F, aMaterial, @@ -410,7 +408,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 10, - "cable." + aMaterial.name().toLowerCase() + ".12", + "cable." + aMaterial.mName.toLowerCase() + ".12", "12x " + aMaterial.mDefaultLocalName + " Cable", 0.75F, aMaterial, @@ -425,7 +423,7 @@ public class GregtechConduits { aMaterial, new GregtechMetaPipeEntity_Cable( aStartID + 11, - "cable." + aMaterial.name().toLowerCase() + ".16", + "cable." + aMaterial.mName.toLowerCase() + ".16", "16x " + aMaterial.mDefaultLocalName + " Cable", 0.875f, aMaterial, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java index b361c6810a..1495e6e282 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java @@ -161,7 +161,7 @@ public class GregtechEnergyBuffer { | GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "WTW", "WMW", Character.valueOf('M'), ItemList.Hull_MAX, Character.valueOf('W'), - OrePrefixes.wireGt08.get(Materials.Superconductor), Character.valueOf('T'), + OrePrefixes.wireGt08.get(Materials.SuperconductorUHV), Character.valueOf('T'), GregtechOreDictNames.buffer_core }); /* * GT_ModHandler.addCraftingRecipe( GregtechItemList.Energy_Buffer_1by1_MAX.get(1L, new Object[0]), diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java index b138383aff..af18105590 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechGeothermalThermalGenerator.java @@ -60,7 +60,7 @@ public class GregtechGeothermalThermalGenerator { | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "CEC", "GMG", "PWP", Character.valueOf('M'), ItemList.Hull_IV, Character.valueOf('P'), ItemList.Electric_Piston_IV, Character.valueOf('E'), ItemList.Electric_Motor_IV, - Character.valueOf('C'), OrePrefixes.circuit.get(Materials.Superconductor), + Character.valueOf('C'), OrePrefixes.circuit.get(Materials.SuperconductorUHV), Character.valueOf('W'), OrePrefixes.cableGt04.get(Materials.Platinum), Character.valueOf('G'), ALLOY.STELLITE.getGear(1) }); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java index e15ca67a6c..b341f867b9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java @@ -124,7 +124,7 @@ public class GregtechSafeBlock { | GT_ModHandler.RecipeBits.BUFFERED, new Object[] { "CMV", " X ", Character.valueOf('M'), ItemList.Hull_UV, Character.valueOf('V'), OrePrefixes.circuit.get(Materials.Master), Character.valueOf('C'), OreDictNames.craftingChest, - Character.valueOf('X'), OrePrefixes.circuit.get(Materials.Superconductor) }); + Character.valueOf('X'), OrePrefixes.circuit.get(Materials.SuperconductorUHV) }); GT_ModHandler.addCraftingRecipe( GregtechItemList.GT_Safe_MAX.get(1L, new Object[0]), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java index 444b5f5e9f..739c77ce87 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechThreadedBuffers.java @@ -1,91 +1,13 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; -import gregtech.common.tileentities.automation.GT_MetaTileEntity_SuperBuffer; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.creative.GT_MetaTileEntity_InfiniteItemHolder; public class GregtechThreadedBuffers { public static void run() { - run2(); - } - - private static void run2() { - GregtechItemList.Infinite_Item_Chest.set( (new GT_MetaTileEntity_InfiniteItemHolder(31010, "infinite.chest.tier.01", "Infinite Item Chest", 1)) .getStackForm(1L)); - - /* - * This file used to contain registration and recipes for GT++ threaded super buffers. Those have now been - * deprecated and replaced by the original GT super buffers. To avoid breaking existing bases, we've assigned - * the threaded super buffer metadata IDs to a copy of the GT super buffers, with a deprecation notice attached. - * We've also provided disassembler recipes that are the reverse of the original crafting recipes, allowing - * players to reclaim their original materials as well as convert the deprecated threaded super buffer metadata - * ID item back to the original GT super buffer metadata ID item. - */ - - final String deprecationNotice = "**DEPRECATED - Drop in disassembler!** "; - GregtechItemList.Automation_Threaded_SuperBuffer_ULV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31000, - "automation.superbuffer.tier.00.deprecated", - deprecationNotice + "Ultra Low Voltage Super Buffer", - 0)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_LV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31001, - "automation.superbuffer.tier.01.deprecated", - deprecationNotice + "Low Voltage Super Buffer", - 1)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_MV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31002, - "automation.superbuffer.tier.02.deprecated", - deprecationNotice + "Medium Voltage Super Buffer", - 2)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_HV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31003, - "automation.superbuffer.tier.03.deprecated", - deprecationNotice + "High Voltage Super Buffer", - 3)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_EV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31004, - "automation.superbuffer.tier.04.deprecated", - deprecationNotice + "Extreme Voltage Super Buffer", - 4)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_IV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31005, - "automation.superbuffer.tier.05.deprecated", - deprecationNotice + "Insane Voltage Super Buffer", - 5)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_LuV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31006, - "automation.superbuffer.tier.06.deprecated", - deprecationNotice + "Ludicrous Voltage Super Buffer", - 6)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_ZPM.set( - (new GT_MetaTileEntity_SuperBuffer( - 31007, - "automation.superbuffer.tier.07.deprecated", - deprecationNotice + "ZPM Voltage Super Buffer", - 7)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_UV.set( - (new GT_MetaTileEntity_SuperBuffer( - 31008, - "automation.superbuffer.tier.08.deprecated", - deprecationNotice + "Ultimate Voltage Super Buffer", - 8)).getStackForm(1L)); - GregtechItemList.Automation_Threaded_SuperBuffer_MAX.set( - (new GT_MetaTileEntity_SuperBuffer( - 31009, - "automation.superbuffer.tier.09.deprecated", - deprecationNotice + "Highly Ultimate Voltage Super Buffer", - 9)).getStackForm(1L)); - } } -- cgit