Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f53823b
Share pottery profiles and backport painted vessels to Forge 1.12.2 a…
faceofcat Dec 2, 2026
50b676d
Test the shared painted mesh and expose the preview jars in CI
faceofcat Dec 2, 2026
5a2aed8
Give the hosted LWJGL 2 client a virtual monitor mode
faceofcat Dec 2, 2026
971984f
Load legacy dev resources and verify the held and placed reference pot
faceofcat Dec 2, 2026
2b82289
Position the painted vessel visibly in first person
faceofcat Dec 2, 2026
0860db1
Draw Forge 1.20.1 pottery paint from reusable atlas tiles and profile…
faceofcat Dec 2, 2026
deefed6
Share paint tiles across both Forge targets and skip clay hidden by o…
faceofcat Dec 2, 2026
2667ef4
Render item and preview paint from shared atlas tiles across modern t…
faceofcat Dec 2, 2026
84212b0
Keep benchmark reports and documentation in the design repository
faceofcat Dec 2, 2026
3dca3a5
Cull back-facing pottery geometry and batch atlas draws
faceofcat Dec 2, 2026
67a35ec
Keep grazing pottery faces visible during camera bobbing
faceofcat Dec 2, 2026
0f8fc7b
Verify saved pottery profiles across Forge tags and item components
faceofcat Dec 3, 2026
9ce5a1d
Exercise Forge 1.20.1 stack compatibility inside the game runtime
faceofcat Dec 3, 2026
217d61c
Edit and stamp pottery blueprints on both Forge targets
faceofcat Dec 3, 2026
08b6ac0
Shape and fire pottery on both Forge wheels
faceofcat Dec 3, 2026
1797e3f
Backport painting, vessel contents, planters and dining to both Forge…
faceofcat Dec 3, 2026
6b2b9fb
Share versioned IntelliJ runs for every loader target
faceofcat Dec 3, 2026
71ac5c1
Wait for the legacy player to reach the painting test table
faceofcat Dec 3, 2026
29b2d1a
Fit legacy pottery icons and allow placement in free corners
faceofcat Dec 3, 2026
17b5aa8
Fit Forge 1.20.1 pottery icons and correct planter light and clay sha…
faceofcat Dec 3, 2026
8c0e9e3
Light miniature trees at canopy height and soften curved pottery shad…
faceofcat Dec 3, 2026
c64a83c
Announce Forge support and validate the full publishing catalog befor…
faceofcat Dec 3, 2026
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
196 changes: 196 additions & 0 deletions .github/forge-display-check/1.12.2/potterycheck/DiningClientCheck.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
package potterycheck;

import java.util.Collections;
import java.util.concurrent.Future;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.*;
import net.modcrafters.minecraft.primalpottery.legacy.PrimalPotteryForge;
import net.modcrafters.minecraft.primalpottery.legacy.ForgeStackProfiles;
import net.modcrafters.minecraft.primalpottery.legacy.PaintedPotEntity;
import net.modcrafters.minecraft.primalpottery.legacy.dining.*;
import net.modcrafters.minecraft.primalpottery.dining.Diner;
import net.modcrafters.minecraft.primalpottery.dining.TableSetting;
import net.modcrafters.minecraft.primalpottery.pottery.*;

/** One integrated-server player cooks no special test items: vanilla stew supplies the real bowl remainder. */
final class DiningClientCheck {
private static final BlockPos PLATE = new BlockPos(55, 80, 4), PLATTER = PLATE.east();
private static final int EDGE = 4;
private static Future<?> pending;
private static boolean photographed;
private enum Step { STEW, AIM_AT_BREAD, RELEASE, CHECK_RELEASE, DONE }
private static volatile Step step = Step.STEW;
private static int ticks;
private static DiningClientCheck scenario;
private final WorldServer level;
private final EntityPlayerMP player;
private final GameType previousMode;
private final int previousFood;
private long started;

private DiningClientCheck(WorldServer level, EntityPlayerMP player) {
this.level = level;
this.player = player;
previousMode = player.interactionManager.getGameType();
previousFood = player.getFoodStats().getFoodLevel();
}

static boolean tick(Minecraft client) throws Exception {
if (pending != null && !pending.isDone()) return false;
if (pending != null) pending.get();
if (step == Step.DONE) {
check(photographed, "client never received a live dining animation");
return true;
}
if (++ticks > 1200) throw new AssertionError("Dining timed out at " + step);
PaintedPotEntity plate = client.world.getTileEntity(PLATE) instanceof PaintedPotEntity
? (PaintedPotEntity) client.world.getTileEntity(PLATE) : null;
if (step == Step.AIM_AT_BREAD) {
if (plate == null || plate.dining.serving(EDGE).getItem() != Items.BREAD ||
client.player.getHeldItemMainhand().getItem() != DiningRegistration.cutlery()) return false;
net.minecraft.client.settings.KeyBinding.setKeyBindState(client.gameSettings.keyBindUseItem.getKeyCode(), true);
client.playerController.processRightClickBlock(client.player, client.world, PLATE, EnumFacing.UP,
new net.minecraft.util.math.Vec3d(55.5, 80.04, 4 + 1./6), EnumHand.MAIN_HAND);
step = Step.RELEASE;
return false;
}
if (step == Step.RELEASE) {
if (plate == null || plate.dining.diner(EDGE) == null) return false;
Diner bite = plate.dining.diner(EDGE);
if (client.world.getTotalWorldTime() - bite.start < 32) return false;
DisplayCheck.screenshot(client, "dining-cut.png");
net.minecraft.client.settings.KeyBinding.setKeyBindState(client.gameSettings.keyBindUseItem.getKeyCode(), false);
step = Step.CHECK_RELEASE;
return false;
}
if (!photographed && plate != null) {
Diner eating = plate.dining.diner(EDGE);
if (eating != null && client.world.getTotalWorldTime() - eating.start >= 30) {
DisplayCheck.screenshot(client, "dining.png");
photographed = true;
}
}
net.minecraft.server.MinecraftServer server = client.getIntegratedServer();
pending = server.addScheduledTask(() -> {
if (scenario == null) {
scenario = new DiningClientCheck(server.getWorld(0), server.getPlayerList().getPlayers().get(0));
scenario.start();
} else scenario.advance();
});
return false;
}

private void start() {
player.setGameType(GameType.SURVIVAL);
player.getFoodStats().setFoodLevel(6);
for (int x = -1; x <= 2; x++) for (int z = -3; z <= 1; z++)
level.setBlockState(PLATE.add(x, -1, z), Blocks.STONE.getDefaultState());
// Aim the real player at the small plate, so server reach and ray checks run on every bite.
player.connection.setPlayerLocation(55.5, 80, 2.5, 0, 43.5F);
player.setHeldItem(EnumHand.OFF_HAND, ItemStack.EMPTY);
Pottery small = new Pottery(Pottery.Size.SMALL, Collections.singletonList(new PotteryDisc(2, 8)));
Pottery platter = new Pottery(Pottery.Size.LARGE, Collections.singletonList(new PotteryDisc(3, 16)));
place(PLATE, small);
place(PLATTER, platter);
PaintedPotEntity tray = pots(PLATTER);
check(tray.layout().at(0).isPlatter() && pots(PLATE).layout().at(EDGE).isPlate(), "plate placement slots");

Item[] foods = {Items.APPLE, Items.BREAD, Items.CARROT, Items.POTATO, Items.BOWL, Items.STICK};
for (int i = 0; i < foods.length; i++) {
player.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(foods[i], 2));
click(PLATTER, TableSetting.servingX(platter, i), .094, TableSetting.servingZ(platter, i));
check(player.getHeldItemMainhand().getCount() == 1 && tray.dining.serving(i).getItem() == foods[i], "platter sector " + i);
}
click(PLATTER, TableSetting.servingX(platter, 0), .094, TableSetting.servingZ(platter, 0));
check(player.getHeldItemMainhand().getCount() == 1 && tray.dining.serving(0).getItem() == Items.APPLE, "occupied sector");
DiningTable restored = new DiningTable();
restored.load(tray.writeToNBT(new NBTTagCompound()));
check(restored.hasVisuals() && restored.drops().size() == 6, "six saved servings");
DiningTable empty = new DiningTable();
check(!empty.hasVisuals(), "unused tile scheduled a renderer");
empty.load(tray.getUpdateTag());
empty.remove(0, platter);
check(!empty.hasVisuals(), "empty platter left renderer scheduled");
for (int i = 0; i < foods.length; i++) check(restored.serving(i).getItem() == foods[i], "saved sector " + i);
player.setSneaking(true);
click(PLATTER, TableSetting.servingX(platter, 3), .094, TableSetting.servingZ(platter, 3));
player.setSneaking(false);
check(tray.dining.serving(3).isEmpty() && tray.dining.drops().size() == 5, "isolated prop removal");

player.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(DiningRegistration.cutlery()));
click(PLATE, TableSetting.utensilX(EDGE, true), .015, TableSetting.utensilZ(EDGE, true));
check(player.getHeldItemMainhand().isEmpty() && !pots(PLATE).dining.utensil(EDGE).isEmpty(), "placed cutlery");
player.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(Items.MUSHROOM_STEW));
click(PLATE, .5, .04, 1./6);
click(PLATE, .5, .04, 1./6);
check(pots(PLATE).dining.diner(EDGE).fromTable, "meal did not use table setting");
// A second player must not be able to take the serving during any of the four bites.
net.minecraftforge.common.util.FakePlayer other = net.minecraftforge.common.util.FakePlayerFactory.getMinecraft(level);
other.setSneaking(true);
check(Dining.use(pots(PLATE), other, EnumHand.MAIN_HAND, .5, .04, 1./6), "second player action passed through");
other.setSneaking(false);
check(pots(PLATE).dining.serving(EDGE).getItem() == Items.MUSHROOM_STEW
&& pots(PLATE).dining.diner(EDGE).player == player.getEntityId(), "second player took the diner's serving");
PlateMeal.release(player);
check(pots(PLATE).dining.diner(EDGE) == null && pots(PLATE).dining.serving(EDGE).getItem() == Items.MUSHROOM_STEW,
"canceling ate the meal");
click(PLATE, .5, .04, 1./6);
DiningTable spectator = new DiningTable();
spectator.load(pots(PLATE).getUpdateTag());
check(spectator.diner(EDGE).player == player.getEntityId(), "late spectator meal sync");
restored.load(pots(PLATE).writeToNBT(new NBTTagCompound()));
check(restored.diner(EDGE) == null && !restored.utensil(EDGE).isEmpty(), "meal persisted as active after restart");
started = level.getTotalWorldTime();
}

private void advance() {
PaintedPotEntity plate = pots(PLATE);
if (step == Step.CHECK_RELEASE) {
if (plate.dining.diner(EDGE) != null) return;
check(plate.dining.serving(EDGE).getItem() == Items.BREAD, "network release consumed the bread");
player.setGameType(previousMode);
player.getFoodStats().setFoodLevel(previousFood);
step = Step.DONE;
System.out.println("POTTERY VERIFIED dining: six platter sectors, props, cutlery, spectator sync, four bites, hunger, bowl and network release");
return;
}
if (plate.dining.diner(EDGE) != null) {
check(level.getTotalWorldTime() - started < 150, "meal never finished");
return;
}
check(plate.dining.serving(EDGE).getItem() == Items.BOWL && player.getFoodStats().getFoodLevel() >= 12,
"stew did not nourish the player and leave its bowl");
check(plate.dining.utensil(EDGE).getItem() == DiningRegistration.cutlery(), "cutlery consumed");
PlateMeal.release(player);
click(PLATE, .5, .04, 1./6);
player.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(Items.BREAD));
click(PLATE, .5, .04, 1./6);
player.setHeldItem(EnumHand.MAIN_HAND, new ItemStack(DiningRegistration.cutlery()));
player.getFoodStats().setFoodLevel(6);
player.inventoryContainer.detectAndSendChanges();
step = Step.AIM_AT_BREAD;
}

private PaintedPotEntity pots(BlockPos pos) { return (PaintedPotEntity) level.getTileEntity(pos); }

private void place(BlockPos pos, Pottery shape) {
level.setBlockToAir(pos);
ItemStack stack = new ItemStack(PrimalPotteryForge.POT);
ForgeStackProfiles.INSTANCE.write(stack, shape);
player.setHeldItem(EnumHand.MAIN_HAND, stack);
stack.onItemUse(player, level, pos.down(), EnumHand.MAIN_HAND, EnumFacing.UP, .5F, 1, .16F);
}
private void click(BlockPos pos, double x, double y, double z) {
net.minecraft.block.state.IBlockState state = level.getBlockState(pos);
check(state.getBlock().onBlockActivated(level, pos, state, player, EnumHand.MAIN_HAND, EnumFacing.UP,
(float) x, (float) y, (float) z), "dining use at " + pos);
}
private static void check(boolean ok, String detail) { if (!ok) throw new AssertionError(detail); }
}
Loading
Loading