This adds the Cobblestoning recipe. Quite useful, if you ask me
Last active
June 11, 2025 02:40
-
-
Save vercte/fe67c1bc6649c287f84905eb9cbfb2fb to your computer and use it in GitHub Desktop.
Heat Condition API Example (Cobblestoning)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.simibubi.create.content.processing.recipe; | |
import com.simibubi.create.Create; | |
import com.simibubi.create.api.recipe.HeatCondition; | |
import com.simibubi.create.api.registry.CreateBuiltInRegistries; | |
import net.minecraft.core.Registry; | |
public class AllHeatConditions { | |
public static final CobblestonedCondition COBBLESTONED = register("cobblestoned", new CobblestonedCondition()); | |
private static <T extends HeatCondition> T register(String name, T type) { | |
return Registry.register(CreateBuiltInRegistries.HEAT_CONDITION, Create.asResource(name), type); | |
} | |
public static void init() {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "create:compacting", | |
"heatRequirement": "create:cobblestoned", | |
"ingredients": [ | |
{ | |
"item": "minecraft:cobblestone" | |
} | |
], | |
"results": [ | |
{ | |
"count": 50, | |
"item": "minecraft:apple" | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.simibubi.create.content.processing.recipe; | |
import com.mojang.blaze3d.vertex.PoseStack; | |
import com.mojang.math.Axis; | |
import com.simibubi.create.api.recipe.HeatCondition; | |
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics; | |
import mezz.jei.api.gui.drawable.IDrawable; | |
import net.minecraft.client.gui.GuiGraphics; | |
import net.minecraft.core.BlockPos; | |
import net.minecraft.world.item.ItemStack; | |
import net.minecraft.world.item.Items; | |
import net.minecraft.world.level.BlockGetter; | |
import net.minecraft.world.level.block.Blocks; | |
import org.jetbrains.annotations.NotNull; | |
import org.jetbrains.annotations.Nullable; | |
import java.util.List; | |
public class CobblestonedCondition implements HeatCondition { | |
public static CobblestoneAnimated animated = new CobblestoneAnimated(); | |
@Override | |
public boolean test(BlockGetter getter, BlockPos basinPos) { | |
return getter.getBlockState(basinPos.below()).is(Blocks.COBBLESTONE); | |
} | |
@Override | |
public @Nullable IDrawable visualize() { | |
return animated; | |
} | |
@Override | |
public @NotNull List<ItemStack> getItemHints() { | |
return List.of( | |
new ItemStack(Items.COBBLESTONE), | |
new ItemStack(Items.DIAMOND), | |
new ItemStack(Items.TOTEM_OF_UNDYING) | |
); | |
} | |
@Override | |
public String getTranslationKey() { | |
return "Cobblestoned"; | |
} | |
@Override | |
public int getColor() { | |
return 0xffff00; | |
} | |
public static class CobblestoneAnimated extends AnimatedKinetics { | |
@Override | |
public void draw(GuiGraphics guiGraphics, int xOffset, int yOffset) { | |
PoseStack matrixStack = guiGraphics.pose(); | |
matrixStack.pushPose(); | |
matrixStack.translate(xOffset, yOffset, 200); | |
matrixStack.mulPose(Axis.XP.rotationDegrees(-15.5f)); | |
matrixStack.mulPose(Axis.YP.rotationDegrees(22.5f)); | |
int scale = 23; | |
blockElement(Blocks.COBBLESTONE.defaultBlockState()) | |
.atLocal(0, 1.65, 0) | |
.scale(scale) | |
.render(guiGraphics); | |
matrixStack.popPose(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment