Skip to content

Commit 4e78a14

Browse files
committed
Support frog
1 parent 72dc14a commit 4e78a14

File tree

7 files changed

+272
-0
lines changed

7 files changed

+272
-0
lines changed

src/main/java/de/bluecolored/bluemap/entities/Addon.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public void run() {
4848
EntityType.REGISTRY.register(new EntityType.Impl(Key.minecraft("camel"), Camel.class));
4949
EntityType.REGISTRY.register(new EntityType.Impl(Key.minecraft("camel_husk"), CamelHusk.class));
5050
EntityType.REGISTRY.register(new EntityType.Impl(Key.minecraft("copper_golem"), CopperGolem.class));
51+
EntityType.REGISTRY.register(new EntityType.Impl(Key.minecraft("frog"), AgeVariantEntity.class));
5152

5253

5354
EntityRendererType.REGISTRY.register(new EntityRendererType.Impl(Key.minecraft("llama"), LlamaRenderer::new));
@@ -83,6 +84,7 @@ public void run() {
8384
EntityRendererType.REGISTRY.register(new EntityRendererType.Impl(Key.minecraft("camel"), CamelRenderer::new));
8485
EntityRendererType.REGISTRY.register(new EntityRendererType.Impl(Key.minecraft("camel_husk"), CamelRenderer::new));
8586
EntityRendererType.REGISTRY.register(new EntityRendererType.Impl(Key.minecraft("copper_golem"), CopperGolemRenderer::new));
87+
EntityRendererType.REGISTRY.register(new EntityRendererType.Impl(Key.minecraft("frog"), FrogRenderer::new));
8688
}
8789

8890
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* This file is part of BlueMap, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) Blue (Lukas Rieger) <https://bluecolored.de>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package de.bluecolored.bluemap.entities.renderer;
26+
27+
import de.bluecolored.bluemap.core.map.TextureGallery;
28+
import de.bluecolored.bluemap.core.map.hires.RenderSettings;
29+
import de.bluecolored.bluemap.core.map.hires.TileModelView;
30+
import de.bluecolored.bluemap.core.resources.ResourcePath;
31+
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
32+
import de.bluecolored.bluemap.core.resources.pack.resourcepack.entitystate.Part;
33+
import de.bluecolored.bluemap.core.resources.pack.resourcepack.model.Model;
34+
import de.bluecolored.bluemap.core.util.Key;
35+
import de.bluecolored.bluemap.core.world.Entity;
36+
import de.bluecolored.bluemap.core.world.block.BlockNeighborhood;
37+
import de.bluecolored.bluemap.entities.entity.AgeVariantEntity;
38+
import de.bluecolored.bluemap.entities.entity.Pig;
39+
40+
public class FrogRenderer extends CustomResourceModelRenderer {
41+
42+
public FrogRenderer(ResourcePack resourcePack, TextureGallery textureGallery, RenderSettings renderSettings) {
43+
super(resourcePack, textureGallery, renderSettings);
44+
}
45+
46+
@Override
47+
public void render(Entity entity, BlockNeighborhood block, Part part, TileModelView tileModel) {
48+
if (!(entity instanceof AgeVariantEntity frog)) return;
49+
50+
// craft model path based on "entity/frog/variant/frog_{variant}"
51+
String modelPath = "entity/frog/variant/frog_" + frog.getRawVariant();
52+
ResourcePath<Model> model = new ResourcePath<>(Key.MINECRAFT_NAMESPACE, modelPath);
53+
54+
// render chosen model
55+
super.render(entity, block, model.getResource(getModelProvider()), TintColorProvider.NO_TINT, tileModel);
56+
57+
// apply part transform
58+
if (part.isTransformed())
59+
tileModel.transform(part.getTransformMatrix());
60+
}
61+
62+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"parts": [
3+
{ "renderer": "minecraft:frog" }
4+
]
5+
}
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
{
2+
"format_version": "1.21.11",
3+
"credit": "Made by Miraculixx",
4+
"texture_size": [48, 48],
5+
"textures": {
6+
},
7+
"elements": [
8+
{
9+
"name": "head",
10+
"from": [-3.5, 3, -4],
11+
"to": [3.5, 6, 5],
12+
"faces": {
13+
"north": {"uv": [3, 7.33333, 5.33333, 8.33333], "texture": "#0"},
14+
"east": {"uv": [0, 7.33333, 3, 8.33333], "texture": "#0"},
15+
"south": {"uv": [8.33333, 7.33333, 10.66667, 8.33333], "texture": "#0"},
16+
"west": {"uv": [5.33333, 7.33333, 8.33333, 8.33333], "texture": "#0"},
17+
"up": {"uv": [5.33333, 7.33333, 3, 4.33333], "texture": "#0"},
18+
"down": {"uv": [7.66667, 4.33333, 5.33333, 7.33333], "texture": "#0"}
19+
}
20+
},
21+
{
22+
"name": "eyes",
23+
"from": [-3.5, 6, -3],
24+
"to": [-0.5, 8, 0],
25+
"faces": {
26+
"north": {"uv": [1, 2.66667, 2, 3.33333], "texture": "#0"},
27+
"east": {"uv": [0, 2.66667, 1, 3.33333], "texture": "#0"},
28+
"south": {"uv": [3, 2.66667, 4, 3.33333], "texture": "#0"},
29+
"west": {"uv": [2, 2.66667, 3, 3.33333], "texture": "#0"},
30+
"up": {"uv": [2, 2.66667, 1, 1.66667], "texture": "#0"},
31+
"down": {"uv": [3, 1.66667, 2, 2.66667], "texture": "#0"}
32+
}
33+
},
34+
{
35+
"name": "eyes",
36+
"from": [0.5, 6, -3],
37+
"to": [3.5, 8, 0],
38+
"faces": {
39+
"north": {"uv": [1, 1, 2, 1.66667], "texture": "#0"},
40+
"east": {"uv": [0, 1, 1, 1.66667], "texture": "#0"},
41+
"south": {"uv": [3, 1, 4, 1.66667], "texture": "#0"},
42+
"west": {"uv": [2, 1, 3, 1.66667], "texture": "#0"},
43+
"up": {"uv": [2, 1, 1, 0], "texture": "#0"},
44+
"down": {"uv": [3, 0, 2, 1], "texture": "#0"}
45+
}
46+
},
47+
{
48+
"name": "body",
49+
"from": [-3.5, 1, -4],
50+
"to": [3.5, 4, 5],
51+
"faces": {
52+
"north": {"uv": [4, 3.33333, 6.33333, 4.33333], "texture": "#0"},
53+
"east": {"uv": [1, 3.33333, 4, 4.33333], "texture": "#0"},
54+
"south": {"uv": [9.33333, 3.33333, 11.66667, 4.33333], "texture": "#0"},
55+
"west": {"uv": [6.33333, 3.33333, 9.33333, 4.33333], "texture": "#0"},
56+
"up": {"uv": [6.33333, 3.33333, 4, 0.33333], "texture": "#0"},
57+
"down": {"uv": [8.66667, 0.33333, 6.33333, 3.33333], "texture": "#0"}
58+
}
59+
},
60+
{
61+
"name": "left_arm",
62+
"from": [-5, 0, -3.5],
63+
"to": [-3, 3, -0.5],
64+
"faces": {
65+
"north": {"uv": [1, 11.66667, 1.66667, 12.66667], "texture": "#0"},
66+
"east": {"uv": [0, 11.66667, 1, 12.66667], "texture": "#0"},
67+
"south": {"uv": [2.66667, 11.66667, 3.33333, 12.66667], "texture": "#0"},
68+
"west": {"uv": [1.66667, 11.66667, 2.66667, 12.66667], "texture": "#0"},
69+
"up": {"uv": [1.66667, 11.66667, 1, 10.66667], "texture": "#0"},
70+
"down": {"uv": [2.33333, 10.66667, 1.66667, 11.66667], "texture": "#0"}
71+
}
72+
},
73+
{
74+
"name": "left_arm",
75+
"from": [-8, 0.01, -7.5],
76+
"to": [0, 0.01, 0.5],
77+
"faces": {
78+
"north": {"uv": [8.66667, 16, 11.33333, 16], "texture": "#0"},
79+
"east": {"uv": [6, 16, 8.66667, 16], "texture": "#0"},
80+
"south": {"uv": [14, 16, 16.66667, 16], "texture": "#0"},
81+
"west": {"uv": [11.33333, 16, 14, 16], "texture": "#0"},
82+
"up": {"uv": [11.33333, 16, 8.66667, 13.33333], "texture": "#0"},
83+
"down": {"uv": [11.33333, 13.33333, 8.66667, 16], "texture": "#0"}
84+
}
85+
},
86+
{
87+
"name": "right_arm",
88+
"from": [0, 0.01, -7.5],
89+
"to": [8, 0.01, 0.5],
90+
"faces": {
91+
"north": {"uv": [3.33333, 16, 6, 16], "texture": "#0"},
92+
"east": {"uv": [0.66667, 16, 3.33333, 16], "texture": "#0"},
93+
"south": {"uv": [8.66667, 16, 11.33333, 16], "texture": "#0"},
94+
"west": {"uv": [6, 16, 8.66667, 16], "texture": "#0"},
95+
"up": {"uv": [6, 16, 3.33333, 13.33333], "texture": "#0"},
96+
"down": {"uv": [6, 13.33333, 3.33333, 16], "texture": "#0"}
97+
}
98+
},
99+
{
100+
"name": "right_arm",
101+
"from": [3, 0, -3.5],
102+
"to": [5, 3, -0.5],
103+
"faces": {
104+
"north": {"uv": [1, 13.66667, 1.66667, 14.66667], "texture": "#0"},
105+
"east": {"uv": [0, 13.66667, 1, 14.66667], "texture": "#0"},
106+
"south": {"uv": [2.66667, 13.66667, 3.33333, 14.66667], "texture": "#0"},
107+
"west": {"uv": [1.66667, 13.66667, 2.66667, 14.66667], "texture": "#0"},
108+
"up": {"uv": [1.66667, 13.66667, 1, 12.66667], "texture": "#0"},
109+
"down": {"uv": [2.33333, 12.66667, 1.66667, 13.66667], "texture": "#0"}
110+
}
111+
},
112+
{
113+
"name": "left_leg",
114+
"from": [-9.5, 0.01, 0],
115+
"to": [-1.5, 0.01, 8],
116+
"faces": {
117+
"north": {"uv": [3.33333, 13.33333, 6, 13.33333], "texture": "#0"},
118+
"east": {"uv": [0.66667, 13.33333, 3.33333, 13.33333], "texture": "#0"},
119+
"south": {"uv": [8.66667, 13.33333, 11.33333, 13.33333], "texture": "#0"},
120+
"west": {"uv": [6, 13.33333, 8.66667, 13.33333], "texture": "#0"},
121+
"up": {"uv": [6, 13.33333, 3.33333, 10.66667], "texture": "#0"},
122+
"down": {"uv": [6, 10.66667, 3.33333, 13.33333], "texture": "#0"}
123+
}
124+
},
125+
{
126+
"name": "left_leg",
127+
"from": [-5.5, 0, 2],
128+
"to": [-2.5, 3, 6],
129+
"faces": {
130+
"north": {"uv": [6, 9.66667, 7, 10.66667], "texture": "#0"},
131+
"east": {"uv": [4.66667, 9.66667, 6, 10.66667], "texture": "#0"},
132+
"south": {"uv": [8.33333, 9.66667, 9.33333, 10.66667], "texture": "#0"},
133+
"west": {"uv": [7, 9.66667, 8.33333, 10.66667], "texture": "#0"},
134+
"up": {"uv": [7, 9.66667, 6, 8.33333], "texture": "#0"},
135+
"down": {"uv": [8, 8.33333, 7, 9.66667], "texture": "#0"}
136+
}
137+
},
138+
{
139+
"name": "right_leg",
140+
"from": [1.5, 0.01, 0],
141+
"to": [9.5, 0.01, 8],
142+
"faces": {
143+
"north": {"uv": [8.66667, 13.33333, 11.33333, 13.33333], "texture": "#0"},
144+
"east": {"uv": [6, 13.33333, 8.66667, 13.33333], "texture": "#0"},
145+
"south": {"uv": [14, 13.33333, 16.66667, 13.33333], "texture": "#0"},
146+
"west": {"uv": [11.33333, 13.33333, 14, 13.33333], "texture": "#0"},
147+
"up": {"uv": [11.33333, 13.33333, 8.66667, 10.66667], "texture": "#0"},
148+
"down": {"uv": [11.33333, 10.66667, 8.66667, 13.33333], "texture": "#0"}
149+
}
150+
},
151+
{
152+
"name": "right_leg",
153+
"from": [2.5, 0, 2],
154+
"to": [5.5, 3, 6],
155+
"faces": {
156+
"north": {"uv": [1.33333, 9.66667, 2.33333, 10.66667], "texture": "#0"},
157+
"east": {"uv": [0, 9.66667, 1.33333, 10.66667], "texture": "#0"},
158+
"south": {"uv": [3.66667, 9.66667, 4.66667, 10.66667], "texture": "#0"},
159+
"west": {"uv": [2.33333, 9.66667, 3.66667, 10.66667], "texture": "#0"},
160+
"up": {"uv": [2.33333, 9.66667, 1.33333, 8.33333], "texture": "#0"},
161+
"down": {"uv": [3.33333, 8.33333, 2.33333, 9.66667], "texture": "#0"}
162+
}
163+
}
164+
],
165+
"groups": [
166+
{
167+
"name": "head",
168+
"origin": [0, 4, 3],
169+
"color": 0,
170+
"children": [0, 1, 2]
171+
},
172+
{
173+
"name": "body",
174+
"origin": [0, 2, 4],
175+
"color": 0,
176+
"children": [3]
177+
},
178+
{
179+
"name": "leg",
180+
"origin": [-4, 3, -2.5],
181+
"color": 0,
182+
"children": [4, 5, 6, 7, 8, 9, 10, 11]
183+
}
184+
]
185+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "entity/frog/frog",
3+
"textures": {
4+
"0": "entity/frog/cold_frog"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "entity/frog/frog",
3+
"textures": {
4+
"0": "entity/frog/temperate_frog"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "entity/frog/frog",
3+
"textures": {
4+
"0": "entity/frog/warm_frog"
5+
}
6+
}

0 commit comments

Comments
 (0)