Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.mcreator.vanillaforging.procedures;
- import net.minecraftforge.items.IItemHandlerModifiable;
- import net.minecraftforge.items.CapabilityItemHandler;
- import net.minecraft.world.World;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.item.Items;
- import net.minecraft.item.ItemStack;
- import net.minecraft.block.Blocks;
- import net.mcreator.vanillaforging.item.WootzsteelchunkItem;
- import net.mcreator.vanillaforging.item.WootzSteelBaseBucketItem;
- import net.mcreator.vanillaforging.item.SteelHardeningDustItem;
- import net.mcreator.vanillaforging.item.StardustItem;
- import net.mcreator.vanillaforging.item.ScrapItem;
- import net.mcreator.vanillaforging.item.CoaldustItem;
- import net.mcreator.vanillaforging.VanillaforgingModElements;
- import java.util.concurrent.atomic.AtomicReference;
- import java.util.concurrent.atomic.AtomicInteger;
- @VanillaforgingModElements.ModElement.Tag
- public class MetallurgySmithingProcedureProcedure extends VanillaforgingModElements.ModElement {
- public MetallurgySmithingProcedureProcedure(VanillaforgingModElements instance) {
- super(instance, 234);
- }
- public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
- if (dependencies.get("x") == null) {
- System.err.println("Failed to load dependency x for procedure MetallurgySmithingProcedure!");
- return;
- }
- if (dependencies.get("y") == null) {
- System.err.println("Failed to load dependency y for procedure MetallurgySmithingProcedure!");
- return;
- }
- if (dependencies.get("z") == null) {
- System.err.println("Failed to load dependency z for procedure MetallurgySmithingProcedure!");
- return;
- }
- if (dependencies.get("world") == null) {
- System.err.println("Failed to load dependency world for procedure MetallurgySmithingProcedure!");
- return;
- }
- int x = (int) dependencies.get("x");
- int y = (int) dependencies.get("y");
- int z = (int) dependencies.get("z");
- World world = (World) dependencies.get("world");
- if (((((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (13))) < 64) && (((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (14))) < 64) && ((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (15))) < 64))) && ((((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (0))).getItem() == new ItemStack(WootzSteelBaseBucketItem.block, (int) (1))
- .getItem()) && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (1))).getItem() == new ItemStack(Blocks.BLUE_ICE, (int) (1)).getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (2))).getItem() == new ItemStack(Items.LAPIS_LAZULI, (int) (1))
- .getItem()) && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (3)))
- .getItem() == new ItemStack(Blocks.BLUE_ICE, (int) (1)).getItem()) && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (4)))
- .getItem() == new ItemStack(Items.LAPIS_LAZULI, (int) (1)).getItem()) && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)
- .ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (5)))
- .getItem() == new ItemStack(CoaldustItem.block, (int) (1)).getItem()) && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)
- .ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (6)))
- .getItem() == new ItemStack(CoaldustItem.block, (int) (1)).getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null)
- .ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (7)))
- .getItem() == new ItemStack(CoaldustItem.block, (int) (1)).getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(
- ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
- null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (8)))
- .getItem() == new ItemStack(CoaldustItem.block, (int) (1)).getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(
- ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(
- CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
- null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid)
- .copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (9)))
- .getItem() == new ItemStack(SteelHardeningDustItem.block,
- (int) (1)).getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(
- ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(
- CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
- null).ifPresent(capability -> {
- _retval.set(capability
- .getStackInSlot(sltid)
- .copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z),
- (int) (10)))
- .getItem() == new ItemStack(
- StardustItem.block, (int) (1))
- .getItem())
- && (((new Object() {
- public ItemStack getItemStack(BlockPos pos,
- int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(
- ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(
- CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
- null).ifPresent(capability -> {
- _retval.set(capability
- .getStackInSlot(sltid)
- .copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(
- new BlockPos((int) x, (int) y, (int) z),
- (int) (11)))
- .getItem() == new ItemStack(
- SteelHardeningDustItem.block,
- (int) (1)).getItem())
- && ((new Object() {
- public ItemStack getItemStack(
- BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(
- ItemStack.EMPTY);
- TileEntity _ent = world
- .getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(
- CapabilityItemHandler.ITEM_HANDLER_CAPABILITY,
- null)
- .ifPresent(capability -> {
- _retval.set(capability
- .getStackInSlot(
- sltid)
- .copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(
- new BlockPos((int) x, (int) y,
- (int) z),
- (int) (12)))
- .getItem() == new ItemStack(
- StardustItem.block,
- (int) (1))
- .getItem())))))))))))))
- && (((((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (13))) <= 62) && ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (13))).getItem() == new ItemStack(ScrapItem.block, (int) (1))
- .getItem())) && ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (13))).getItem() == new ItemStack(Blocks.AIR, (int) (1))
- .getItem()))
- && (((((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (14))) <= 61) && ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (14)))
- .getItem() == new ItemStack(WootzsteelchunkItem.block, (int) (1)).getItem())) || ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (14))).getItem() == new ItemStack(Blocks.AIR, (int) (1))
- .getItem()))
- && ((((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (15))) <= 63) && ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (15)))
- .getItem() == new ItemStack(Items.BUCKET, (int) (1)).getItem())) || ((new Object() {
- public ItemStack getItemStack(BlockPos pos, int sltid) {
- AtomicReference<ItemStack> _retval = new AtomicReference<>(ItemStack.EMPTY);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).copy());
- });
- }
- return _retval.get();
- }
- }.getItemStack(new BlockPos((int) x, (int) y, (int) z), (int) (15)))
- .getItem() == new ItemStack(Blocks.AIR, (int) (1)).getItem()))))))) {
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (0);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (1);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (2);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (3);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (4);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (5);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (6);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (7);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (8);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (9);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (10);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (11);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (12);
- final int _amount = (int) 1;
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ItemStack _stk = capability.getStackInSlot(_sltid).copy();
- _stk.shrink(_amount);
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _stk);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (13);
- final ItemStack _setstack = new ItemStack(ScrapItem.block, (int) (1));
- _setstack.setCount((int) ((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (13))) + 2));
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _setstack);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (14);
- final ItemStack _setstack = new ItemStack(WootzsteelchunkItem.block, (int) (1));
- _setstack.setCount((int) ((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (14))) + 3));
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _setstack);
- }
- });
- }
- }
- {
- TileEntity _ent = world.getTileEntity(new BlockPos((int) x, (int) y, (int) z));
- if (_ent != null) {
- final int _sltid = (int) (15);
- final ItemStack _setstack = new ItemStack(Items.BUCKET, (int) (1));
- _setstack.setCount((int) ((new Object() {
- public int getAmount(BlockPos pos, int sltid) {
- AtomicInteger _retval = new AtomicInteger(0);
- TileEntity _ent = world.getTileEntity(pos);
- if (_ent != null) {
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- _retval.set(capability.getStackInSlot(sltid).getCount());
- });
- }
- return _retval.get();
- }
- }.getAmount(new BlockPos((int) x, (int) y, (int) z), (int) (15))) + 1));
- _ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> {
- if (capability instanceof IItemHandlerModifiable) {
- ((IItemHandlerModifiable) capability).setStackInSlot(_sltid, _setstack);
- }
- });
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement