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:
1 parent
318a309580
commit
9e48e35680
13 files changed
+925
-28
No files matched your search
@@ -185,6 +185,29 @@ public class VanillaModelDump {
|
||||
} catch (ReflectiveOperationException e) {
|
||||
failed.add("posed/book (" + e + ")");
|
||||
}
|
||||
// EnchantTableRenderer: BookModel.State.forAnimation(time 0, flip 0 → pages 0.1/0.9, open) — closed
|
||||
// (idle, no player within 3 blocks) and fully open (a player nearby).
|
||||
for (float open : new float[] {0F, 1F}) {
|
||||
posedBlockEntity(out, failed, set, net.minecraft.client.model.geom.ModelLayers.BOOK,
|
||||
"posed/enchanting_book_" + (open == 0 ? "closed" : "open") + "#main",
|
||||
m -> new net.minecraft.client.model.object.book.BookModel(m),
|
||||
net.minecraft.client.model.object.book.BookModel.State.forAnimation(0F, 0.1F, 0.9F, open));
|
||||
}
|
||||
// CopperGolemStatueBlockRenderer: one baked layer per statue pose, CopperGolemStatueModel.setupAnim
|
||||
// (root.y = 0, root.zRot = π).
|
||||
String[][] statues = {{"standing", "COPPER_GOLEM"}, {"running", "COPPER_GOLEM_RUNNING"},
|
||||
{"sitting", "COPPER_GOLEM_SITTING"}, {"star", "COPPER_GOLEM_STAR"}};
|
||||
for (String[] st : statues) {
|
||||
try {
|
||||
ModelLayerLocation loc = (ModelLayerLocation) net.minecraft.client.model.geom.ModelLayers.class
|
||||
.getField(st[1]).get(null);
|
||||
posedBlockEntity(out, failed, set, loc, "posed/copper_golem_statue_" + st[0] + "#main",
|
||||
m -> new net.minecraft.client.model.object.statue.CopperGolemStatueModel(m),
|
||||
net.minecraft.util.Unit.INSTANCE);
|
||||
} catch (ReflectiveOperationException e) {
|
||||
failed.add("posed/copper_golem_statue_" + st[0] + " (" + e + ")");
|
||||
}
|
||||
}
|
||||
JsonObject root = new JsonObject();
|
||||
root.addProperty("version", SharedConstants.getCurrentVersion().name());
|
||||
JsonObject models = new JsonObject();
|
||||
@@ -607,7 +630,18 @@ public class VanillaModelDump {
|
||||
ModelLayerLocation loc,
|
||||
java.util.function.Function<ModelPart, Model<?>> factory,
|
||||
Object state) {
|
||||
String name = "posed/" + loc.model().getPath() + "#" + loc.layer();
|
||||
posedBlockEntity(out, failed, set, loc, "posed/" + loc.model().getPath() + "#" + loc.layer(), factory, state);
|
||||
}
|
||||
|
||||
/** {@link #posedBlockEntity} under an explicit name (several static states of one layer). */
|
||||
static void posedBlockEntity(
|
||||
Map<String, JsonObject> out,
|
||||
List<String> failed,
|
||||
EntityModelSet set,
|
||||
ModelLayerLocation loc,
|
||||
String name,
|
||||
java.util.function.Function<ModelPart, Model<?>> factory,
|
||||
Object state) {
|
||||
try {
|
||||
JsonObject jem = dump(factory.apply(set.bakeLayer(loc)), state, name, failed);
|
||||
if (jem == null) return;
|
||||
|
||||
Reference in new issue
Block a user