mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 09:34:42 +00:00
add extended fluid pattern terminal
This commit is contained in:
1 parent
1253a9002d
commit
ecde78111d
23 files changed
+896
-6
No files matched your search
@@ -0,0 +1,53 @@
|
||||
package com.glodblock.github.client;
|
||||
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.implementations.GuiExpandedProcessingPatternTerm;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.render.StackSizeRenderer;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import com.glodblock.github.client.container.ContainerExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.client.render.FluidRenderUtils;
|
||||
import com.glodblock.github.inventory.GuiType;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
public class GuiExtendedFluidPatternTerminal extends GuiExpandedProcessingPatternTerm {
|
||||
|
||||
private final StackSizeRenderer stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
|
||||
private GuiTabButton craftingStatusBtn;
|
||||
|
||||
public GuiExtendedFluidPatternTerminal(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
||||
super(inventoryPlayer, te);
|
||||
ContainerExtendedFluidPatternTerminal container = new ContainerExtendedFluidPatternTerminal(inventoryPlayer, te);
|
||||
container.setGui(this);
|
||||
this.inventorySlots = container;
|
||||
Ae2ReflectClient.setGuiExContainer(this, container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
craftingStatusBtn = Ae2ReflectClient.getCraftingStatusButton(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSlot(Slot slot) {
|
||||
if (!(slot instanceof SlotFake && FluidRenderUtils.renderFluidPacketIntoGuiSlot(
|
||||
slot, slot.getStack(), stackSizeRenderer, fontRenderer))) {
|
||||
super.drawSlot(slot);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) {
|
||||
if (btn == craftingStatusBtn) {
|
||||
InventoryHandler.switchGui(GuiType.FLUID_PAT_TERM_CRAFTING_STATUS);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+8
-1
@@ -3,6 +3,8 @@ package com.glodblock.github.client;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.implementations.GuiCraftingStatus;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import com.glodblock.github.common.part.PartExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.common.part.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.inventory.GuiType;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
@@ -14,9 +16,11 @@ import java.io.IOException;
|
||||
public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
|
||||
private GuiTabButton originalGuiBtn;
|
||||
private final ITerminalHost part;
|
||||
|
||||
public GuiFluidPatternTerminalCraftingStatus(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
||||
super(inventoryPlayer, te);
|
||||
this.part = te;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,7 +32,10 @@ public class GuiFluidPatternTerminalCraftingStatus extends GuiCraftingStatus {
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton btn) throws IOException {
|
||||
if (btn == originalGuiBtn) {
|
||||
InventoryHandler.switchGui(GuiType.FLUID_PATTERN_TERMINAL);
|
||||
if (part instanceof PartFluidPatternTerminal)
|
||||
InventoryHandler.switchGui(GuiType.FLUID_PATTERN_TERMINAL);
|
||||
else if (part instanceof PartExtendedFluidPatternTerminal)
|
||||
InventoryHandler.switchGui(GuiType.FLUID_EXTENDED_PATTERN_TERMINAL);
|
||||
} else {
|
||||
super.actionPerformed(btn);
|
||||
}
|
||||
|
||||
+436
@@ -0,0 +1,436 @@
|
||||
package com.glodblock.github.client.container;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.implementations.ContainerExpandedProcessingPatternTerm;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
import appeng.container.slot.SlotPatternOutputs;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.item.AEItemStack;
|
||||
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.common.part.PartExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.interfaces.PatternConsumer;
|
||||
import com.glodblock.github.loader.FCItems;
|
||||
import com.glodblock.github.util.Ae2Reflect;
|
||||
import com.glodblock.github.util.FluidPatternDetails;
|
||||
import com.glodblock.github.util.Util;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ContainerExtendedFluidPatternTerminal extends ContainerExpandedProcessingPatternTerm implements PatternConsumer {
|
||||
|
||||
private final Slot[] craftingSlots;
|
||||
private final Slot[] outputSlots;
|
||||
private final Slot patternSlotIN;
|
||||
private final Slot patternSlotOUT;
|
||||
public final ITerminalHost part;
|
||||
|
||||
public ContainerExtendedFluidPatternTerminal(InventoryPlayer ip, ITerminalHost monitorable) {
|
||||
super(ip, monitorable);
|
||||
craftingSlots = Ae2Reflect.getExCraftingSlots(this);
|
||||
outputSlots = Ae2Reflect.getExOutputSlots(this);
|
||||
patternSlotIN = Ae2Reflect.getExPatternSlotIn(this);
|
||||
patternSlotOUT = Ae2Reflect.getExPatternSlotOut(this);
|
||||
part = monitorable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void encode() {
|
||||
if (!checkHasFluidPattern()) {
|
||||
super.encode();
|
||||
return;
|
||||
}
|
||||
ItemStack stack = this.patternSlotOUT.getStack();
|
||||
if (stack.isEmpty()) {
|
||||
stack = this.patternSlotIN.getStack();
|
||||
if (stack.isEmpty() || !isPattern(stack)) {
|
||||
return;
|
||||
}
|
||||
if (stack.getCount() == 1) {
|
||||
this.patternSlotIN.putStack(ItemStack.EMPTY);
|
||||
} else {
|
||||
stack.shrink(1);
|
||||
}
|
||||
encodeFluidPattern();
|
||||
} else if (isPattern(stack)) {
|
||||
encodeFluidPattern();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isPattern(final ItemStack output) {
|
||||
if (output.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (output.getItem() instanceof ItemFluidEncodedPattern) {
|
||||
return true;
|
||||
}
|
||||
final IDefinitions defs = AEApi.instance().definitions();
|
||||
return defs.items().encodedPattern().isSameAs(output) || defs.materials().blankPattern().isSameAs(output);
|
||||
}
|
||||
|
||||
private boolean checkHasFluidPattern() {
|
||||
boolean hasFluid = false, search = false;
|
||||
for (Slot craftingSlot : this.craftingSlots) {
|
||||
final ItemStack crafting = craftingSlot.getStack();
|
||||
if (crafting.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
search = true;
|
||||
if (crafting.getItem() instanceof ItemFluidPacket) {
|
||||
hasFluid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!search) { // search=false -> inputs were empty
|
||||
return false;
|
||||
}
|
||||
// `search` should be true at this point
|
||||
for (Slot outputSlot : this.outputSlots) {
|
||||
final ItemStack out = outputSlot.getStack();
|
||||
if (out.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
search = false;
|
||||
if (hasFluid) {
|
||||
break;
|
||||
} else if (out.getItem() instanceof ItemFluidPacket) {
|
||||
hasFluid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return hasFluid && !search; // search=true -> outputs were empty
|
||||
}
|
||||
|
||||
private void encodeFluidPattern() {
|
||||
ItemStack patternStack = new ItemStack(FCItems.DENSE_ENCODED_PATTERN);
|
||||
FluidPatternDetails pattern = new FluidPatternDetails(patternStack);
|
||||
pattern.setInputs(collectInventory(craftingSlots));
|
||||
pattern.setOutputs(collectInventory(outputSlots));
|
||||
patternSlotOUT.putStack(pattern.writeToStack());
|
||||
}
|
||||
|
||||
private static IAEItemStack[] collectInventory(Slot[] slots) {
|
||||
// see note at top of DensePatternDetails
|
||||
List<IAEItemStack> acc = new ArrayList<>();
|
||||
for (Slot slot : slots) {
|
||||
ItemStack stack = slot.getStack();
|
||||
if (stack.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (stack.getItem() instanceof ItemFluidPacket) {
|
||||
IAEItemStack dropStack = ItemFluidDrop.newAeStack(ItemFluidPacket.getFluidStack(stack));
|
||||
if (dropStack != null) {
|
||||
acc.add(dropStack);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
IAEItemStack aeStack = AEItemStack.fromItemStack(stack);
|
||||
if (aeStack == null) {
|
||||
continue;
|
||||
}
|
||||
acc.add(aeStack);
|
||||
}
|
||||
return acc.toArray(new IAEItemStack[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAction(EntityPlayerMP player, InventoryAction action, int slotId, long id) {
|
||||
if (slotId < 0 || slotId >= this.inventorySlots.size()) {
|
||||
super.doAction(player, action, slotId, id);
|
||||
return;
|
||||
}
|
||||
Slot slot = getSlot(slotId);
|
||||
ItemStack stack = player.inventory.getItemStack();
|
||||
if ((slot instanceof SlotFakeCraftingMatrix || slot instanceof SlotPatternOutputs) && !stack.isEmpty()
|
||||
&& stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null) && Util.getFluidFromItem(stack) != null) {
|
||||
FluidStack fluid = null;
|
||||
switch (action) {
|
||||
case PICKUP_OR_SET_DOWN:
|
||||
fluid = Util.getFluidFromItem(stack);
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
break;
|
||||
case SPLIT_OR_PLACE_SINGLE:
|
||||
fluid = Util.getFluidFromItem(ItemHandlerHelper.copyStackWithSize(stack, 1));
|
||||
FluidStack origin = ItemFluidPacket.getFluidStack(slot.getStack());
|
||||
if (fluid != null && fluid.equals(origin)) {
|
||||
fluid.amount += origin.amount;
|
||||
if (fluid.amount <= 0) fluid = null;
|
||||
}
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
break;
|
||||
}
|
||||
if (fluid == null) {
|
||||
super.doAction(player, action, slotId, id);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (action == InventoryAction.SPLIT_OR_PLACE_SINGLE) {
|
||||
if (stack.isEmpty() && !slot.getStack().isEmpty() && slot.getStack().getItem() instanceof ItemFluidPacket) {
|
||||
FluidStack fluid = ItemFluidPacket.getFluidStack(slot.getStack());
|
||||
if (fluid != null && fluid.amount - 1000 >= 1) {
|
||||
fluid.amount -= 1000;
|
||||
slot.putStack(ItemFluidPacket.newStack(fluid));
|
||||
}
|
||||
}
|
||||
}
|
||||
super.doAction(player, action, slotId, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void multiply(int multiple) {
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt * multiple > Integer.MAX_VALUE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt * multiple > slot.getStack().getMaxStackSize()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt * multiple > Integer.MAX_VALUE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt * multiple > slot.getStack().getMaxStackSize()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount *= multiple;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() * multiple);
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount *= multiple;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() * multiple);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void divide(int divide) {
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt % divide != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt % divide != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt % divide != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt % divide != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount /= divide;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() / divide);
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount /= divide;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() / divide);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void increase(int increase) {
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt + increase * 1000 > Integer.MAX_VALUE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt + increase > slot.getStack().getMaxStackSize()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt + increase * 1000 > Integer.MAX_VALUE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt + increase > slot.getStack().getMaxStackSize()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount += increase * 1000;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() + increase);
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount += increase * 1000;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() + increase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decrease(int decrease) {
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt - decrease * 1000 < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt - decrease < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
long amt = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack())).amount;
|
||||
if (amt - decrease * 1000 < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
long amt = slot.getStack().getCount();
|
||||
if (amt - decrease < 1) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.craftingSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount -= decrease * 1000;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() - decrease);
|
||||
}
|
||||
}
|
||||
|
||||
for (Slot slot : this.outputSlots) {
|
||||
if (ItemFluidPacket.isFluidPacket(slot.getStack()) && ItemFluidPacket.getFluidStack(slot.getStack()) != null) {
|
||||
FluidStack fluid = Objects.requireNonNull(ItemFluidPacket.getFluidStack(slot.getStack()));
|
||||
fluid.amount -= decrease * 1000;
|
||||
ItemStack packet = ItemFluidPacket.newStack(fluid);
|
||||
slot.putStack(packet);
|
||||
}
|
||||
else if (!slot.getStack().isEmpty()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
stack.setCount(stack.getCount() - decrease);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptPattern(IAEItemStack[] inputs, IAEItemStack[] outputs) {
|
||||
if (part instanceof PartExtendedFluidPatternTerminal) {
|
||||
((PartExtendedFluidPatternTerminal) part).onChangeCrafting(inputs, outputs);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import com.glodblock.github.common.part.PartExtendedFluidPatternTerminal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemPartExtendedFluidPatternTerminal extends Item implements IPartItem<PartExtendedFluidPatternTerminal> {
|
||||
|
||||
public ItemPartExtendedFluidPatternTerminal() {
|
||||
this.setMaxStackSize(64);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public PartExtendedFluidPatternTerminal createPartFromItemStack(ItemStack is) {
|
||||
return new PartExtendedFluidPatternTerminal(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public EnumActionResult onItemUse(@Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EnumHand hand, @Nonnull EnumFacing side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
return AEApi.instance().partHelper().placeBus(player.getHeldItem(hand), pos, side, player, hand, world);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.glodblock.github.common.part;
|
||||
|
||||
import appeng.api.networking.crafting.ICraftingPatternDetails;
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.items.parts.PartModels;
|
||||
import appeng.parts.PartModel;
|
||||
import appeng.parts.reporting.PartExpandedProcessingPatternTerminal;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.InvOperation;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
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.GuiType;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PartExtendedFluidPatternTerminal extends PartExpandedProcessingPatternTerminal {
|
||||
|
||||
@PartModels
|
||||
public static ResourceLocation[] MODELS = new ResourceLocation[] {
|
||||
new ResourceLocation(FluidCraft.MODID, "part/f_pattern_ex_term_on"), // 0
|
||||
new ResourceLocation(FluidCraft.MODID, "part/f_pattern_ex_term_off"), // 1
|
||||
};
|
||||
|
||||
private static final IPartModel MODELS_ON = new PartModel(MODEL_BASE, MODELS[0], MODEL_STATUS_ON);
|
||||
private static final IPartModel MODELS_OFF = new PartModel(MODEL_BASE, MODELS[1], MODEL_STATUS_OFF);
|
||||
private static final IPartModel MODELS_HAS_CHANNEL = new PartModel(MODEL_BASE, MODELS[0], MODEL_STATUS_HAS_CHANNEL);
|
||||
|
||||
public PartExtendedFluidPatternTerminal(ItemStack is) {
|
||||
super(is);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IPartModel getStaticModels() {
|
||||
return this.selectModel(MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPartActivate(final EntityPlayer player, final EnumHand hand, final Vec3d pos) {
|
||||
TileEntity te = this.getTile();
|
||||
BlockPos tePos = te.getPos();
|
||||
if (Platform.isWrench(player, player.inventory.getCurrentItem(), tePos)) {
|
||||
return super.onPartActivate(player, hand, pos);
|
||||
}
|
||||
if (Platform.isServer()) {
|
||||
if (GuiBridge.GUI_EXPANDED_PROCESSING_PATTERN_TERMINAL.hasPermissions(te, tePos.getX(), tePos.getY(), tePos.getZ(), getSide(), player)) {
|
||||
InventoryHandler.openGui(player, te.getWorld(), tePos, getSide().getFacing(), GuiType.FLUID_EXTENDED_PATTERN_TERMINAL);
|
||||
} else {
|
||||
Platform.openGUI(player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_ME);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(IItemHandler inv, int slot, InvOperation mc, ItemStack removedStack,
|
||||
ItemStack newStack) {
|
||||
if (slot == 1) {
|
||||
final ItemStack is = inv.getStackInSlot(1);
|
||||
if (!is.isEmpty() && is.getItem() instanceof ItemFluidEncodedPattern) {
|
||||
final ItemFluidEncodedPattern pattern = (ItemFluidEncodedPattern) is.getItem();
|
||||
final ICraftingPatternDetails details = pattern.getPatternForItem( is, this.getHost().getTile().getWorld() );
|
||||
if( details != null )
|
||||
{
|
||||
|
||||
for( int x = 0; x < this.getInventoryByName("crafting").getSlots(); x ++ ) {
|
||||
((AppEngInternalInventory) this.getInventoryByName("crafting")).setStackInSlot(x, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.getInventoryByName("output").getSlots(); x ++ ) {
|
||||
((AppEngInternalInventory) this.getInventoryByName("output")).setStackInSlot(x, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.getInventoryByName("crafting").getSlots() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getInputs()[x];
|
||||
if (item != null && item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet = ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.createItemStack()));
|
||||
((AppEngInternalInventory) this.getInventoryByName("crafting")).setStackInSlot(x, packet);
|
||||
}
|
||||
else ((AppEngInternalInventory) this.getInventoryByName("crafting")).setStackInSlot( x, item == null ? ItemStack.EMPTY : item.createItemStack() );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.getInventoryByName("output").getSlots() && x < details.getOutputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getOutputs()[x];
|
||||
if (item != null && item.getItem() instanceof ItemFluidDrop) {
|
||||
ItemStack packet = ItemFluidPacket.newStack(ItemFluidDrop.getFluidStack(item.createItemStack()));
|
||||
((AppEngInternalInventory) this.getInventoryByName("output")).setStackInSlot(x, packet);
|
||||
}
|
||||
else ((AppEngInternalInventory) this.getInventoryByName("output")).setStackInSlot( x, item == null ? ItemStack.EMPTY : item.createItemStack() );
|
||||
}
|
||||
}
|
||||
this.getHost().markForSave();
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.onChangeInventory(inv, slot, mc, removedStack, newStack);
|
||||
}
|
||||
|
||||
public void onChangeCrafting(IAEItemStack[] newCrafting, IAEItemStack[] newOutput) {
|
||||
IItemHandler crafting = this.getInventoryByName("crafting");
|
||||
IItemHandler output = this.getInventoryByName("output");
|
||||
if (crafting instanceof AppEngInternalInventory && output instanceof AppEngInternalInventory) {
|
||||
for (int x = 0; x < crafting.getSlots() && x < newCrafting.length; x++) {
|
||||
final IAEItemStack item = newCrafting[x];
|
||||
((AppEngInternalInventory)crafting)
|
||||
.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
|
||||
}
|
||||
|
||||
for (int x = 0; x < output.getSlots() && x < newOutput.length; x++) {
|
||||
final IAEItemStack item = newOutput[x];
|
||||
((AppEngInternalInventory)output)
|
||||
.setStackInSlot(x, item == null ? ItemStack.EMPTY : item.createItemStack());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.model.DenseEncodedPatternModel;
|
||||
import com.glodblock.github.client.model.FluidPacketModel;
|
||||
import com.glodblock.github.common.part.PartDualInterface;
|
||||
import com.glodblock.github.common.part.PartExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.common.part.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.interfaces.HasCustomModel;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -30,6 +31,7 @@ public class ClientRegistryHandler extends RegistryHandler {
|
||||
}
|
||||
AEApi.instance().registries().partModels().registerModels(PartDualInterface.MODELS);
|
||||
AEApi.instance().registries().partModels().registerModels(PartFluidPatternTerminal.MODELS);
|
||||
AEApi.instance().registries().partModels().registerModels(PartExtendedFluidPatternTerminal.MODELS);
|
||||
}
|
||||
|
||||
private static void registerModel(String key, Item item) {
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.glodblock.github.integration.jei;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.container.ContainerExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.common.part.PartExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.network.CPacketLoadPattern;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferError;
|
||||
import mezz.jei.api.recipe.transfer.IRecipeTransferHandler;
|
||||
import mezz.jei.transfer.RecipeTransferErrorTooltip;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ExtendedFluidPatternTerminalRecipeTransferHandler implements IRecipeTransferHandler<ContainerExtendedFluidPatternTerminal> {
|
||||
|
||||
private final ExtraExtractors ext;
|
||||
|
||||
ExtendedFluidPatternTerminalRecipeTransferHandler(ExtraExtractors ext) {
|
||||
this.ext = ext;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Class<ContainerExtendedFluidPatternTerminal> getContainerClass() {
|
||||
return ContainerExtendedFluidPatternTerminal.class;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IRecipeTransferError transferRecipe(@Nonnull ContainerExtendedFluidPatternTerminal container, @Nonnull IRecipeLayout recipeLayout,
|
||||
@Nonnull EntityPlayer player, boolean maxTransfer, boolean doTransfer) {
|
||||
|
||||
if (recipeLayout.getRecipeCategory().getUid().equals(VanillaRecipeCategoryUid.CRAFTING)) {
|
||||
return new RecipeTransferErrorTooltip(I18n.format(NameConst.TT_CRAFTING_RECIPE_ONLY));
|
||||
}
|
||||
|
||||
if (doTransfer && container.part instanceof PartExtendedFluidPatternTerminal) {
|
||||
PartExtendedFluidPatternTerminal tile = (PartExtendedFluidPatternTerminal)container.part;
|
||||
IAEItemStack[] crafting = new IAEItemStack[tile.getInventoryByName("crafting").getSlots()];
|
||||
IAEItemStack[] output = new IAEItemStack[tile.getInventoryByName("output").getSlots()];
|
||||
FluidPatternEncoderRecipeTransferHandler.transferRecipeSlots(recipeLayout, crafting, output, false, ext);
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLoadPattern(crafting, output));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,8 @@ public class FCJeiPlugin implements IModPlugin {
|
||||
new FluidPatternEncoderRecipeTransferHandler(ext), Constants.UNIVERSAL_RECIPE_TRANSFER_UID);
|
||||
registry.getRecipeTransferRegistry().addRecipeTransferHandler(
|
||||
new FluidPatternTerminalRecipeTransferHandler(ext), Constants.UNIVERSAL_RECIPE_TRANSFER_UID);
|
||||
registry.getRecipeTransferRegistry().addRecipeTransferHandler(
|
||||
new ExtendedFluidPatternTerminalRecipeTransferHandler(ext), Constants.UNIVERSAL_RECIPE_TRANSFER_UID);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.fluids.container.ContainerFluidInterface;
|
||||
import appeng.fluids.helper.IFluidInterfaceHost;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
import appeng.parts.reporting.AbstractPartTerminal;
|
||||
import com.glodblock.github.client.*;
|
||||
import com.glodblock.github.client.container.*;
|
||||
import com.glodblock.github.common.part.PartFluidPatternTerminal;
|
||||
@@ -106,14 +107,14 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_PAT_TERM_CRAFTING_STATUS(new PartGuiFactory<PartFluidPatternTerminal>(PartFluidPatternTerminal.class) {
|
||||
FLUID_PAT_TERM_CRAFTING_STATUS(new PartGuiFactory<AbstractPartTerminal>(AbstractPartTerminal.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, PartFluidPatternTerminal inv) {
|
||||
protected Object createServerGui(EntityPlayer player, AbstractPartTerminal inv) {
|
||||
return new ContainerCraftingStatus(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, PartFluidPatternTerminal inv) {
|
||||
protected Object createClientGui(EntityPlayer player, AbstractPartTerminal inv) {
|
||||
return new GuiFluidPatternTerminalCraftingStatus(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
@@ -130,6 +131,18 @@ public enum GuiType {
|
||||
}
|
||||
}),
|
||||
|
||||
FLUID_EXTENDED_PATTERN_TERMINAL(new PartGuiFactory<ITerminalHost>(ITerminalHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, ITerminalHost inv) {
|
||||
return new ContainerExtendedFluidPatternTerminal(player.inventory, inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createClientGui(EntityPlayer player, ITerminalHost inv) {
|
||||
return new GuiExtendedFluidPatternTerminal(player.inventory, inv);
|
||||
}
|
||||
}),
|
||||
|
||||
PRIORITY(new PartOrTileGuiFactory<FCPriorityHost>(FCPriorityHost.class) {
|
||||
@Override
|
||||
protected Object createServerGui(EntityPlayer player, FCPriorityHost inv) {
|
||||
|
||||
@@ -27,6 +27,8 @@ public class FCItems {
|
||||
public static ItemPartDualInterface PART_DUAL_INTERFACE;
|
||||
@GameRegistry.ObjectHolder(FluidCraft.MODID + ":" + NameConst.ITEM_PART_FLUID_PATTERN_TERMINAL)
|
||||
public static ItemPartFluidPatternTerminal PART_FLUID_PATTERN_TERMINAL;
|
||||
@GameRegistry.ObjectHolder(FluidCraft.MODID + ":" + NameConst.ITEM_PART_EXTENDED_FLUID_PATTERN_TERMINAL)
|
||||
public static ItemPartExtendedFluidPatternTerminal PART_EXTENDED_FLUID_PATTERN_TERMINAL;
|
||||
|
||||
public static void init(RegistryHandler regHandler) {
|
||||
regHandler.item(NameConst.ITEM_FLUID_DROP, new ItemFluidDrop());
|
||||
@@ -34,6 +36,7 @@ public class FCItems {
|
||||
regHandler.item(NameConst.ITEM_DENSE_ENCODED_PATTERN, new ItemFluidEncodedPattern());
|
||||
regHandler.item(NameConst.ITEM_PART_DUAL_INTERFACE, new ItemPartDualInterface());
|
||||
regHandler.item(NameConst.ITEM_PART_FLUID_PATTERN_TERMINAL, new ItemPartFluidPatternTerminal());
|
||||
regHandler.item(NameConst.ITEM_PART_EXTENDED_FLUID_PATTERN_TERMINAL, new ItemPartExtendedFluidPatternTerminal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class ClientProxy extends CommonProxy {
|
||||
return fluid != null ? fluid.getFluid().getColor(fluid) : -1;
|
||||
}, FCItems.FLUID_PACKET);
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler((s, i) -> AEColor.TRANSPARENT.getVariantByTintIndex(i), FCItems.PART_FLUID_PATTERN_TERMINAL);
|
||||
|
||||
Minecraft.getMinecraft().getItemColors().registerItemColorHandler((s, i) -> AEColor.TRANSPARENT.getVariantByTintIndex(i), FCItems.PART_EXTENDED_FLUID_PATTERN_TERMINAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.container.implementations.ContainerExpandedProcessingPatternTerm;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
import appeng.container.slot.OptionalSlotFake;
|
||||
import appeng.container.slot.SlotFakeCraftingMatrix;
|
||||
@@ -23,6 +24,10 @@ public class Ae2Reflect {
|
||||
private static final Field fContainerPatternTerm_outputSlots;
|
||||
private static final Field fContainerPatternTerm_patternSlotIN;
|
||||
private static final Field fContainerPatternTerm_patternSlotOUT;
|
||||
private static final Field fContainerExPatternTerm_craftingSlots;
|
||||
private static final Field fContainerExPatternTerm_outputSlots;
|
||||
private static final Field fContainerExPatternTerm_patternSlotIN;
|
||||
private static final Field fContainerExPatternTerm_patternSlotOUT;
|
||||
private static final Field fInventory_container;
|
||||
|
||||
static {
|
||||
@@ -34,6 +39,10 @@ public class Ae2Reflect {
|
||||
fContainerPatternTerm_outputSlots = reflectField(ContainerPatternTerm.class, "outputSlots");
|
||||
fContainerPatternTerm_patternSlotIN = reflectField(ContainerPatternTerm.class, "patternSlotIN");
|
||||
fContainerPatternTerm_patternSlotOUT = reflectField(ContainerPatternTerm.class, "patternSlotOUT");
|
||||
fContainerExPatternTerm_craftingSlots = reflectField(ContainerExpandedProcessingPatternTerm.class, "gridSlots");
|
||||
fContainerExPatternTerm_outputSlots = reflectField(ContainerExpandedProcessingPatternTerm.class, "outputSlots");
|
||||
fContainerExPatternTerm_patternSlotIN = reflectField(ContainerExpandedProcessingPatternTerm.class, "patternSlotIN");
|
||||
fContainerExPatternTerm_patternSlotOUT = reflectField(ContainerExpandedProcessingPatternTerm.class, "patternSlotOUT");
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Failed to initialize AE2 reflection hacks!", e);
|
||||
}
|
||||
@@ -109,4 +118,20 @@ public class Ae2Reflect {
|
||||
return readField(cont, fContainerPatternTerm_patternSlotOUT);
|
||||
}
|
||||
|
||||
public static SlotFakeCraftingMatrix[] getExCraftingSlots(ContainerExpandedProcessingPatternTerm cont) {
|
||||
return readField(cont, fContainerExPatternTerm_craftingSlots);
|
||||
}
|
||||
|
||||
public static OptionalSlotFake[] getExOutputSlots(ContainerExpandedProcessingPatternTerm cont) {
|
||||
return readField(cont, fContainerExPatternTerm_outputSlots);
|
||||
}
|
||||
|
||||
public static SlotRestrictedInput getExPatternSlotIn(ContainerExpandedProcessingPatternTerm cont) {
|
||||
return readField(cont, fContainerExPatternTerm_patternSlotIN);
|
||||
}
|
||||
|
||||
public static SlotRestrictedInput getExPatternSlotOut(ContainerExpandedProcessingPatternTerm cont) {
|
||||
return readField(cont, fContainerExPatternTerm_patternSlotOUT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import appeng.client.gui.implementations.*;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
import appeng.client.render.StackSizeRenderer;
|
||||
import appeng.fluids.client.gui.GuiFluidInterface;
|
||||
import com.glodblock.github.client.container.ContainerExtendedFluidPatternTerminal;
|
||||
import com.glodblock.github.client.container.ContainerFluidPatternTerminal;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -75,6 +76,11 @@ public class Ae2ReflectClient {
|
||||
Ae2Reflect.writeField(instance, fGuiMEMonitorable_configSrc, container.getConfigManager());
|
||||
}
|
||||
|
||||
public static void setGuiExContainer(GuiExpandedProcessingPatternTerm instance, ContainerExtendedFluidPatternTerminal container) {
|
||||
Ae2Reflect.writeField(instance, fGuiMEMonitorable_monitorableContainer, container);
|
||||
Ae2Reflect.writeField(instance, fGuiMEMonitorable_configSrc, container.getConfigManager());
|
||||
}
|
||||
|
||||
public static GuiTabButton getCraftingStatusButton(GuiMEMonitorable gui) {
|
||||
return Ae2Reflect.readField(gui, fGuiMEMonitorable_craftingStatusBtn);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public final class NameConst {
|
||||
public static final String ITEM_DENSE_ENCODED_PATTERN = "dense_encoded_pattern";
|
||||
public static final String ITEM_PART_DUAL_INTERFACE = "part_dual_interface";
|
||||
public static final String ITEM_PART_FLUID_PATTERN_TERMINAL = "part_fluid_pattern_terminal";
|
||||
public static final String ITEM_PART_EXTENDED_FLUID_PATTERN_TERMINAL = "part_fluid_pattern_ex_terminal";
|
||||
|
||||
public static final String TT_KEY = FluidCraft.MODID + ".tooltip.";
|
||||
public static final String TT_FLUID_PACKET = TT_KEY + "fluid_packet";
|
||||
|
||||
@@ -13,6 +13,7 @@ item.ae2fc:fluid_packet.name=Fluid Packet
|
||||
item.ae2fc:dense_encoded_pattern.name=Encoded Pattern
|
||||
item.ae2fc:part_dual_interface.name=ME Dual Interface
|
||||
item.ae2fc:part_fluid_pattern_terminal.name=ME Fluid Pattern Terminal
|
||||
item.ae2fc:part_fluid_pattern_ex_terminal.name=ME Extended Processing Fluid Pattern Terminal
|
||||
|
||||
ae2fc.gui.fluid_pattern_encoder=Fluid Pattern Encoder
|
||||
ae2fc.gui.fluid_packet_decoder=ME Fluid Packet Decoder
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"parent": "appliedenergistics2:item/part/display",
|
||||
"textures": {
|
||||
"front": "appliedenergistics2:items/part/expanded_processing_pattern_terminal",
|
||||
"front_bright": "ae2fc:parts/pattern_terminal_ex_bright",
|
||||
"front_medium": "ae2fc:parts/pattern_terminal_ex_medium",
|
||||
"front_dark": "ae2fc:parts/pattern_terminal_ex_dark"
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@
|
||||
"front_medium": "ae2fc:parts/pattern_terminal_medium",
|
||||
"front_dark": "ae2fc:parts/pattern_terminal_dark"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"parent": "appliedenergistics2:part/display_off",
|
||||
"textures": {
|
||||
"lightsBright": "ae2fc:parts/pattern_terminal_ex_bright",
|
||||
"lightsMedium": "ae2fc:parts/pattern_terminal_ex_medium",
|
||||
"lightsDark": "ae2fc:parts/pattern_terminal_ex_dark"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"ae2_uvl_marker": true,
|
||||
"textures": {
|
||||
"lightsBright": "ae2fc:parts/pattern_terminal_ex_bright",
|
||||
"lightsMedium": "ae2fc:parts/pattern_terminal_ex_medium",
|
||||
"lightsDark": "ae2fc:parts/pattern_terminal_ex_dark"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [
|
||||
2,
|
||||
2,
|
||||
0
|
||||
],
|
||||
"to": [
|
||||
14,
|
||||
14,
|
||||
2
|
||||
],
|
||||
"faces": {
|
||||
"north": {
|
||||
"texture": "#lightsBright",
|
||||
"tintindex": 3,
|
||||
"uvlightmap": {
|
||||
"sky": 0.007,
|
||||
"block": 0.007
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [
|
||||
2,
|
||||
2,
|
||||
0
|
||||
],
|
||||
"to": [
|
||||
14,
|
||||
14,
|
||||
2
|
||||
],
|
||||
"faces": {
|
||||
"north": {
|
||||
"texture": "#lightsMedium",
|
||||
"tintindex": 2,
|
||||
"uvlightmap": {
|
||||
"sky": 0.007,
|
||||
"block": 0.007
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [
|
||||
2,
|
||||
2,
|
||||
0
|
||||
],
|
||||
"to": [
|
||||
14,
|
||||
14,
|
||||
2
|
||||
],
|
||||
"faces": {
|
||||
"north": {
|
||||
"texture": "#lightsDark",
|
||||
"tintindex": 1,
|
||||
"uvlightmap": {
|
||||
"sky": 0.007,
|
||||
"block": 0.007
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"type": "appliedenergistics2:part_shaped",
|
||||
"result": {
|
||||
"item": "ae2fc:part_fluid_pattern_ex_terminal",
|
||||
"count": 1
|
||||
},
|
||||
"pattern": [
|
||||
"c c",
|
||||
"tft",
|
||||
"c c"
|
||||
],
|
||||
"key": {
|
||||
"f": {
|
||||
"type": "appliedenergistics2:part",
|
||||
"part": "cable_glass.fluix"
|
||||
},
|
||||
"t": {
|
||||
"item": "ae2fc:part_fluid_pattern_terminal"
|
||||
},
|
||||
"c": {
|
||||
"type": "appliedenergistics2:part",
|
||||
"part": "material.calculation_processor"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 133 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 147 B |
Reference in new issue
Block a user