From f3d65f7c14fed61f5e5c125bd82db6c75ffccbce Mon Sep 17 00:00:00 2001 From: Florian Gillmann Date: Thu, 21 May 2026 00:27:42 +0200 Subject: [PATCH] feat: update to minestom 2026.05.17c-26.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - player_head item: add `transformation` (180° X rotation + [0.5, 0, 0.5] translation) to every entry of the template's items/player_head.json. 26.1 client no longer applies a default for minecraft:special player_head. Without the explicit transform, emote bones render inverted and shifted. - ModelParser.convertUV: clamp output components to [0, 16]. 26.1 client runs NativeImage.computeTransparency (render-pass auto-classification, 26.1 Snapshot 7) which rejects out-of-bounds UVs that 1.21.11 silently accepted. - update from Pos.fromPoint() to Point.asPos() and from setTimeRate to WorldClock.pause() - follow widened Viewable/Entity generic bounds in Minestom --- gradle/libs.versions.toml | 2 +- .../worldseed/multipart/GenericModelImpl.java | 2 +- .../multipart/model_bones/BoneEntity.java | 2 +- .../model_bones/misc/ModelBoneHitbox.java | 2 +- .../model_bones/misc/ModelBoneVFX.java | 2 +- .../multipart/parser/ModelParser.java | 11 +++-- src/test/java/Main.java | 3 +- .../assets/minecraft/items/player_head.json | 48 +++++++++++++++++++ 8 files changed, 63 insertions(+), 9 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b207e30e..d722efe7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] java = "25" junit = "6.0.0-M2" -minestom = "2026.04.13-1.21.11" +minestom = "2026.05.17c-26.1.1" commons-io = "2.20.0" zt-zip = "1.17" javax-json = "1.1.4" diff --git a/src/main/java/net/worldseed/multipart/GenericModelImpl.java b/src/main/java/net/worldseed/multipart/GenericModelImpl.java index e349e737..e1dc0089 100644 --- a/src/main/java/net/worldseed/multipart/GenericModelImpl.java +++ b/src/main/java/net/worldseed/multipart/GenericModelImpl.java @@ -308,7 +308,7 @@ public void sendPacketToViewers(@NotNull SendablePacket packet) { } @Override - public void sendPacketsToViewers(@NotNull Collection packets) { + public void sendPacketsToViewers(@NotNull Collection packets) { for (Player viewer : this.viewers) { for (SendablePacket packet : packets) { viewer.sendPacket(packet); diff --git a/src/main/java/net/worldseed/multipart/model_bones/BoneEntity.java b/src/main/java/net/worldseed/multipart/model_bones/BoneEntity.java index 73ef3dc6..f9631692 100644 --- a/src/main/java/net/worldseed/multipart/model_bones/BoneEntity.java +++ b/src/main/java/net/worldseed/multipart/model_bones/BoneEntity.java @@ -29,7 +29,7 @@ public BoneEntity(@NotNull EntityType entityType, GenericModel model, String nam } @Override - public @NotNull Set getViewers() { + public @NotNull Set getViewers() { return model.getViewers(); } diff --git a/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneHitbox.java b/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneHitbox.java index 4b6627c7..45db13fd 100644 --- a/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneHitbox.java +++ b/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneHitbox.java @@ -221,7 +221,7 @@ public Pos calculatePosition() { p = applyTransform(p); p = calculateGlobalRotation(p); - return Pos.fromPoint(p).div(4).mul(scale); + return p.asPos().div(4).mul(scale); } @Override diff --git a/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneVFX.java b/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneVFX.java index 9f515d86..417d442e 100644 --- a/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneVFX.java +++ b/src/main/java/net/worldseed/multipart/model_bones/misc/ModelBoneVFX.java @@ -64,7 +64,7 @@ public Pos calculatePosition() { p = applyTransform(p); p = calculateGlobalRotation(p); - Pos endPos = Pos.fromPoint(p); + Pos endPos = p.asPos(); return endPos .div(4, 4, 4).mul(scale) diff --git a/src/main/java/net/worldseed/resourcepack/multipart/parser/ModelParser.java b/src/main/java/net/worldseed/resourcepack/multipart/parser/ModelParser.java index fb41375d..ca1c3704 100644 --- a/src/main/java/net/worldseed/resourcepack/multipart/parser/ModelParser.java +++ b/src/main/java/net/worldseed/resourcepack/multipart/parser/ModelParser.java @@ -317,9 +317,14 @@ private static UV convertUV(UV uv, int width, int height, boolean inverse) { double ex = uv.x2 * (16.0 / width); double ey = uv.y2 * (16.0 / height); - if (inverse) - return new UV(ex + sx, ey + sy, sx, sy, uv.texture, uv.rotation); - return new UV(sx, sy, ex + sx, ey + sy, uv.texture, uv.rotation); + if (inverse) { + return new UV(clampUV(ex + sx), clampUV(ey + sy), clampUV(sx), clampUV(sy), uv.texture, uv.rotation); + } + return new UV(clampUV(sx), clampUV(sy), clampUV(ex + sx), clampUV(ey + sy), uv.texture, uv.rotation); + } + + private static double clampUV(double v) { + return Math.clamp(v, 0.0, 16.0); } private static JsonObject mappingsToJson() { diff --git a/src/test/java/Main.java b/src/test/java/Main.java index 3911c88b..15c4b3f9 100644 --- a/src/test/java/Main.java +++ b/src/test/java/Main.java @@ -29,6 +29,7 @@ import net.minestom.server.timer.TaskSchedule; import net.minestom.server.utils.MathUtils; import net.minestom.server.world.DimensionType; +import net.minestom.server.world.clock.WorldClock; import net.worldseed.multipart.ModelEngine; import net.worldseed.resourcepack.PackBuilder; import org.apache.commons.io.FileUtils; @@ -63,7 +64,7 @@ void main() throws Exception { lobby.setChunkSupplier(LightingChunk::new); lobby.enableAutoChunkLoad(true); lobby.setGenerator(unit -> unit.modifier().fillHeight(0, 1, Block.STONE)); - lobby.setTimeRate(0); + lobby.clock(WorldClock.OVERWORLD).pause(); instanceManager.registerInstance(lobby); // Commands diff --git a/src/test/resources/resourcepack_template/assets/minecraft/items/player_head.json b/src/test/resources/resourcepack_template/assets/minecraft/items/player_head.json index 32f6d8ba..5af70fe2 100644 --- a/src/test/resources/resourcepack_template/assets/minecraft/items/player_head.json +++ b/src/test/resources/resourcepack_template/assets/minecraft/items/player_head.json @@ -10,6 +10,12 @@ "base": "minecraft:custom/entities/player/head", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -20,6 +26,12 @@ "base": "minecraft:custom/entities/player/right_arm", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -30,6 +42,12 @@ "base": "minecraft:custom/entities/player/left_arm", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -40,6 +58,12 @@ "base": "minecraft:custom/entities/player/torso", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -50,6 +74,12 @@ "base": "minecraft:custom/entities/player/right_leg", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -60,6 +90,12 @@ "base": "minecraft:custom/entities/player/left_leg", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -70,6 +106,12 @@ "base": "minecraft:custom/entities/player/slim_right", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }, @@ -80,6 +122,12 @@ "base": "minecraft:custom/entities/player/slim_left", "model": { "type": "minecraft:player_head" + }, + "transformation": { + "left_rotation": [1.0, 0.0, 0.0, -0.0], + "right_rotation": [0.0, 0.0, 0.0, 1.0], + "scale": [1.0, 1.0, 1.0], + "translation": [0.5, 0.0, 0.5] } } }