From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: The Great Renaming (#3014) * move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names --- .../tectech/thing/metaTileEntity/Textures.java | 318 ++ .../metaTileEntity/hatch/MTEHatchCapacitor.java | 241 + .../metaTileEntity/hatch/MTEHatchCreativeData.java | 129 + .../hatch/MTEHatchCreativeMaintenance.java | 90 + .../hatch/MTEHatchCreativeUncertainty.java | 56 + .../hatch/MTEHatchDataConnector.java | 198 + .../metaTileEntity/hatch/MTEHatchDataInput.java | 101 + .../hatch/MTEHatchDataItemsInput.java | 255 + .../hatch/MTEHatchDataItemsOutput.java | 133 + .../metaTileEntity/hatch/MTEHatchDataOutput.java | 113 + .../metaTileEntity/hatch/MTEHatchDynamoMulti.java | 127 + .../metaTileEntity/hatch/MTEHatchDynamoTunnel.java | 286 + .../metaTileEntity/hatch/MTEHatchEnergyMulti.java | 133 + .../metaTileEntity/hatch/MTEHatchEnergyTunnel.java | 203 + .../metaTileEntity/hatch/MTEHatchObjectHolder.java | 176 + .../thing/metaTileEntity/hatch/MTEHatchParam.java | 554 ++ .../metaTileEntity/hatch/MTEHatchParamText.java | 291 ++ .../thing/metaTileEntity/hatch/MTEHatchRack.java | 412 ++ .../metaTileEntity/hatch/MTEHatchUncertainty.java | 467 ++ .../hatch/MTEHatchWirelessComputationInput.java | 132 + .../hatch/MTEHatchWirelessComputationOutput.java | 60 + .../hatch/MTEHatchWirelessDataItemsInput.java | 139 + .../hatch/MTEHatchWirelessDataItemsOutput.java | 142 + .../hatch/MTEHatchWirelessMulti.java | 209 + .../multi/ForgeOfGodsRingsStructureString.java | 5105 ++++++++++++++++++ .../multi/ForgeOfGodsStructureString.java | 5435 ++++++++++++++++++++ .../metaTileEntity/multi/MTEActiveTransformer.java | 231 + .../thing/metaTileEntity/multi/MTEDataBank.java | 382 ++ .../metaTileEntity/multi/MTEEnergyInfuser.java | 315 ++ .../metaTileEntity/multi/MTEEyeOfHarmony.java | 1845 +++++++ .../thing/metaTileEntity/multi/MTEForgeOfGods.java | 3059 +++++++++++ .../thing/metaTileEntity/multi/MTEMicrowave.java | 342 ++ .../metaTileEntity/multi/MTENetworkSwitch.java | 283 + .../metaTileEntity/multi/MTEQuantumComputer.java | 618 +++ .../metaTileEntity/multi/MTEResearchStation.java | 687 +++ .../thing/metaTileEntity/multi/MTETeslaTower.java | 991 ++++ .../metaTileEntity/multi/base/INameFunction.java | 6 + .../metaTileEntity/multi/base/IStatusFunction.java | 6 + .../thing/metaTileEntity/multi/base/LedStatus.java | 64 + .../metaTileEntity/multi/base/Parameters.java | 327 ++ .../thing/metaTileEntity/multi/base/SoundLoop.java | 59 + .../multi/base/TTMultiblockBase.java | 2760 ++++++++++ .../render/TTRenderedExtendedFacingTexture.java | 25 + .../multi/godforge_modules/MTEBaseModule.java | 510 ++ .../multi/godforge_modules/MTEExoticModule.java | 547 ++ .../multi/godforge_modules/MTEMoltenModule.java | 244 + .../multi/godforge_modules/MTEPlasmaModule.java | 245 + .../multi/godforge_modules/MTESmeltingModule.java | 245 + .../metaTileEntity/pipe/MTEPipeBlockData.java | 52 + .../metaTileEntity/pipe/MTEPipeBlockEnergy.java | 52 + .../thing/metaTileEntity/pipe/MTEPipeData.java | 312 ++ .../thing/metaTileEntity/pipe/MTEPipeEnergy.java | 281 + .../metaTileEntity/pipe/MTEPipeEnergyMirror.java | 223 + .../metaTileEntity/single/MTEBuckConverter.java | 265 + .../metaTileEntity/single/MTEDebugPollutor.java | 217 + .../single/MTEDebugPowerGenerator.java | 383 ++ .../single/MTEDebugStructureWriter.java | 292 ++ .../metaTileEntity/single/MTEOwnerDetector.java | 237 + .../thing/metaTileEntity/single/MTETeslaCoil.java | 396 ++ .../metaTileEntity/single/MTETransformerTT.java | 68 + .../metaTileEntity/single/MTEWetTransformer.java | 49 + 61 files changed, 32123 insertions(+) create mode 100644 src/main/java/tectech/thing/metaTileEntity/Textures.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeData.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeMaintenance.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeUncertainty.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataConnector.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataInput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataItemsInput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataItemsOutput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataOutput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoMulti.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDynamoTunnel.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyMulti.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchEnergyTunnel.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchObjectHolder.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchParam.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchParamText.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchRack.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchUncertainty.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchWirelessComputationInput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchWirelessComputationOutput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchWirelessDataItemsInput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchWirelessDataItemsOutput.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchWirelessMulti.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsRingsStructureString.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/ForgeOfGodsStructureString.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEActiveTransformer.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEDataBank.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEEnergyInfuser.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEEyeOfHarmony.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEForgeOfGods.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEMicrowave.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTENetworkSwitch.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEQuantumComputer.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTEResearchStation.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/MTETeslaTower.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/INameFunction.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/IStatusFunction.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/LedStatus.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/Parameters.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/SoundLoop.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/TTMultiblockBase.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/base/render/TTRenderedExtendedFacingTexture.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEBaseModule.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEExoticModule.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEMoltenModule.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTEPlasmaModule.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/multi/godforge_modules/MTESmeltingModule.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeBlockData.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeBlockEnergy.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeData.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergy.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/pipe/MTEPipeEnergyMirror.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEBuckConverter.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPollutor.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEDebugPowerGenerator.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEDebugStructureWriter.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEOwnerDetector.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTETeslaCoil.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTETransformerTT.java create mode 100644 src/main/java/tectech/thing/metaTileEntity/single/MTEWetTransformer.java (limited to 'src/main/java/tectech/thing/metaTileEntity') diff --git a/src/main/java/tectech/thing/metaTileEntity/Textures.java b/src/main/java/tectech/thing/metaTileEntity/Textures.java new file mode 100644 index 0000000000..d9e6c47a28 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/Textures.java @@ -0,0 +1,318 @@ +package tectech.thing.metaTileEntity; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; +import static gregtech.api.enums.Textures.BlockIcons.CustomIcon; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_8V_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_8V_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_8V_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_EV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_EV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_EV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_HV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_HV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_HV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_IV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_IV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_IV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LuV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LuV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_LuV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MAX_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MAX_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MAX_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_MV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_UV_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_UV_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_UV_TOP; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_ZPM_BOTTOM; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_ZPM_SIDE; +import static gregtech.api.enums.Textures.BlockIcons.MACHINE_ZPM_TOP; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_IN_MULTI; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGY_IN; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGY_IN_MULTI; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGY_ON_WIRELESS; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGY_OUT; +import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_ENERGY_OUT_MULTI; + +import gregtech.api.enums.Dyes; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.objects.GTRenderedTexture; +import gregtech.api.objects.GTSidedTexture; +import gregtech.api.render.TextureFactory; + +public class Textures { + + private static final IIconContainer OVERLAY_ENERGY_IN_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_POWER"); + private static final IIconContainer OVERLAY_ENERGY_OUT_POWER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_POWER"); + private static final IIconContainer OVERLAY_ENERGY_IN_LASER = new CustomIcon("iconsets/OVERLAY_ENERGY_IN_LASER"); + private static final IIconContainer OVERLAY_ENERGY_OUT_LASER = new CustomIcon("iconsets/OVERLAY_ENERGY_OUT_LASER"); + private static final IIconContainer OVERLAY_ENERGY_ON_WIRELESS_4A = new CustomIcon( + "iconsets/OVERLAY_ENERGY_ON_WIRELESS_4A"); + private static final IIconContainer OVERLAY_ENERGY_ON_WIRELESS_16A = new CustomIcon( + "iconsets/OVERLAY_ENERGY_ON_WIRELESS_16A"); + private static final IIconContainer OVERLAY_ENERGY_ON_WIRELESS_LASER = new CustomIcon( + "iconsets/OVERLAY_ENERGY_ON_WIRELESS_LASER"); + private static final IIconContainer MACHINE_UEV_SIDE = new CustomIcon("iconsets/MACHINE_UEV_SIDE"); + private static final IIconContainer MACHINE_UIV_SIDE = new CustomIcon("iconsets/MACHINE_UIV_SIDE"); + private static final IIconContainer MACHINE_UMV_SIDE = new CustomIcon("iconsets/MACHINE_UMV_SIDE"); + private static final IIconContainer MACHINE_UXV_SIDE = new CustomIcon("iconsets/MACHINE_UXV_SIDE"); + private static final IIconContainer MACHINE_MAXV_SIDE = new CustomIcon("iconsets/MACHINE_MAXV_SIDE"); + private static final IIconContainer MACHINE_UEV_TOP = new CustomIcon("iconsets/MACHINE_UEV_TOP"); + private static final IIconContainer MACHINE_UIV_TOP = new CustomIcon("iconsets/MACHINE_UIV_TOP"); + private static final IIconContainer MACHINE_UMV_TOP = new CustomIcon("iconsets/MACHINE_UMV_TOP"); + private static final IIconContainer MACHINE_UXV_TOP = new CustomIcon("iconsets/MACHINE_UXV_TOP"); + private static final IIconContainer MACHINE_MAXV_TOP = new CustomIcon("iconsets/MACHINE_MAXV_TOP"); + private static final IIconContainer MACHINE_UEV_BOTTOM = new CustomIcon("iconsets/MACHINE_UEV_BOTTOM"); + private static final IIconContainer MACHINE_UIV_BOTTOM = new CustomIcon("iconsets/MACHINE_UIV_BOTTOM"); + private static final IIconContainer MACHINE_UMV_BOTTOM = new CustomIcon("iconsets/MACHINE_UMV_BOTTOM"); + private static final IIconContainer MACHINE_UXV_BOTTOM = new CustomIcon("iconsets/MACHINE_UXV_BOTTOM"); + private static final IIconContainer MACHINE_MAXV_BOTTOM = new CustomIcon("iconsets/MACHINE_MAXV_BOTTOM"); + + private static final IIconContainer TESLA_TRANSCEIVER_TOP = new CustomIcon("iconsets/TESLA_TRANSCEIVER_TOP"); + + public static IIconContainer[] MACHINECASINGS_SIDE_TT = new IIconContainer[] { MACHINE_8V_SIDE, MACHINE_LV_SIDE, + MACHINE_MV_SIDE, MACHINE_HV_SIDE, MACHINE_EV_SIDE, MACHINE_IV_SIDE, MACHINE_LuV_SIDE, MACHINE_ZPM_SIDE, + MACHINE_UV_SIDE, MACHINE_MAX_SIDE, MACHINE_UEV_SIDE, MACHINE_UIV_SIDE, MACHINE_UMV_SIDE, MACHINE_UXV_SIDE, + MACHINE_MAXV_SIDE, }, + MACHINECASINGS_TOP_TT = new IIconContainer[] { MACHINE_8V_TOP, MACHINE_LV_TOP, MACHINE_MV_TOP, MACHINE_HV_TOP, + MACHINE_EV_TOP, MACHINE_IV_TOP, MACHINE_LuV_TOP, MACHINE_ZPM_TOP, MACHINE_UV_TOP, MACHINE_MAX_TOP, + MACHINE_UEV_TOP, MACHINE_UIV_TOP, MACHINE_UMV_TOP, MACHINE_UXV_TOP, MACHINE_MAXV_TOP, }, + MACHINECASINGS_BOTTOM_TT = new IIconContainer[] { MACHINE_8V_BOTTOM, MACHINE_LV_BOTTOM, MACHINE_MV_BOTTOM, + MACHINE_HV_BOTTOM, MACHINE_EV_BOTTOM, MACHINE_IV_BOTTOM, MACHINE_LuV_BOTTOM, MACHINE_ZPM_BOTTOM, + MACHINE_UV_BOTTOM, MACHINE_MAX_BOTTOM, MACHINE_UEV_BOTTOM, MACHINE_UIV_BOTTOM, MACHINE_UMV_BOTTOM, + MACHINE_UXV_BOTTOM, MACHINE_MAXV_BOTTOM, }; + public static ITexture[] OVERLAYS_ENERGY_IN_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_OUT_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_IN_MULTI_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_MULTI, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_OUT_MULTI_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_MULTI, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_IN_POWER_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_POWER, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_OUT_POWER_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_POWER, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_IN_LASER_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_IN_LASER, new short[] { 60, 60, 245, 0 }), }, + OVERLAYS_ENERGY_OUT_LASER_TT = new ITexture[] { + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 180, 180, 180, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 220, 220, 220, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 255, 100, 0, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 255, 255, 30, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 128, 128, 128, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 240, 240, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 220, 220, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 200, 200, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 180, 180, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 160, 160, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 140, 140, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 120, 120, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 100, 100, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 80, 80, 245, 0 }), + new GTRenderedTexture(OVERLAY_ENERGY_OUT_LASER, new short[] { 60, 60, 245, 0 }), }; + public static final ITexture[] OVERLAYS_ENERGY_IN_WIRELESS_MULTI_4A = { + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_4A, new short[] { 255, 255, 255, 0 }) }; + + public static final ITexture[] OVERLAYS_ENERGY_IN_WIRELESS_MULTI_16A = { + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_16A, new short[] { 255, 255, 255, 0 }) }; + + public static final ITexture[] OVERLAYS_ENERGY_IN_WIRELESS_MULTI_64A = { + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS, new short[] { 25, 43, 255, 0 }) }; + + public static final ITexture[] OVERLAYS_ENERGY_IN_WIRELESS_LASER = { + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }), + TextureFactory.of(OVERLAY_ENERGY_ON_WIRELESS_LASER, new short[] { 255, 255, 255, 0 }) }; + + public static ITexture[][] MACHINE_CASINGS_TT = new ITexture[15][17]; + + public static ITexture TESLA_TRANSCEIVER_TOP_BA = new GTRenderedTexture(TESLA_TRANSCEIVER_TOP); + + public static void run() { + for (byte i = 0; i < MACHINE_CASINGS_TT.length; i++) { + for (byte j = 0; j < MACHINE_CASINGS_TT[i].length; j++) { + MACHINE_CASINGS_TT[i][j] = new GTSidedTexture( + MACHINECASINGS_BOTTOM_TT[i], + MACHINECASINGS_TOP_TT[i], + MACHINECASINGS_SIDE_TT[i], + Dyes.getModulation(j - 1, MACHINE_METAL.mRGBa)); + } + } + MACHINE_CASINGS = MACHINE_CASINGS_TT; + + // These will throw IndexOutOfBoundsException if one of the arrays are the wrong length + System.arraycopy(OVERLAYS_ENERGY_IN_TT, 0, OVERLAYS_ENERGY_IN, 0, OVERLAYS_ENERGY_IN_TT.length); + System.arraycopy(OVERLAYS_ENERGY_OUT_TT, 0, OVERLAYS_ENERGY_OUT, 0, OVERLAYS_ENERGY_OUT_TT.length); + System + .arraycopy(OVERLAYS_ENERGY_IN_MULTI_TT, 0, OVERLAYS_ENERGY_IN_MULTI, 0, OVERLAYS_ENERGY_IN_MULTI_TT.length); + System.arraycopy( + OVERLAYS_ENERGY_OUT_MULTI_TT, + 0, + OVERLAYS_ENERGY_OUT_MULTI, + 0, + OVERLAYS_ENERGY_OUT_MULTI_TT.length); + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java new file mode 100644 index 0000000000..d3cfb21c29 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCapacitor.java @@ -0,0 +1,241 @@ +package tectech.thing.metaTileEntity.hatch; + +import static gregtech.api.enums.GTValues.V; +import static net.minecraft.util.StatCollector.translateToLocal; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; + +import com.gtnewhorizons.modularui.api.screen.ModularWindow; +import com.gtnewhorizons.modularui.api.screen.UIBuildContext; +import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; +import com.gtnewhorizons.modularui.common.widget.SlotGroup; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.gui.modularui.GTUIInfos; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.modularui.IAddUIWidgets; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatch; +import gregtech.api.objects.GTRenderedTexture; +import tectech.Reference; +import tectech.TecTech; +import tectech.loader.TecTechConfig; +import tectech.util.CommonValues; +import tectech.util.TTUtility; + +/** + * Created by Tec on 03.04.2017. + */ +public class MTEHatchCapacitor extends MTEHatch implements IAddUIWidgets { + + private static Textures.BlockIcons.CustomIcon TM_H; + private static Textures.BlockIcons.CustomIcon TM_H_ACTIVE; + private static final Map componentBinds = new HashMap<>(); + + public MTEHatchCapacitor(int aID, String aName, String aNameRegional, int aTier) { + super( + aID, + aName, + aNameRegional, + aTier, + 16, + new String[] { CommonValues.THETA_MOVEMENT, translateToLocal("gt.blockmachines.hatch.capacitor.desc.0"), + EnumChatFormatting.AQUA + translateToLocal("gt.blockmachines.hatch.capacitor.desc.1") }); + TTUtility.setTier(aTier, this); + } + + public MTEHatchCapacitor(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 16, aDescription, aTextures); + } + + @Override + public int getInventoryStackLimit() { + return 1; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + TM_H_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_CAPS_ACTIVE"); + TM_H = new Textures.BlockIcons.CustomIcon("iconsets/TM_TESLA_CAPS"); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GTRenderedTexture(TM_H_ACTIVE) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GTRenderedTexture(TM_H) }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new MTEHatchCapacitor(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(ForgeDirection facing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isValidSlot(int aIndex) { + return true; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return side == aBaseMetaTileEntity.getFrontFacing(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return side == aBaseMetaTileEntity.getFrontFacing(); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); + return true; + } + + @Override + public int getSizeInventory() { + return getBaseMetaTileEntity().isActive() ? 0 : mInventory.length; + } + + public long[] getCapacitors() { + long tier = -1; + long tCurrent = 0; + long tEnergyMax = 0; + for (int i = 0; i < mInventory.length; i++) { + if (mInventory[i] == null || mInventory[i].stackSize != 1) { + continue; + } + CapacitorComponent cap = componentBinds.get(TTUtility.getUniqueIdentifier(mInventory[i])); + if (cap != null && cap.tier > tier) { + tier = cap.tier; + } + } + if (tier >= 0) { + for (int i = 0; i < mInventory.length; i++) { + if (mInventory[i] == null || mInventory[i].stackSize != 1) { + continue; + } + CapacitorComponent cap = componentBinds.get(TTUtility.getUniqueIdentifier(mInventory[i])); + if (cap == null) { + continue; + } + if (cap.tier < tier) { + if (getBaseMetaTileEntity().isActive()) { + mInventory[i] = null; + getBaseMetaTileEntity().setOnFire(); + } + } else { + tCurrent += cap.current; + tEnergyMax += cap.energyMax; + } + } + } + return new long[] { tier, tCurrent, tEnergyMax }; + } + + @Override + public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { + builder.widget( + SlotGroup.ofItemHandler(inventoryHandler, 4) + .startFromSlot(0) + .endAtSlot(15) + .slotCreator(index -> new BaseSlot(inventoryHandler, index) { + + @Override + public int getSlotStackLimit() { + return 1; + } + + @Override + public boolean isEnabled() { + return !getBaseMetaTileEntity().isActive(); + } + }) + .background(getGUITextureSet().getItemSlot()) + .build() + .setPos(52, 7)); + } + + public static void run() { + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.0", 0, 1, V[1] * 512); // LV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.1", 1, 1, V[2] * 512); // MV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.2", 2, 1, V[3] * 512); // HV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.3", 3, 1, V[4] * 512); // EV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.4", 4, 1, V[5] * 512); // IV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.5", 5, 1, V[6] * 512); // LuV + // Capacitor + new MTEHatchCapacitor.CapacitorComponent(Reference.MODID + ":item.tm.teslaCoilCapacitor.6", 6, 1, V[7] * 512); // ZPM + // Capacitor + } + + public static class CapacitorComponent implements Comparable { + + private final String unlocalizedName; + private final long tier, current, energyMax; + + CapacitorComponent(ItemStack is, long tier, long current, long energyMax) { + this(TTUtility.getUniqueIdentifier(is), tier, current, energyMax); + } + + CapacitorComponent(String is, long tier, long current, long energyMax) { + unlocalizedName = is; + this.tier = tier; + this.current = current; + this.energyMax = energyMax; + componentBinds.put(unlocalizedName, this); + if (TecTechConfig.DEBUG_MODE) { + TecTech.LOGGER.info("Tesla Capacitor registered: " + unlocalizedName); + } + } + + @Override + public int compareTo(CapacitorComponent o) { + return unlocalizedName.compareTo(o.unlocalizedName); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof CapacitorComponent) { + return compareTo((CapacitorComponent) obj) == 0; + } + return false; + } + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeData.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeData.java new file mode 100644 index 0000000000..ed162e59e6 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeData.java @@ -0,0 +1,129 @@ +package tectech.thing.metaTileEntity.hatch; + +import static net.minecraft.util.StatCollector.translateToLocal; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import tectech.mechanics.dataTransport.QuantumDataPacket; +import tectech.mechanics.pipe.IConnectsToDataPipe; +import tectech.thing.metaTileEntity.pipe.MTEPipeData; +import tectech.util.CommonValues; +import tectech.util.TTUtility; + +/** + * Created by danie_000 on 27.10.2016. + */ +public class MTEHatchCreativeData extends MTEHatchDataConnector { + + public MTEHatchCreativeData(int aID, String aName, String aNameRegional, int aTier) { + super( + aID, + aName, + aNameRegional, + aTier, + new String[] { CommonValues.TEC_MARK_EM, translateToLocal("gt.blockmachines.debug.tt.data.desc.0"), + translateToLocal("gt.blockmachines.debug.tt.data.desc.1"), + EnumChatFormatting.AQUA + translateToLocal("gt.blockmachines.debug.tt.data.desc.2") }); + TTUtility.setTier(aTier, this); + } + + public MTEHatchCreativeData(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new MTEHatchCreativeData(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public boolean isOutputFacing(ForgeDirection side) { + return side == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isInputFacing(ForgeDirection side) { + return false; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isDataInputFacing(ForgeDirection side) { + return isInputFacing(side); + } + + @Override + protected QuantumDataPacket loadPacketFromNBT(NBTTagCompound nbt) { + return new QuantumDataPacket(nbt); + } + + @Override + public boolean canConnectData(ForgeDirection side) { + return isOutputFacing(side); + } + + @Override + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + IConnectsToDataPipe current = this, source = this, next; + int range = 0; + while ((next = current.getNext(source)) != null && range++ < 1000) { + if (next instanceof MTEHatchDataInput) { + ((MTEHatchDataInput) next).setContents(q); + break; + } + source = current; + current = next; + } + q = null; + } + + @Override + public IConnectsToDataPipe getNext(IConnectsToDataPipe source /* ==this */) { + IGregTechTileEntity base = getBaseMetaTileEntity(); + byte color = base.getColorization(); + if (color < 0) { + return null; + } + IGregTechTileEntity next = base.getIGregTechTileEntityAtSide(base.getFrontFacing()); + if (next == null) { + return null; + } + IMetaTileEntity meta = next.getMetaTileEntity(); + if (meta instanceof MTEPipeData) { + ((MTEPipeData) meta).markUsed(); + return (IConnectsToDataPipe) meta; + } else if (meta instanceof MTEHatchDataInput && ((MTEHatchDataInput) meta).getColorization() == color + && ((MTEHatchDataInput) meta).canConnectData( + base.getFrontFacing() + .getOpposite())) { + return (IConnectsToDataPipe) meta; + } + return null; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (CommonValues.MOVE_AT == aTick % 20) { + if (aBaseMetaTileEntity.isAllowedToWork()) { + getBaseMetaTileEntity().setActive(true); + if (q == null) q = new QuantumDataPacket(0xFFFFFFFFL); + moveAround(aBaseMetaTileEntity); + } else { + q = null; + getBaseMetaTileEntity().setActive(false); + } + } + } + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeMaintenance.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeMaintenance.java new file mode 100644 index 0000000000..28d631e606 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeMaintenance.java @@ -0,0 +1,90 @@ +package tectech.thing.metaTileEntity.hatch; + +import static net.minecraft.util.StatCollector.translateToLocal; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +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.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatchMaintenance; +import gregtech.api.objects.GTRenderedTexture; +import tectech.util.CommonValues; +import tectech.util.TTUtility; + +public class MTEHatchCreativeMaintenance extends MTEHatchMaintenance { + + private static Textures.BlockIcons.CustomIcon face; + + public MTEHatchCreativeMaintenance(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + TTUtility.setTier(aTier, this); + } + + public MTEHatchCreativeMaintenance(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures, false); + } + + @Override + public String[] getDescription() { + return new String[] { CommonValues.THETA_MOVEMENT, + translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.0"), // For automatically maintaining + // Multiblocks + translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.1"), // Does fix everything but itself. + EnumChatFormatting.AQUA + translateToLocal("gt.blockmachines.debug.tt.maintenance.desc.2") // Fixing is + // for plebs! + }; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + face = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_FULLAUTOMAINTENANCE"); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GTRenderedTexture(face) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, new GTRenderedTexture(face) }; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new MTEHatchCreativeMaintenance(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + this.mWrench = this.mScrewdriver = this.mSoftHammer = this.mHardHammer = this.mCrowbar = this.mSolderingTool = true; + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, ForgeDirection side, + float aX, float aY, float aZ) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeUncertainty.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeUncertainty.java new file mode 100644 index 0000000000..953506e4d9 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchCreativeUncertainty.java @@ -0,0 +1,56 @@ +package tectech.thing.metaTileEntity.hatch; + +import static net.minecraft.util.StatCollector.translateToLocal; + +import net.minecraft.util.EnumChatFormatting; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import tectech.util.CommonValues; + +public class MTEHatchCreativeUncertainty extends MTEHatchUncertainty { + + public MTEHatchCreativeUncertainty(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier); + } + + public MTEHatchCreativeUncertainty(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity iGregTechTileEntity) { + return new MTEHatchCreativeUncertainty(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public String[] getDescription() { + return new String[] { CommonValues.TEC_MARK_EM, translateToLocal("gt.blockmachines.debug.tt.certain.desc.0"), // Feeling + // certain, + // for + // sure + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + + translateToLocal("gt.blockmachines.debug.tt.certain.desc.1") // Schrödinger's cat escaped the + // box + }; + } + + @Override + public void regenerate() { + // no-op + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide() && (aTick % 100) == 0) { + if (mode == 0) { + aBaseMetaTileEntity.setActive(false); + status = -128; + } else { + aBaseMetaTileEntity.setActive(true); + compute(); + } + } + } +} diff --git a/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataConnector.java b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataConnector.java new file mode 100644 index 0000000000..484fcdaff1 --- /dev/null +++ b/src/main/java/tectech/thing/metaTileEntity/hatch/MTEHatchDataConnector.java @@ -0,0 +1,198 @@ +package tectech.thing.metaTileEntity.hatch; + +import static gregtech.api.enums.Dyes.MACHINE_METAL; +import static net.minecraft.util.StatCollector.translateToLocalFormatted; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; + +import org.apache.commons.lang3.reflect.FieldUtils; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.MTEHatch; +import gregtech.api.objects.GTRenderedTexture; +import tectech.mechanics.dataTransport.DataPacket; +import tectech.mechanics.pipe.IConnectsToDataPipe; +import tectech.util.CommonValues; +import tectech.util.TTUtility; + +/** + * Created by danie_000 on 11.12.2016. + */ +public abstract class MTEHatchDataConnector extends MTEHatch implements IConnectsToDataPipe { + + public static Textures.BlockIcons.CustomIcon EM_D_SIDES; + public static Textures.BlockIcons.CustomIcon EM_D_ACTIVE; + public static Textures.BlockIcons.CustomIcon EM_D_CONN; + + private String clientLocale = "en_US"; + + public T q; + + public short id = -1; + + protected MTEHatchDataConnector(int aID, String aName, String aNameRegional, int aTier, String[] descr) { + super(aID, aName, aNameRegional, aTier, 0, descr); + TTUtility.setTier(aTier, this); + } + + protected MTEHatchDataConnector(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + EM_D_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_D_ACTIVE"); + EM_D_SIDES = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_D_SIDES"); + EM_D_CONN = new Textures.BlockIcons.CustomIcon("iconsets/EM_DATA_CONN"); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GTRenderedTexture( + EM_D_ACTIVE, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GTRenderedTexture(EM_D_CONN) }; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[] { aBaseTexture, + new GTRenderedTexture( + EM_D_SIDES, + Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), + new GTRenderedTexture(EM_D_CONN) }; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setShort("eID", id); + if (q != null) { + aNBT.setTag("eDATA", q.toNbt()); + } + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + id = aNBT.getShort("eID"); + if (aNBT.hasKey("eDATA")) { + q = loadPacketFromNBT(aNBT.getCompoundTag("eDATA")); + } + } + + protected abstract T loadPacketFromNBT(NBTTagCompound nbt); + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (CommonValues.MOVE_AT == aTick % 20) { + if (q == null) { + getBaseMetaTileEntity().setActive(false); + } else { + getBaseMetaTileEntity().setActive(true); + moveAround(aBaseMetaTileEntity); + } + } + } + } + + public abstract void moveAround(IGregTechTileEntity aBaseMetaTileEntity); + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + try { + EntityPlayerMP player = (EntityPlayerMP) aPlayer; + clientLocale = (String) FieldUtils.readField(player, "translator", true); + } catch (Exception e) { + clientLocale = "en_US"; + } + return true; + } + + @Override + public boolean isFacingValid(ForgeDirection facing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isLiquidInput(ForgeDirection side) { + return false; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side, + ItemStack aStack) { + return false; + } + + @Override + public boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public boolean isGivingInformation() { + return true; +