mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
9 files changed
+136
-65
No files matched your search
+5
-5
@@ -5,9 +5,9 @@ dependencies {
|
||||
compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-149-GTNH:dev')
|
||||
compile('curse.maven:cofh-core-69162:2388751')
|
||||
compile('com.github.GTNewHorizons:waila:1.5.22:dev')
|
||||
compile('com.github.GTNewHorizons:CraftTweaker:3.2.11:dev')
|
||||
compile('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")
|
||||
compileOnly('com.github.GTNewHorizons:CraftTweaker:3.2.11:dev')
|
||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }
|
||||
compile("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev')
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.49:dev')
|
||||
@@ -15,12 +15,12 @@ dependencies {
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.216:dev')
|
||||
compileOnly('com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('com.github.GTNewHorizons:AppleCore:3.2.5:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.28:dev') { transitive = false }
|
||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.5-GTNH:dev') { transitive = false }
|
||||
compile('com.github.GTNewHorizons:ThaumicEnergistics:1.3.27-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.3.27-GTNH:dev') { transitive = false }
|
||||
compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.191:dev') { transitive = false }
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:KekzTech:0.6.25:dev')
|
||||
|
||||
@@ -28,7 +28,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
modid = FluidCraft.MODID,
|
||||
version = FluidCraft.VERSION,
|
||||
name = FluidCraft.MODNAME,
|
||||
dependencies = "required-after:appliedenergistics2;required-after:CoFHCore;after:waila")
|
||||
dependencies = "required-after:appliedenergistics2;required-after:CoFHCore;after:waila;after:thaumicenergistics;after:ae2wct")
|
||||
public class FluidCraft {
|
||||
|
||||
public static final String MODID = "GRADLETOKEN_MODID";
|
||||
@@ -72,7 +72,7 @@ public class FluidCraft {
|
||||
if (!Config.removeRecipe) {
|
||||
RecipeLoader.INSTANCE.run();
|
||||
}
|
||||
RecipeLoader.runWCTRecipe();
|
||||
RecipeLoader.runTerminalRecipe();
|
||||
|
||||
if (ModAndClassUtil.isV2) {
|
||||
CalculatorV2PluginLoader.installCalculatorV2Plugins();
|
||||
|
||||
@@ -104,7 +104,8 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
this.configSrc = ((IConfigurableObject) this.inventorySlots).getConfigManager();
|
||||
(this.monitorableContainer = (FCContainerMonitor<T>) this.inventorySlots).setGui(this);
|
||||
this.viewCell = te instanceof IViewCellStorage;
|
||||
if (inventoryPlayer.getCurrentItem().getItem() instanceof ItemWirelessUltraTerminal)
|
||||
if (inventoryPlayer.getCurrentItem() != null
|
||||
&& inventoryPlayer.getCurrentItem().getItem() instanceof ItemWirelessUltraTerminal)
|
||||
this.drawSwitchGuiBtn = true;
|
||||
}
|
||||
|
||||
@@ -376,7 +377,7 @@ public abstract class FCGuiMonitor<T extends IAEStack<T>> extends AEBaseMEGui
|
||||
false));
|
||||
this.offsetY += 20;
|
||||
}
|
||||
if (!(this instanceof GuiEssentiaTerminal)) {
|
||||
if (ModAndClassUtil.ThE && !(this instanceof GuiEssentiaTerminal)) {
|
||||
this.buttonList.add(
|
||||
this.EssentiaTerminal = new GuiFCImgButton(
|
||||
this.guiLeft - 18,
|
||||
|
||||
@@ -93,7 +93,12 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
}
|
||||
if (gui == GuiType.WIRELESS_CRAFTING_TERMINAL) {
|
||||
return new WirelessCraftingTerminalInventory(stack, x, gridNode, player);
|
||||
} else if (ModAndClassUtil.ThE && gui == GuiType.WIRELESS_ESSENTIA_TERMINAL) {
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
} else if (gui == GuiType.WIRELESS_FLUID_TERMINAL) {
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
} else {
|
||||
this.setMode(GuiType.WIRELESS_FLUID_TERMINAL, stack); // set as default mode
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.tile.inventory.BiggerAppEngInventory;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
|
||||
public class ItemBiggerAppEngInventory extends BiggerAppEngInventory {
|
||||
|
||||
private final ItemStack is;
|
||||
@@ -20,7 +22,9 @@ public class ItemBiggerAppEngInventory extends BiggerAppEngInventory {
|
||||
@Override
|
||||
public void markDirty() {
|
||||
boolean isCraft = Platform.openNbtData(is).getBoolean("craftingMode");
|
||||
if (isCraft) {
|
||||
boolean isCraftingTerm = Platform.openNbtData(is).getString("mode_main")
|
||||
.equals(GuiType.WIRELESS_CRAFTING_TERMINAL.toString());
|
||||
if (!isCraftingTerm && isCraft) {
|
||||
for (int x = 0; x < this.getSizeInventory(); x++) {
|
||||
final ItemStack is = this.getStackInSlot(x);
|
||||
if (is != null) {
|
||||
|
||||
@@ -4,6 +4,9 @@ import static com.glodblock.github.loader.ItemAndBlockHolder.*;
|
||||
import static net.minecraft.init.Blocks.redstone_torch;
|
||||
import static net.minecraft.init.Items.fish;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -102,6 +105,10 @@ public class RecipeLoader implements Runnable {
|
||||
.findItemStack("appliedenergistics2", "tile.BlockChest", 1);
|
||||
public static final ItemStack AE2_ENERGY_CELL = GameRegistry
|
||||
.findItemStack("appliedenergistics2", "tile.BlockEnergyCell", 1);
|
||||
public static final ItemStack THE_WIRELESS_TERM = GameRegistry
|
||||
.findItemStack("thaumicenergistics", "wireless.essentia.terminal", 1);
|
||||
private static final ItemStack WCT_WIRELESS_TERM = GameRegistry
|
||||
.findItemStack("ae2wct", "wirelessCraftingTerminal", 1);
|
||||
public static final ItemStack BUCKET = new ItemStack(Items.bucket, 1);
|
||||
public static final ItemStack IRON_BAR = new ItemStack(Blocks.iron_bars, 1);
|
||||
|
||||
@@ -450,10 +457,18 @@ public class RecipeLoader implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
public static void runWCTRecipe() {
|
||||
public static void runTerminalRecipe() {
|
||||
if (ModAndClassUtil.WCT) {
|
||||
GameRegistry.addRecipe(new WirelessTerminalRecipe(WIRELESS_PATTERN_TERM.stack()));
|
||||
GameRegistry.addRecipe(new WirelessTerminalRecipe(WIRELESS_FLUID_TERM.stack()));
|
||||
GameRegistry.addRecipe(new WirelessTerminalRecipe(WIRELESS_ULTRA_TERM.stack()));
|
||||
}
|
||||
|
||||
ItemStack[] term = { AE2_WIRELESS_TERMINAL, WIRELESS_FLUID_TERM.stack(), WIRELESS_PATTERN_TERM.stack(),
|
||||
THE_WIRELESS_TERM, WCT_WIRELESS_TERM };
|
||||
GameRegistry.addShapelessRecipe(
|
||||
WIRELESS_ULTRA_TERM.stack(),
|
||||
Arrays.stream(term).filter(Objects::nonNull).toArray());
|
||||
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -10,6 +10,7 @@ import codechicken.nei.recipe.IRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiFluidCraftingWireless;
|
||||
import com.glodblock.github.client.gui.base.FCGuiEncodeTerminal;
|
||||
import com.glodblock.github.nei.object.OrderStack;
|
||||
import com.glodblock.github.nei.recipes.FluidRecipe;
|
||||
@@ -30,8 +31,9 @@ public class FluidPatternTerminalRecipeTransferHandler implements IOverlayHandle
|
||||
|
||||
@Override
|
||||
public void overlayRecipe(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex, boolean shift) {
|
||||
if (firstGui instanceof FCGuiEncodeTerminal) {
|
||||
boolean priority = ((FCGuiEncodeTerminal) firstGui).container.prioritize;
|
||||
if (firstGui instanceof FCGuiEncodeTerminal || firstGui instanceof GuiFluidCraftingWireless) {
|
||||
boolean priority = !(firstGui instanceof GuiFluidCraftingWireless)
|
||||
&& ((FCGuiEncodeTerminal) firstGui).container.prioritize;
|
||||
List<OrderStack<?>> in = FluidRecipe.getPackageInputs(recipe, recipeIndex, priority);
|
||||
List<OrderStack<?>> out = FluidRecipe.getPackageOutputs(recipe, recipeIndex, !notUseOther(recipe));
|
||||
boolean craft = shouldCraft(recipe);
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.glodblock.github.network;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.glodblock.github.inventory.gui.PartOrItemGuiFactory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,6 +17,7 @@ import com.glodblock.github.client.gui.container.base.FCContainerEncodeTerminal;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.gui.PartOrItemGuiFactory;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
@@ -70,25 +70,28 @@ public class CPacketPatternValueSet implements IMessage {
|
||||
final TileEntity te = context.getTile();
|
||||
if (te != null) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(te),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(te),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
} else if (message.originGui.guiFactory instanceof PartOrItemGuiFactory) {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(player.inventory.currentItem, Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM), 0),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(
|
||||
player.inventory.currentItem,
|
||||
Util.GuiHelper.encodeType(0, Util.GuiHelper.GuiType.ITEM),
|
||||
0),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
} else {
|
||||
InventoryHandler.openGui(
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(player.inventory.currentItem, 0, 0),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
player,
|
||||
player.worldObj,
|
||||
new BlockPos(player.inventory.currentItem, 0, 0),
|
||||
Objects.requireNonNull(context.getSide()),
|
||||
message.originGui);
|
||||
}
|
||||
if (player.openContainer instanceof FCContainerEncodeTerminal) {
|
||||
Slot slot = player.openContainer.getSlot(message.valueIndex);
|
||||
|
||||
@@ -12,11 +12,14 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerCraftingWireless;
|
||||
import com.glodblock.github.client.gui.container.ContainerItemMonitor;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerEncodeTerminal;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.nei.NEIUtils;
|
||||
@@ -95,9 +98,8 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
@SuppressWarnings("unchecked")
|
||||
public IMessage onMessage(CPacketTransferRecipe message, MessageContext ctx) {
|
||||
Container c = ctx.getServerHandler().playerEntity.openContainer;
|
||||
if (c instanceof FCContainerEncodeTerminal) {
|
||||
FCContainerEncodeTerminal cf = (FCContainerEncodeTerminal) c;
|
||||
ITerminalHost host = cf.getHost();
|
||||
if (c instanceof ContainerItemMonitor) {
|
||||
ITerminalHost host = ((ContainerItemMonitor) c).getHost();
|
||||
IItemList<IAEItemStack> storageList;
|
||||
if (host != null) {
|
||||
storageList = host.getItemInventory().getStorageList();
|
||||
@@ -105,46 +107,85 @@ public class CPacketTransferRecipe implements IMessage {
|
||||
storageList = AEApi.instance().storage().createItemList();
|
||||
}
|
||||
|
||||
boolean combine = cf.combine;
|
||||
cf.getPatternTerminal().setCraftingRecipe(message.isCraft);
|
||||
IInventory inputSlot = cf.getInventoryByName("crafting");
|
||||
IInventory outputSlot = cf.getInventoryByName("output");
|
||||
for (int i = 0; i < inputSlot.getSizeInventory(); i++) {
|
||||
inputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
for (int i = 0; i < outputSlot.getSizeInventory(); i++) {
|
||||
outputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
if (c instanceof ContainerCraftingWireless && host != null) {
|
||||
// crafting terminal only
|
||||
ContainerCraftingWireless cf = (ContainerCraftingWireless) c;
|
||||
|
||||
if (!message.isCraft) {
|
||||
if (combine) {
|
||||
message.inputs = NEIUtils.compress(message.inputs);
|
||||
message.outputs = NEIUtils.compress(message.outputs);
|
||||
IInventory inputSlot = cf.getInventoryByName("crafting");
|
||||
|
||||
if (!storageList.isEmpty()) {
|
||||
int i = 0;
|
||||
for (OrderStack stack : message.inputs) {
|
||||
if (inputSlot.getStackInSlot(i) == null) {
|
||||
ItemStack is = (ItemStack) stack.getStack();
|
||||
IAEItemStack iaeItemStack = AEApi.instance().storage().createItemStack(is);
|
||||
IAEItemStack storedItem = storageList.findPrecise(iaeItemStack);
|
||||
if (storedItem == null) {
|
||||
for (IAEItemStack tmp : storageList.findFuzzy(iaeItemStack, FuzzyMode.IGNORE_ALL)) {
|
||||
tmp.setStackSize(is.stackSize);
|
||||
ItemStack substitute = tmp.getItemStack().copy();
|
||||
inputSlot.setInventorySlotContents(i, substitute);
|
||||
host.getItemInventory()
|
||||
.extractItems(tmp, Actionable.MODULATE, cf.getActionSource());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
host.getItemInventory()
|
||||
.extractItems(iaeItemStack, Actionable.MODULATE, cf.getActionSource());
|
||||
inputSlot.setInventorySlotContents(i, is);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
message.inputs = NEIUtils.clearNull(message.inputs);
|
||||
message.outputs = NEIUtils.clearNull(message.outputs);
|
||||
}
|
||||
// using exists item to fill slot
|
||||
if (message.shift && !storageList.isEmpty()) {
|
||||
for (OrderStack stack : message.inputs) {
|
||||
if (stack.getStack() instanceof FluidStack) continue;
|
||||
ItemStack is = (ItemStack) stack.getStack();
|
||||
IAEItemStack iaeItemStack = AEApi.instance().storage().createItemStack(is);
|
||||
if (storageList.findPrecise(iaeItemStack) == null) {
|
||||
for (IAEItemStack tmp : storageList.findFuzzy(iaeItemStack, FuzzyMode.IGNORE_ALL)) {
|
||||
ItemStack substitute = tmp.getItemStack().copy();
|
||||
substitute.stackSize = is.stackSize;
|
||||
stack.putStack(substitute);
|
||||
break;
|
||||
c.onCraftMatrixChanged(inputSlot);
|
||||
|
||||
} else if (c instanceof FCContainerEncodeTerminal) {
|
||||
// pattern terminal only
|
||||
FCContainerEncodeTerminal cf = (FCContainerEncodeTerminal) c;
|
||||
|
||||
boolean combine = cf.combine;
|
||||
cf.getPatternTerminal().setCraftingRecipe(message.isCraft);
|
||||
IInventory inputSlot = cf.getInventoryByName("crafting");
|
||||
IInventory outputSlot = cf.getInventoryByName("output");
|
||||
for (int i = 0; i < inputSlot.getSizeInventory(); i++) {
|
||||
inputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
for (int i = 0; i < outputSlot.getSizeInventory(); i++) {
|
||||
outputSlot.setInventorySlotContents(i, null);
|
||||
}
|
||||
|
||||
if (!message.isCraft) {
|
||||
if (combine) {
|
||||
message.inputs = NEIUtils.compress(message.inputs);
|
||||
message.outputs = NEIUtils.compress(message.outputs);
|
||||
}
|
||||
message.inputs = NEIUtils.clearNull(message.inputs);
|
||||
message.outputs = NEIUtils.clearNull(message.outputs);
|
||||
}
|
||||
// using exists item to fill slot
|
||||
if (message.shift && !storageList.isEmpty()) {
|
||||
for (OrderStack stack : message.inputs) {
|
||||
if (stack.getStack() instanceof FluidStack) continue;
|
||||
ItemStack is = (ItemStack) stack.getStack();
|
||||
IAEItemStack iaeItemStack = AEApi.instance().storage().createItemStack(is);
|
||||
if (storageList.findPrecise(iaeItemStack) == null) {
|
||||
for (IAEItemStack tmp : storageList.findFuzzy(iaeItemStack, FuzzyMode.IGNORE_ALL)) {
|
||||
ItemStack substitute = tmp.getItemStack().copy();
|
||||
substitute.stackSize = is.stackSize;
|
||||
stack.putStack(substitute);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
transferPack(message.inputs, inputSlot);
|
||||
transferPack(message.outputs, outputSlot);
|
||||
c.onCraftMatrixChanged(inputSlot);
|
||||
c.onCraftMatrixChanged(outputSlot);
|
||||
}
|
||||
transferPack(message.inputs, inputSlot);
|
||||
transferPack(message.outputs, outputSlot);
|
||||
c.onCraftMatrixChanged(inputSlot);
|
||||
c.onCraftMatrixChanged(outputSlot);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user