Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/code-cleanup' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Dream-Master committed Dec 26, 2024
2 parents 7467ba2 + b17d557 commit 45fc2d4
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -55,24 +53,13 @@ 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",
serverSide = "com.gtnewhorizons.gtnhintergalactic.proxy.CommonProxy")
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) {

Expand All @@ -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);
}
Expand Down Expand Up @@ -124,8 +110,4 @@ public void onMissingMapping(FMLMissingMappingsEvent event) {
}
}
}

public void markTextureUsed(IIcon o) {
proxy.markTextureUsed(o);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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)?
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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();
}
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand All @@ -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];
Expand All @@ -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) {}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 45fc2d4

Please sign in to comment.