From f22fac93c38db3b719d47948f2beb193fc1f20be Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Fri, 18 Oct 2024 13:54:13 +0800 Subject: [PATCH 1/2] buff primitive item bus to have 4 slots --- .../multiblockpart/MetaTileEntityPrimitiveItemBus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java b/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java index 69950ce0d..bb2f27725 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java +++ b/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java @@ -15,7 +15,7 @@ public class MetaTileEntityPrimitiveItemBus extends MetaTileEntityItemBus { public MetaTileEntityPrimitiveItemBus(ResourceLocation metaTileEntityId, boolean isExportHatch) { - super(metaTileEntityId, 0, isExportHatch); + super(metaTileEntityId, 1, isExportHatch); initializeInventory(); } From 9a85b48cb56b5ff1cb8f9e8ac15f6f2d55995ec8 Mon Sep 17 00:00:00 2001 From: MCTian-mi <35869948+MCTian-mi@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:18:28 +0800 Subject: [PATCH 2/2] primitive smelter tweaks --- .../MetaTileEntityPrimitiveSmelter.java | 22 +++++++++-------- .../MetaTileEntityPrimitiveItemBus.java | 24 +++++++++++++++++++ 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityPrimitiveSmelter.java b/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityPrimitiveSmelter.java index 07104f725..1353979fd 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityPrimitiveSmelter.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/primitive/MetaTileEntityPrimitiveSmelter.java @@ -48,10 +48,6 @@ public MetaTileEntityPrimitiveSmelter(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.PRIMITIVE_SMELTER); } - public static TraceabilityPredicate casingPredicate() { - return states(ModuleCore.Blocks.MASONRY_BRICK.getDefaultState()); - } - @Override protected void initializeAbilities() { this.importItems = new ItemHandlerList(getAbilities(SuSyMultiblockAbilities.PRIMITIVE_IMPORT_ITEMS)); @@ -64,17 +60,23 @@ protected void formStructure(PatternMatchContext context) { this.initializeAbilities(); } + public static IBlockState getCasingState() { + return ModuleCore.Blocks.MASONRY_BRICK.getDefaultState(); + } + @Override protected @NotNull BlockPattern createStructurePattern() { return FactoryBlockPattern.start() - .aisle("OOO", "III", "SIS") - .aisle("OOO", "I I", "I I") - .aisle("OOO", "ICI", "SIS") - .where('I', casingPredicate().or(abilities(SuSyMultiblockAbilities.PRIMITIVE_IMPORT_ITEMS).setMaxGlobalLimited(4))) + .aisle("BBB", "BBB", "SBS") + .aisle("BBB", "B#B", "B B") + .aisle("BBB", "BCB", "SBS") + .where('B', states(getCasingState()).setMinGlobalLimited(14) + .or(abilities(SuSyMultiblockAbilities.PRIMITIVE_IMPORT_ITEMS).setPreviewCount(1)) + .or(abilities(SuSyMultiblockAbilities.PRIMITIVE_EXPORT_ITEMS).setPreviewCount(1))) .where('C', selfPredicate()) - .where('O', casingPredicate().or(abilities(SuSyMultiblockAbilities.PRIMITIVE_EXPORT_ITEMS).setMaxGlobalLimited(2))) .where('S', states(ModuleCore.Blocks.MASONRY_BRICK_SLAB.getDefaultState())) - .where(' ', air().or(SNOW_PREDICATE)) + .where('#', air().or(SNOW_PREDICATE)) + .where(' ', air()) .build(); } diff --git a/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java b/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java index bb2f27725..825b8146e 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java +++ b/src/main/java/supersymmetry/common/metatileentities/multiblockpart/MetaTileEntityPrimitiveItemBus.java @@ -1,5 +1,7 @@ package supersymmetry.common.metatileentities.multiblockpart; +import gregtech.api.capability.impl.NotifiableItemStackHandler; +import gregtech.api.items.itemhandlers.GTItemStackHandler; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.metatileentity.multiblock.MultiblockAbility; @@ -53,4 +55,26 @@ public boolean hasGhostCircuitInventory() { public String getHarvestTool() { return "pickaxe"; } + + @Override + protected IItemHandlerModifiable createExportItemHandler() { + return !isExportHatch ? new GTItemStackHandler(this, 0) : + new NotifiableItemStackHandler(this, 4, getController(), true) { + @Override + public int getSlotLimit(int slot) { + return 16; + } + }; + } + + @Override + protected IItemHandlerModifiable createImportItemHandler() { + return isExportHatch ? new GTItemStackHandler(this, 0) : + new NotifiableItemStackHandler(this, 4, getController(), false) { + @Override + public int getSlotLimit(int slot) { + return 16; + } + }; + } }