Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primitive Smelter polishments #324

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -15,7 +17,7 @@
public class MetaTileEntityPrimitiveItemBus extends MetaTileEntityItemBus {

public MetaTileEntityPrimitiveItemBus(ResourceLocation metaTileEntityId, boolean isExportHatch) {
super(metaTileEntityId, 0, isExportHatch);
super(metaTileEntityId, 1, isExportHatch);
initializeInventory();
}

Expand Down Expand Up @@ -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;
}
};
}
}