From 527bab2be07b4b5f024da807b12e023599a3a8f9 Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:47:30 -0600 Subject: [PATCH 1/2] remove unneeded stuff --- .../gtnhintergalactic/GTNHIntergalactic.java | 18 --- .../gtnhintergalactic/gui/IG_UITextures.java | 3 - .../gtnhintergalactic/proxy/ClientProxy.java | 31 ----- .../gtnhintergalactic/proxy/CommonProxy.java | 16 --- ...aTileEntity_EnhancedMultiBlockBase_EM.java | 112 ------------------ .../tile/multi/TileEntityDysonSwarm.java | 3 +- .../elevator/TileEntitySpaceElevator.java | 4 +- .../elevatormodules/TileEntityModuleBase.java | 3 +- 8 files changed, 3 insertions(+), 187 deletions(-) delete mode 100644 src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/GT_MetaTileEntity_EnhancedMultiBlockBase_EM.java diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/GTNHIntergalactic.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/GTNHIntergalactic.java index 57ede35..2ce0c7e 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/GTNHIntergalactic.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/GTNHIntergalactic.java @@ -2,7 +2,6 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; -import net.minecraft.util.IIcon; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -19,7 +18,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLMissingMappingsEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod( @@ -55,9 +53,6 @@ public class GTNHIntergalactic { public static final String ASSET_PREFIX = "gtnhintergalactic"; /** Creative tab for mod items */ public static CreativeTabs tab; - /** Mod instance */ - @Mod.Instance(Tags.MODID) - public static GTNHIntergalactic instance; /** Proxy used for loading */ @SidedProxy( clientSide = "com.gtnewhorizons.gtnhintergalactic.proxy.ClientProxy", @@ -65,14 +60,6 @@ public class GTNHIntergalactic { public static CommonProxy proxy; @Mod.EventHandler - // preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the - // GameRegistry." (Remove if not needed) - public void preInit(FMLPreInitializationEvent event) { - proxy.preInit(event); - } - - @Mod.EventHandler - // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) public void init(FMLInitializationEvent event) { tab = new CreativeTabs(CreativeTabs.getNextID(), Tags.MODNAME) { @@ -90,7 +77,6 @@ public int func_151243_f() { } @Mod.EventHandler - // postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed) public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } @@ -124,8 +110,4 @@ public void onMissingMapping(FMLMissingMappingsEvent event) { } } } - - public void markTextureUsed(IIcon o) { - proxy.markTextureUsed(o); - } } diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/gui/IG_UITextures.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/gui/IG_UITextures.java index 99cd41e..f87c701 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/gui/IG_UITextures.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/gui/IG_UITextures.java @@ -20,9 +20,6 @@ public class IG_UITextures { public static final UITexture OVERLAY_BUTTON_PROJECTS = UITexture .fullImage(ASSET_PREFIX, "gui/overlay_button/projects.png"); - public static final UITexture OVERLAY_BUTTON_CHECK = UITexture - .fullImage(ASSET_PREFIX, "gui/overlay_button/check.png"); - public static final UITexture OVERLAY_BUTTON_CROSS = UITexture .fullImage(ASSET_PREFIX, "gui/overlay_button/cross.png"); diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/ClientProxy.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/ClientProxy.java index c27fcaf..9ebb36f 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/ClientProxy.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/ClientProxy.java @@ -1,6 +1,5 @@ package com.gtnewhorizons.gtnhintergalactic.proxy; -import net.minecraft.util.IIcon; import net.minecraftforge.common.MinecraftForge; import com.gtnewhorizons.gtnhintergalactic.block.BlockSpaceElevatorCable; @@ -9,18 +8,11 @@ import com.gtnewhorizons.gtnhintergalactic.nei.NEI_IG_Config; import com.gtnewhorizons.gtnhintergalactic.render.RenderSpaceElevatorCable; import com.gtnewhorizons.gtnhintergalactic.tile.TileEntitySpaceElevatorCable; -import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.versioning.ArtifactVersion; -import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import cpw.mods.fml.common.versioning.InvalidVersionSpecificationException; -import cpw.mods.fml.common.versioning.VersionRange; /** * Proxy used by the client to load stuff @@ -29,21 +21,10 @@ */ public class ClientProxy extends CommonProxy { - private boolean notifyHodgepodgeTextureUsed = false; - @Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); TooltipUtil.postInit(); - try { - ArtifactVersion accepted = new DefaultArtifactVersion( - "hodgepodge", - VersionRange.createFromVersionSpec("[2.0.0,3)")); - ModContainer mc = Loader.instance().getIndexedModList().get("hodgepodge"); - if (mc != null) notifyHodgepodgeTextureUsed = accepted.containsVersion(mc.getProcessedVersion()); - } catch (InvalidVersionSpecificationException e) { - throw new RuntimeException(e); - } } @Override @@ -56,16 +37,4 @@ public void init(FMLInitializationEvent event) { new IGTextures().run(); MinecraftForge.EVENT_BUS.register(new NEI_IG_Config()); } - - /** - * Mark a texture as used, to prevent hodgepodge from optimizing it - * - * @param o Textured to be used - */ - @Override - public void markTextureUsed(IIcon o) { - if (notifyHodgepodgeTextureUsed) { - if (o instanceof IPatchedTextureAtlasSprite) ((IPatchedTextureAtlasSprite) o).markNeedsAnimationUpdate(); - } - } } diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/CommonProxy.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/CommonProxy.java index 018b03f..53da106 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/CommonProxy.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/proxy/CommonProxy.java @@ -1,7 +1,5 @@ package com.gtnewhorizons.gtnhintergalactic.proxy; -import net.minecraft.util.IIcon; - import com.gtnewhorizons.gtnhintergalactic.block.IGBlocks; import com.gtnewhorizons.gtnhintergalactic.item.IGItems; import com.gtnewhorizons.gtnhintergalactic.loader.MachineLoader; @@ -14,7 +12,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -27,11 +24,6 @@ */ public class CommonProxy { - // preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the - // GameRegistry." (Remove if not needed) - public void preInit(FMLPreInitializationEvent event) {} - - // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) public void init(FMLInitializationEvent event) { if (Textures.BlockIcons.casingTexturePages[32] == null) { Textures.BlockIcons.casingTexturePages[32] = new ITexture[128]; @@ -44,18 +36,10 @@ public void init(FMLInitializationEvent event) { CheckRecipeResultRegistry.register(new ResultNoSpaceProject("", "")); } - // postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed) public void postInit(FMLPostInitializationEvent event) { new RecipeLoader().run(); new SpaceProjectRegistration().run(); new MachineRecipes().run(); IG_RecipeAdder.postInit(); } - - /** - * Mark a texture as used, to prevent hodgepodge from optimizing it - * - * @param o Textured to be used - */ - public void markTextureUsed(IIcon o) {} } diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/GT_MetaTileEntity_EnhancedMultiBlockBase_EM.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/GT_MetaTileEntity_EnhancedMultiBlockBase_EM.java deleted file mode 100644 index 6a2d255..0000000 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/GT_MetaTileEntity_EnhancedMultiBlockBase_EM.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.gtnewhorizons.gtnhintergalactic.tile.multi; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.input.Keyboard; - -import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; -import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; -import com.gtnewhorizon.structurelib.alignment.enumerable.Flip; -import com.gtnewhorizon.structurelib.structure.IStructureDefinition; - -import gregtech.api.interfaces.ISecondaryDescribable; -import gregtech.api.util.MultiblockTooltipBuilder; -import micdoodle8.mods.galacticraft.core.util.GCCoreUtil; -import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; - -public abstract class GT_MetaTileEntity_EnhancedMultiBlockBase_EM extends TTMultiblockBase - implements IConstructable, ISecondaryDescribable { - - private static Map tooltips = new HashMap<>(); - - protected GT_MetaTileEntity_EnhancedMultiBlockBase_EM(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - protected GT_MetaTileEntity_EnhancedMultiBlockBase_EM(String aName) { - super(aName); - } - - @Override - public boolean onWrenchRightClick(ForgeDirection side, ForgeDirection wrenchingSide, EntityPlayer aPlayer, float aX, - float aY, float aZ) { - if (wrenchingSide != getBaseMetaTileEntity().getFrontFacing()) - return super.onWrenchRightClick(side, wrenchingSide, aPlayer, aX, aY, aZ); - if (aPlayer.isSneaking()) { - // we won't be allowing horizontal flips, as it can be perfectly emulated by rotating twice and flipping - // horizontally - // allowing an extra round of flip make it hard to draw meaningful flip markers in GT_Proxy#drawGrid - toolSetFlip(getFlip().isHorizontallyFlipped() ? Flip.NONE : Flip.HORIZONTAL); - } else { - toolSetRotation(null); - } - return true; - } - - protected abstract MultiblockTooltipBuilder createTooltip(); - - @Override - public String[] getDescription() { - return getCurrentDescription(); - } - - @Override - public boolean isDisplaySecondaryDescription() { - return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT); - } - - public String[] getPrimaryDescription() { - return getTooltip().getInformation(); - } - - public String[] getSecondaryDescription() { - return getTooltip().getStructureInformation(); - } - - protected MultiblockTooltipBuilder getTooltip() { - int tId = getBaseMetaTileEntity().getMetaTileID(); - MultiblockTooltipBuilder tooltip = tooltips.get(tId); - if (tooltip == null) { - tooltip = createTooltip(); - tooltips.put(tId, tooltip); - } - return tooltip; - } - - @Override - public String[] getStructureDescription(ItemStack stackSize) { - return getTooltip().getStructureHint(); - } - - protected IAlignmentLimits getInitialAlignmentLimits() { - return (d, r, f) -> !f.isVerticallyFliped(); - } - - @Override - public abstract IStructureDefinition getStructure_EM(); - - protected static String buildAddedBy(String... contributors) { - StringBuilder addedByString = new StringBuilder(GCCoreUtil.translate("ig.structure.author") + " "); - int numOfContributors = contributors.length; - while (numOfContributors > 1) { - addedByString.append( - contributors[contributors.length - numOfContributors] + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY); - if (numOfContributors > 2) { - addedByString.append(", "); - } - numOfContributors--; - } - if (contributors.length > 1) { - addedByString.append(GCCoreUtil.translate("ig.structure.and") + " "); - } - addedByString.append(contributors[contributors.length - 1]); - return addedByString.toString(); - } -} diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/TileEntityDysonSwarm.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/TileEntityDysonSwarm.java index 2f7bd63..85ad23e 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/TileEntityDysonSwarm.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/TileEntityDysonSwarm.java @@ -48,8 +48,7 @@ import tectech.thing.metaTileEntity.hatch.MTEHatchDynamoMulti; import tectech.thing.metaTileEntity.multi.base.TTMultiblockBase; -public class TileEntityDysonSwarm extends GT_MetaTileEntity_EnhancedMultiBlockBase_EM - implements ISurvivalConstructable { +public class TileEntityDysonSwarm extends TTMultiblockBase implements ISurvivalConstructable { @LoreHolder("gt.blockmachines.multimachine.ig.dyson.lore") private static String loreTooltip; diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevator/TileEntitySpaceElevator.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevator/TileEntitySpaceElevator.java index 6907fa1..406b609 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevator/TileEntitySpaceElevator.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevator/TileEntitySpaceElevator.java @@ -35,7 +35,6 @@ import com.gtnewhorizons.gtnhintergalactic.config.IGConfig; import com.gtnewhorizons.gtnhintergalactic.gui.IG_UITextures; import com.gtnewhorizons.gtnhintergalactic.tile.TileEntitySpaceElevatorCable; -import com.gtnewhorizons.gtnhintergalactic.tile.multi.GT_MetaTileEntity_EnhancedMultiBlockBase_EM; import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevatormodules.TileEntityModuleBase; import com.gtnewhorizons.modularui.api.ModularUITextures; import com.gtnewhorizons.modularui.api.drawable.IDrawable; @@ -80,8 +79,7 @@ * * @author minecraft7771 */ -public class TileEntitySpaceElevator extends GT_MetaTileEntity_EnhancedMultiBlockBase_EM - implements ISurvivalConstructable { +public class TileEntitySpaceElevator extends TTMultiblockBase implements ISurvivalConstructable { // region Structure and textures variables /** List of project modules in this elevator */ diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevatormodules/TileEntityModuleBase.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevatormodules/TileEntityModuleBase.java index ad5ac61..8fff970 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevatormodules/TileEntityModuleBase.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/tile/multi/elevatormodules/TileEntityModuleBase.java @@ -9,7 +9,6 @@ import com.gtnewhorizon.structurelib.structure.StructureUtility; import com.gtnewhorizons.gtnhintergalactic.block.IGBlocks; import com.gtnewhorizons.gtnhintergalactic.gui.IG_UITextures; -import com.gtnewhorizons.gtnhintergalactic.tile.multi.GT_MetaTileEntity_EnhancedMultiBlockBase_EM; import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevator.TileEntitySpaceElevator; import com.gtnewhorizons.modularui.api.screen.ModularWindow; import com.gtnewhorizons.modularui.common.widget.DrawableWidget; @@ -37,7 +36,7 @@ * * @author minecraft7771 */ -public abstract class TileEntityModuleBase extends GT_MetaTileEntity_EnhancedMultiBlockBase_EM { +public abstract class TileEntityModuleBase extends TTMultiblockBase { /** Base size of the EU buffer at UV */ protected static long EU_BUFFER_BASE_SIZE = 160008000L; From b17d557251cf4c0d4fa4f0846295b66357a9f1bc Mon Sep 17 00:00:00 2001 From: Maya <10861407+serenibyss@users.noreply.github.com> Date: Tue, 24 Dec 2024 08:51:09 -0600 Subject: [PATCH 2/2] use mte ids for dyson controller --- .../gtnewhorizons/gtnhintergalactic/loader/MachineLoader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gtnewhorizons/gtnhintergalactic/loader/MachineLoader.java b/src/main/java/com/gtnewhorizons/gtnhintergalactic/loader/MachineLoader.java index b7353aa..1d67d6b 100644 --- a/src/main/java/com/gtnewhorizons/gtnhintergalactic/loader/MachineLoader.java +++ b/src/main/java/com/gtnewhorizons/gtnhintergalactic/loader/MachineLoader.java @@ -1,5 +1,6 @@ package com.gtnewhorizons.gtnhintergalactic.loader; +import static gregtech.api.enums.MetaTileEntityIDs.DysonSwarmController; import static gregtech.api.enums.MetaTileEntityIDs.PlanetaryGasSiphonController; import static gregtech.api.enums.MetaTileEntityIDs.SpaceElevatorController; import static gregtech.api.enums.MetaTileEntityIDs.SpaceElevatorModuleAssemblerT1; @@ -46,7 +47,7 @@ public void run() { GCCoreUtil.translate("gt.blockmachines.multimachine.ig.siphon.name")).getStackForm(1); IGItems.DysonSwarmController = new TileEntityDysonSwarm( - 14001, // TODO Use MTE ID when 5u PR is merged and tagged + DysonSwarmController.ID, "DysonSwarm", GCCoreUtil.translate("gt.blockmachines.multimachine.ig.dyson.name")).getStackForm(1); // TODO populate ItemList field for this (and Siphon above)?