Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-19 22:40:18 +01:00
Convert skull floor geometries into a template
Should be easier to modify in needed in the future.
Dieser Commit ist enthalten in:
Ursprung
5676870dd8
Commit
8244afa8c7
@ -53,7 +53,7 @@ import java.util.zip.ZipOutputStream;
|
|||||||
|
|
||||||
public class SkullResourcePackManager {
|
public class SkullResourcePackManager {
|
||||||
|
|
||||||
private static final long RESOURCE_PACK_VERSION = 5;
|
private static final long RESOURCE_PACK_VERSION = 6;
|
||||||
|
|
||||||
private static final Path SKULL_SKIN_CACHE_PATH = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("player_skulls");
|
private static final Path SKULL_SKIN_CACHE_PATH = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("player_skulls");
|
||||||
|
|
||||||
@ -170,6 +170,8 @@ public class SkullResourcePackManager {
|
|||||||
zipOS.closeEntry();
|
zipOS.closeEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addFloorGeometries(zipOS);
|
||||||
|
|
||||||
ZipEntry entry = new ZipEntry("skull_resource_pack/pack_icon.png");
|
ZipEntry entry = new ZipEntry("skull_resource_pack/pack_icon.png");
|
||||||
zipOS.putNextEntry(entry);
|
zipOS.putNextEntry(entry);
|
||||||
zipOS.write(FileUtils.readAllBytes("icon.png"));
|
zipOS.write(FileUtils.readAllBytes("icon.png"));
|
||||||
@ -177,6 +179,23 @@ public class SkullResourcePackManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addFloorGeometries(ZipOutputStream zipOS) throws IOException {
|
||||||
|
String template = new String(FileUtils.readAllBytes("bedrock/skull_resource_pack/models/blocks/player_skull_floor.geo.json"), StandardCharsets.UTF_8);
|
||||||
|
String[] quadrants = {"a", "b", "c", "d"};
|
||||||
|
for (int i = 0; i < quadrants.length; i++) {
|
||||||
|
String quadrant = quadrants[i];
|
||||||
|
float yRotation = i * 22.5f;
|
||||||
|
String contents = template
|
||||||
|
.replace("${quadrant}", quadrant)
|
||||||
|
.replace("${y_rotation}", String.valueOf(yRotation));
|
||||||
|
|
||||||
|
ZipEntry entry = new ZipEntry("skull_resource_pack/models/blocks/player_skull_floor_" + quadrant + ".geo.json");
|
||||||
|
zipOS.putNextEntry(entry);
|
||||||
|
zipOS.write(contents.getBytes(StandardCharsets.UTF_8));
|
||||||
|
zipOS.closeEntry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void addAttachables(ZipOutputStream zipOS) throws IOException {
|
private static void addAttachables(ZipOutputStream zipOS) throws IOException {
|
||||||
String template = new String(FileUtils.readAllBytes("bedrock/skull_resource_pack/attachables/template_attachable.json"), StandardCharsets.UTF_8);
|
String template = new String(FileUtils.readAllBytes("bedrock/skull_resource_pack/attachables/template_attachable.json"), StandardCharsets.UTF_8);
|
||||||
for (String skinHash : SKULL_SKINS.keySet()) {
|
for (String skinHash : SKULL_SKINS.keySet()) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"minecraft:geometry": [
|
"minecraft:geometry": [
|
||||||
{
|
{
|
||||||
"description": {
|
"description": {
|
||||||
"identifier": "geometry.geyser.player_skull_floor_a",
|
"identifier": "geometry.geyser.player_skull_floor_${quadrant}",
|
||||||
"texture_width": 64,
|
"texture_width": 64,
|
||||||
"texture_height": 64
|
"texture_height": 64
|
||||||
},
|
},
|
||||||
@ -11,6 +11,7 @@
|
|||||||
{
|
{
|
||||||
"name": "head",
|
"name": "head",
|
||||||
"pivot": [0, 24, 0],
|
"pivot": [0, 24, 0],
|
||||||
|
"rotation": [0, ${y_rotation}, 0],
|
||||||
"cubes": [
|
"cubes": [
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [0, 0]}
|
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [0, 0]}
|
||||||
]
|
]
|
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"format_version": "1.12.0",
|
|
||||||
"minecraft:geometry": [
|
|
||||||
{
|
|
||||||
"description": {
|
|
||||||
"identifier": "geometry.geyser.player_skull_floor_b",
|
|
||||||
"texture_width": 64,
|
|
||||||
"texture_height": 64
|
|
||||||
},
|
|
||||||
"bones": [
|
|
||||||
{
|
|
||||||
"name": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"rotation": [0, 22.5, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [0, 0]}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hat",
|
|
||||||
"parent": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [32, 0], "inflate": 0.5}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"format_version": "1.12.0",
|
|
||||||
"minecraft:geometry": [
|
|
||||||
{
|
|
||||||
"description": {
|
|
||||||
"identifier": "geometry.geyser.player_skull_floor_c",
|
|
||||||
"texture_width": 64,
|
|
||||||
"texture_height": 64
|
|
||||||
},
|
|
||||||
"bones": [
|
|
||||||
{
|
|
||||||
"name": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"rotation": [0, 45, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [0, 0]}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hat",
|
|
||||||
"parent": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [32, 0], "inflate": 0.5}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
"format_version": "1.12.0",
|
|
||||||
"minecraft:geometry": [
|
|
||||||
{
|
|
||||||
"description": {
|
|
||||||
"identifier": "geometry.geyser.player_skull_floor_d",
|
|
||||||
"texture_width": 64,
|
|
||||||
"texture_height": 64
|
|
||||||
},
|
|
||||||
"bones": [
|
|
||||||
{
|
|
||||||
"name": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"rotation": [0, 67.5, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [0, 0]}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hat",
|
|
||||||
"parent": "head",
|
|
||||||
"pivot": [0, 24, 0],
|
|
||||||
"cubes": [
|
|
||||||
{"origin": [-4, 0.5, -4], "size": [8, 8, 8], "uv": [32, 0], "inflate": 0.5}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,10 +1,6 @@
|
|||||||
skull_resource_pack/animations/disable.animation.json
|
skull_resource_pack/animations/disable.animation.json
|
||||||
skull_resource_pack/animations/player_skull.animation.json
|
skull_resource_pack/animations/player_skull.animation.json
|
||||||
skull_resource_pack/models/blocks/player_skull.geo.json
|
skull_resource_pack/models/blocks/player_skull.geo.json
|
||||||
skull_resource_pack/models/blocks/player_skull_floor_a.geo.json
|
|
||||||
skull_resource_pack/models/blocks/player_skull_floor_c.geo.json
|
|
||||||
skull_resource_pack/models/blocks/player_skull_floor_b.geo.json
|
|
||||||
skull_resource_pack/models/blocks/player_skull_floor_d.geo.json
|
|
||||||
skull_resource_pack/models/blocks/player_skull_hand.geo.json
|
skull_resource_pack/models/blocks/player_skull_hand.geo.json
|
||||||
skull_resource_pack/models/blocks/player_skull_wall.geo.json
|
skull_resource_pack/models/blocks/player_skull_wall.geo.json
|
||||||
skull_resource_pack/textures/terrain_texture.json
|
skull_resource_pack/textures/terrain_texture.json
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren