primitive chunk table in world snapshot instead of colliding long-keyed hashmap, bounded cache for tinted/composited mob and banner textures, vanilla dump with nested model json, village benchmark and perf test scenes
This commit is contained in:
1 parent
b5baffebbd
commit
88bae41a03
10 files changed
+306
-38
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -31,7 +30,8 @@ import net.minecraft.world.entity.EntityType;
|
||||
|
||||
/**
|
||||
* Dumps the vanilla Java entity models straight from an (unobfuscated, 26.x+) Minecraft CLIENT jar into
|
||||
* the CEM-template JSON layout PixelPics loads ({@code {"models": {name: {"model": "<jem json>"}}}}).
|
||||
* the CEM-template JSON layout PixelPics loads ({@code {"models": {name: {"model": {<jem>}}}}}; the jem is a
|
||||
* nested object, not the template set's embedded JSON string, so the plugin parses the file only once).
|
||||
*
|
||||
* <p>Unlike the third-party CEM template set (rest geometry only), every entity model is instantiated
|
||||
* through its real renderer and posed by its real {@code setupAnim} with a default (idle, adult, not
|
||||
@@ -152,7 +152,7 @@ public class VanillaModelDump {
|
||||
parts.add(part("root", rootDef, baked, 0, 0, 0));
|
||||
jem.add("models", parts);
|
||||
JsonObject entry = new JsonObject();
|
||||
entry.addProperty("model", new Gson().toJson(jem));
|
||||
entry.add("model", jem); // nested object, not a JSON string: parsed once at plugin start
|
||||
out.putIfAbsent(name, entry);
|
||||
} catch (Throwable t) {
|
||||
failed.add(name + " (layer: " + t + ")");
|
||||
@@ -315,7 +315,7 @@ public class VanillaModelDump {
|
||||
JsonObject jem = dump(factory.apply(set.bakeLayer(loc)), state, name, failed);
|
||||
if (jem == null) return;
|
||||
JsonObject entry = new JsonObject();
|
||||
entry.addProperty("model", new Gson().toJson(jem));
|
||||
entry.add("model", jem);
|
||||
out.put(name, entry);
|
||||
} catch (Throwable t) {
|
||||
failed.add(name + " (" + t + ")");
|
||||
@@ -368,7 +368,7 @@ public class VanillaModelDump {
|
||||
String tex = textures.get(f);
|
||||
if (tex != null) jem.addProperty("texture", tex);
|
||||
JsonObject entry = new JsonObject();
|
||||
entry.addProperty("model", new Gson().toJson(jem));
|
||||
entry.add("model", jem);
|
||||
out.put(name, entry);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user