Skip to content

Commit

Permalink
Another Cleanup + Removal of GT-Harddep (#74)
Browse files Browse the repository at this point in the history
* Update deps

* Fix generics

* Deobfuscate parameters

* Minor fixes

* Remove GT harddep

* Exclude GT6
  • Loading branch information
glowredman authored Mar 26, 2024
1 parent f7a608b commit 93dd3c9
Show file tree
Hide file tree
Showing 51 changed files with 412 additions and 421 deletions.
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Add your dependencies here

dependencies {
api 'com.github.GTNewHorizons:GT5-Unofficial:5.09.45.95:dev'
compileOnly 'com.github.GTNewHorizons:GT5-Unofficial:5.09.45.128:dev'
api 'com.github.GTNewHorizons:Baubles:1.0.4:dev'
api 'com.github.GTNewHorizons:ModularUI:1.1.42:dev'

api 'net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev'
api 'thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ developmentEnvironmentUserName = Developer

# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
enableModernJavaSyntax = true

# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
enableGenericInjection = true

# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.16'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.19'
}


23 changes: 15 additions & 8 deletions src/main/java/emt/EMT.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,15 @@ public class EMT {
public static final String CLIENT_PROXY = "emt.proxy.ClientProxy";
public static final String COMMON_PROXY = "emt.proxy.CommonProxy";
public static final String CHANNEL = "EMT";
public static final String DEPENDS = "required-after:Thaumcraft;" + "required-after:IC2;"
+ "required-after:gregtech;"
+ "after:Avaritia;"
+ "after:MagicBees;"
+ "after:ForbiddenMagic;"
+ "after:dreamcraft;";
public static final String DEPENDS = """
required-after:Thaumcraft;\
required-after:IC2;\
required-after:modularui;\
after:gregtech;\
after:Avaritia;\
after:MagicBees;\
after:ForbiddenMagic;\
after:dreamcraft""";
public static final CreativeTabs TAB = new EMTCreativeTab("EMT.creativeTab");
public static final Logger LOGGER = LogManager.getLogger("Electro-Magic Tools");
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("EMT");
Expand All @@ -76,7 +79,9 @@ public void preInit(FMLPreInitializationEvent event) {
Registry.registerPreInit();
EMTEssentiasOutputs.addPrimalOutputs();
registerPackets();
Solars.populateCache();
if (Registry.enableGTCompat) {
Solars.populateCache();
}
}

@Mod.EventHandler
Expand All @@ -103,6 +108,8 @@ public void onFMLServerStart(FMLServerStartingEvent event) {

public void registerPackets() {
INSTANCE.registerMessage(PacketEMTKeys.class, PacketEMTKeys.class, 0, Side.SERVER);
INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT);
if (Registry.enableGTCompat) {
INSTANCE.registerMessage(PacketNodeInfo.class, PacketNodeInfo.class, 1, Side.CLIENT);
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/emt/block/BlockEssentiaGenerators.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void registerBlockIcons(IIconRegister ir) {

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emt/block/BlockMachines.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void registerBlockIcons(IIconRegister ir) {
}

@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
list.add(new ItemStack(id, 1, 0));
list.add(new ItemStack(id, 1, 1));
list.add(new ItemStack(id, 1, 2));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emt/block/BlockPortableNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p
}

@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
public TileEntity createNewTileEntity(World worldIn, int meta) {
return null;
}
}
2 changes: 1 addition & 1 deletion src/main/java/emt/block/BlockSolars.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ else if (instance == 0) {
}

@SideOnly(Side.CLIENT)
public void getSubBlocks(Item id, CreativeTabs tab, List list) {
public void getSubBlocks(Item id, CreativeTabs tab, List<ItemStack> list) {
for (int meta = 0; meta < countOfMetas; meta++) {
list.add(new ItemStack(id, 1, meta));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emt/client/renderer/RenderShield.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void doRender(Entity entityShield, double x, double y, double z, float pa
glTranslated(x, y, z);
}

glCallList(this.glCallList);
glCallList(glCallList);

glPopMatrix();
glPopAttrib();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/emt/command/CommandOutputs.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public String getCommandName() {
}

@Override
public String getCommandUsage(ICommandSender p_71518_1_) {
public String getCommandUsage(ICommandSender sender) {
return "/emt_outputs";
}

Expand All @@ -107,7 +107,7 @@ public boolean canCommandSenderUseCommand(ICommandSender par1iCommandSender) {
}

@Override
public List addTabCompletionOptions(ICommandSender command, String[] stringArray) {
public List<String> addTabCompletionOptions(ICommandSender command, String[] stringArray) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/emt/entity/EntityEnergyBall.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void onUpdate() {
}

/** Generating Coords for every Entity **/
ArrayList<Entity> entities = new ArrayList();
ArrayList<Entity> entities = new ArrayList<>();

int chunkSize = ((RADIUS - 1) >> 4) + 2;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/emt/entity/EntityLaser.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ public void onUpdate() {
}

Entity entity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(
this,
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double d0 = 0.0D;
int l;
float down;

for (l = 0; l < list.size(); ++l) {
Entity entity1 = (Entity) list.get(l);
Entity entity1 = list.get(l);

if (entity1.canBeCollidedWith() && (entity1 != this.shootingEntity || this.ticksInAir >= 5)) {
down = 0.3F;
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/emt/gthandler/common/loader/EMT_GT_Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,26 @@
import net.minecraftforge.oredict.OreDictionary;

import emt.tile.GT_MetaTileEntity_ResearchCompleter;
import emt.util.EMTConfigHandler;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TierEU;
import gregtech.api.util.GT_OreDictUnificator;
import thaumcraft.common.config.ConfigItems;

public class EMT_GT_Loader implements Runnable {
public class EMT_GT_Loader {

public static int aIDoffset = 13000 - GT_Values.VN.length - 1;
public static ItemStack ResearchMultiblock;

@Override
public void run() {
public static void run() {
ResearchMultiblock = new GT_MetaTileEntity_ResearchCompleter(
aIDoffset + GT_Values.VN.length + 2,
EMTConfigHandler.aIDoffset + GT_Values.VN.length + 2,
"Research Completer",
"Research Completer").getStackForm(1L);
}

public void runlate() {
public static void runlate() {
GT_Values.RA.stdBuilder()
.itemInputs(
new ItemStack(Items.book),
Expand Down
21 changes: 7 additions & 14 deletions src/main/java/emt/init/EMTBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import emt.block.BlockMachines;
import emt.block.BlockPortableNode;
import emt.block.BlockShield;
import emt.block.BlockSolars;
import emt.item.block.ItemBlockElectricCloud;
import emt.item.block.ItemBlockEssentiaGenerators;
import emt.item.block.ItemBlockMachines;
import emt.item.block.ItemBlockSolars;
import emt.tile.solar.Solars;
import ic2.api.item.IC2Items;
import thaumcraft.api.aspects.Aspect;
Expand All @@ -24,7 +22,7 @@ public class EMTBlocks {

public static Block portableNode, essentiaGens, shield, emtMachines, electricCloud;

public static Block[] solars = new Block[Solars.getCountOfInstances()];
public static Block[] solars = new Block[0];

public static void registerBlocks() {
portableNode = new BlockPortableNode("portablenode");
Expand All @@ -33,22 +31,17 @@ public static void registerBlocks() {
shield = new BlockShield("shield");
GameRegistry.registerBlock(shield, "ShieldBlock");

for (int i = 0; i < solars.length; i++) {
if (i == 0) {
solars[i] = new BlockSolars("solar", Solars.getCountOfMetas(i), i);
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars");
} else {
solars[i] = new BlockSolars("solar" + (i + 1), Solars.getCountOfMetas(i), i);
GameRegistry.registerBlock(solars[i], ItemBlockSolars.class, "EMTSolars" + (i + 1));
}
if (Registry.enableGTCompat) {
solars = Solars.registerBlocks();
}

emtMachines = new BlockMachines("machine");
GameRegistry.registerBlock(emtMachines, ItemBlockMachines.class, "EMTMachines");

essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");

if (Registry.enableGTCompat) {
essentiaGens = new BlockEssentiaGenerators("essentia");
GameRegistry.registerBlock(essentiaGens, ItemBlockEssentiaGenerators.class, "EssentiaGenerators");
}
electricCloud = new BlockElectricCloud("electricCloud");
GameRegistry.registerBlock(electricCloud, ItemBlockElectricCloud.class, "electricCloud");
}
Expand Down
Loading

0 comments on commit 93dd3c9

Please sign in to comment.