Skip to content

Commit b80e10a

Browse files
committed
Fix issues
1 parent 88eba3b commit b80e10a

File tree

7 files changed

+192
-169
lines changed

7 files changed

+192
-169
lines changed

src/main/java/de/bluecolored/bluemap/entities/data/EquipmentData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
@Data
66
public class EquipmentData {
7-
ItemStack head, chest, legs, feet, mainhand, offhand, body, saddle;
7+
private ItemStack head, chest, legs, feet, mainhand, offhand, body, saddle;
88
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package de.bluecolored.bluemap.entities.data;
22

33
import de.bluecolored.bluemap.core.util.Key;
4+
import lombok.Data;
45

5-
public record ItemStack(Key id, int count) {}
6+
@Data
7+
public class ItemStack {
8+
private Key id;
9+
private int count;
10+
}

src/main/java/de/bluecolored/bluemap/entities/entity/Fox.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@
2424
*/
2525
package de.bluecolored.bluemap.entities.entity;
2626

27+
import de.bluecolored.bluenbt.NBTDeserializer;
2728
import de.bluecolored.bluenbt.NBTName;
29+
import de.bluecolored.bluenbt.NBTReader;
30+
import de.bluecolored.bluenbt.TypeDeserializer;
2831
import lombok.EqualsAndHashCode;
2932
import lombok.Getter;
3033
import lombok.ToString;
3134

35+
import java.io.IOException;
36+
3237
@Getter
3338
@EqualsAndHashCode(callSuper = true)
3439
@ToString
@@ -39,9 +44,22 @@ public class Fox extends AgeEntity {
3944
@NBTName("Sleeping") boolean sleeping;
4045
@NBTName("Type") Type type;
4146

47+
@NBTDeserializer(Fox.Deserializer.class)
4248
public enum Type {
4349
RED,
4450
SNOW
4551
}
4652

53+
public static class Deserializer implements TypeDeserializer<Fox.Type> {
54+
55+
@Override
56+
public Fox.Type read(NBTReader reader) throws IOException {
57+
return switch (reader.nextString()) {
58+
case "snow" -> Fox.Type.SNOW;
59+
default -> Fox.Type.RED;
60+
};
61+
}
62+
63+
}
64+
4765
}

src/main/java/de/bluecolored/bluemap/entities/renderer/LlamaRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void render(Entity entity, BlockNeighborhood block, Part part, TileModelV
9191
ResourcePath<Model> decorationModel = switch (
9292
Optional.ofNullable(llama.getEquipment())
9393
.map(EquipmentData::getBody)
94-
.map(ItemStack::id)
94+
.map(ItemStack::getId)
9595
.map(Key::getFormatted)
9696
.orElse("")
9797
) {

src/main/resources/assets/minecraft/models/entity/cow/cow.json

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -8,127 +8,127 @@
88
"elements": [
99
{
1010
"name": "head",
11-
"from": [-2, 16, -14],
12-
"to": [6, 24, -8],
13-
"rotation": {"angle": 0, "axis": "x", "origin": [4, 22, -14]},
11+
"from": [-4, 16, -15],
12+
"to": [4, 24, -9],
13+
"rotation": {"angle": 0, "axis": "y", "origin": [2, 22, -15]},
1414
"faces": {
15-
"north": {"uv": [1.5, 3, 3.5, 7], "texture": "#body"},
16-
"east": {"uv": [0, 3, 1.5, 7], "texture": "#body"},
17-
"south": {"uv": [5, 3, 7, 7], "texture": "#body"},
18-
"west": {"uv": [3.5, 3, 5, 7], "texture": "#body"},
19-
"up": {"uv": [1.5, 0, 3.5, 3], "texture": "#body"},
20-
"down": {"uv": [3.5, 0, 5.5, 3], "texture": "#body"}
15+
"north": {"uv": [1.5, 1.5, 3.5, 3.5], "texture": "#body"},
16+
"east": {"uv": [0, 1.5, 1.5, 3.5], "texture": "#body"},
17+
"south": {"uv": [5, 1.5, 7, 3.5], "texture": "#body"},
18+
"west": {"uv": [3.5, 1.5, 5, 3.5], "texture": "#body"},
19+
"up": {"uv": [1.5, 0, 3.5, 1.5], "texture": "#body"},
20+
"down": {"uv": [3.5, 0, 5.5, 1.5], "texture": "#body"}
2121
}
2222
},
2323
{
2424
"name": "body",
25-
"from": [-4, 12, -8],
26-
"to": [8, 22, 10],
27-
"rotation": {"angle": 0, "axis": "y", "origin": [-4, 12, -8]},
25+
"from": [-6, 12, -9],
26+
"to": [6, 22, 9],
27+
"rotation": {"angle": 0, "axis": "y", "origin": [-6, 12, -9]},
2828
"faces": {
29-
"north": {"uv": [7, 2, 10, 7], "texture": "#body"},
30-
"east": {"uv": [4.5, 7, 7, 16], "rotation": 90, "texture": "#body"},
31-
"south": {"uv": [10, 2, 13, 7], "texture": "#body"},
32-
"west": {"uv": [10, 7, 12.5, 16], "rotation": 270, "texture": "#body"},
33-
"up": {"uv": [12.5, 7, 15.5, 16], "texture": "#body"},
34-
"down": {"uv": [7, 7, 10, 16], "rotation": 180, "texture": "#body"}
29+
"north": {"uv": [7, 1, 10, 3.5], "texture": "#body"},
30+
"east": {"uv": [4.5, 3.5, 7, 8], "rotation": 90, "texture": "#body"},
31+
"south": {"uv": [10, 1, 13, 3.5], "texture": "#body"},
32+
"west": {"uv": [10, 3.5, 12.5, 8], "rotation": 270, "texture": "#body"},
33+
"up": {"uv": [12.5, 3.5, 15.5, 8], "texture": "#body"},
34+
"down": {"uv": [7, 3.5, 10, 8], "rotation": 180, "texture": "#body"}
3535
}
3636
},
3737
{
3838
"name": "horn_right",
39-
"from": [6, 22, -12],
40-
"to": [7, 25, -11],
41-
"rotation": {"angle": 0, "axis": "y", "origin": [8, 22, -13]},
39+
"from": [4, 22, -13],
40+
"to": [5, 25, -12],
41+
"rotation": {"angle": 0, "axis": "y", "origin": [6, 22, -14]},
4242
"faces": {
43-
"north": {"uv": [6.25, 0.5, 6.5, 2], "texture": "#body"},
44-
"east": {"uv": [6, 0.5, 6.25, 2], "texture": "#body"},
45-
"south": {"uv": [5.75, 0.5, 6, 2], "texture": "#body"},
46-
"west": {"uv": [5.5, 0.5, 5.75, 2], "texture": "#body"},
47-
"up": {"uv": [5.75, 0, 6, 0.5], "texture": "#body"},
48-
"down": {"uv": [6, 0, 6.25, 0.5], "texture": "#body"}
43+
"north": {"uv": [6.25, 0.25, 6.5, 1], "texture": "#body"},
44+
"east": {"uv": [6, 0.25, 6.25, 1], "texture": "#body"},
45+
"south": {"uv": [5.75, 0.25, 6, 1], "texture": "#body"},
46+
"west": {"uv": [5.5, 0.25, 5.75, 1], "texture": "#body"},
47+
"up": {"uv": [5.75, 0, 6, 0.25], "texture": "#body"},
48+
"down": {"uv": [6, 0, 6.25, 0.25], "texture": "#body"}
4949
}
5050
},
5151
{
5252
"name": "horn_left",
53-
"from": [-3, 22, -12],
54-
"to": [-2, 25, -11],
55-
"rotation": {"angle": 0, "axis": "x", "origin": [-4, 22, -13]},
53+
"from": [-5, 22, -13],
54+
"to": [-4, 25, -12],
55+
"rotation": {"angle": 0, "axis": "y", "origin": [-6, 22, -14]},
5656
"faces": {
57-
"north": {"uv": [6.5, 0.5, 6.25, 2], "texture": "#body"},
58-
"east": {"uv": [5.75, 0.5, 5.5, 2], "texture": "#body"},
59-
"south": {"uv": [6, 0.5, 5.75, 2], "texture": "#body"},
60-
"west": {"uv": [6.25, 0.5, 6, 2], "texture": "#body"},
61-
"up": {"uv": [6, 0, 5.75, 0.5], "texture": "#body"},
62-
"down": {"uv": [6.25, 0, 6, 0.5], "texture": "#body"}
57+
"north": {"uv": [6.5, 0.25, 6.25, 1], "texture": "#body"},
58+
"east": {"uv": [5.75, 0.25, 5.5, 1], "texture": "#body"},
59+
"south": {"uv": [6, 0.25, 5.75, 1], "texture": "#body"},
60+
"west": {"uv": [6.25, 0.25, 6, 1], "texture": "#body"},
61+
"up": {"uv": [6, 0, 5.75, 0.25], "texture": "#body"},
62+
"down": {"uv": [6.25, 0, 6, 0.25], "texture": "#body"}
6363
}
6464
},
6565
{
6666
"name": "leg_front_right",
67-
"from": [4, 0, -8],
68-
"to": [8, 12, -4],
69-
"rotation": {"angle": 0, "axis": "y", "origin": [6, 0, -6]},
67+
"from": [2, 0, -9],
68+
"to": [6, 12, -5],
69+
"rotation": {"angle": 0, "axis": "y", "origin": [4, 0, -7]},
7070
"faces": {
71-
"north": {"uv": [1, 10, 2, 16], "texture": "#body"},
72-
"east": {"uv": [0, 10, 1, 16], "texture": "#body"},
73-
"south": {"uv": [3, 10, 4, 16], "texture": "#body"},
74-
"west": {"uv": [2, 10, 3, 16], "texture": "#body"},
75-
"up": {"uv": [1, 8, 2, 10], "texture": "#body"},
76-
"down": {"uv": [2, 8, 3, 10], "texture": "#body"}
71+
"north": {"uv": [1, 5, 2, 8], "texture": "#body"},
72+
"east": {"uv": [0, 5, 1, 8], "texture": "#body"},
73+
"south": {"uv": [3, 5, 4, 8], "texture": "#body"},
74+
"west": {"uv": [2, 5, 3, 8], "texture": "#body"},
75+
"up": {"uv": [1, 4, 2, 5], "texture": "#body"},
76+
"down": {"uv": [2, 4, 3, 5], "texture": "#body"}
7777
}
7878
},
7979
{
8080
"name": "leg_front_left",
81-
"from": [-4, 0, -8],
82-
"to": [0, 12, -4],
83-
"rotation": {"angle": 0, "axis": "y", "origin": [-2, 0, -6]},
81+
"from": [-6, 0, -9],
82+
"to": [-2, 12, -5],
83+
"rotation": {"angle": 0, "axis": "y", "origin": [-4, 0, -7]},
8484
"faces": {
85-
"north": {"uv": [1, 10, 2, 16], "texture": "#body"},
86-
"east": {"uv": [0, 10, 1, 16], "texture": "#body"},
87-
"south": {"uv": [3, 10, 4, 16], "texture": "#body"},
88-
"west": {"uv": [2, 10, 3, 16], "texture": "#body"},
89-
"up": {"uv": [1, 8, 2, 10], "texture": "#body"},
90-
"down": {"uv": [2, 8, 3, 10], "texture": "#body"}
85+
"north": {"uv": [1, 5, 2, 8], "texture": "#body"},
86+
"east": {"uv": [0, 5, 1, 8], "texture": "#body"},
87+
"south": {"uv": [3, 5, 4, 8], "texture": "#body"},
88+
"west": {"uv": [2, 5, 3, 8], "texture": "#body"},
89+
"up": {"uv": [1, 4, 2, 5], "texture": "#body"},
90+
"down": {"uv": [2, 4, 3, 5], "texture": "#body"}
9191
}
9292
},
9393
{
9494
"name": "leg_back_left",
95-
"from": [-4, 0, 5],
96-
"to": [0, 12, 9],
97-
"rotation": {"angle": 0, "axis": "y", "origin": [-2, 0, 7]},
95+
"from": [-6, 0, 4],
96+
"to": [-2, 12, 8],
97+
"rotation": {"angle": 0, "axis": "y", "origin": [-4, 0, 6]},
9898
"faces": {
99-
"north": {"uv": [1, 10, 2, 16], "texture": "#body"},
100-
"east": {"uv": [0, 10, 1, 16], "texture": "#body"},
101-
"south": {"uv": [3, 10, 4, 16], "texture": "#body"},
102-
"west": {"uv": [2, 10, 3, 16], "texture": "#body"},
103-
"up": {"uv": [1, 8, 2, 10], "texture": "#body"},
104-
"down": {"uv": [2, 8, 3, 10], "texture": "#body"}
99+
"north": {"uv": [1, 5, 2, 8], "texture": "#body"},
100+
"east": {"uv": [0, 5, 1, 8], "texture": "#body"},
101+
"south": {"uv": [3, 5, 4, 8], "texture": "#body"},
102+
"west": {"uv": [2, 5, 3, 8], "texture": "#body"},
103+
"up": {"uv": [1, 4, 2, 5], "texture": "#body"},
104+
"down": {"uv": [2, 4, 3, 5], "texture": "#body"}
105105
}
106106
},
107107
{
108108
"name": "leg_back_right",
109-
"from": [4, 0, 5],
110-
"to": [8, 12, 9],
111-
"rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 7]},
109+
"from": [2, 0, 4],
110+
"to": [6, 12, 8],
111+
"rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 6]},
112112
"faces": {
113-
"north": {"uv": [1, 10, 2, 16], "texture": "#body"},
114-
"east": {"uv": [0, 10, 1, 16], "texture": "#body"},
115-
"south": {"uv": [3, 10, 4, 16], "texture": "#body"},
116-
"west": {"uv": [2, 10, 3, 16], "texture": "#body"},
117-
"up": {"uv": [1, 8, 2, 10], "texture": "#body"},
118-
"down": {"uv": [2, 8, 3, 10], "texture": "#body"}
113+
"north": {"uv": [1, 5, 2, 8], "texture": "#body"},
114+
"east": {"uv": [0, 5, 1, 8], "texture": "#body"},
115+
"south": {"uv": [3, 5, 4, 8], "texture": "#body"},
116+
"west": {"uv": [2, 5, 3, 8], "texture": "#body"},
117+
"up": {"uv": [1, 4, 2, 5], "texture": "#body"},
118+
"down": {"uv": [2, 4, 3, 5], "texture": "#body"}
119119
}
120120
},
121121
{
122122
"name": "udder",
123-
"from": [0, 11, 4],
124-
"to": [4, 12, 10],
125-
"rotation": {"angle": 0, "axis": "y", "origin": [2, 11, 5]},
123+
"from": [-2, 11, 3],
124+
"to": [2, 12, 9],
125+
"rotation": {"angle": 0, "axis": "y", "origin": [0, 11, 4]},
126126
"faces": {
127-
"north": {"uv": [13.25, 0, 14.25, 0.5], "texture": "#body"},
128-
"east": {"uv": [14.25, 0.5, 14.5, 3.5], "rotation": 90, "texture": "#body"},
129-
"south": {"uv": [14.25, 0, 15.25, 0.5], "texture": "#body"},
130-
"west": {"uv": [13, 0.5, 13.25, 3.5], "rotation": 90, "texture": "#body"},
131-
"down": {"uv": [13.25, 0.5, 14.25, 3.5], "texture": "#body"}
127+
"north": {"uv": [13.25, 0, 14.25, 0.25], "texture": "#body"},
128+
"east": {"uv": [14.25, 0.25, 14.5, 1.75], "rotation": 90, "texture": "#body"},
129+
"south": {"uv": [14.25, 0, 15.25, 0.25], "texture": "#body"},
130+
"west": {"uv": [13, 0.25, 13.25, 1.75], "rotation": 90, "texture": "#body"},
131+
"down": {"uv": [13.25, 0.25, 14.25, 1.75], "texture": "#body"}
132132
}
133133
}
134134
]

0 commit comments

Comments
 (0)