Skip to content

Instantly share code, notes, and snippets.

@bernie-g
Created May 4, 2020 00:05
Show Gist options
  • Save bernie-g/de68de7fb5561b67691dfcb1322296ea to your computer and use it in GitHub Desktop.
Save bernie-g/de68de7fb5561b67691dfcb1322296ea to your computer and use it in GitHub Desktop.
(function () {
Plugin.register("animation_utils", {
title: "Modded Entity Template",
icon: "movie_filter",
author: "Gecko",
description: "",
min_version: "3.5.2",
onload() {
Codecs.modded_entity.templates["1.15"] = {
name: "1.15",
flip_y: true,
integer_size: false,
file: `// Made with Blockbench %(bb_version)
// Exported for Minecraft version 1.15
// Paste this class into your mod and generate all required imports
public class %(identifier) extends AnimatedEntityModel<Entity> {
%(fields)
public %(identifier)() {
textureWidth = %(texture_width);
textureHeight = %(texture_height);
%(content)
}
@Override
public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
%(renderers)
}
}`,
field: `private final AnimatedModelRenderer %(bone);`,
bone: `%(bone) = new AnimatedModelRenderer(this);
%(bone).setRotationPoint(%(x), %(y), %(z));
?(has_parent)%(parent).addChild(%(bone));
?(has_rotation)setRotationAngle(%(bone), %(rx), %(ry), %(rz));
%(bone).setModelRendererName(\"%(bone)\");
this.registerModelRenderer(%(bone));
%(cubes)`,
renderer: `%(bone).render(matrixStack, buffer, packedLight, packedOverlay);`,
cube: `%(bone).setTextureOffset(%(uv_x), %(uv_y)).addBox(%(x), %(y), %(z), %(dx), %(dy), %(dz), %(inflate), %(mirror));`,
};
},
onunload() {
delete Codecs.modded_entity.templates["1.15"];
},
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment