mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
wireless crafting terminal
This commit is contained in:
1 parent
513af871aa
commit
f22bebbf21
33 files changed
+695
-215
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
|
||||
public class FCGuiSwitchTerminal {
|
||||
|
||||
private GuiFCImgButton fluidBtn;
|
||||
private GuiFCImgButton essentiaBtn;
|
||||
private GuiFCImgButton craftBtn;
|
||||
private GuiFCImgButton patternBtn;
|
||||
private final GuiType originGui;
|
||||
|
||||
public FCGuiSwitchTerminal(GuiType gui) {
|
||||
this.originGui = gui;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void addButtons(List buttonList, int offsetX, int offsetY) {
|
||||
int y = 0;
|
||||
if (this.originGui != GuiType.WIRELESS_FLUID_TERMINAL) {
|
||||
buttonList.add(fluidBtn = new GuiFCImgButton(offsetX, offsetY + y, "FLUID_TEM", "YES"));
|
||||
y += 20;
|
||||
}
|
||||
if (ModAndClassUtil.ThE && this.originGui != GuiType.WIRELESS_ESSENTIA_TERMINAL) {
|
||||
buttonList.add(essentiaBtn = new GuiFCImgButton(offsetX, offsetY + y, "ESSENTIA_TEM", "YES"));
|
||||
y += 20;
|
||||
}
|
||||
buttonList.add(craftBtn = new GuiFCImgButton(offsetX, offsetY + y, "CRAFT_TEM", "YES"));
|
||||
y += 20;
|
||||
buttonList.add(patternBtn = new GuiFCImgButton(offsetX, offsetY + y, "PATTERN_TEM", "YES"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,20 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.client.render.AppEngRenderItem;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerEssentiaMonitor;
|
||||
import com.glodblock.github.client.me.EssentiaRepo;
|
||||
@@ -13,15 +24,6 @@ import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class GuiEssentiaTerminal extends GuiFluidMonitor {
|
||||
|
||||
@@ -51,15 +53,21 @@ public class GuiEssentiaTerminal extends GuiFluidMonitor {
|
||||
IAEItemStack stack = ((SlotME) slot).getAEStack();
|
||||
if (stack == null) return true;
|
||||
FluidStack fluidStack = ItemFluidDrop.getFluidStack(slot.getStack());
|
||||
AspectRender.drawAspect(this.player, slot.xDisplayPosition, slot.yDisplayPosition, this.zLevel, AspectUtil.getAspectFromGas(fluidStack), fluidStack.amount);
|
||||
AspectRender.drawAspect(
|
||||
this.player,
|
||||
slot.xDisplayPosition,
|
||||
slot.yDisplayPosition,
|
||||
this.zLevel,
|
||||
AspectUtil.getAspectFromGas(fluidStack),
|
||||
fluidStack.amount);
|
||||
IAEItemStack gas = stack.copy().setStackSize(stack.getStackSize() / AspectUtil.R);
|
||||
stackSizeRenderer.setAeStack(gas);
|
||||
stackSizeRenderer.renderItemOverlayIntoGUI(
|
||||
fontRendererObj,
|
||||
mc.getTextureManager(),
|
||||
gas.getItemStack(),
|
||||
slot.xDisplayPosition,
|
||||
slot.yDisplayPosition);
|
||||
fontRendererObj,
|
||||
mc.getTextureManager(),
|
||||
gas.getItemStack(),
|
||||
slot.xDisplayPosition,
|
||||
slot.yDisplayPosition);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -50,6 +50,10 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
this.registerApp(4, "SUBMIT", "SUBMIT", "submit");
|
||||
this.registerApp(6, "DISABLE", "DISABLE", "disable");
|
||||
this.registerApp(7, "ENABLE", "ENABLE", "enable");
|
||||
this.registerApp(10, "FLUID_TEM", "YES", "fluid_terminal_w");
|
||||
this.registerApp(11, "CRAFT_TEM", "YES", "craft_terminal_w");
|
||||
this.registerApp(12, "PATTERN_TEM", "YES", "pattern_terminal_w");
|
||||
this.registerApp(13, "ESSENTIA_TEM", "YES", "essentia_terminal_w");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +65,8 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
} else {
|
||||
a.displayValue = StatCollector.translateToLocal(prefix + title + ".hint");
|
||||
}
|
||||
a.index = iconIndex;
|
||||
a.index = iconIndex % 10;
|
||||
a.page = iconIndex / 10;
|
||||
appearances.put(new EnumPair(setting, val), a);
|
||||
}
|
||||
|
||||
@@ -81,6 +86,17 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
return 8;
|
||||
}
|
||||
|
||||
private int getIconPage() {
|
||||
if (this.buttonSetting != null && this.currentValue != null) {
|
||||
final ButtonAppearance app = appearances.get(new EnumPair(this.buttonSetting, this.currentValue));
|
||||
if (app == null) {
|
||||
return 0;
|
||||
}
|
||||
return app.page;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getSetting() {
|
||||
return this.buttonSetting;
|
||||
}
|
||||
@@ -184,6 +200,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
public void drawButton(final Minecraft par1Minecraft, final int par2, final int par3) {
|
||||
if (this.visible) {
|
||||
final int iconIndex = this.getIconIndex();
|
||||
final int iconPage = this.getIconPage();
|
||||
|
||||
if (this.halfSize) {
|
||||
this.width = 8;
|
||||
@@ -199,7 +216,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
GL11.glColor4f(0.5f, 0.5f, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states.png"));
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states" + iconPage + ".png"));
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition
|
||||
&& par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
@@ -235,7 +252,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
GL11.glColor4f(0.5f, 0.5f, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states.png"));
|
||||
par1Minecraft.renderEngine.bindTexture(FluidCraft.resource("textures/gui/states" + iconPage + ".png"));
|
||||
this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition
|
||||
&& par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
@@ -296,6 +313,7 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
private static class ButtonAppearance {
|
||||
|
||||
public int index;
|
||||
public int page;
|
||||
public String displayName;
|
||||
public String displayValue;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.client.gui.widgets.GuiImgButton;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.core.localization.GuiColors;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketInventoryAction;
|
||||
import appeng.helpers.InventoryAction;
|
||||
|
||||
import com.glodblock.github.client.gui.container.ContainerCraftingWireless;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
|
||||
public class GuiFluidCraftingWireless extends GuiItemMonitor {
|
||||
|
||||
private GuiImgButton clearBtn;
|
||||
|
||||
public GuiFluidCraftingWireless(final InventoryPlayer inventoryPlayer, final IWirelessTerminal te) {
|
||||
super(inventoryPlayer, te, new ContainerCraftingWireless(inventoryPlayer, te));
|
||||
this.setReservedSpace(73);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
super.actionPerformed(btn);
|
||||
if (this.clearBtn == btn) {
|
||||
Slot s = null;
|
||||
final Container c = this.inventorySlots;
|
||||
for (final Object j : c.inventorySlots) {
|
||||
if (j instanceof SlotCraftingMatrix) {
|
||||
s = (Slot) j;
|
||||
}
|
||||
}
|
||||
if (s != null) {
|
||||
final PacketInventoryAction p = new PacketInventoryAction(InventoryAction.MOVE_REGION, s.slotNumber, 0);
|
||||
NetworkHandler.instance.sendToServer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.buttonList.add(
|
||||
this.clearBtn = new GuiImgButton(
|
||||
this.guiLeft + 92,
|
||||
this.guiTop + this.ySize - 156,
|
||||
Settings.ACTIONS,
|
||||
ActionItems.STASH));
|
||||
this.clearBtn.setHalfSize(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
||||
this.fontRendererObj.drawString(
|
||||
GuiText.CraftingTerminal.getLocal(),
|
||||
8,
|
||||
this.ySize - 96 + 1 - this.getReservedSpace(),
|
||||
GuiColors.CraftingTerminalTitle.getColor());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackground() {
|
||||
return "gui/crafting.png";
|
||||
}
|
||||
|
||||
}
|
||||
+7
-6
@@ -13,8 +13,8 @@ import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.common.parts.PartFluidTerminal;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
|
||||
@@ -36,9 +36,9 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.FLUID_TERMINAL_EX, 1));
|
||||
else if (host instanceof PartFluidTerminal) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.FLUID_TERM, 1));
|
||||
} else if (host instanceof WirelessFluidTerminal) {
|
||||
} else if (host instanceof WirelessFluidTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_FLUID_TERM, 1));
|
||||
} else if (host instanceof WirelessPatternTerminal) {
|
||||
} else if (host instanceof WirelessPatternTerminalInventory) {
|
||||
Ae2ReflectClient.rewriteIcon(this, new ItemStack(ItemAndBlockHolder.WIRELESS_PATTERN_TERM, 1));
|
||||
}
|
||||
|
||||
@@ -53,8 +53,9 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
else if (host instanceof PartFluidPatternTerminalEx)
|
||||
InventoryHandler.switchGui(GuiType.FLUID_PATTERN_TERMINAL_EX);
|
||||
else if (host instanceof PartFluidTerminal) InventoryHandler.switchGui(GuiType.FLUID_TERMINAL);
|
||||
else if (host instanceof WirelessFluidTerminal) InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_TERMINAL);
|
||||
else if (host instanceof WirelessPatternTerminal)
|
||||
else if (host instanceof WirelessFluidTerminalInventory)
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_TERMINAL);
|
||||
else if (host instanceof WirelessPatternTerminalInventory)
|
||||
InventoryHandler.switchGui(GuiType.WIRELESS_FLUID_PATTERN_TERMINAL);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
|
||||
+3
-2
@@ -4,9 +4,10 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
|
||||
public class GuiPatternPortableCell extends GuiFluidPatternTerminal {
|
||||
public class GuiFluidPatternWireless extends GuiFluidPatternTerminal {
|
||||
|
||||
public GuiPatternPortableCell(InventoryPlayer inventoryPlayer, IWirelessTerminal te) {
|
||||
public GuiFluidPatternWireless(InventoryPlayer inventoryPlayer, IWirelessTerminal te) {
|
||||
super(inventoryPlayer, te);
|
||||
}
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.container.slot.SlotCraftingMatrix;
|
||||
import appeng.container.slot.SlotCraftingTerm;
|
||||
import appeng.helpers.IContainerCraftingPacket;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
|
||||
import com.glodblock.github.inventory.item.IWirelessCraftTerminal;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class ContainerCraftingWireless extends ContainerItemMonitor
|
||||
implements IAEAppEngInventory, IContainerCraftingPacket {
|
||||
|
||||
private final IWirelessCraftTerminal it;
|
||||
private final SlotCraftingMatrix[] craftingSlots = new SlotCraftingMatrix[9];
|
||||
private final SlotCraftingTerm outputSlot;
|
||||
private final int slot;
|
||||
private int ticks = 0;
|
||||
private double powerMultiplier = 0.5;
|
||||
|
||||
public ContainerCraftingWireless(final InventoryPlayer ip, final IWirelessTerminal monitorable) {
|
||||
super(ip, monitorable, false);
|
||||
this.it = (IWirelessCraftTerminal) monitorable;
|
||||
final int slotIndex = monitorable.getInventorySlot();
|
||||
this.lockPlayerInventorySlot(slotIndex);
|
||||
this.slot = slotIndex;
|
||||
final IInventory crafting = this.it.getInventoryByName("crafting");
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 3; x++) {
|
||||
this.addSlotToContainer(
|
||||
this.craftingSlots[x + y * 3] = new SlotCraftingMatrix(
|
||||
this,
|
||||
crafting,
|
||||
x + y * 3,
|
||||
37 + x * 18,
|
||||
-72 + y * 18));
|
||||
}
|
||||
}
|
||||
AppEngInternalInventory output = new AppEngInternalInventory(this, 1);
|
||||
this.addSlotToContainer(
|
||||
this.outputSlot = new SlotCraftingTerm(
|
||||
this.getPlayerInv().player,
|
||||
this.getActionSource(),
|
||||
this.getPowerSource(),
|
||||
monitorable,
|
||||
crafting,
|
||||
crafting,
|
||||
output,
|
||||
131,
|
||||
-72 + 18,
|
||||
this));
|
||||
this.bindPlayerInventory(ip, 0, 0);
|
||||
this.onCraftMatrixChanged(crafting);
|
||||
}
|
||||
|
||||
public void detectAndSendChanges() {
|
||||
this.ticks = Util
|
||||
.drainItemPower(this, this.getPlayerInv(), this.slot, this.ticks, this.getPowerMultiplier(), this.it);
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
private double getPowerMultiplier() {
|
||||
return this.powerMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCraftMatrixChanged(final IInventory par1IInventory) {
|
||||
final ContainerNull cn = new ContainerNull();
|
||||
final InventoryCrafting ic = new InventoryCrafting(cn, 3, 3);
|
||||
for (int x = 0; x < 9; x++) {
|
||||
ic.setInventorySlotContents(x, this.craftingSlots[x].getStack());
|
||||
}
|
||||
this.outputSlot
|
||||
.putStack(CraftingManager.getInstance().findMatchingRecipe(ic, this.getPlayerInv().player.worldObj));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final IInventory inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removedStack, final ItemStack newStack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(final String name) {
|
||||
if (name.equals("player")) {
|
||||
return this.getInventoryPlayer();
|
||||
}
|
||||
return this.it.getInventoryByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useRealItems() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+38
-33
@@ -1,28 +1,29 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.container.slot.SlotPlayerHotBar;
|
||||
import appeng.container.slot.SlotPlayerInv;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
import com.glodblock.github.util.Util;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.container.slot.SlotPlayerHotBar;
|
||||
import appeng.container.slot.SlotPlayerInv;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
|
||||
@@ -35,7 +36,7 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
if (Platform.isClient()) {
|
||||
Slot clickSlot = (Slot) this.inventorySlots.get(idx);
|
||||
if ((clickSlot instanceof SlotPlayerInv || clickSlot instanceof SlotPlayerHotBar) && clickSlot.getHasStack()
|
||||
&& AspectUtil.isEssentiaContainer(clickSlot.getStack())) {
|
||||
&& AspectUtil.isEssentiaContainer(clickSlot.getStack())) {
|
||||
ItemStack tis = clickSlot.getStack();
|
||||
Map<Integer, IAEFluidStack> tmp = new HashMap<>();
|
||||
tmp.put(0, null);
|
||||
@@ -47,7 +48,8 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postChange(Iterable<IAEFluidStack> change, ItemStack fluidContainer, EntityPlayer player, int slotIndex) {
|
||||
public void postChange(Iterable<IAEFluidStack> change, ItemStack fluidContainer, EntityPlayer player,
|
||||
int slotIndex) {
|
||||
for (IAEFluidStack fluid : change) {
|
||||
IAEFluidStack nfluid = this.monitor.getStorageList().findPrecise(fluid);
|
||||
ItemStack out = fluidContainer.copy();
|
||||
@@ -56,10 +58,12 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
// add essentia to jars
|
||||
if (nfluid.getStackSize() / AspectUtil.R <= 0) continue;
|
||||
final IAEFluidStack toExtract = nfluid.copy();
|
||||
MutablePair<Integer, ItemStack> fillStack = AspectUtil.fillEssentiaFromGas(out, toExtract.getFluidStack());
|
||||
MutablePair<Integer, ItemStack> fillStack = AspectUtil
|
||||
.fillEssentiaFromGas(out, toExtract.getFluidStack());
|
||||
if (fillStack == null || fillStack.right == null || fillStack.left <= 0) continue;
|
||||
toExtract.setStackSize((long) fillStack.left * fluidContainer.stackSize);
|
||||
IAEFluidStack tmp = this.host.getFluidInventory().extractItems(toExtract, Actionable.SIMULATE, this.getActionSource());
|
||||
IAEFluidStack tmp = this.host.getFluidInventory()
|
||||
.extractItems(toExtract, Actionable.SIMULATE, this.getActionSource());
|
||||
if (tmp == null) continue;
|
||||
fillStack.right.stackSize = (int) (tmp.getStackSize() / fillStack.left);
|
||||
this.dropItem(fillStack.right);
|
||||
@@ -68,11 +72,11 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
this.host.getFluidInventory().extractItems(toExtract, Actionable.MODULATE, this.getActionSource());
|
||||
if ((int) (tmp.getStackSize() % fillStack.left) / AspectUtil.R > 0) {
|
||||
this.dropItem(
|
||||
AspectUtil.setAspectAmount(
|
||||
fillStack.right,
|
||||
(int) (tmp.getStackSize() % fillStack.left) / AspectUtil.R,
|
||||
AspectUtil.getAspectFromGas(toExtract)),
|
||||
1);
|
||||
AspectUtil.setAspectAmount(
|
||||
fillStack.right,
|
||||
(int) (tmp.getStackSize() % fillStack.left) / AspectUtil.R,
|
||||
AspectUtil.getAspectFromGas(toExtract)),
|
||||
1);
|
||||
out.stackSize++;
|
||||
}
|
||||
}
|
||||
@@ -85,17 +89,18 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
final IAEFluidStack aeFluidStack = fluidStack.copy();
|
||||
// simulate result is incorrect. so I'm using other solution and ec2 both mod have same issues
|
||||
final IAEFluidStack notInserted = this.host.getFluidInventory()
|
||||
.injectItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
MutablePair<Integer, ItemStack> drainStack = AspectUtil.drainEssentiaFromGas(out.copy(), aeFluidStack.getFluidStack());
|
||||
.injectItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
MutablePair<Integer, ItemStack> drainStack = AspectUtil
|
||||
.drainEssentiaFromGas(out.copy(), aeFluidStack.getFluidStack());
|
||||
if (notInserted != null && notInserted.getStackSize() > 0 && drainStack != null) {
|
||||
if (fluidStack.getStackSize() == notInserted.getStackSize()) continue;
|
||||
aeFluidStack.decStackSize(notInserted.getStackSize());
|
||||
|
||||
if (drainStack.left > aeFluidStack.getStackSize()
|
||||
&& AspectUtil.isEssentiaContainer(drainStack.right)) {
|
||||
&& AspectUtil.isEssentiaContainer(drainStack.right)) {
|
||||
aeFluidStack.setStackSize(drainStack.left - aeFluidStack.getStackSize());
|
||||
this.host.getFluidInventory()
|
||||
.extractItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
.extractItems(aeFluidStack, Actionable.MODULATE, this.getActionSource());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -121,7 +126,7 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
System.out.print(aeFluidStack.getStackSize() + "\n");
|
||||
}
|
||||
out.stackSize = (int) (fluidContainer.stackSize
|
||||
- (aeFluidStack.getStackSize() / drainStack.left));
|
||||
- (aeFluidStack.getStackSize() / drainStack.left));
|
||||
}
|
||||
this.dropItem(drainStack.right, fluidContainer.stackSize); // drop empty item
|
||||
}
|
||||
@@ -132,12 +137,12 @@ public class ContainerEssentiaMonitor extends ContainerFluidPortableCell {
|
||||
player.inventory.getItemStack().stackSize = player.inventory.getItemStack().stackSize - out.stackSize;
|
||||
if (player.inventory.getItemStack().stackSize > 0) {
|
||||
FluidCraft.proxy.netHandler.sendTo(
|
||||
new SPacketFluidUpdate(new HashMap<>(), player.inventory.getItemStack()),
|
||||
(EntityPlayerMP) player);
|
||||
new SPacketFluidUpdate(new HashMap<>(), player.inventory.getItemStack()),
|
||||
(EntityPlayerMP) player);
|
||||
} else {
|
||||
player.inventory.setItemStack(null);
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendTo(new SPacketFluidUpdate(new HashMap<>()), (EntityPlayerMP) player);
|
||||
.sendTo(new SPacketFluidUpdate(new HashMap<>()), (EntityPlayerMP) player);
|
||||
}
|
||||
} else {
|
||||
player.inventory.setInventorySlotContents(slotIndex, out.stackSize > 0 ? out : null);
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class ContainerFluidPatternWireless extends ContainerFluidPatternTerminal {
|
||||
|
||||
private double powerMultiplier = 0.5;
|
||||
private final IWirelessTerminal civ;
|
||||
private int ticks = 0;
|
||||
private final int slot;
|
||||
|
||||
public ContainerFluidPatternWireless(InventoryPlayer ip, IWirelessTerminal monitorable) {
|
||||
super(ip, monitorable);
|
||||
if (monitorable != null) {
|
||||
final int slotIndex = monitorable.getInventorySlot();
|
||||
this.lockPlayerInventorySlot(slotIndex);
|
||||
this.slot = slotIndex;
|
||||
} else {
|
||||
this.slot = -1;
|
||||
this.lockPlayerInventorySlot(ip.currentItem);
|
||||
}
|
||||
this.civ = monitorable;
|
||||
}
|
||||
|
||||
public void detectAndSendChanges() {
|
||||
this.ticks = Util
|
||||
.drainItemPower(this, this.getPlayerInv(), this.slot, this.ticks, this.getPowerMultiplier(), this.civ);
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
private double getPowerMultiplier() {
|
||||
return this.powerMultiplier;
|
||||
}
|
||||
|
||||
void setPowerMultiplier(final double powerMultiplier) {
|
||||
this.powerMultiplier = powerMultiplier;
|
||||
}
|
||||
}
|
||||
+3
-31
@@ -1,13 +1,9 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class ContainerFluidPortableCell extends ContainerFluidMonitor {
|
||||
|
||||
@@ -32,32 +28,8 @@ public class ContainerFluidPortableCell extends ContainerFluidMonitor {
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem()
|
||||
: this.getPlayerInv().getStackInSlot(this.slot);
|
||||
if (this.civ != null) {
|
||||
if (currentItem != this.civ.getItemStack()) {
|
||||
if (currentItem != null) {
|
||||
if (Platform.isSameItem(this.civ.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv()
|
||||
.setInventorySlotContents(this.getPlayerInv().currentItem, this.civ.getItemStack());
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
this.ticks++;
|
||||
if (this.ticks > 10 && this.civ != null) {
|
||||
this.civ.extractAEPower(
|
||||
this.getPowerMultiplier() * this.ticks,
|
||||
Actionable.MODULATE,
|
||||
PowerMultiplier.CONFIG);
|
||||
this.ticks = 0;
|
||||
}
|
||||
this.ticks = Util
|
||||
.drainItemPower(this, this.getPlayerInv(), this.slot, this.ticks, this.getPowerMultiplier(), this.civ);
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
|
||||
-69
@@ -1,69 +0,0 @@
|
||||
package com.glodblock.github.client.gui.container;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.inventory.item.IWirelessTerminal;
|
||||
|
||||
public class ContainerPatternPortableCell extends ContainerFluidPatternTerminal {
|
||||
|
||||
private double powerMultiplier = 0.5;
|
||||
private final IWirelessTerminal civ;
|
||||
private int ticks = 0;
|
||||
private final int slot;
|
||||
|
||||
public ContainerPatternPortableCell(InventoryPlayer ip, IWirelessTerminal monitorable) {
|
||||
super(ip, monitorable);
|
||||
if (monitorable != null) {
|
||||
final int slotIndex = monitorable.getInventorySlot();
|
||||
this.lockPlayerInventorySlot(slotIndex);
|
||||
this.slot = slotIndex;
|
||||
} else {
|
||||
this.slot = -1;
|
||||
this.lockPlayerInventorySlot(ip.currentItem);
|
||||
}
|
||||
this.civ = monitorable;
|
||||
}
|
||||
|
||||
public void detectAndSendChanges() {
|
||||
final ItemStack currentItem = this.slot < 0 ? this.getPlayerInv().getCurrentItem()
|
||||
: this.getPlayerInv().getStackInSlot(this.slot);
|
||||
if (this.civ != null) {
|
||||
if (currentItem != this.civ.getItemStack()) {
|
||||
if (currentItem != null) {
|
||||
if (Platform.isSameItem(this.civ.getItemStack(), currentItem)) {
|
||||
this.getPlayerInv()
|
||||
.setInventorySlotContents(this.getPlayerInv().currentItem, this.civ.getItemStack());
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
this.ticks++;
|
||||
if (this.ticks > 10 && this.civ != null) {
|
||||
this.civ.extractAEPower(
|
||||
this.getPowerMultiplier() * this.ticks,
|
||||
Actionable.MODULATE,
|
||||
PowerMultiplier.CONFIG);
|
||||
this.ticks = 0;
|
||||
}
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
private double getPowerMultiplier() {
|
||||
return this.powerMultiplier;
|
||||
}
|
||||
|
||||
void setPowerMultiplier(final double powerMultiplier) {
|
||||
this.powerMultiplier = powerMultiplier;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -37,7 +37,7 @@ import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.IPatternConsumer;
|
||||
import com.glodblock.github.inventory.item.PatternTerminal;
|
||||
import com.glodblock.github.inventory.item.IItemPatternTerminal;
|
||||
import com.glodblock.github.loader.ItemAndBlockHolder;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -45,7 +45,7 @@ import com.glodblock.github.util.Util;
|
||||
public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
implements IAEAppEngInventory, IOptionalSlotHost, IContainerCraftingPacket, IPatternConsumer {
|
||||
|
||||
protected final PatternTerminal patternTerminal;
|
||||
protected final IItemPatternTerminal patternTerminal;
|
||||
protected final AppEngInternalInventory cOut = new AppEngInternalInventory(null, 1);
|
||||
protected final IInventory crafting;
|
||||
protected final SlotRestrictedInput patternSlotIN;
|
||||
@@ -77,7 +77,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
|
||||
public FCContainerEncodeTerminal(final InventoryPlayer ip, final ITerminalHost monitorable) {
|
||||
super(ip, monitorable);
|
||||
this.patternTerminal = (PatternTerminal) monitorable;
|
||||
this.patternTerminal = (IItemPatternTerminal) monitorable;
|
||||
this.inverted = patternTerminal.isInverted();
|
||||
final IInventory patternInv = this.patternTerminal.getInventoryByName("pattern");
|
||||
this.crafting = this.patternTerminal.getInventoryByName("crafting");
|
||||
@@ -170,7 +170,7 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
||||
}
|
||||
}
|
||||
|
||||
public PatternTerminal getPatternTerminal() {
|
||||
public IItemPatternTerminal getPatternTerminal() {
|
||||
return this.patternTerminal;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package com.glodblock.github.client.me;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.crossmod.thaumcraft.AspectUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class EssentiaRepo extends FluidRepo {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import appeng.util.Platform;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -44,7 +44,7 @@ public class ItemWirelessFluidTerminal extends ItemBaseWirelessTerminal
|
||||
try {
|
||||
IGridNode gridNode = Util.getWirelessGrid(stack);
|
||||
if (gridNode != null) {
|
||||
return new WirelessFluidTerminal(stack, x, gridNode, player);
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Platform.isClient()) player.addChatMessage(PlayerMessages.OutOfRange.get());
|
||||
|
||||
@@ -15,7 +15,7 @@ import appeng.util.Platform;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -44,7 +44,7 @@ public class ItemWirelessPatternTerminal extends ItemBaseWirelessTerminal
|
||||
try {
|
||||
IGridNode gridNode = Util.getWirelessGrid(stack);
|
||||
if (gridNode != null) {
|
||||
return new WirelessPatternTerminal(stack, x, gridNode, player);
|
||||
return new WirelessPatternTerminalInventory(stack, x, gridNode, player);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Platform.isClient()) player.addChatMessage(PlayerMessages.OutOfRange.get());
|
||||
|
||||
@@ -1,26 +1,33 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminal;
|
||||
import com.glodblock.github.inventory.item.WirelessCraftingTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessFluidTerminalInventory;
|
||||
import com.glodblock.github.inventory.item.WirelessPatternTerminalInventory;
|
||||
import com.glodblock.github.loader.IRegister;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
implements IRegister<ItemWirelessUltraTerminal> {
|
||||
implements IRegister<ItemWirelessUltraTerminal> {
|
||||
|
||||
public final static String MODE = "mode";
|
||||
|
||||
public ItemWirelessUltraTerminal() {
|
||||
super(GuiType.WIRELESS_ESSENTIA_TERMINAL);
|
||||
@@ -42,11 +49,43 @@ public class ItemWirelessUltraTerminal extends ItemBaseWirelessTerminal
|
||||
try {
|
||||
IGridNode gridNode = Util.getWirelessGrid(stack);
|
||||
if (gridNode != null) {
|
||||
return new WirelessFluidTerminal(stack, x, gridNode, player);
|
||||
if (this.type == GuiType.WIRELESS_FLUID_PATTERN_TERMINAL) {
|
||||
return new WirelessPatternTerminalInventory(stack, x, gridNode, player);
|
||||
}
|
||||
if (this.type == GuiType.WIRELESS_CRAFTING_TERMINAL) {
|
||||
return new WirelessCraftingTerminalInventory(stack, x, gridNode, player);
|
||||
} else {
|
||||
return new WirelessFluidTerminalInventory(stack, x, gridNode, player);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (Platform.isClient()) player.addChatMessage(PlayerMessages.OutOfRange.get());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack item, final World w, final EntityPlayer player) {
|
||||
readMode(item);
|
||||
return super.onItemRightClick(item, w, player);
|
||||
}
|
||||
|
||||
public void readMode(ItemStack stack) {
|
||||
NBTTagCompound data = Platform.openNbtData(stack);
|
||||
if (data.hasKey(MODE)) {
|
||||
String GUI = data.getString(MODE);
|
||||
try {
|
||||
this.type = GuiType.valueOf(GUI);
|
||||
} catch (IllegalArgumentException e) {
|
||||
this.type = GuiType.WIRELESS_CRAFTING_TERMINAL;
|
||||
}
|
||||
} else {
|
||||
this.type = GuiType.WIRELESS_CRAFTING_TERMINAL;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMode(String mode, ItemStack stack) {
|
||||
NBTTagCompound data = Platform.openNbtData(stack);
|
||||
data.setString(MODE, mode);
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.item.PatternTerminal;
|
||||
import com.glodblock.github.inventory.item.IItemPatternTerminal;
|
||||
|
||||
public abstract class FCFluidEncodeTerminal extends FCPart implements PatternTerminal {
|
||||
public abstract class FCFluidEncodeTerminal extends FCPart implements IItemPatternTerminal {
|
||||
|
||||
protected AppEngInternalInventory crafting;
|
||||
protected AppEngInternalInventory output;
|
||||
@@ -71,62 +71,77 @@ public abstract class FCFluidEncodeTerminal extends FCPart implements PatternTer
|
||||
this.crafting.writeToNBT(data, "craftingGrid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldCombine() {
|
||||
return this.combine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCombineMode(boolean shouldCombine) {
|
||||
this.combine = shouldCombine;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubstitution() {
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPrioritize() {
|
||||
return this.prioritize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeSubstitute(boolean canBeSubstitute) {
|
||||
this.beSubstitute = canBeSubstitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeSubstitute() {
|
||||
return this.beSubstitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSubstitution(boolean canSubstitute) {
|
||||
this.substitute = canSubstitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPrioritization(boolean canPrioritize) {
|
||||
this.prioritize = canPrioritize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInverted() {
|
||||
return inverted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInverted(boolean inverted) {
|
||||
this.inverted = inverted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivePage() {
|
||||
return this.activePage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActivePage(int activePage) {
|
||||
this.activePage = activePage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCraftingRecipe(final boolean craftingMode) {
|
||||
this.craftingMode = craftingMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCraftingRecipe() {
|
||||
return this.craftingMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeCrafting(IAEItemStack[] newCrafting, IAEItemStack[] newOutput) {
|
||||
IInventory crafting = this.getInventoryByName("crafting");
|
||||
IInventory output = this.getInventoryByName("output");
|
||||
@@ -159,6 +174,7 @@ public abstract class FCFluidEncodeTerminal extends FCPart implements PatternTer
|
||||
return super.getInventoryByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sortCraftingItems() {
|
||||
List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
List<ItemStack> fluids = new ArrayList<ItemStack>();
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
package com.glodblock.github.crossmod.thaumcraft;
|
||||
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
|
||||
import com.glodblock.github.util.RenderUtil;
|
||||
|
||||
public class AspectRender {
|
||||
|
||||
public static final ResourceLocation UNKNOWN_TEXTURE = new ResourceLocation("thaumcraft", "textures/aspects/_unknown.png");
|
||||
public static final ResourceLocation UNKNOWN_TEXTURE = new ResourceLocation(
|
||||
"thaumcraft",
|
||||
"textures/aspects/_unknown.png");
|
||||
|
||||
public static void drawAspect(EntityPlayer player, int posX, int posY, float zLevel, Aspect aspect, long amount) {
|
||||
if (aspect == null || amount <= 0) {
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
package com.glodblock.github.crossmod.thaumcraft;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.aspects.IEssentiaContainerItem;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumicenergistics.api.storage.IAspectStack;
|
||||
import thaumicenergistics.common.fluids.GaseousEssentia;
|
||||
import thaumicenergistics.common.integration.tc.EssentiaItemContainerHelper;
|
||||
import thaumicenergistics.common.storage.AspectStack;
|
||||
|
||||
import java.util.Objects;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.util.item.AEFluidStack;
|
||||
|
||||
public class AspectUtil {
|
||||
|
||||
@@ -62,14 +63,15 @@ public class AspectUtil {
|
||||
}
|
||||
|
||||
public static FluidStack getGasFromAspect(IAspectStack aspectStack) {
|
||||
if (aspectStack == null || aspectStack.isEmpty())
|
||||
return null;
|
||||
return new FluidStack(GaseousEssentia.getGasFromAspect(aspectStack.getAspect()), (int) aspectStack.getStackSize() * R);
|
||||
if (aspectStack == null || aspectStack.isEmpty()) return null;
|
||||
return new FluidStack(
|
||||
GaseousEssentia.getGasFromAspect(aspectStack.getAspect()),
|
||||
(int) aspectStack.getStackSize() * R);
|
||||
}
|
||||
|
||||
public static boolean isEssentiaContainer(ItemStack stack) {
|
||||
return HELPER.getItemType(stack) != EssentiaItemContainerHelper.AspectItemType.Invalid
|
||||
&& HELPER.getItemType(stack) != EssentiaItemContainerHelper.AspectItemType.ItemAspect;
|
||||
&& HELPER.getItemType(stack) != EssentiaItemContainerHelper.AspectItemType.ItemAspect;
|
||||
}
|
||||
|
||||
public static AEFluidStack getAEGasFromContainer(ItemStack stack) {
|
||||
@@ -110,7 +112,8 @@ public class AspectUtil {
|
||||
}
|
||||
int cap = HELPER.getContainerCapacity(itemStack);
|
||||
int tryFill = Math.min(cap, amount);
|
||||
ImmutablePair<Integer, ItemStack> result = HELPER.injectIntoContainer(itemStack, new AspectStack(aspect, tryFill));
|
||||
ImmutablePair<Integer, ItemStack> result = HELPER
|
||||
.injectIntoContainer(itemStack, new AspectStack(aspect, tryFill));
|
||||
return result != null ? new MutablePair<>(result.left * R, result.right) : null;
|
||||
}
|
||||
return null;
|
||||
@@ -126,7 +129,8 @@ public class AspectUtil {
|
||||
if (contents == null || !Objects.equals(contents.getAspect(), aspect)) {
|
||||
drained = 0;
|
||||
} else {
|
||||
ImmutablePair<Integer, ItemStack> result = HELPER.extractFromContainer(itemStack, new AspectStack(aspect, amount));
|
||||
ImmutablePair<Integer, ItemStack> result = HELPER
|
||||
.extractFromContainer(itemStack, new AspectStack(aspect, amount));
|
||||
drained = result == null ? 0 : result.left;
|
||||
stack = result == null ? null : result.right;
|
||||
}
|
||||
|
||||
@@ -239,12 +239,25 @@ public enum GuiType {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
return new ContainerPatternPortableCell(player.inventory, inv);
|
||||
return new ContainerFluidPatternWireless(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
return new GuiPatternPortableCell(player.inventory, inv);
|
||||
return new GuiFluidPatternWireless(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
WIRELESS_CRAFTING_TERMINAL(new ItemGuiFactory<IWirelessTerminal>(IWirelessTerminal.class) {
|
||||
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
return new ContainerCraftingWireless(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, IWirelessTerminal inv) {
|
||||
return new GuiFluidCraftingWireless(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
|
||||
+1
-7
@@ -1,15 +1,11 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
|
||||
public interface PatternTerminal {
|
||||
public interface IItemPatternTerminal extends IItemTerminal {
|
||||
|
||||
boolean isInverted();
|
||||
|
||||
IInventory getInventoryByName(final String name);
|
||||
|
||||
boolean canBeSubstitute();
|
||||
|
||||
boolean isPrioritize();
|
||||
@@ -39,6 +35,4 @@ public interface PatternTerminal {
|
||||
boolean isCraftingRecipe();
|
||||
|
||||
void sortCraftingItems();
|
||||
|
||||
default void saveSettings() {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public interface IItemTerminal {
|
||||
|
||||
IInventory getInventoryByName(final String name);
|
||||
|
||||
default void saveSettings() {}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
public interface IWirelessCraftTerminal extends IWirelessTerminal, IItemTerminal {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
public interface IWirelessPatternTerminal extends IWirelessTerminal, PatternTerminal {
|
||||
public interface IWirelessPatternTerminal extends IWirelessTerminal, IItemPatternTerminal {
|
||||
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package com.glodblock.github.inventory.item;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.config.*;
|
||||
import appeng.api.implementations.items.IAEItemPowerStorage;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.IMEMonitor;
|
||||
import appeng.api.storage.MEMonitorHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.items.contents.WirelessTerminalViewCells;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class WirelessCraftingTerminalInventory extends MEMonitorHandler<IAEItemStack>
|
||||
implements IWirelessCraftTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
private final int inventorySlot;
|
||||
private final AppEngInternalInventory viewCell;
|
||||
private final StorageChannel channel;
|
||||
private final IGridNode grid;
|
||||
|
||||
protected AppEngInternalInventory crafting;
|
||||
protected AppEngInternalInventory output;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessCraftingTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEItemStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.ITEMS)));
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
this.inventorySlot = slot;
|
||||
this.viewCell = new WirelessTerminalViewCells(is);
|
||||
this.channel = StorageChannel.ITEMS;
|
||||
this.crafting = new ItemBiggerAppEngInventory(is, "crafting", 9);
|
||||
this.output = new ItemBiggerAppEngInventory(is, "output", 3);
|
||||
}
|
||||
|
||||
public StorageChannel getChannel() {
|
||||
return this.channel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double extractAEPower(double amt, Actionable mode, PowerMultiplier usePowerMultiplier) {
|
||||
amt = usePowerMultiplier.multiply(amt);
|
||||
if (mode == Actionable.SIMULATE) {
|
||||
return usePowerMultiplier.divide(Math.min(amt, this.ips.getAECurrentPower(this.target)));
|
||||
}
|
||||
return usePowerMultiplier.divide(this.ips.extractAEPower(this.target, amt));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEItemStack> getItemInventory() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEMonitor<IAEFluidStack> getFluidInventory() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager() {
|
||||
final ConfigManager out = new ConfigManager((manager, settingName, newValue) -> {
|
||||
final NBTTagCompound data = Platform.openNbtData(this.target);
|
||||
manager.writeToNBT(data);
|
||||
});
|
||||
out.registerSetting(Settings.SORT_BY, SortOrder.NAME);
|
||||
out.registerSetting(Settings.VIEW_MODE, ViewItems.ALL);
|
||||
out.registerSetting(Settings.SORT_DIRECTION, SortDir.ASCENDING);
|
||||
out.readFromNBT((NBTTagCompound) Platform.openNbtData(this.target).copy());
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventorySlot() {
|
||||
return this.inventorySlot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getViewCellStorage() {
|
||||
return this.viewCell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGridNode getGridNode(ForgeDirection dir) {
|
||||
return this.grid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType(ForgeDirection dir) {
|
||||
return AECableType.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void securityBreak() {
|
||||
this.getGridNode(ForgeDirection.UNKNOWN).getMachine().securityBreak();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveChanges() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName(String name) {
|
||||
if (name.equals("crafting")) {
|
||||
return this.crafting;
|
||||
}
|
||||
|
||||
if (name.equals("output")) {
|
||||
return this.output;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -28,7 +28,7 @@ import appeng.util.Platform;
|
||||
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class WirelessFluidTerminal extends MEMonitorHandler<IAEFluidStack> implements IWirelessTerminal {
|
||||
public class WirelessFluidTerminalInventory extends MEMonitorHandler<IAEFluidStack> implements IWirelessTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
@@ -38,7 +38,7 @@ public class WirelessFluidTerminal extends MEMonitorHandler<IAEFluidStack> imple
|
||||
private final IGridNode grid;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessFluidTerminal(final ItemStack is, final int slot, IGridNode gridNode, EntityPlayer player) {
|
||||
public WirelessFluidTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode, EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEFluidStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.FLUIDS)));
|
||||
+8
-6
@@ -33,11 +33,11 @@ import com.glodblock.github.inventory.ItemBiggerAppEngInventory;
|
||||
import com.glodblock.github.inventory.WirelessFluidPatternTerminalPatterns;
|
||||
import com.glodblock.github.util.Util;
|
||||
|
||||
public class WirelessPatternTerminal extends MEMonitorHandler<IAEItemStack> implements IWirelessPatternTerminal {
|
||||
public class WirelessPatternTerminalInventory extends MEMonitorHandler<IAEItemStack>
|
||||
implements IWirelessPatternTerminal {
|
||||
|
||||
private final ItemStack target;
|
||||
private final IAEItemPowerStorage ips;
|
||||
private final EntityPlayer p;
|
||||
private final int inventorySlot;
|
||||
private final AppEngInternalInventory viewCell;
|
||||
private final StorageChannel channel;
|
||||
@@ -56,14 +56,14 @@ public class WirelessPatternTerminal extends MEMonitorHandler<IAEItemStack> impl
|
||||
protected int activePage = 0;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public WirelessPatternTerminal(final ItemStack is, final int slot, IGridNode gridNode, EntityPlayer player) {
|
||||
public WirelessPatternTerminalInventory(final ItemStack is, final int slot, IGridNode gridNode,
|
||||
EntityPlayer player) {
|
||||
super(
|
||||
(IMEInventoryHandler<IAEItemStack>) Objects
|
||||
.requireNonNull(Util.getWirelessInv(is, player, StorageChannel.ITEMS)));
|
||||
this.ips = (ToolWirelessTerminal) is.getItem();
|
||||
this.grid = gridNode;
|
||||
this.target = is;
|
||||
this.p = player;
|
||||
this.inventorySlot = slot;
|
||||
this.viewCell = new WirelessTerminalViewCells(is);
|
||||
this.channel = StorageChannel.ITEMS;
|
||||
@@ -163,12 +163,14 @@ public class WirelessPatternTerminal extends MEMonitorHandler<IAEItemStack> impl
|
||||
|
||||
@Override
|
||||
public void saveChanges() {
|
||||
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IInventory inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {}
|
||||
ItemStack newStack) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInverted() {
|
||||
@@ -6,7 +6,7 @@ import codechicken.nei.api.IConfigureNEI;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminal;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternTerminalEx;
|
||||
import com.glodblock.github.client.gui.GuiPatternPortableCell;
|
||||
import com.glodblock.github.client.gui.GuiFluidPatternWireless;
|
||||
import com.glodblock.github.nei.recipes.FluidRecipe;
|
||||
|
||||
public class NEI_FC_Config implements IConfigureNEI {
|
||||
@@ -17,7 +17,7 @@ public class NEI_FC_Config implements IConfigureNEI {
|
||||
API.addSearchProvider(new NEIItemFilter());
|
||||
for (String identifier : FluidRecipe.getSupportRecipes()) {
|
||||
API.registerGuiOverlayHandler(
|
||||
GuiPatternPortableCell.class,
|
||||
GuiFluidPatternWireless.class,
|
||||
FluidPatternTerminalRecipeTransferHandler.INSTANCE,
|
||||
identifier);
|
||||
API.registerGuiOverlayHandler(
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -17,6 +18,8 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.implementations.tiles.IWirelessAccessPoint;
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -30,6 +33,7 @@ import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
@@ -40,6 +44,7 @@ import com.glodblock.github.common.item.ItemBaseWirelessTerminal;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.inventory.IAEFluidTank;
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
@@ -47,6 +52,32 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
public final class Util {
|
||||
|
||||
public static int drainItemPower(AEBaseContainer c, InventoryPlayer ip, int slot, int ticks, double pm,
|
||||
IFluidPortableCell wt) {
|
||||
final ItemStack currentItem = slot < 0 ? ip.getCurrentItem() : ip.getStackInSlot(slot);
|
||||
if (wt != null) {
|
||||
if (currentItem != wt.getItemStack()) {
|
||||
if (currentItem != null) {
|
||||
if (Platform.isSameItem(wt.getItemStack(), currentItem)) {
|
||||
ip.setInventorySlotContents(ip.currentItem, wt.getItemStack());
|
||||
} else {
|
||||
c.setValidContainer(false);
|
||||
}
|
||||
} else {
|
||||
c.setValidContainer(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
c.setValidContainer(false);
|
||||
}
|
||||
ticks++;
|
||||
if (ticks > 10 && wt != null) {
|
||||
wt.extractAEPower(pm * ticks, Actionable.MODULATE, PowerMultiplier.CONFIG);
|
||||
ticks = 0;
|
||||
}
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public static boolean hasInfinityBoosterCard(ItemStack is) {
|
||||
if (ModAndClassUtil.WCT && is.getItem() instanceof ItemBaseWirelessTerminal) {
|
||||
NBTTagCompound data = Platform.openNbtData(is);
|
||||
@@ -66,7 +97,6 @@ public final class Util {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static IBaseMonitor<? extends IAEStack<? extends IAEStack<?>>> getWirelessInv(ItemStack is,
|
||||
EntityPlayer player, StorageChannel channel) {
|
||||
IGridNode gridNode = getWirelessGrid(is);
|
||||
|
||||
Reference in new issue
Block a user