Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring GT++ 2025-02-13 #3948

Merged
merged 12 commits into from
Feb 16, 2025
5 changes: 3 additions & 2 deletions src/main/java/gregtech/api/util/SemiFluidFuelHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;

import org.apache.commons.lang3.tuple.Pair;

import gregtech.api.enums.GTValues;
import gregtech.api.recipe.RecipeMaps;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.util.minecraft.FluidUtils;

public class SemiFluidFuelHandler {
Expand All @@ -31,7 +32,7 @@ public static boolean generateFuels() {
for (ItemStack i : g.mInputs) {
FluidStack f = FluidContainerRegistry.getFluidForFilledItem(i);
if (f != null) {
Pair<FluidStack, Integer> aData = new Pair<>(f, g.mSpecialValue);
Pair<FluidStack, Integer> aData = Pair.of(f, g.mSpecialValue);
aFoundFluidsFromItems.put(aData.hashCode(), aData);
}
}
Expand Down
35 changes: 0 additions & 35 deletions src/main/java/gtPlusPlus/api/objects/data/Pair.java

This file was deleted.

44 changes: 0 additions & 44 deletions src/main/java/gtPlusPlus/api/objects/data/Quad.java

This file was deleted.

26 changes: 0 additions & 26 deletions src/main/java/gtPlusPlus/api/objects/data/Triplet.java

This file was deleted.

173 changes: 0 additions & 173 deletions src/main/java/gtPlusPlus/api/objects/data/TypeCounter.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package gtPlusPlus.api.objects.minecraft;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
Expand All @@ -9,7 +11,7 @@

import gregtech.api.util.GTUtility;
import gtPlusPlus.core.tileentities.base.TileEntityBase;
import gtPlusPlus.core.util.data.ArrayUtils;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;

public class BTF_Inventory implements ISidedInventory {

Expand Down Expand Up @@ -204,7 +206,9 @@ public boolean addItemStack(ItemStack aInput) {
}

public final void purgeNulls() {
ItemStack[] aTemp = ArrayUtils.removeNulls(this.mInventory);
List<ItemStack> list = new ObjectArrayList<>(this.mInventory);
list.removeAll(Collections.singleton((ItemStack) null));
ItemStack[] aTemp = list.toArray(new ItemStack[0]);
for (int g = 0; g < this.getSizeInventory(); g++) {
if (aTemp.length < this.getSizeInventory()) {
if (g <= aTemp.length - 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;

import org.apache.commons.lang3.tuple.Pair;

import gregtech.mixin.interfaces.accessors.IRecipeMutableAccess;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class ShapedRecipe implements IRecipeMutableAccess {
Expand Down Expand Up @@ -89,7 +90,7 @@ public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
}
mInfo = ((ItemStack) stack).getDisplayName();
}
aRecipePairs.add(new Pair<>(CHARS.charAt(aCharSlot), stack));
aRecipePairs.add(Pair.of(CHARS.charAt(aCharSlot), stack));
Logger.RECIPE(
"Storing '" + CHARS.charAt(aCharSlot)
+ "' with an object of type "
Expand All @@ -101,7 +102,7 @@ public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
aCharSlot++;
aLoggingInfo[aInfoSlot++] = mInfo;
} else {
aRecipePairs.add(new Pair<>(' ', null));
aRecipePairs.add(Pair.of(' ', null));
Logger.RECIPE("Storing ' ' with an object of type null");
aChar[aMemSlot++] = ' ';
aLoggingInfo[aInfoSlot++] = "Empty";
Expand Down Expand Up @@ -153,7 +154,7 @@ public ShapedRecipe(Object[] aInputs, ItemStack aOutput) {
}
mInfo = ((ItemStack) stack).getDisplayName();
}
aRecipePairs.add(new Pair<>(CHARS.charAt(aCharSlot), stack));
aRecipePairs.add(Pair.of(CHARS.charAt(aCharSlot), stack));
Logger.RECIPE(
"Registering Pair of '" + CHARS.charAt(aCharSlot)
+ "' and a "
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gtPlusPlus/core/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingAttackEvent;

import org.apache.commons.lang3.tuple.Pair;

import baubles.common.container.InventoryBaubles;
import baubles.common.lib.PlayerHandler;
import cpw.mods.fml.common.IFuelHandler;
Expand All @@ -23,7 +25,6 @@
import galaxyspace.core.entity.mob.EntityEvolvedColdBlaze;
import gregtech.api.enums.Mods;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.api.objects.data.Pair;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.config.ASMConfiguration;
import gtPlusPlus.core.creative.AddToCreativeTab;
Expand Down
Loading