Skip to content

Instantly share code, notes, and snippets.

@SirEdvin
Created February 17, 2026 15:23
Show Gist options
  • Select an option

  • Save SirEdvin/6c1f44ba232b215ad8e62770e1a1503c to your computer and use it in GitHub Desktop.

Select an option

Save SirEdvin/6c1f44ba232b215ad8e62770e1a1503c to your computer and use it in GitHub Desktop.
ublic static MultiblockMachineDefinition MACHINE = GTTrueSteam.REGISTRATE.multiblock("coating_shrine", CoatingShrineMachine::new)
.rotationState(RotationState.NON_Y_AXIS)
.recipeType(TrueSteamRecipeTypes.COATING)
.appearanceBlock(GTBlocks.CASING_STEEL_SOLID)
.pattern(definition -> FactoryBlockPattern.start()
.aisle("BSHSB", "|###|", "|###|", "|###|", "SSSSS")
.aisle("SBBBS", "#####", "#####", "#####", "SCCCS")
.aisle("IPFPO", "#####", "#####", "#####", "SCCCS")
.aisle("SBBBS", "#####", "#####", "#####", "SCCCS")
.aisle("BSKSB", "|###|", "|###|", "|###|", "SSSSS")
.where("S", Predicates.blockTag(BlockTags.STAIRS))
.where("B", Predicates.custom(x -> x.getBlockState().isSolid(), BLOCK_SUPPLIER).addTooltips(Component.literal("Any soild block can be used")))
.where("|", Predicates.blockTag(BlockTags.WALLS))
.where("#", Predicates.any())
.where("C", Predicates.blocks(TrueSteamBlocks.BronzeGlass.get()))
.where("I", Predicates.ability(PartAbility.IMPORT_ITEMS))
.where("O", Predicates.ability(PartAbility.EXPORT_ITEMS))
.where("K", Predicates.controller(Predicates.blocks(definition.get())))
.where("H", Predicates.blocks(TrueSteamBlocks.BoilerHusk.get()))
.where("F", Predicates.custom(x -> {
var fluidState = x.getBlockState().getFluidState();
return !fluidState.isEmpty() && fluidState.isSource();
}, FLUID_SUPPLIER).addTooltips(Component.literal("Any fluid source can be used")))
.where("P", Predicates.blocks(GTBlocks.CASING_STEEL_PIPE.get()))
.build())
.shapeInfo(definition -> MultiblockShapeInfo.builder()
.aisle("B2H2B", "|###|", "|###|", "|###|", "72226")
.aisle("3BBB4", "#####", "#####", "#####", "3CCC4")
.aisle("IPFPO", "#####", "#####", "#####", "3CCC4")
.aisle("3BBB4", "#####", "#####", "#####", "3CCC4")
.aisle("B1K1B", "|###|", "|###|", "|###|", "51118")
.where('1', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH))
.where('2', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.SOUTH))
.where('3', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.EAST))
.where('4', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.WEST))
.where('5', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH).setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT))
.where('6', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.WEST).setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT))
.where('7', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.EAST).setValue(StairBlock.SHAPE, StairsShape.OUTER_RIGHT))
.where('8', Blocks.STONE_BRICK_STAIRS.defaultBlockState().setValue(StairBlock.FACING, Direction.NORTH).setValue(StairBlock.SHAPE, StairsShape.OUTER_LEFT))
.where('S', Blocks.STONE_BRICK_STAIRS)
.where('B', Blocks.STONE_BRICKS)
.where('|', Blocks.STONE_BRICK_WALL)
.where('#', Blocks.AIR)
.where('C', TrueSteamBlocks.BronzeGlass.get())
.where('I', GTMachines.ITEM_IMPORT_BUS[1], Direction.WEST)
.where('O', GTMachines.ITEM_EXPORT_BUS[1], Direction.EAST)
.where('K', definition, Direction.SOUTH)
.where('H', TrueSteamBlocks.BoilerHusk.get())
.where('F', Blocks.LAVA)
.where('P', GTBlocks.CASING_STEEL_PIPE.get())
.build()
)
.hasBER(true)
.modelProperty(GTMachineModelProperties.RECIPE_LOGIC_STATUS, RecipeLogic.Status.IDLE)
.model(GTMachineModels.createWorkableCasingMachineModel(
GTCEu.id("block/casings/solid/machine_casing_solid_steel"),
GTCEu.id("block/machines/chemical_bath")
).andThen(b -> b.addDynamicRenderer(CoatingShrineRenderer::new)))
.register();
public class CoatingShrineRenderer extends DynamicRender<IRecipeLogicMachine, CoatingShrineRenderer> {
// spotless:off
@SuppressWarnings("deprecation")
public static final Codec<CoatingShrineRenderer> CODEC = Codec.unit(CoatingShrineRenderer::new);
public static final DynamicRenderType<IRecipeLogicMachine, CoatingShrineRenderer> TYPE = new DynamicRenderType<>(CoatingShrineRenderer.CODEC);
// spotless:on
@Override
public @NotNull DynamicRenderType<IRecipeLogicMachine, CoatingShrineRenderer> getType() {
return TYPE;
}
@Override
public @NotNull AABB getRenderBoundingBox(IRecipeLogicMachine machine) {
BlockPos pos = machine.self().getPos();
var facing = ((CoatingShrineMachine)machine).getFrontFacing();
var rightFacing = facing.getClockWise();
var rightCorner = pos.offset(rightFacing.getStepX() * 2, 0, rightFacing.getStepZ() * 2);
var leftCorner = pos.offset(-rightFacing.getStepX() * 2, 0, -rightFacing.getStepZ() * 2);
var leftBackCorner = leftCorner.offset(-facing.getStepX() * 5, 5, -facing.getStepZ() * 5);
return new AABB(rightCorner, leftBackCorner);
}
@Override
public void render(@NotNull IRecipeLogicMachine machine, float partialTick, @NotNull PoseStack poseStack, @NotNull MultiBufferSource buffer, int packedLight, int packedOverlay) {
if (machine.isActive() && machine instanceof CoatingShrineMachine coatingMachine) {
var recipeLogic = machine.getRecipeLogic();
var itemOutputs = recipeLogic.getLastRecipe().inputs.get(GTRecipeCapabilities.ITEM);
var firstItem = itemOutputs.get(0).content;
if (firstItem instanceof ItemStack firstItemStack) {
var controllerPos = coatingMachine.getPos();
var direction = coatingMachine.getFrontFacing().getOpposite();
var fluidPos = controllerPos.relative(direction, 2);
var level = coatingMachine.getLevel();
var progress = recipeLogic.getProgressPercent();
poseStack.pushPose();
poseStack.translate(fluidPos.getX(), fluidPos.getY(), fluidPos.getZ());
poseStack.translate(direction.getStepX() * progress, 1.0, direction.getStepZ() * progress);
var model = Minecraft.getInstance().getItemRenderer().getModel(firstItemStack, level, null, packedLight);
Minecraft.getInstance().getItemRenderer().render(
firstItemStack,
ItemDisplayContext.GROUND,
true,
poseStack,
buffer,
packedLight,
packedOverlay,
model
);
poseStack.popPose();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment