Skip to content

Commit

Permalink
Merge pull request #324 from MCTian-mi/pyrotech-polishments
Browse files Browse the repository at this point in the history
Primitive Smelter polishments
  • Loading branch information
bruberu authored Oct 18, 2024
2 parents 0fafc27 + 9a85b48 commit 805394b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
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;
}
};
}
}

0 comments on commit 805394b

Please sign in to comment.