geforkt von Mirrors/Paper
e14e8ce3bc
Upstream has released updates that appear 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: e9ce88b9 SPIGOT-6562: Add more specific sculk sensor event CraftBukkit Changes: d7ef1e91 SPIGOT-6558: Attempt to improve SkullMeta e7a63287 SPIGOT-6562: Add more specific sculk sensor event
55 Zeilen
2.6 KiB
Diff
55 Zeilen
2.6 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.
|
|
|
|
Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
|
|
@@ -0,0 +0,0 @@ import net.minecraft.core.BlockPos;
|
|
import net.minecraft.nbt.CompoundTag;
|
|
import net.minecraft.nbt.ListTag;
|
|
import net.minecraft.nbt.NbtOps;
|
|
+import net.minecraft.nbt.NumericTag;
|
|
+import net.minecraft.nbt.StringTag;
|
|
import net.minecraft.nbt.Tag;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.network.protocol.Packet;
|
|
@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData {
|
|
}
|
|
|
|
public static MapItemSavedData load(CompoundTag nbt) {
|
|
- DataResult dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, nbt.get("dimension")));
|
|
+ // Paper start - fix "Not a string" spam
|
|
+ Tag dimension = nbt.get("dimension");
|
|
+ if (dimension instanceof NumericTag && ((NumericTag) dimension).getAsInt() >= CraftWorld.CUSTOM_DIMENSION_OFFSET) {
|
|
+ long least = nbt.getLong("UUIDLeast");
|
|
+ long most = nbt.getLong("UUIDMost");
|
|
+
|
|
+ if (least != 0L && most != 0L) {
|
|
+ UUID uuid = new UUID(most, least);
|
|
+ CraftWorld world = (CraftWorld) Bukkit.getWorld(uuid);
|
|
+ if (world != null) {
|
|
+ dimension = StringTag.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH));
|
|
+ } else {
|
|
+ dimension = StringTag.create("bukkit:_invalidworld_");
|
|
+ }
|
|
+ } else {
|
|
+ dimension = StringTag.create("bukkit:_invalidworld_");
|
|
+ }
|
|
+ }
|
|
+ DataResult<ResourceKey<Level>> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, dimension)); // CraftBukkit - decompile error
|
|
+ // Paper end - fix "Not a string" spam
|
|
Logger logger = MapItemSavedData.LOGGER;
|
|
|
|
Objects.requireNonNull(logger);
|