mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 08:20:51 +01:00
e035fd7034
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: cc9aa21a SPIGOT-6399, SPIGOT-7344: Clarify collidable behavior for player entities f23325b6 Add API for per-world simulation distances 26e1774e Add API for per-world view distances 0b541e60 Add PlayerLoginEvent#getRealAddress 5f027d2d PR-949: Add Vector#fromJOML() overloads for read-only vector types CraftBukkit Changes: bcf56171a PR-1321: Clean up some stuff which got missed during previous PRs 7f833a2d1 SPIGOT-7462: Players no longer drop XP after dying near a Sculk Catalyst 752aac669 Implement APIs for per world view and simulation distances 57d7ef433 Preserve empty enchantment tags for glow effect 465ec3fb4 Remove connected check on setScoreboard f90ce621e Use one PermissibleBase for all command blocks 5876cca44 SPIGOT-7550: Fix creation of Arrow instances f03fc3aa3 SPIGOT-7549: ServerTickManager#setTickRate incorrect Precondition 9d7f49b01 SPIGOT-7548: Fix wrong spawn location for experience orb and dropped item Spigot Changes: ed9ba9a4 Drop no longer required patch ignoring -o option 86b5dd6a SPIGOT-7546: Fix hardcoded check for outdated client message aa7cde7a Remove obsolete APIs for per world view and simulation distances 6dff577e Remove obsolete patch preserving empty `ench` tags a3bf95b8 Remove obsolete PlayerLoginEvent#getRealAddress 1b02f5d6 Remove obsolete connected check on setScoreboard patch acf717eb Remove obsolete command block PermissibleBase patch 053fa2a9 Remove redundant patch dealing with null tile entities
106 lines
6.9 KiB
Diff
106 lines
6.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Wed, 14 Dec 2022 15:52:11 -0800
|
|
Subject: [PATCH] Improve logging and errors
|
|
|
|
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
|
|
diff --git a/src/main/java/net/minecraft/advancements/AdvancementTree.java b/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
|
index 938fe76677139e7e99698b61691bfcadf70dbd87..5cf3732d2197b381ae9256d8bed03a755d8539f4 100644
|
|
--- a/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
|
+++ b/src/main/java/net/minecraft/advancements/AdvancementTree.java
|
|
@@ -35,7 +35,7 @@ public class AdvancementTree {
|
|
this.remove(advancementnode1);
|
|
}
|
|
|
|
- AdvancementTree.LOGGER.info("Forgot about advancement {}", advancement.holder());
|
|
+ AdvancementTree.LOGGER.debug("Forgot about advancement {}", advancement.holder()); // Paper
|
|
this.nodes.remove(advancement.holder().id());
|
|
if (advancement.parent() == null) {
|
|
this.roots.remove(advancement);
|
|
@@ -77,7 +77,7 @@ public class AdvancementTree {
|
|
}
|
|
}
|
|
|
|
- // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload
|
|
+ // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload // Paper - you say it was moved... but it wasn't :) it should be moved however, since this is called when the API creates an advancement
|
|
}
|
|
|
|
private boolean tryInsert(AdvancementHolder advancement) {
|
|
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
index 536f0c496ce36ca3248fc6eeac9bbd77214a36f9..5e24c1e712eb16d0d5343760a65310bd79d1020c 100644
|
|
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
|
|
@@ -66,6 +66,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
|
|
AdvancementTree advancementtree = new AdvancementTree();
|
|
|
|
advancementtree.addAll(this.advancements.values());
|
|
+ LOGGER.info("Loaded {} advancements", advancementtree.nodes().size()); // Paper - moved from AdvancementTree#addAll
|
|
Iterator iterator = advancementtree.roots().iterator();
|
|
|
|
while (iterator.hasNext()) {
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index d4187f23bdebbab0cbee72009e0257de3e1c876c..8ff416bbb4743af7bb4f3a1b30e34bd288059fa9 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -3388,7 +3388,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
|
|
|
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
|
|
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
|
|
- ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
|
|
+ // ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log
|
|
this.disconnect(profilepublickey_b.getComponent(), profilepublickey_b.kickCause); // Paper - kick event causes
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/packs/PathPackResources.java b/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
|
index 89aa86a49eda563c82ccedc99641e699f8e578b0..4822f94ce183a99ad9e0d1bdc6c5708d958f6104 100644
|
|
--- a/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
|
+++ b/src/main/java/net/minecraft/server/packs/PathPackResources.java
|
|
@@ -108,6 +108,12 @@ public class PathPackResources extends AbstractPackResources {
|
|
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) {
|
|
for(Path path2 : directoryStream) {
|
|
String string = path2.getFileName().toString();
|
|
+ // Paper start
|
|
+ if (!Files.isDirectory(path2)) {
|
|
+ LOGGER.error("Invalid directory entry: {} in {}.", string, this.root, new java.nio.file.NotDirectoryException(string));
|
|
+ continue;
|
|
+ }
|
|
+ // Paper end
|
|
if (ResourceLocation.isValidNamespace(string)) {
|
|
set.add(string);
|
|
} else {
|
|
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
index 4259181bab2dc4f2d0409b56fdf81d966003376d..93e7d350a4176250d9ae3f0e1e7e6a4197d613b0 100644
|
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
@@ -84,7 +84,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
|
return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
|
}));
|
|
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
|
- RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
|
+ RecipeManager.LOGGER.info("Loaded {} recipes", this.byName.size()); // Paper - log correct number of recipes
|
|
}
|
|
|
|
// CraftBukkit start
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
|
index 080cca90f15d90249b7a38f33286ae2f735ba7d9..2677e21d8239bf0361a3bc5c9a50c328e54d70f6 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
|
@@ -44,6 +44,7 @@ import org.bukkit.material.MaterialData;
|
|
*/
|
|
@Deprecated
|
|
public final class CraftLegacy {
|
|
+ private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Paper
|
|
|
|
private static final Map<Byte, Material> SPAWN_EGGS = new HashMap<>();
|
|
private static final Set<String> whitelistedStates = new HashSet<>(Arrays.asList("explode", "check_decay", "decayable", "facing"));
|
|
@@ -255,7 +256,7 @@ public final class CraftLegacy {
|
|
}
|
|
|
|
static {
|
|
- System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!");
|
|
+ LOGGER.warn("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!"); // Paper - doesn't need to be an error
|
|
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
|
new Exception().printStackTrace();
|
|
}
|