Skip to content

Commit

Permalink
The Great Renaming (#3014)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NotAPenguin0 authored Sep 2, 2024
1 parent afd3fd9 commit 1b820de
Show file tree
Hide file tree
Showing 3,474 changed files with 382,932 additions and 385,217 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 5 additions & 5 deletions docs/RecipeBuilder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# introduction

GT_RecipeBuilder is the replacement of GT_Values.RA.addXXXX for constructing and adding recipes.
GTRecipeBuilder is the replacement of GT_Values.RA.addXXXX for constructing and adding recipes.
Compared to the old style, this one utilizes the builder pattern to

1. allow greater flexibility in API.
Expand Down Expand Up @@ -29,13 +29,13 @@ being the preferred choice.
## complicated recipe adder

1. If one invocation of recipe adder would add multiple recipe to same recipe map, give that recipe map a recipeEmitter
2. If one invocation of recipe adder would conditionally add recipe, define a new IRecipeMap in GT_RecipeConstants
2. If one invocation of recipe adder would conditionally add recipe, define a new IRecipeMap in GTRecipeConstants
3. If one invocation of recipe adder would add recipe to multiple recipe map,
1. If all recipe maps involved receive recipe only via this type of adding, use the chaining mechanism offered by GT_RecipeMap, i.e. addDownstream().
1. If all recipe maps involved receive recipe only via this type of adding, use the chaining mechanism offered by GTRecipeMap, i.e. addDownstream().

e.g.sMultiblockElectrolyzerRecipes and sElectrolyzerRecipes
2. Otherwise, define a new IRecipeMap in GT_RecipeConstants.
4. If the target isn't a real recipe map (e.g. AssLine stuff), define a new IRecipeMap in GT_RecipeConstants.
2. Otherwise, define a new IRecipeMap in GTRecipeConstants.
4. If the target isn't a real recipe map (e.g. AssLine stuff), define a new IRecipeMap in GTRecipeConstants.

## Downstream in an addon

Expand Down
2 changes: 1 addition & 1 deletion docs/ResourcePacks_Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can simply add textures named by the following rules:
- Basically place at `gregtech/textures/gui/progressbar/${unlocalized name of recipemap}`. Unlocalized name can be found on either of:
- Hold shift while hovering over NEI tab. "HandlerID" indicates unlocalized name.
![](/docs/img/recipemap-unlocalized-name.png)
- Read code. Usually they're passed as 2nd argument for `GT_Recipe_Map` constructor. Recipemaps are defined at `gregtech.api.util.GT_Recipe`.
- Read code. Usually they're passed as 2nd argument for `GTRecipe_Map` constructor. Recipemaps are defined at `gregtech.api.util.GTRecipe`.
- For steam machines, append `_bronze`, `_steel`, or `_primitive`.
- Exceptions: Miner: `miner`, Electric Furnace: `E_Furnace`, Electric Oven: `E_Oven`

Expand Down
28 changes: 14 additions & 14 deletions src/functionalTest/java/gregtech/test/GTParallelHelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

import gregtech.api.enums.Materials;
import gregtech.api.enums.TierEU;
import gregtech.api.util.GT_ParallelHelper;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
import gregtech.api.util.GTRecipe;
import gregtech.api.util.GTUtility;
import gregtech.api.util.ParallelHelper;
import gregtech.test.mock.MockIVoidableMachine;

public class GTParallelHelperTest {

static GT_Recipe rubberRecipe;
static GTRecipe rubberRecipe;
static ItemStack[] inputItems;
static MockIVoidableMachine machine;

Expand All @@ -27,7 +27,7 @@ static void setup() {
machine = new MockIVoidableMachine();
ItemStack rubberDust = Materials.RawRubber.getDust(1);
ItemStack sulfurDust = Materials.Sulfur.getDust(1);
rubberRecipe = new GT_Recipe(
rubberRecipe = new GTRecipe(
new ItemStack[] { rubberDust.copy(), sulfurDust.copy() },
new ItemStack[] { Materials.Rubber.getDust(1), Materials.Rubber.getDustTiny(1) },
null,
Expand All @@ -38,15 +38,15 @@ static void setup() {
1,
0);

inputItems = new ItemStack[] { GT_Utility.copyAmountUnsafe(Integer.MAX_VALUE, rubberDust),
GT_Utility.copyAmountUnsafe(Integer.MAX_VALUE, rubberDust),
GT_Utility.copyAmountUnsafe(Integer.MAX_VALUE, sulfurDust),
GT_Utility.copyAmountUnsafe(Integer.MAX_VALUE, sulfurDust) };
inputItems = new ItemStack[] { GTUtility.copyAmountUnsafe(Integer.MAX_VALUE, rubberDust),
GTUtility.copyAmountUnsafe(Integer.MAX_VALUE, rubberDust),
GTUtility.copyAmountUnsafe(Integer.MAX_VALUE, sulfurDust),
GTUtility.copyAmountUnsafe(Integer.MAX_VALUE, sulfurDust) };
}

@Test
void OutputsIntegerOverflow() {
GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(rubberRecipe)
ParallelHelper helper = new ParallelHelper().setRecipe(rubberRecipe)
.setMachine(machine, false, false)
.setItemInputs(inputItems)
.setMaxParallel(4_000_000)
Expand All @@ -64,7 +64,7 @@ void OutputsIntegerOverflow() {
@Test
void parallelIntegerOverflow() {
// Without batch mode
GT_ParallelHelper helperWithoutBatchMode = new GT_ParallelHelper().setRecipe(rubberRecipe)
ParallelHelper helperWithoutBatchMode = new ParallelHelper().setRecipe(rubberRecipe)
.setMachine(machine, false, false)
.setItemInputs(inputItems)
.setMaxParallel(Integer.MAX_VALUE)
Expand All @@ -74,7 +74,7 @@ void parallelIntegerOverflow() {
assertEquals(Integer.MAX_VALUE, helperWithoutBatchMode.getCurrentParallel());

// With batch mode
GT_ParallelHelper helperWithBatchMode = new GT_ParallelHelper().setRecipe(rubberRecipe)
ParallelHelper helperWithBatchMode = new ParallelHelper().setRecipe(rubberRecipe)
.setMachine(machine, false, false)
.setItemInputs(inputItems)
.setMaxParallel(Integer.MAX_VALUE / 50)
Expand All @@ -87,7 +87,7 @@ void parallelIntegerOverflow() {

@Test
void chanceMultiplier() {
GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(rubberRecipe)
ParallelHelper helper = new ParallelHelper().setRecipe(rubberRecipe)
.setMachine(machine, false, false)
.setItemInputs(inputItems)
.setMaxParallel(10)
Expand All @@ -106,7 +106,7 @@ void chanceMultiplier() {

@Test
void outputMultiplier() {
GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(rubberRecipe)
ParallelHelper helper = new ParallelHelper().setRecipe(rubberRecipe)
.setMachine(machine, false, false)
.setItemInputs(inputItems)
.setMaxParallel(1)
Expand Down
44 changes: 22 additions & 22 deletions src/functionalTest/java/gregtech/test/GTRecipeTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package gregtech.test;

import static gregtech.api.GregTech_API.sBlockOres1;
import static gregtech.api.enums.GT_Values.RA;
import static gregtech.api.GregTechAPI.sBlockOres1;
import static gregtech.api.enums.GTValues.RA;
import static gregtech.api.enums.ItemList.Circuit_Parts_Crystal_Chip_Master;
import static gregtech.api.enums.ItemList.IC2_LapotronCrystal;
import static gregtech.api.enums.OrePrefixes.circuit;
import static gregtech.api.enums.OrePrefixes.lens;
import static gregtech.api.util.GT_OreDictUnificator.get;
import static gregtech.api.util.GT_Utility.copyAmount;
import static gregtech.api.util.GTOreDictUnificator.get;
import static gregtech.api.util.GTUtility.copyAmount;
import static net.minecraft.init.Blocks.chest;
import static net.minecraft.init.Blocks.iron_ore;
import static net.minecraft.init.Blocks.lapis_block;
Expand All @@ -32,12 +32,12 @@
import gregtech.api.enums.Materials;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMapBuilder;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GTRecipe;

class GTRecipeTest {

static RecipeMap<?> recipeMap;
static GT_Recipe lapotronChipRecipe;
static GTRecipe lapotronChipRecipe;

@BeforeAll
static void setup() {
Expand Down Expand Up @@ -65,7 +65,7 @@ static void setup() {
.duration(0)
.eut(0)
.addTo(recipeMap)
.toArray(new GT_Recipe[0])[0];
.toArray(new GTRecipe[0])[0];

RA.stdBuilder()
.itemInputs(new ItemStack(sBlockOres1, 1, 32))
Expand Down Expand Up @@ -115,25 +115,25 @@ void ensureRecipesAdded() {

@Test
void findWithExactSameInputs() {
GT_Recipe recipe = recipeMap.findRecipeQuery()
GTRecipe recipe = recipeMap.findRecipeQuery()
.items(new ItemStack(lapis_block, 1), get(circuit, Materials.HV, 1))
.find();
assertNotNull(recipe);

GT_Recipe stoneRecipe = recipeMap.findRecipeQuery()
GTRecipe stoneRecipe = recipeMap.findRecipeQuery()
.items(new ItemStack(stone_slab, 128))
.find();
assertNotNull(stoneRecipe);
}

@Test
void findWildcardWithExactSameInputs() {
GT_Recipe chestRecipe = recipeMap.findRecipeQuery()
GTRecipe chestRecipe = recipeMap.findRecipeQuery()
.items(new ItemStack(log, 2, WILDCARD_VALUE), new ItemStack(planks, 2, WILDCARD_VALUE))
.find();
assertNotNull(chestRecipe);

GT_Recipe lapotronChipRecipe = recipeMap.findRecipeQuery()
GTRecipe lapotronChipRecipe = recipeMap.findRecipeQuery()
.items(IC2_LapotronCrystal.getWildcard(1), copyAmount(0, get(lens, Materials.BlueTopaz, 1)))
.find();
assertNotNull(lapotronChipRecipe);
Expand All @@ -142,7 +142,7 @@ void findWildcardWithExactSameInputs() {
@Test
void findWildcardWithDifferentMeta() {
// https://github.com/GTNewHorizons/GT5-Unofficial/pull/2364/commits/e7112fce5f24431f3a4ad19288d662b93cbb91f2
GT_Recipe recipe = recipeMap.findRecipeQuery()
GTRecipe recipe = recipeMap.findRecipeQuery()
.items(new ItemStack(log, 2, 0), new ItemStack(planks, 2, 1))
.find();
assertNotNull(recipe);
Expand All @@ -155,7 +155,7 @@ void findWithNBT() {
NBTTagCompound tag = new NBTTagCompound();
tag.setFloat("charge", 123456);
lapisBlock.stackTagCompound = tag;
GT_Recipe recipe = recipeMap.findRecipeQuery()
GTRecipe recipe = recipeMap.findRecipeQuery()
.items(lapisBlock, get(circuit, Materials.HV, 1))
.find();
assertNotNull(recipe);
Expand All @@ -165,7 +165,7 @@ void findWithNBT() {
NBTTagCompound glassTag = new NBTTagCompound();
glassTag.setInteger("integer", 123456);
glass.setTagCompound(glassTag);
GT_Recipe nbtSensitiveRecipe = recipeMap.findRecipeQuery()
GTRecipe nbtSensitiveRecipe = recipeMap.findRecipeQuery()
.items(glass)
.find();
assertNotNull(nbtSensitiveRecipe);
Expand All @@ -175,20 +175,20 @@ void findWithNBT() {
NBTTagCompound dataStickTag = new NBTTagCompound();
dataStickTag.setInteger("integer", 123456);
dataStick.setTagCompound(dataStickTag);
GT_Recipe checkNBTRecipe = recipeMap.findRecipeQuery()
GTRecipe checkNBTRecipe = recipeMap.findRecipeQuery()
.items(dataStick)
.find();
assertNotNull(checkNBTRecipe);
}

@Test
void rejectWithInsufficientAmount() {
GT_Recipe recipe = recipeMap.findRecipeQuery()
GTRecipe recipe = recipeMap.findRecipeQuery()
.items(new ItemStack(log, 1, 0), new ItemStack(planks, 1, 0))
.find();
assertNull(recipe);

GT_Recipe stoneRecipe = recipeMap.findRecipeQuery()
GTRecipe stoneRecipe = recipeMap.findRecipeQuery()
.items(new ItemStack(stone_slab, 127))
.find();
assertNull(stoneRecipe);
Expand All @@ -197,7 +197,7 @@ void rejectWithInsufficientAmount() {
@Test
void rejectWithoutNonConsumable() {
// https://github.com/GTNewHorizons/GT5-Unofficial/pull/2364/commits/bfc93bff7ed34616021e8c5b6dbdc50dd7096af5
GT_Recipe recipe = recipeMap.findRecipeQuery()
GTRecipe recipe = recipeMap.findRecipeQuery()
.items(IC2_LapotronCrystal.get(1))
.cachedRecipe(lapotronChipRecipe)
.find();
Expand All @@ -207,13 +207,13 @@ void rejectWithoutNonConsumable() {
@Test
void rejectWithoutCorrectNBT() {
// For NBT sensitive recipes
GT_Recipe nbtSensitiveRecipe = recipeMap.findRecipeQuery()
GTRecipe nbtSensitiveRecipe = recipeMap.findRecipeQuery()
.items(new ItemStack(glass_bottle, 2))
.find();
assertNull(nbtSensitiveRecipe);

// For items that need to check NBT, e.g. data sticks
GT_Recipe checkNBTRecipe = recipeMap.findRecipeQuery()
GTRecipe checkNBTRecipe = recipeMap.findRecipeQuery()
.items(ItemList.Tool_DataStick.get(0))
.find();
assertNull(checkNBTRecipe);
Expand All @@ -225,12 +225,12 @@ void findWithSpecificOreDictionary() {
// We cannot use circuit assembling recipe like the issue mentioned above,
// as mUnificationTarget is not set for circuits in GT5.
// But it works in the same way; specific circuit -> GT ore block, unificated circuit -> vanilla ore block
GT_Recipe recipeCorrectOre = recipeMap.findRecipeQuery()
GTRecipe recipeCorrectOre = recipeMap.findRecipeQuery()
.items(new ItemStack(sBlockOres1, 1, 32))
.find();
assertNotNull(recipeCorrectOre);

GT_Recipe recipeWrongOre = recipeMap.findRecipeQuery()
GTRecipe recipeWrongOre = recipeMap.findRecipeQuery()
.items(new ItemStack(iron_ore, 1))
.find();
assertNull(recipeWrongOre);
Expand Down
17 changes: 8 additions & 9 deletions src/functionalTest/java/kubatech/test/EIGTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package kubatech.test;

import static gregtech.api.util.GT_RecipeBuilder.HOURS;
import static gregtech.api.util.GTRecipeBuilder.HOURS;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.File;
Expand Down Expand Up @@ -48,16 +48,16 @@

import org.junit.jupiter.api.Test;

import gregtech.api.GregTech_API;
import gregtech.api.GregTechAPI;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.common.blocks.GT_Item_Machines;
import gregtech.common.blocks.ItemMachines;
import ic2.api.crops.CropCard;
import ic2.api.crops.Crops;
import ic2.core.Ic2Items;
import ic2.core.crop.TileEntityCrop;
import ic2.core.item.ItemCropSeed;
import kubatech.api.eig.EIGDropTable;
import kubatech.tileentity.gregtech.multiblock.GT_MetaTileEntity_ExtremeIndustrialGreenhouse;
import kubatech.tileentity.gregtech.multiblock.MTEExtremeIndustrialGreenhouse;
import kubatech.tileentity.gregtech.multiblock.eigbuckets.EIGIC2Bucket;

public class EIGTests {
Expand Down Expand Up @@ -190,7 +190,7 @@ EIGDropTable getRealDrops(TileEntityCrop cropTile, CropCard cc, int growth, int
return expected;
}

EIGDropTable getEIGDrops(GT_MetaTileEntity_ExtremeIndustrialGreenhouse EIG, ItemStack stack) {
EIGDropTable getEIGDrops(MTEExtremeIndustrialGreenhouse EIG, ItemStack stack) {
EIGDropTable generated = new EIGDropTable();
EIGIC2Bucket bucket = new EIGIC2Bucket(stack, stack.stackSize, null, false);
bucket.revalidate(EIG);
Expand All @@ -208,7 +208,7 @@ void EIGDrops() {
TileEntityCrop cropTile = (TileEntityCrop) myWorld.getTileEntity(10, 81, 0);
ItemStack ccStack = ItemCropSeed.generateItemStackFromValues(cc, (byte) 10, (byte) 10, (byte) 10, (byte) 1);

GT_Item_Machines itemMachines = (GT_Item_Machines) Item.getItemFromBlock(GregTech_API.sBlockMachines);
ItemMachines itemMachines = (ItemMachines) Item.getItemFromBlock(GregTechAPI.sBlockMachines);
itemMachines.placeBlockAt(
new ItemStack(itemMachines, 1, EIG_CONTROLLER_METADATA),
null,
Expand All @@ -222,8 +222,7 @@ void EIGDrops() {
0,
EIG_CONTROLLER_METADATA);
IGregTechTileEntity te = (IGregTechTileEntity) myWorld.getTileEntity(0, 81, 0);
GT_MetaTileEntity_ExtremeIndustrialGreenhouse EIG = (GT_MetaTileEntity_ExtremeIndustrialGreenhouse) te
.getMetaTileEntity();
MTEExtremeIndustrialGreenhouse EIG = (MTEExtremeIndustrialGreenhouse) te.getMetaTileEntity();

// update stats of crop TE to those provided by the EIG
cropTile.humidity = EIGIC2Bucket.getHumidity(EIG, false);
Expand All @@ -238,7 +237,7 @@ void EIGDrops() {
xyz[1] += te.getYCoord();
xyz[2] += te.getZCoord();

myWorld.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTech_API.sBlockCasings4, 1, 0);
myWorld.setBlock(xyz[0], xyz[1] - 2, xyz[2], GregTechAPI.sBlockCasings4, 1, 0);
myWorld.setBlock(xyz[0], xyz[1] - 1, xyz[2], Blocks.farmland, 0, 0);

ItemStack stackToTest = null;
Expand Down
6 changes: 3 additions & 3 deletions src/functionalTest/java/kubatech/test/kubatechTestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartedEvent;
import gregtech.GT_Mod;
import gregtech.GTMod;

@Mod(
modid = "kubatech-tests",
Expand All @@ -37,8 +37,8 @@ public class kubatechTestMod {
@EventHandler
public void preInit(FMLPreInitializationEvent ev) {
// Disable GT5u messing with vanilla recipes for unit tests
GT_Mod.gregtechproxy.mNerfedWoodPlank = false;
GT_Mod.gregtechproxy.mNerfedVanillaTools = false;
GTMod.gregtechproxy.mNerfedWoodPlank = false;
GTMod.gregtechproxy.mNerfedVanillaTools = false;
}

@EventHandler
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/bartworks/API/APIConfigValues.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2018-2020 bartimaeusnek Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions: The above copyright notice and this permission notice shall be included in all copies or substantial
* portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

package bartworks.API;

public class APIConfigValues {

// One-Side-Only
public static boolean debugLog = true;
}
Loading

0 comments on commit 1b820de

Please sign in to comment.