From 64e30ee0558556688c888ff6a212fb5f33e5fe99 Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Sat, 2 Sep 2023 01:01:31 -0400 Subject: [PATCH] updated antimatter, added super buffer tile class --- AntimatterAPI | 2 +- .../tile/single/TileEntitySuperBuffer.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 common/src/main/java/muramasa/gregtech/tile/single/TileEntitySuperBuffer.java diff --git a/AntimatterAPI b/AntimatterAPI index 816fe53c4..189787330 160000 --- a/AntimatterAPI +++ b/AntimatterAPI @@ -1 +1 @@ -Subproject commit 816fe53c45e8bc85e720afb9e839c19b8d8ca9ee +Subproject commit 18978733008b2e691d6ecb147c1c991e28bc973c diff --git a/common/src/main/java/muramasa/gregtech/tile/single/TileEntitySuperBuffer.java b/common/src/main/java/muramasa/gregtech/tile/single/TileEntitySuperBuffer.java new file mode 100644 index 000000000..2969836cf --- /dev/null +++ b/common/src/main/java/muramasa/gregtech/tile/single/TileEntitySuperBuffer.java @@ -0,0 +1,28 @@ +package muramasa.gregtech.tile.single; + +import muramasa.antimatter.capability.item.TrackedItemHandler; +import muramasa.antimatter.capability.machine.MachineItemHandler; +import muramasa.antimatter.gui.SlotType; +import muramasa.antimatter.machine.event.ContentEvent; +import muramasa.antimatter.machine.types.Machine; +import muramasa.antimatter.tile.TileEntityMachine; +import net.minecraft.core.BlockPos; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.state.BlockState; +import tesseract.api.item.ExtendedItemContainer; +import tesseract.util.ItemHandlerUtils; + +public class TileEntitySuperBuffer extends TileEntityMachine { + public TileEntitySuperBuffer(Machine type, BlockPos pos, BlockState state) { + super(type, pos, state); + itemHandler.set(() -> new SuperBufferItemHandler(this)); + } + + public static class SuperBufferItemHandler extends MachineItemHandler { + + public SuperBufferItemHandler(TileEntitySuperBuffer tile) { + super(tile); + this.inventories.put(SlotType.STORAGE, new TrackedItemHandler<>(tile, 256, true, true, (t, s) -> true, ContentEvent.ITEM_INPUT_CHANGED)); + } + } +}