mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-12 06:58:11 +02:00
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: f47abd88 SPIGOT-6242: Fix some file line endings de96535b SPIGOT-6234: enum classes don't serialize properly when implementing ConfigurationSerializable CraftBukkit Changes: 4475707d SPIGOT-6244: /spawnpoint ignores angle 8b3b096d SPIGOT-6242: Fix some file line endings 4b33c749 SPIGOT-6186: Canceling a CreatureSpawnEvent results in a "Unable to summon entity due to duplicate UUIDs" error 2b3ca726 SPIGOT-6236: Vehicle passenger portal cooldown does not change
44 lines
2.2 KiB
Diff
44 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Thu, 8 Oct 2020 00:00:25 -0400
|
|
Subject: [PATCH] Fix "Not a string" Map Conversion spam
|
|
|
|
The maps did convert successfully, but had noisy logs due to Spigot
|
|
implementing this logic incorrectly.
|
|
|
|
This stops the spam by converting the old format to new before
|
|
requesting the world.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java
|
|
index 225353e072033d1e5aaf5604b8db255d9a154dc8..7ca4d279b9f13336ca425e413ff532f03bc0de0a 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldMap.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldMap.java
|
|
@@ -73,7 +73,26 @@ public class WorldMap extends PersistentBase {
|
|
|
|
@Override
|
|
public void a(NBTTagCompound nbttagcompound) {
|
|
- DataResult<ResourceKey<World>> dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, nbttagcompound.get("dimension"))); // CraftBukkit - decompile error
|
|
+ // Paper start - fix "Not a string" spam
|
|
+ NBTBase dimension = nbttagcompound.get("dimension");
|
|
+ if (dimension instanceof NBTNumber && ((NBTNumber) dimension).asInt() >= CraftWorld.CUSTOM_DIMENSION_OFFSET) {
|
|
+ long least = nbttagcompound.getLong("UUIDLeast");
|
|
+ long most = nbttagcompound.getLong("UUIDMost");
|
|
+
|
|
+ if (least != 0L && most != 0L) {
|
|
+ this.uniqueId = new UUID(most, least);
|
|
+ CraftWorld world = (CraftWorld) server.getWorld(this.uniqueId);
|
|
+ if (world != null) {
|
|
+ dimension = NBTTagString.create("minecaft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
|
+ } else {
|
|
+ dimension = NBTTagString.create("bukkit:_invalidworld_");
|
|
+ }
|
|
+ } else {
|
|
+ dimension = NBTTagString.create("bukkit:_invalidworld_");
|
|
+ }
|
|
+ }
|
|
+ DataResult<ResourceKey<World>> dataresult = DimensionManager.a(new Dynamic(DynamicOpsNBT.a, dimension)); // CraftBukkit - decompile error
|
|
+ // Paper end - fix "Not a string" spam
|
|
Logger logger = WorldMap.LOGGER;
|
|
|
|
logger.getClass();
|