mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-27 07:13:14 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
9bdeaa9708
commit
42e704a5d8
66 files changed
+1059
-828
No files matched your search
@@ -1,5 +1,11 @@
|
||||
package com.github.vfyjxf.nee.utils;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import appeng.client.gui.implementations.GuiCraftConfirm;
|
||||
import appeng.client.gui.implementations.GuiCraftingTerm;
|
||||
import appeng.client.gui.implementations.GuiPatternTerm;
|
||||
@@ -7,17 +13,13 @@ import appeng.client.gui.implementations.GuiPatternTermEx;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.implementations.ContainerPatternTermEx;
|
||||
import appeng.helpers.IContainerCraftingPacket;
|
||||
|
||||
import com.github.vfyjxf.nee.container.WCTContainerCraftingConfirm;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminalEx;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.container.ContainerFluidPatternTerminalEx;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
/**
|
||||
* @author vfyjxf
|
||||
@@ -34,8 +36,7 @@ public class GuiUtils {
|
||||
|
||||
public static boolean isWirelessCraftingTermContainer(Container container) {
|
||||
if (!isWirelessCraftingTerminalModLoaded) return false;
|
||||
return container
|
||||
instanceof net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
|
||||
return container instanceof net.p455w0rd.wirelesscraftingterminal.common.container.ContainerWirelessCraftingTerminal;
|
||||
}
|
||||
|
||||
public static boolean isContainerWirelessCraftingConfirm(Container container) {
|
||||
@@ -72,8 +73,7 @@ public class GuiUtils {
|
||||
|
||||
public static boolean isPatternContainer(Container container) {
|
||||
if (isFluidCraftModloaded) {
|
||||
return container instanceof ContainerPatternTerm
|
||||
|| container instanceof ContainerPatternTermEx
|
||||
return container instanceof ContainerPatternTerm || container instanceof ContainerPatternTermEx
|
||||
|| container instanceof ContainerFluidPatternTerminal
|
||||
|| container instanceof ContainerFluidPatternTerminalEx;
|
||||
} else {
|
||||
@@ -96,8 +96,7 @@ public class GuiUtils {
|
||||
|
||||
public static boolean isPatternTerm(GuiScreen guiScreen) {
|
||||
if (isFluidCraftModloaded) {
|
||||
return guiScreen instanceof GuiPatternTerm
|
||||
|| guiScreen instanceof GuiPatternTermEx
|
||||
return guiScreen instanceof GuiPatternTerm || guiScreen instanceof GuiPatternTermEx
|
||||
|| guiScreen instanceof GuiFluidPatternTerminal
|
||||
|| guiScreen instanceof GuiFluidPatternTerminalEx;
|
||||
} else {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.github.vfyjxf.nee.utils;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public class Ingredient {
|
||||
|
||||
private long requireCount;
|
||||
|
||||
@@ -3,6 +3,15 @@ package com.github.vfyjxf.nee.utils;
|
||||
import static com.github.vfyjxf.nee.nei.NEECraftingHelper.noPreview;
|
||||
import static com.github.vfyjxf.nee.utils.GuiUtils.isFluidCraftPatternTerm;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.implementations.GuiMEMonitorable;
|
||||
@@ -11,18 +20,12 @@ import appeng.util.item.AEItemStack;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.IRecipeHandler;
|
||||
|
||||
import com.github.vfyjxf.nee.config.NEEConfig;
|
||||
import com.github.vfyjxf.nee.network.NEENetworkHandler;
|
||||
import com.github.vfyjxf.nee.network.packet.PacketCraftingRequest;
|
||||
import com.glodblock.github.client.gui.base.FCGuiMonitor;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.p455w0rd.wirelesscraftingterminal.client.gui.GuiWirelessCraftingTerminal;
|
||||
|
||||
public class IngredientTracker {
|
||||
|
||||
@@ -79,11 +82,9 @@ public class IngredientTracker {
|
||||
|
||||
private ItemRepo getRepo() throws IllegalAccessException {
|
||||
if (isFluidCraftPatternTerm(termGui)) {
|
||||
return (ItemRepo)
|
||||
ReflectionHelper.findField(FCGuiMonitor.class, "repo").get(termGui);
|
||||
return (ItemRepo) ReflectionHelper.findField(FCGuiMonitor.class, "repo").get(termGui);
|
||||
} else {
|
||||
return (ItemRepo)
|
||||
ReflectionHelper.findField(GuiMEMonitorable.class, "repo").get(termGui);
|
||||
return (ItemRepo) ReflectionHelper.findField(GuiMEMonitorable.class, "repo").get(termGui);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,14 +96,12 @@ public class IngredientTracker {
|
||||
try {
|
||||
if (!GuiUtils.isGuiWirelessCrafting(termGui)) {
|
||||
ItemRepo repo = getRepo();
|
||||
list = (IItemList<IAEItemStack>)
|
||||
ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
|
||||
list = (IItemList<IAEItemStack>) ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
|
||||
} else {
|
||||
// wireless crafting terminal support
|
||||
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
|
||||
.get(termGui);
|
||||
list = (IItemList<IAEItemStack>)
|
||||
ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
|
||||
list = (IItemList<IAEItemStack>) ReflectionHelper.findField(ItemRepo.class, "list").get(repo);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
@@ -124,18 +123,17 @@ public class IngredientTracker {
|
||||
if (termGui != null) {
|
||||
try {
|
||||
if (!GuiUtils.isGuiWirelessCrafting(termGui)) {
|
||||
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiMEMonitorable.class, "repo")
|
||||
.get(termGui);
|
||||
for (IAEItemStack stack : (IItemList<IAEItemStack>)
|
||||
ReflectionHelper.findField(ItemRepo.class, "list").get(repo)) {
|
||||
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiMEMonitorable.class, "repo").get(termGui);
|
||||
for (IAEItemStack stack : (IItemList<IAEItemStack>) ReflectionHelper
|
||||
.findField(ItemRepo.class, "list").get(repo)) {
|
||||
list.add(stack.copy());
|
||||
}
|
||||
} else {
|
||||
// wireless crafting terminal support
|
||||
ItemRepo repo = (ItemRepo) ReflectionHelper.findField(GuiWirelessCraftingTerminal.class, "repo")
|
||||
.get(termGui);
|
||||
for (IAEItemStack stack : (IItemList<IAEItemStack>)
|
||||
ReflectionHelper.findField(ItemRepo.class, "list").get(repo)) {
|
||||
for (IAEItemStack stack : (IItemList<IAEItemStack>) ReflectionHelper
|
||||
.findField(ItemRepo.class, "list").get(repo)) {
|
||||
list.add(stack.copy());
|
||||
}
|
||||
}
|
||||
@@ -214,8 +212,7 @@ public class IngredientTracker {
|
||||
}
|
||||
} else {
|
||||
ItemStack craftableStack = ingredient.getCraftableIngredient();
|
||||
if (craftableStack != null
|
||||
&& craftableStack.isItemEqual(stack)
|
||||
if (craftableStack != null && craftableStack.isItemEqual(stack)
|
||||
&& ItemStack.areItemStackTagsEqual(craftableStack, stack)
|
||||
&& stack.stackSize > 0) {
|
||||
int missingCount = (int) ingredient.getMissingCount();
|
||||
@@ -254,8 +251,7 @@ public class IngredientTracker {
|
||||
List<ItemStack> inventoryStacks = new ArrayList<>();
|
||||
|
||||
for (Slot slot : (List<Slot>) termGui.inventorySlots.inventorySlots) {
|
||||
boolean canGetStack = slot != null
|
||||
&& slot.getHasStack()
|
||||
boolean canGetStack = slot != null && slot.getHasStack()
|
||||
&& slot.getStack().stackSize > 0
|
||||
&& slot.isItemValid(slot.getStack())
|
||||
&& slot.canTakeStack(Minecraft.getMinecraft().thePlayer);
|
||||
|
||||
@@ -2,22 +2,26 @@ package com.github.vfyjxf.nee.utils;
|
||||
|
||||
import static com.github.vfyjxf.nee.config.NEEConfig.*;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import com.github.vfyjxf.nee.NotEnoughEnergistics;
|
||||
import com.github.vfyjxf.nee.processor.IRecipeProcessor;
|
||||
import com.github.vfyjxf.nee.processor.RecipeProcessor;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.JsonToNBT;
|
||||
import net.minecraft.nbt.NBTException;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
import com.github.vfyjxf.nee.NotEnoughEnergistics;
|
||||
import com.github.vfyjxf.nee.processor.IRecipeProcessor;
|
||||
import com.github.vfyjxf.nee.processor.RecipeProcessor;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public final class ItemUtils {
|
||||
|
||||
public static Gson gson = new Gson();
|
||||
@@ -29,8 +33,7 @@ public final class ItemUtils {
|
||||
static {
|
||||
try {
|
||||
GT_MetaGenerated_ToolClass = Class.forName("gregtech.api.items.GT_MetaGenerated_Tool");
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
}
|
||||
} catch (ClassNotFoundException ignored) {}
|
||||
}
|
||||
|
||||
public static void reloadConfig() {
|
||||
@@ -65,8 +68,12 @@ public final class ItemUtils {
|
||||
currentStack.setTagCompound(nbt);
|
||||
}
|
||||
}
|
||||
transformItemBlacklist.add(new StackProcessor(
|
||||
currentStack, currentItem, processor.recipeProcessor, processor.identifier));
|
||||
transformItemBlacklist.add(
|
||||
new StackProcessor(
|
||||
currentStack,
|
||||
currentItem,
|
||||
processor.recipeProcessor,
|
||||
processor.identifier));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,8 +108,12 @@ public final class ItemUtils {
|
||||
currentStack.setTagCompound(nbt);
|
||||
}
|
||||
}
|
||||
transformItemPriorityList.add(new StackProcessor(
|
||||
currentStack, currentItem, processor.recipeProcessor, processor.identifier));
|
||||
transformItemPriorityList.add(
|
||||
new StackProcessor(
|
||||
currentStack,
|
||||
currentItem,
|
||||
processor.recipeProcessor,
|
||||
processor.identifier));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,11 +197,18 @@ public final class ItemUtils {
|
||||
|
||||
public static String toItemJsonString(ItemStack stack) {
|
||||
GameRegistry.UniqueIdentifier identifier = GameRegistry.findUniqueIdentifierFor(stack.getItem());
|
||||
String nbtString =
|
||||
stack.hasTagCompound() ? ",\"nbt\":" + stack.getTagCompound().toString() : "";
|
||||
String nbtString = stack.hasTagCompound() ? ",\"nbt\":" + stack.getTagCompound().toString() : "";
|
||||
int meta = stack.getItemDamage();
|
||||
return "{" + "\"modid\":" + identifier.modId + "," + "\"name\":" + identifier.name + "," + "\"meta\":" + meta
|
||||
+ nbtString + "}";
|
||||
return "{" + "\"modid\":"
|
||||
+ identifier.modId
|
||||
+ ","
|
||||
+ "\"name\":"
|
||||
+ identifier.name
|
||||
+ ","
|
||||
+ "\"meta\":"
|
||||
+ meta
|
||||
+ nbtString
|
||||
+ "}";
|
||||
}
|
||||
|
||||
public static boolean hasRecipeProcessor(String processorId) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.github.vfyjxf.nee.utils;
|
||||
|
||||
public class ModIDs {
|
||||
|
||||
public static final String WCT = "ae2wct";
|
||||
public static final String FC = "ae2fc";
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class StackProcessor {
|
||||
|
||||
public String modid;
|
||||
public String name;
|
||||
public String meta;
|
||||
|
||||
Reference in new issue
Block a user