Skip to content
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ After publishing, the action commits the next development version and changelog

## Unreleased

- The pottery wheel fills the block it stands on and the lower half of the block above. The outline is that whole shape, so nothing else can be placed there. Breaking either part drops one wheel, and a wheel from an older world grows the upper half when the space above it is empty.
- Right-click the table with a blueprint to set it on the wheel. That uses one blueprint, even in Creative. Right-click the table with an empty hand to take it back. Setting another blueprint returns the one that was there. Breaking the wheel in Survival drops the blueprint along with any clay still on it.
- The blueprint's shape stands on all four edges of the table.
- Editing a stack of raw templates saves the shape onto one blueprint and leaves the rest of the stack raw.
- The template editor says left-click shapes the outside and right-click creates the inside.
- Pottery on a shelf sits on the plank, a little larger than before, and shows the liquid inside.
- Placed pottery keeps an even shade from one layer of the shape to the next.
- A wide mouth is a Bowl, a narrow mouth is a Jug, and any other shape is Pottery. A raw piece is named Raw Bowl, Raw Jug, or Raw Pottery.
- The creative tab contains the pottery wheel and the raw pottery template.
- On NeoForge 1.20.6, pottery items render in the inventory.
- A raw or fired piece in your hand or inventory has the shape that was thrown. Raw clay looks like clay, painted clay and fired pottery use a bright dye, and a closed pot keeps its lid.
- Raw pottery's tooltip says it needs firing. Undyed clay also says it can be dyed, and a vessel says how many millilitres it will hold once it is fired.
- A clay ball on the wheel is used up. The wheel stops when the shape is finished. Take the piece off then and you get raw pottery of that shape. Take it off earlier and you get the shape it had reached.
- Undyed raw pottery can go back on the wheel and be reshaped toward another blueprint.
- Craft raw pottery with a dye to paint it. Smelt raw pottery, painted or plain, and it fires into a usable vessel with the same shape and colour.

## 0.0.1

- Picking up clay unlocks recipes for the pottery wheel and raw template. Mining either half of the wheel returns the wheel in Survival.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.modcrafters.minecraft.primalpottery.block.PotteryBlock;
import net.modcrafters.minecraft.primalpottery.item.ModItems;
import net.modcrafters.minecraft.primalpottery.item.ModTab;
import net.modcrafters.minecraft.primalpottery.recipe.ModRecipes;
import net.modcrafters.minecraft.primalpottery.network.LidPayload;
import net.modcrafters.minecraft.primalpottery.network.LidSync;
import net.modcrafters.minecraft.primalpottery.network.PlacedLidPayload;
Expand All @@ -26,6 +27,7 @@ public void onInitialize() {
ModBlocks.register((id, block) -> Registry.register(BuiltInRegistries.BLOCK, id, block));
ModBlockEntities.register((id, type) -> Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, id, type));
ModItems.register((id, item) -> Registry.register(BuiltInRegistries.ITEM, id, item));
ModRecipes.register((id, serializer) -> Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, id, serializer));
Registry.register(
BuiltInRegistries.CREATIVE_MODE_TAB,
ModTab.ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.rendertype.RenderTypes;
import net.minecraft.client.renderer.special.SpecialModelRenderers;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.shapes.Shapes;
import net.modcrafters.minecraft.primalpottery.Ids;
import net.modcrafters.minecraft.primalpottery.block.ModBlockEntities;
import net.modcrafters.minecraft.primalpottery.client.PotteryPreview;
import net.modcrafters.minecraft.primalpottery.client.PotterySpecialRenderer;
import net.modcrafters.minecraft.primalpottery.network.LidPayload;
import net.modcrafters.minecraft.primalpottery.network.LidSync;
import net.modcrafters.minecraft.primalpottery.network.PlacedLidPayload;
Expand All @@ -31,6 +34,7 @@ public void onInitializeClient() {
PlacedLidSync.sender = (pos, slot, closed) -> ClientPlayNetworking.send(new PlacedLidPayload(pos, slot, closed));
PictureInPictureRendererRegistry.register(context -> new PotteryPreview.Renderer());
PotteryPreview.SINK = (graphics, state) -> graphics.guiRenderState.addPicturesInPictureState(state);
SpecialModelRenderers.ID_MAPPER.put(Ids.of("pottery"), PotterySpecialRenderer.Unbaked.MAP_CODEC);
BlockEntityRendererRegistry.register(ModBlockEntities.WHEEL, context -> new WheelRenderer());
BlockEntityRendererRegistry.register(ModBlockEntities.POTTERY, context -> new PotteryRenderer());
LevelRenderEvents.BEFORE_BLOCK_OUTLINE.register((context, outline) -> {
Expand Down
1 change: 1 addition & 0 deletions fabric/src/main/resources/primalpottery.accesswidener
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
accessWidener v2 official
accessible field net/minecraft/client/gui/GuiGraphicsExtractor guiRenderState Lnet/minecraft/client/renderer/state/gui/GuiRenderState;
accessible field net/minecraft/client/renderer/special/SpecialModelRenderers ID_MAPPER Lnet/minecraft/util/ExtraCodecs$LateBoundIdMapper;
5 changes: 4 additions & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ tasks.named('compileJava', JavaCompile) {

neoForge {
version = neoforge_version
def at = rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
if (!at.exists()) {
at = rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
}
if (at.exists()) {
accessTransformers.from(at.absolutePath)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.modcrafters.minecraft.primalpottery.block.ModBlocks;
import net.modcrafters.minecraft.primalpottery.item.ModItems;
import net.modcrafters.minecraft.primalpottery.item.ModTab;
import net.modcrafters.minecraft.primalpottery.recipe.ModRecipes;
import net.modcrafters.minecraft.primalpottery.neoforge.client.PrimalPotteryNeoForgeClient;
//? if >=26.1
import net.modcrafters.minecraft.primalpottery.neoforge.PotteryGameTests;
Expand Down Expand Up @@ -68,6 +69,7 @@ private static void registerContent(RegisterEvent event) {
event.register(Registries.BLOCK, helper -> ModBlocks.register(helper::register));
event.register(Registries.BLOCK_ENTITY_TYPE, helper -> ModBlockEntities.register(helper::register));
event.register(Registries.ITEM, helper -> ModItems.register(helper::register));
event.register(Registries.RECIPE_SERIALIZER, helper -> ModRecipes.register(helper::register));
//? if >=26.1 {
event.register(net.minecraft.core.registries.Registries.TEST_INSTANCE_TYPE, helper -> {
helper.register(net.modcrafters.minecraft.primalpottery.Ids.of("wheel"), PotteryGameTests.codec());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
//? if >=26.1
import net.neoforged.neoforge.client.event.RegisterPictureInPictureRenderersEvent;
//? if >=26.1
import net.neoforged.neoforge.client.event.RegisterSpecialModelRendererEvent;
//? if >=26.1
import net.modcrafters.minecraft.primalpottery.client.PotterySpecialRenderer;
//? if >=26.1
import net.modcrafters.minecraft.primalpottery.Ids;
//? if >=26.1
import net.minecraft.client.renderer.rendertype.RenderTypes;
//? if >=26.1
import net.neoforged.neoforge.client.event.ExtractBlockOutlineRenderStateEvent;
Expand Down Expand Up @@ -61,10 +67,20 @@ public static void register(IEventBus modBus) {
*///?}
};
modBus.addListener(PrimalPotteryNeoForgeClient::renderers);
//? if <26.1 {
/*modBus.addListener(PrimalPotteryNeoForgeClient::colors);
*///?}
//? if >=26.1 {
modBus.addListener(PrimalPotteryNeoForgeClient::pictures);
modBus.addListener(PrimalPotteryNeoForgeClient::specialModels);
PotteryPreview.SINK = (graphics, state) -> graphics.submitPictureInPictureRenderState(state);
//?}
//? if >=1.21 && <26.1 {
/*modBus.addListener(PrimalPotteryNeoForgeClient::items);
*///?}
//? if <1.21 {
/*modBus.addListener(PrimalPotteryNeoForgeClient::bindItems);
*///?}
}

public static void registerGame(IEventBus gameBus) {
Expand All @@ -79,8 +95,63 @@ public static void registerGame(IEventBus gameBus) {
private static void pictures(RegisterPictureInPictureRenderersEvent event) {
event.register(PotteryPreview.State.class, PotteryPreview.Renderer::new);
}

private static void specialModels(RegisterSpecialModelRendererEvent event) {
event.register(Ids.of("pottery"), PotterySpecialRenderer.Unbaked.MAP_CODEC);
}
//?}

//? if <26.1 {
/*private static net.neoforged.neoforge.client.extensions.common.IClientItemExtensions extensions() {
return new net.neoforged.neoforge.client.extensions.common.IClientItemExtensions() {
private net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer renderer;

@Override
public net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer getCustomRenderer() {
if (this.renderer == null) {
var minecraft = net.minecraft.client.Minecraft.getInstance();
this.renderer = new net.modcrafters.minecraft.primalpottery.client.PotteryItemRenderer(
minecraft.getBlockEntityRenderDispatcher(), minecraft.getEntityModels());
}
return this.renderer;
}
};
}
*///?}

//? if >=1.21 && <26.1 {
/*private static void items(net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent event) {
event.registerItem(
extensions(),
net.modcrafters.minecraft.primalpottery.item.ModItems.POTTERY,
net.modcrafters.minecraft.primalpottery.item.ModItems.RAW_POTTERY
);
}
*///?}

//? if <1.21 {
/*private static void bindItems(net.neoforged.fml.event.lifecycle.FMLClientSetupEvent event) {
var extensions = extensions();
net.modcrafters.minecraft.primalpottery.item.ModItems.POTTERY.renderProperties = extensions;
net.modcrafters.minecraft.primalpottery.item.ModItems.RAW_POTTERY.renderProperties = extensions;
}
*///?}

//? if <26.1 {
/*private static void colors(net.neoforged.neoforge.client.event.RegisterColorHandlersEvent.Item event) {
event.register(
(stack, tintIndex) -> {
Integer color = net.modcrafters.minecraft.primalpottery.item.PotteryItem.dyeColor(
net.modcrafters.minecraft.primalpottery.item.PotteryItem.dye(stack)
);
return color == null ? -1 : 0xFF000000 | color;
},
net.modcrafters.minecraft.primalpottery.item.ModItems.RAW_POTTERY,
net.modcrafters.minecraft.primalpottery.item.ModItems.POTTERY
);
}
*///?}

private static void renderers(EntityRenderersEvent.RegisterRenderers event) {
event.registerBlockEntityRenderer(ModBlockEntities.WHEEL, context -> new WheelRenderer());
event.registerBlockEntityRenderer(ModBlockEntities.POTTERY, context -> new PotteryRenderer());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public net.minecraft.world.item.Item renderProperties
Loading