add ae2 recipe support and add a gui to set the count of item that CraftingHelper needs to craft

This commit is contained in:
vfyjxf committed 2022-01-02 16:00:18 +08:00
1 parent 512d1fa562
commit fde98d153e
27 files changed
+1287 -343

No files matched your search

@@ -0,0 +1,58 @@
package com.github.vfyjxf.nee.container;
import appeng.api.config.SecurityPermissions;
import appeng.api.networking.IGrid;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.IActionHost;
import appeng.api.networking.security.PlayerSource;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotInaccessible;
import appeng.tile.inventory.AppEngInternalInventory;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ContainerCraftingAmount extends AEBaseContainer {
private final Slot resultSlot;
private ItemStack resultStack;
public ContainerCraftingAmount(InventoryPlayer ip, Object anchor) {
super(ip, anchor);
this.resultSlot = new SlotInaccessible(new AppEngInternalInventory(null, 1), 0, 34, 53);
this.addSlotToContainer(resultSlot);
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
this.verifyPermissions(SecurityPermissions.CRAFT, false);
}
public IGrid getGrid() {
final IActionHost h = ((IActionHost) this.getTarget());
return h.getActionableNode().getGrid();
}
public World getWorld() {
return this.getPlayerInv().player.worldObj;
}
public BaseActionSource getActionSrc() {
return new PlayerSource(this.getPlayerInv().player, (IActionHost) this.getTarget());
}
public Slot getResultSlot() {
return resultSlot;
}
public ItemStack getResultStack() {
return resultStack;
}
public void setResultStack(ItemStack resultStack) {
this.resultStack = resultStack;
}
}