diff --git a/build-logic/src/main/groovy/vr.base-conventions.gradle b/build-logic/src/main/groovy/vr.base-conventions.gradle index 0ad55b341..f567a9d10 100644 --- a/build-logic/src/main/groovy/vr.base-conventions.gradle +++ b/build-logic/src/main/groovy/vr.base-conventions.gradle @@ -22,8 +22,8 @@ base { } dependencies { - compileOnly "com.viaversion:viaversion:5.0.4-SNAPSHOT" - compileOnly "com.viaversion:viabackwards:5.0.4-SNAPSHOT" + compileOnly "com.viaversion:viaversion:5.2.1-SNAPSHOT" + compileOnly "com.viaversion:viabackwards:5.2.1-SNAPSHOT" } publishing { diff --git a/common/src/main/java/com/viaversion/viarewind/protocol/v1_8to1_7_6_10/rewriter/EntityPacketRewriter1_8.java b/common/src/main/java/com/viaversion/viarewind/protocol/v1_8to1_7_6_10/rewriter/EntityPacketRewriter1_8.java index 751012851..e2262cfe3 100644 --- a/common/src/main/java/com/viaversion/viarewind/protocol/v1_8to1_7_6_10/rewriter/EntityPacketRewriter1_8.java +++ b/common/src/main/java/com/viaversion/viarewind/protocol/v1_8to1_7_6_10/rewriter/EntityPacketRewriter1_8.java @@ -146,6 +146,9 @@ public void register() { handler(wrapper -> { final int entityId = wrapper.get(Types.VAR_INT, 0); final EntityTypes1_8.EntityType type = EntityTypes1_8.getTypeFromId(wrapper.get(Types.BYTE, 0), true); + if (type == null) { + return; + } int x = wrapper.get(Types.INT, 0); int y = wrapper.get(Types.INT, 1); @@ -184,7 +187,7 @@ public void register() { hologram.setPosition(x / 32.0, y / 32.0, z / 32.0); hologram.setRotation(yaw * 360f / 256, pitch * 360f / 256); hologram.setHeadYaw(yaw * 360f / 256); - } else if (type != null && type.isOrHasParent(EntityTypes1_8.EntityType.FALLING_BLOCK)) { + } else if (type.isOrHasParent(EntityTypes1_8.EntityType.FALLING_BLOCK)) { int blockId = data & 0xFFF; int blockData = data >> 12 & 0xF; final IdAndData replace = protocol.getItemRewriter().handleBlock(blockId, blockData); diff --git a/common/src/main/java/com/viaversion/viarewind/protocol/v1_9to1_8/rewriter/EntityPacketRewriter1_9.java b/common/src/main/java/com/viaversion/viarewind/protocol/v1_9to1_8/rewriter/EntityPacketRewriter1_9.java index 9348bcc51..41f35c575 100644 --- a/common/src/main/java/com/viaversion/viarewind/protocol/v1_9to1_8/rewriter/EntityPacketRewriter1_9.java +++ b/common/src/main/java/com/viaversion/viarewind/protocol/v1_9to1_8/rewriter/EntityPacketRewriter1_9.java @@ -100,7 +100,7 @@ public void register() { final EntityTypes1_9.EntityType type = EntityTypes1_9.getTypeFromId(entityType, true); // Cancel new entities which can't be handled properly - if (type == EntityTypes1_9.EntityType.AREA_EFFECT_CLOUD || type == EntityTypes1_9.EntityType.SPECTRAL_ARROW || type == EntityTypes1_9.EntityType.DRAGON_FIREBALL) { + if (type == null || type == EntityTypes1_9.EntityType.AREA_EFFECT_CLOUD || type == EntityTypes1_9.EntityType.SPECTRAL_ARROW || type == EntityTypes1_9.EntityType.DRAGON_FIREBALL) { wrapper.cancel(); return; } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 71968a12d..3302f6fab 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -24,7 +24,7 @@ }, "depends": { "viafabric": ">=0.4.14", - "viabackwards": ">=5.0.4" + "viabackwards": ">=5.2.1-SNAPSHOT" }, "custom": { "modmenu:api": true,