block-entity contents from the decompiled renderers: enchanting table book (closed, open towards a nearby photographer), campfire and shelf items, vault display item, copper golem statues (poses, weathering), spawner and trial spawner mobs, beacon beam with glass colours, end portal and gateway star field, block-entity parts in block displays (lectern book, bell), outer item-model transformations for special models, contents test scenes

This commit is contained in:
MineTec committed 2026-11-04 20:15:40 +01:00
1 parent 318a309580
commit 9e48e35680
13 files changed
+925 -28

No files matched your search

+67 -1
View File
@@ -189,6 +189,72 @@ public class PPTest extends JavaPlugin {
scenes.put("geo_water", new Scene("geo_water", this::geoWater, 6, 3.5, -5, 6, -3, 2.5));
scenes.put("geo_water_top", new Scene("geo_water_top", this::geoWater, 6, 9, 2.4, 6, -4, 2.5));
scenes.put("geo_water_under", new Scene("geo_water_under", this::geoWater, 11.5, -3.3, 0.3, 4, -5, 3));
// Block-entity contents: enchanting-table book (closed; open when the camera is within 3 blocks), campfire
// and shelf items, copper golem statues (4 poses x stages), spawner/trial-spawner mobs, vault, beacon beam
// through red+blue glass, 3x3 end portal and an end gateway. Rendered 100 ticks after building (beacon
// levels update every 80 ticks).
scenes.put("be_contents", new Scene("be_contents", this::beContents, 7, 4.5, 13, 7, 0.8, 3));
scenes.put("be_contents_n", new Scene("be_contents_n", this::beContents, 7, 4.5, -7, 7, 0.8, 3));
scenes.put("be_contents_close", new Scene("be_contents_close", this::beContents, 1.2, 1.8, 2.2, 1.5, 0.6, 0));
scenes.put("be_contents_beam", new Scene("be_contents_beam", this::beContents, 4, 6, 26, 10, 9, 6));
scenes.put("be_contents_portal", new Scene("be_contents_portal", this::beContents, 11.5, 3.6, -1.8, 11.5, 0, 1.2));
}
private void beContents(Location o) {
put(o, 0, 0, 0, "enchanting_table");
put(o, 2, 0, 0, "campfire[facing=south,lit=true]");
put(o, 4, 0, 0, "soul_campfire[facing=east,lit=false]");
put(o, 6, 0, 0, "oak_shelf[facing=south]");
put(o, 8, 0, 0, "cherry_shelf[facing=south,powered=false]");
if (o.clone().add(2, 0, 0).getBlock().getState() instanceof org.bukkit.block.Campfire c) {
Material[] food = {Material.BEEF, Material.COD, Material.PORKCHOP, Material.POTATO};
for (int i = 0; i < 4; i++) {
c.setItem(i, it(food[i]));
c.setCookTimeTotal(i, 1_000_000); // else the lit campfire pops them out at once (total 0)
}
c.update(true, false);
}
if (o.clone().add(4, 0, 0).getBlock().getState() instanceof org.bukkit.block.Campfire c) {
c.setItem(0, it(Material.SALMON));
c.setItem(2, it(Material.CHICKEN));
c.update(true, false);
}
Material[][] shelves = {{Material.DIAMOND, Material.BOOK, Material.OAK_LOG}, {Material.GOLDEN_APPLE, null, Material.LANTERN}};
for (int k = 0; k < 2; k++) {
if (o.clone().add(6 + 2 * k, 0, 0).getBlock().getState() instanceof org.bukkit.block.Shelf sh) {
for (int i = 0; i < 3; i++) if (shelves[k][i] != null) sh.getSnapshotInventory().setItem(i, it(shelves[k][i]));
sh.update(true, false);
}
}
String[] poses = {"standing", "running", "sitting", "star"};
String[] stages = {"", "exposed_", "weathered_", "waxed_oxidized_"};
String[] facing = {"south", "south", "east", "west"};
for (int i = 0; i < 4; i++)
put(o, i * 2, 0, 3, stages[i] + "copper_golem_statue[copper_golem_pose=" + poses[i] + ",facing=" + facing[i] + "]");
put(o, 0, 0, 6, "spawner");
put(o, 2, 0, 6, "spawner");
put(o, 4, 0, 6, "trial_spawner[trial_spawner_state=waiting_for_players]");
put(o, 6, 0, 6, "vault[facing=south]");
EntityType[] mobs = {EntityType.ZOMBIE, EntityType.PIG};
for (int i = 0; i < 2; i++) {
if (o.clone().add(i * 2, 0, 6).getBlock().getState() instanceof org.bukkit.block.CreatureSpawner cs) {
cs.setSpawnedType(mobs[i]);
cs.update(true, false);
}
}
if (o.clone().add(4, 0, 6).getBlock().getState() instanceof org.bukkit.block.TrialSpawner ts) {
ts.getNormalConfiguration().setSpawnedType(EntityType.SKELETON);
ts.update(true, false);
put(o, 4, 0, 6, "trial_spawner[trial_spawner_state=waiting_for_players]");
}
// Beacon on a 3x3 iron pyramid, red glass 2 above, blue glass 4 above (red+blue = averaged section).
for (int x = -1; x <= 1; x++) for (int z = -1; z <= 1; z++) put(o, 10 + x, -1, 6 + z, "iron_block");
put(o, 10, 0, 6, "beacon");
put(o, 10, 2, 6, "red_stained_glass");
put(o, 10, 4, 6, "blue_stained_glass_pane");
for (int x = 0; x < 3; x++) for (int z = 0; z < 3; z++) put(o, 10 + x, 0, z, "end_portal");
put(o, 14, 1, 1, "end_gateway");
put(o, 14, 0, 1, "obsidian");
}
private void rfVisualLayers(Location o) {
@@ -592,7 +658,7 @@ public class PPTest extends JavaPlugin {
t.printStackTrace();
}
// Let one tick pass (passengers/leashes settle), then render.
Bukkit.getScheduler().runTaskLater(this, () -> render(sc, o), sc.name.equals("proj_shake") ? 4 : sc.name.startsWith("proj_") ? 30 : 10);
Bukkit.getScheduler().runTaskLater(this, () -> render(sc, o), sc.name.equals("proj_shake") ? 4 : sc.name.startsWith("proj_") ? 30 : sc.name.startsWith("be_contents") ? 100 : 10);
}
private void render(Scene sc, Location o) {