Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Cleaning... Again #765

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.gradle
.settings
/.idea/
/.vscode/
/run/
/build/
/eclipse/
Expand All @@ -26,13 +25,12 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*([!.]).json
src/main/resources/mixins.*.json
*.bat
*.DS_Store
!gradlew.bat
*.bak
/screenshots
/world
/saves
/asm
/.vscode
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1696952014
//version: 1696265388
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -793,7 +793,7 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}

dependencies {
def lwjgl3ifyVersion = '1.5.1'
def lwjgl3ifyVersion = '1.5.0'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
Expand Down
1 change: 0 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies {
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.18:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:SC2:2.0.2:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Binnie:2.2.0:dev') {transitive = false}
compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Chisel:2.11.4-GTNH:dev') {transitive=false}

Expand Down
16 changes: 16 additions & 0 deletions src/main/java/gregtech/api/util/GTPP_Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,22 @@ public static class GTPP_Recipe_Map {
E,
true,
true).setUsualFluidInputCount(3).setUsualFluidOutputCount(3);
public static final GT_Recipe_Map sSteamTurbineFuels = new GT_Recipe_Map(
new HashSet<>(10),
"gtpp.recipe.steamturbinefuel",
"GeoThermal Fuel",
null,
"",
1,
1,
0,
0,
1,
"Fuel Value: ",
1000,
" EU",
true,
false).useModularUI(true);

// LFTR recipes
public static final GT_Recipe_Map sLiquidFluorineThoriumReactorRecipes = new GT_Recipe_Map_FluidOnly(
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/gregtech/api/util/ThermalFuel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package gregtech.api.util;

import net.minecraftforge.fluids.FluidStack;

import gtPlusPlus.core.util.math.MathUtils;

public class ThermalFuel {

public static void addThermalFuel(FluidStack aInput1, FluidStack aInput2, FluidStack aOutput1, int euValue,
int aSpecialValue) {
GTPP_Recipe x = new GTPP_Recipe(
true,
null,
null,
null,
null,
new FluidStack[] { aInput1, aInput2 },
new FluidStack[] { aOutput1 },
20, // 1 Tick
euValue, // No Eu produced
aSpecialValue // Magic Number
);
GTPP_Recipe.GTPP_Recipe_Map.sGeoThermalFuels.addRecipe(x);
}

public static void addSteamTurbineFuel(FluidStack aInput1) {
GTPP_Recipe x = new GTPP_Recipe(
true,
null,
null,
null,
null,
new FluidStack[] { aInput1 },
null,
20, // 1 Tick
MathUtils.findPercentageOfInt((aInput1.amount / 2), 95), // No Eu produced
0 // Magic Number
);
GTPP_Recipe.GTPP_Recipe_Map.sSteamTurbineFuels.addRecipe(x);
}
}
11 changes: 1 addition & 10 deletions src/main/java/gtPlusPlus/GTplusplus.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,11 @@
import gtPlusPlus.core.chunkloading.GTPP_ChunkManager;
import gtPlusPlus.core.commands.CommandDebugChunks;
import gtPlusPlus.core.commands.CommandEnableDebugWhileRunning;
import gtPlusPlus.core.commands.CommandMath;
import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.config.ConfigHandler;
import gtPlusPlus.core.handler.BookHandler;
import gtPlusPlus.core.handler.MobMentality;
import gtPlusPlus.core.handler.PacketHandler;
import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
import gtPlusPlus.core.handler.events.LoginEventHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
Expand All @@ -67,7 +64,6 @@
name = CORE.name,
version = CORE.VERSION,
dependencies = "required-after:Forge;" + " after:TConstruct;"
+ " after:PlayerAPI;"
+ " after:dreamcraft;"
+ " after:IC2;"
+ " required-after:gregtech;"
Expand Down Expand Up @@ -173,10 +169,6 @@ public void preInit(final FMLPreInitializationEvent event) {
CORE.DEVENV = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
// Utils.LOG_INFO("User's Country: " + CORE.USER_COUNTRY);

Utils.registerEvent(new LoginEventHandler());
Utils.registerEvent(new MobMentality());
Logger.INFO("Login Handler Initialized");

proxy.preInit(event);
Logger.INFO("Setting up our own GT_Proxy.");
Meta_GT_Proxy.preInit();
Expand Down Expand Up @@ -237,7 +229,6 @@ public void postInit(final FMLPostInitializationEvent event) {
@EventHandler
public synchronized void serverStarting(final FMLServerStartingEvent event) {
INIT_PHASE.SERVER_START.setPhaseActive(true);
event.registerServerCommand(new CommandMath());
event.registerServerCommand(new CommandEnableDebugWhileRunning());
event.registerServerCommand(new CommandDebugChunks());
if (Thaumcraft.isModLoaded()) {
Expand Down Expand Up @@ -318,7 +309,7 @@ protected void dumpGtRecipeMap(final GT_Recipe_Map r) {
}
}

private static final boolean setupMaterialBlacklist() {
private static boolean setupMaterialBlacklist() {
Material.invalidMaterials.put(Materials._NULL);
Material.invalidMaterials.put(Materials.Clay);
Material.invalidMaterials.put(Materials.Phosphorus);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/gtPlusPlus/GenerateDictionaries.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;

import gregtech.api.objects.XSTR;
import gtPlusPlus.api.objects.random.XSTR;

public class GenerateDictionaries {

Expand Down Expand Up @@ -96,13 +97,14 @@ public static void main(String[] args) {
private static final class Utils {

private static final Charset utf8 = StandardCharsets.UTF_8;
private static final Random rand = new XSTR();

private static final void log(String s) {
private static void log(String s) {
System.out.println("[GTPP-Proguard] " + s);
}

public static int randInt(final int min, final int max) {
return XSTR.XSTR_INSTANCE.nextInt((max - min) + 1) + min;
return rand.nextInt((max - min) + 1) + min;
}

public static boolean doesFileExist(File f) {
Expand All @@ -116,8 +118,6 @@ public static File createFile(File aFile) {
boolean blnCreated = false;
log("Trying to use relative path " + aFile.getPath());
try {
// log("Trying to use path "+aFile.getCanonicalPath());
// log("Trying to use absolute path "+aFile.getAbsolutePath());
blnCreated = aFile.createNewFile();
} catch (IOException ioe) {
log("Error while creating a new empty file :" + ioe);
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/gtPlusPlus/RoadMap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package gtPlusPlus;

/**
* This Class purely exists to note down ideas and or plans to (re)implement things.
*
* @author Alkalus
*
*/
public class RoadMap {

// Reorganization of Item, Block and Common Class loading.
/*
* So, due to the complex/silly way I've done things, I've ran into some circular loading problems around the mod.
* Issues occur where Classes like CI.java try access the GregtechItemList.java objects before they're actually set.
* A plan should be created to organize the best scheme to load things in the best order.
*/

// Recreation of GUIs for all Multiblocks
/*
* Most Multi's use generic or straight out wrong GUI's on the controller. I'd like to go back and recreate all of
* these. Some could even benefit from a totally new type of UI (Instead of Text issues, just change a 2x2px area
* between red and green for status lights) These advanced GUIs are probably out of my capability, but if anyone
* thinks they're a good idea, I'll give them a go.
*/

// Better Integration with GTNH
/*
* Refactor things to be more common, refactor things to automatically switch between GTNH and standard variants
* without having to over-abuse CORE.GTNH switches everywhere. Most of this can be done via expanding CI.java, so
* that we have automated handlers for everything (IE. getX(5) will get 5x of the correct version of X)
*/

/*
* Thallium - Everglades only. (Mostly useless) Technetium - Has some recipes but seem to be dead ends so
* unobtainable. Polonium - Unobtainable. (Radioactive, Mostly Useless) Francium - Unobtainable. (Radioactive,
* Mostly Useless) Promethium - Unobtainable. Radium - Everglades only. (Do use, Moderately Rare) Actinium -
* Unobtainable. (Radioactive, Do use) Proactinium - Unobtainable. (Do use) Neptunium - Has some recipes but seem to
* be dead ends so unobtainable. Curium - Fusion only. Berkelium - Unobtainable. Californium - Fusion only.
* Einsteinium - Unobtainable. Fermium - Unobtainable. Strontium - Everglades only. (Do use 1) Iodine - Everglades
* only. Dysprosium - Everglades only. (Do use 1) Rhenium - Weird ABS recipe only. Flerovium - Unobtainable. Dubnium
* - Unobtainable. Seaborgium - Unobtainable. Bohrium - Unobtainable. Hassium - Unobtainable. Meitnerium -
* Unobtainable. Darmstadtium - Unobtainable. Roentgenium - Unobtainable. Copernicium - Unobtainable. Nihonium -
* Unobtainable. Moscovium - Unobtainable. Livermorium - Unobtainable. Tennessine - Unobtainable. Nobelium -
* Unobtainable. Lawrencium - Unobtainable. Astatine - Unobtainable. (Radioactive, Mostly Useless)
*/

}
80 changes: 80 additions & 0 deletions src/main/java/gtPlusPlus/api/helpers/MaterialHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package gtPlusPlus.api.helpers;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

import net.minecraft.item.ItemStack;

import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
import gregtech.api.util.GT_OreDictUnificator;
import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class MaterialHelper {

public static ItemStack getComponentFromMaterial(OrePrefixes oreprefix, Material material, int amount) {
return ItemUtils.getOrePrefixStack(oreprefix, material, amount);
}

/**
* Generates a 16 Fluid Pipe
*
* @see {@code Example: Copper 16x Pipe (Materials.Copper, Materials.Copper.mName, "Copper", ID, 60, 1000, true)}
* @param aMaterial - Pipe Material
* @param name - Pipe Internal name
* @param displayName - Pipe Display Name
* @param aID - Pipe's Meta ID
* @param baseCapacity - Pipes Base Capacity
* @param heatCapacity - Pipe Max Temp
* @param gasProof - Is Gas Proof?
* @return A boolean which corresponds to whether or not the Pipe was registered to the Ore Dictionary.
*/
public static boolean generateHexadecuplePipe(Materials aMaterial, String name, String displayName, int aID,
int baseCapacity, int heatCapacity, boolean gasProof) {
try {
Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class;
Constructor<GT_MetaPipeEntity_Fluid> constructor = aPipeEntity.getConstructor(
new Class[] { int.class, String.class, String.class, float.class, Materials.class, int.class,
int.class, boolean.class, int.class });
if (constructor != null) {
GT_MetaPipeEntity_Fluid aPipe;
aPipe = constructor.newInstance(
aID,
"GT_Pipe_" + name + "_Hexadecuple",
"Hexadecuple " + displayName + " Fluid Pipe",
1.0F,
aMaterial,
baseCapacity,
heatCapacity,
gasProof,
16);
return GT_OreDictUnificator.registerOre("pipeHexadecuple" + aMaterial, aPipe.getStackForm(1L));
}

} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException e) {}
return false;
}

public static ItemStack getCells(Materials aMaterial, int i) {
return ItemUtils.getOrePrefixStack(OrePrefixes.cell, aMaterial, i);
}

public static ItemStack getDust(Materials aMaterial, int i) {
return ItemUtils.getOrePrefixStack(OrePrefixes.dust, aMaterial, i);
}

public static ItemStack getDustSmall(Materials aMaterial, int i) {
return ItemUtils.getOrePrefixStack(OrePrefixes.dustSmall, aMaterial, i);
}

public static ItemStack getDustTiny(Materials aMaterial, int i) {
return ItemUtils.getOrePrefixStack(OrePrefixes.dustTiny, aMaterial, i);
}

public static ItemStack getGems(Materials aMaterial, int i) {
return ItemUtils.getOrePrefixStack(OrePrefixes.gem, aMaterial, i);
}
}
20 changes: 20 additions & 0 deletions src/main/java/gtPlusPlus/api/interfaces/IEntityCatcher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package gtPlusPlus.api.interfaces;

import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

import gtPlusPlus.api.objects.minecraft.BlockPos;

public interface IEntityCatcher {

public boolean hasEntity(ItemStack aStack);

public Entity getStoredEntity(World aWorld, ItemStack aStack);

public boolean setStoredEntity(World aWorld, ItemStack aStack, Entity aEntity);

public Class<? extends Entity> getStoredEntityClass(ItemStack aStack);

public boolean spawnStoredEntity(World aWorld, ItemStack aStack, BlockPos aPos);
}
22 changes: 22 additions & 0 deletions src/main/java/gtPlusPlus/api/interfaces/IToolable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package gtPlusPlus.api.interfaces;

public interface IToolable {

public boolean isScrewdriverable();

public boolean onScrewdriverLMB();

public boolean onScrewdriverRMB();

public boolean isWrenchable();

public boolean onWrenchLMB();

public boolean onWrenchRMB();

public boolean isMalletable();

public boolean onMalletLMB();

public boolean onMalletRMB();
}
Loading
Loading