More work

This commit is contained in:
Nassim Jahnke 2023-06-07 19:18:05 +02:00
parent 965cf53cd5
commit 3fbb00319f
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
5 changed files with 195 additions and 230 deletions

View File

@ -1627,12 +1627,12 @@ index 98f2def9125d6faf5859572a004fa8d2fa066417..436f381c727cda72c04859c540dce471
public static ChatFormatting getById(int colorIndex) { public static ChatFormatting getById(int colorIndex) {
if (colorIndex < 0) { if (colorIndex < 0) {
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index d476bf8435ee585d8c4faa431716524774527acc..36bbe7d0b2089361beda89097c15eca9ab48a57d 100644 index 5aa9be9b4b89352784835c4bbf25023a3304c0c8..fb381a7f3362b5c7848f9c326e9378b76f6fdad9 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -62,6 +62,7 @@ public class CommandSourceStack implements SharedSuggestionProvider { @@ -65,6 +65,7 @@ public class CommandSourceStack implements SharedSuggestionProvider {
private final CommandSigningContext signingContext;
private final TaskChainer chatMessageChainer; private final TaskChainer chatMessageChainer;
private final IntConsumer returnValueConsumer;
public volatile CommandNode currentCommand; // CraftBukkit public volatile CommandNode currentCommand; // CraftBukkit
+ public boolean bypassSelectorPermissions = false; // Paper + public boolean bypassSelectorPermissions = false; // Paper
@ -2151,7 +2151,7 @@ index 5f051cb22ae77f4d8994b07ac5b963bd0ff05673..7952635a963e28cb670c8f4869664103
list.forEach((loader) -> { list.forEach((loader) -> {
Registry<?> registry = loader.getFirst(); Registry<?> registry = loader.getFirst();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf937673ba4 100644 index 9b34e401040a45393afbb9e984ff421a89f744a0..2d35572157b28f2e637d9b47a82c5e7adecde96e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -194,6 +194,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -194,6 +194,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
@ -2170,7 +2170,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf9
private int playerIdleTimeout; private int playerIdleTimeout;
public final long[] tickTimes; public final long[] tickTimes;
@Nullable @Nullable
@@ -1263,6 +1265,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1261,6 +1263,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
SpigotTimings.schedulerTimer.startTiming(); // Spigot SpigotTimings.schedulerTimer.startTiming(); // Spigot
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
SpigotTimings.schedulerTimer.stopTiming(); // Spigot SpigotTimings.schedulerTimer.stopTiming(); // Spigot
@ -2178,7 +2178,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf9
this.profiler.push("commandFunctions"); this.profiler.push("commandFunctions");
SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
this.getFunctions().tick(); this.getFunctions().tick();
@@ -1631,8 +1634,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1629,8 +1632,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.motd; return this.motd;
} }
@ -2197,7 +2197,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf9
} }
public boolean isStopped() { public boolean isStopped() {
@@ -2351,39 +2364,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2343,39 +2356,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) { public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
@ -2250,7 +2250,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf9
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66180922fd 100644 index 931955a7f5b20f04350ec91b3bc95146e8e219a3..5872ead2fe3a64f02f8bc36603fbb856728fd255 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -161,6 +161,7 @@ import net.minecraft.world.scores.Score; @@ -161,6 +161,7 @@ import net.minecraft.world.scores.Score;
@ -2269,7 +2269,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
public Component listName; public Component listName;
public org.bukkit.Location compassTarget; public org.bukkit.Location compassTarget;
public int newExp = 0; public int newExp = 0;
@@ -326,6 +328,7 @@ public class ServerPlayer extends Player { @@ -325,6 +327,7 @@ public class ServerPlayer extends Player {
// CraftBukkit start // CraftBukkit start
this.displayName = this.getScoreboardName(); this.displayName = this.getScoreboardName();
@ -2277,7 +2277,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
this.bukkitPickUpLoot = true; this.bukkitPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth(); this.maxHealthCache = this.getMaxHealth();
} }
@@ -819,22 +822,17 @@ public class ServerPlayer extends Player { @@ -818,22 +821,17 @@ public class ServerPlayer extends Player {
String deathmessage = defaultMessage.getString(); String deathmessage = defaultMessage.getString();
this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel this.keepLevel = keepInventory; // SPIGOT-2222: pre-set keepLevel
@ -2302,9 +2302,9 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
+ if (deathMessage != null && deathMessage != net.kyori.adventure.text.Component.empty() && flag) { // Paper - Adventure // TODO: allow plugins to override? + if (deathMessage != null && deathMessage != net.kyori.adventure.text.Component.empty() && flag) { // Paper - Adventure // TODO: allow plugins to override?
+ Component ichatbasecomponent = PaperAdventure.asVanilla(deathMessage); // Paper - Adventure + Component ichatbasecomponent = PaperAdventure.asVanilla(deathMessage); // Paper - Adventure
this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> { this.connection.send(new ClientboundPlayerCombatKillPacket(this.getId(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> {
boolean flag1 = true; boolean flag1 = true;
@@ -1771,13 +1769,13 @@ public class ServerPlayer extends Player { @@ -1774,13 +1772,13 @@ public class ServerPlayer extends Player {
public void sendSystemMessage(Component message, boolean overlay) { public void sendSystemMessage(Component message, boolean overlay) {
if (this.acceptsSystemMessages(overlay)) { if (this.acceptsSystemMessages(overlay)) {
@ -2320,7 +2320,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
} else { } else {
return null; return null;
} }
@@ -1786,8 +1784,13 @@ public class ServerPlayer extends Player { @@ -1789,8 +1787,13 @@ public class ServerPlayer extends Player {
} }
public void sendChatMessage(OutgoingChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) { public void sendChatMessage(OutgoingChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) {
@ -2335,7 +2335,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
} }
} }
@@ -1805,6 +1808,7 @@ public class ServerPlayer extends Player { @@ -1808,6 +1811,7 @@ public class ServerPlayer extends Player {
} }
public String locale = "en_us"; // CraftBukkit - add, lowercase public String locale = "en_us"; // CraftBukkit - add, lowercase
@ -2343,7 +2343,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
public void updateOptions(ServerboundClientInformationPacket packet) { public void updateOptions(ServerboundClientInformationPacket packet) {
// CraftBukkit start // CraftBukkit start
if (getMainArm() != packet.mainHand()) { if (getMainArm() != packet.mainHand()) {
@@ -1816,6 +1820,10 @@ public class ServerPlayer extends Player { @@ -1819,6 +1823,10 @@ public class ServerPlayer extends Player {
this.server.server.getPluginManager().callEvent(event); this.server.server.getPluginManager().callEvent(event);
} }
this.locale = packet.language; this.locale = packet.language;
@ -2355,7 +2355,7 @@ index e8f748a7af40637b6aa5e0b032de909316e1161f..8105a30251c45b4ab111c97d34029c66
// CraftBukkit end // CraftBukkit end
this.chatVisibility = packet.chatVisibility(); this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff7ff70a5c 100644 index eebd9792338f912e60a9b0ab4de0660888b841f6..a1b9a2eeba2febef1b568a4c5aea99829210dbe1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,8 @@ import net.minecraft.world.phys.shapes.VoxelShape; @@ -187,6 +187,8 @@ import net.minecraft.world.phys.shapes.VoxelShape;
@ -2430,7 +2430,7 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
// CraftBukkit end // CraftBukkit end
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> {
@@ -1784,9 +1789,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1783,9 +1788,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
*/ */
this.player.disconnect(); this.player.disconnect();
@ -2445,7 +2445,7 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
} }
// CraftBukkit end // CraftBukkit end
this.player.getTextFilter().leave(); this.player.getTextFilter().leave();
@@ -1883,11 +1890,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1882,11 +1889,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent()); CompletableFuture<FilteredText> completablefuture = this.filterTextPacket(playerchatmessage.signedContent());
@ -2459,7 +2459,7 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
this.broadcastChatMessage(playerchatmessage1); this.broadcastChatMessage(playerchatmessage1);
}, this.server.chatExecutor); // CraftBukkit - async chat }, this.server.chatExecutor); // CraftBukkit - async chat
@@ -1993,7 +2000,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1992,7 +1999,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment); Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);
if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
@ -2468,7 +2468,7 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
return Optional.empty(); return Optional.empty();
} else { } else {
this.player.resetLastActionTime(); this.player.resetLastActionTime();
@@ -2051,7 +2058,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2050,7 +2057,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.handleCommand(s); this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
@ -2482,7 +2482,7 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
Player player = this.getCraftPlayer(); Player player = this.getCraftPlayer();
AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server));
String originalFormat = event.getFormat(), originalMessage = event.getMessage(); String originalFormat = event.getFormat(), originalMessage = event.getMessage();
@@ -2181,7 +2193,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2180,7 +2192,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
}); });
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Re-add "Command Only" flag check
@ -2491,44 +2491,6 @@ index d4065032c7d9f37c1f64f61d67f7204139e3b493..531c8e74e7aa81a483650ec891a994ff
} else { } else {
this.chat(s, message, true); this.chat(s, message, true);
} }
@@ -3003,30 +3015,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return;
}
- // CraftBukkit start
+ // CraftBukkit start // Paper start - Adventure
Player player = this.player.getBukkitEntity();
int x = packet.getPos().getX();
int y = packet.getPos().getY();
int z = packet.getPos().getZ();
- String[] lines = new String[4];
+ List<net.kyori.adventure.text.Component> lines = new java.util.ArrayList<>();
for (int i = 0; i < signText.size(); ++i) {
FilteredText filteredtext = (FilteredText) signText.get(i);
if (this.player.isTextFilteringEnabled()) {
- lines[i] = ChatFormatting.stripFormatting(filteredtext.filteredOrEmpty());
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty())); // Paper - adventure
} else {
- lines[i] = ChatFormatting.stripFormatting(filteredtext.raw());
+ lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw())); // Paper - adventure
}
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);
this.cserver.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- Component[] components = org.bukkit.craftbukkit.block.CraftSign.sanitizeLines(event.getLines());
- for (int i = 0; i < components.length; i++) {
- tileentitysign.setMessage(i, components[i]);
+ for (int i = 0; i < 4; i++) {
+ tileentitysign.setMessage(i, PaperAdventure.asVanilla(event.line(i)));
}
+ // Paper end
tileentitysign.isEditable = false;
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 1aae5c4c85efbaab626fa3776252b046618ae1cc..7983033160b77e28eb8135f8709dacd6b806ebe3 100644 index 1aae5c4c85efbaab626fa3776252b046618ae1cc..7983033160b77e28eb8135f8709dacd6b806ebe3 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@ -2571,7 +2533,7 @@ index 1cb95db25a20d38faacd99a5805630c1598e9db3..d99b2235038eb1aba8cda474c4aa51e2
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8526cd32a 100644 index c48318d9d5882dd87e423aecf27c31994af42bdb..e65c889dd1a84a1a8959d1cb80a8c233c3600a6f 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils; @@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
@ -2582,7 +2544,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
import java.io.File; import java.io.File;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.nio.file.Path; import java.nio.file.Path;
@@ -276,7 +277,7 @@ public abstract class PlayerList { @@ -283,7 +284,7 @@ public abstract class PlayerList {
} }
// CraftBukkit start // CraftBukkit start
ichatmutablecomponent.withStyle(ChatFormatting.YELLOW); ichatmutablecomponent.withStyle(ChatFormatting.YELLOW);
@ -2591,7 +2553,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
ServerStatus serverping = this.server.getStatus(); ServerStatus serverping = this.server.getStatus();
@@ -297,19 +298,18 @@ public abstract class PlayerList { @@ -304,19 +305,18 @@ public abstract class PlayerList {
// Ensure that player inventory is populated with its viewer // Ensure that player inventory is populated with its viewer
player.containerMenu.transferTo(player.containerMenu, bukkitPlayer); player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
@ -2616,16 +2578,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
} }
// CraftBukkit end // CraftBukkit end
@@ -506,7 +506,7 @@ public abstract class PlayerList { @@ -524,7 +524,7 @@ public abstract class PlayerList {
}
- public String remove(ServerPlayer entityplayer) { // CraftBukkit - return string
+ public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // Paper - return Component
ServerLevel worldserver = entityplayer.getLevel();
entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -517,7 +517,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(); entityplayer.closeContainer();
} }
@ -2634,7 +2587,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
this.cserver.getPluginManager().callEvent(playerQuitEvent); this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
@@ -570,7 +570,7 @@ public abstract class PlayerList { @@ -577,7 +577,7 @@ public abstract class PlayerList {
this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity()); this.cserver.getScoreboardManager().removePlayer(entityplayer.getBukkitEntity());
// CraftBukkit end // CraftBukkit end
@ -2643,7 +2596,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
} }
// CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer // CraftBukkit start - Whole method, SocketAddress to LoginListener, added hostname to signature, return EntityPlayer
@@ -616,10 +616,10 @@ public abstract class PlayerList { @@ -623,10 +623,10 @@ public abstract class PlayerList {
} }
// return chatmessage; // return chatmessage;
@ -2656,7 +2609,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
} else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) {
IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); IpBanListEntry ipbanentry = this.ipBans.get(socketaddress);
@@ -629,17 +629,17 @@ public abstract class PlayerList { @@ -636,17 +636,17 @@ public abstract class PlayerList {
} }
// return chatmessage; // return chatmessage;
@ -2677,7 +2630,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
return null; return null;
} }
return entity; return entity;
@@ -1150,7 +1150,7 @@ public abstract class PlayerList { @@ -1157,7 +1157,7 @@ public abstract class PlayerList {
public void removeAll() { public void removeAll() {
// CraftBukkit start - disconnect safely // CraftBukkit start - disconnect safely
for (ServerPlayer player : this.players) { for (ServerPlayer player : this.players) {
@ -2686,7 +2639,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
} }
// CraftBukkit end // CraftBukkit end
@@ -1191,24 +1191,43 @@ public abstract class PlayerList { @@ -1198,24 +1198,43 @@ public abstract class PlayerList {
} }
public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) { public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) {
@ -2733,7 +2686,7 @@ index 9909208363443a216cf689197f103d9e79119bbf..857ce5715e4ea68df2964a3f6595cdb8
} }
if (flag1 && sender != null) { if (flag1 && sender != null) {
@@ -1217,7 +1236,7 @@ public abstract class PlayerList { @@ -1224,7 +1243,7 @@ public abstract class PlayerList {
} }
@ -2830,8 +2783,20 @@ index 4c62df5a3781ec9df4a5c5f1b528649e6e8a62d1..affd1b8c7589ba59330dc0b6fc803cce
return this.createWorldFog; return this.createWorldFog;
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 8e35fecb84fb9ed61cb31d218f8a21bb7cabeb48..5ba1c6a8e266883a1342815ec54f13df9054165b 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -185,6 +185,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
} else {
SignBlockEntity.LOGGER.warn("Player {} just tried to change non-editable sign", player.getName().getString());
+ if (player.distanceToSqr(this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ()) < 32 * 32) // Paper
((ServerPlayer) player).connection.send(this.getUpdatePacket()); // CraftBukkit
}
}
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 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 0e04e7467ee27ea9e3ef60fe598cc21ab39f4c68..0f5e92a2256fe22b55d2428f98db403ad1b8834d 100644 index 614e567eb1ef10ac7514909a8425e29ac3627d3d..60596c4ac2ebb8caf19d65591624275ba63b0199 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -33,6 +33,7 @@ import net.minecraft.world.level.saveddata.SavedData; @@ -33,6 +33,7 @@ import net.minecraft.world.level.saveddata.SavedData;
@ -2852,7 +2817,7 @@ index 0e04e7467ee27ea9e3ef60fe598cc21ab39f4c68..0f5e92a2256fe22b55d2428f98db403a
} }
collection = icons; collection = icons;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe90887c110 100644 index 9874d0d3ae16e79f2598d9c1f93a9b7cc40f56b0..19fdfbe49108b1e757ed89d995f5440815c51311 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -608,8 +608,10 @@ public final class CraftServer implements Server { @@ -608,8 +608,10 @@ public final class CraftServer implements Server {
@ -2866,7 +2831,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
} }
@Override @Override
@@ -1462,7 +1464,15 @@ public final class CraftServer implements Server { @@ -1460,7 +1462,15 @@ public final class CraftServer implements Server {
return this.configuration.getInt("settings.spawn-radius", -1); return this.configuration.getInt("settings.spawn-radius", -1);
} }
@ -2882,7 +2847,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
public String getShutdownMessage() { public String getShutdownMessage() {
return this.configuration.getString("settings.shutdown-message"); return this.configuration.getString("settings.shutdown-message");
} }
@@ -1630,7 +1640,20 @@ public final class CraftServer implements Server { @@ -1628,7 +1638,20 @@ public final class CraftServer implements Server {
} }
@Override @Override
@ -2903,7 +2868,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
Set<CommandSender> recipients = new HashSet<>(); Set<CommandSender> recipients = new HashSet<>();
for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) { if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
@@ -1638,14 +1661,14 @@ public final class CraftServer implements Server { @@ -1636,14 +1659,14 @@ public final class CraftServer implements Server {
} }
} }
@ -2920,7 +2885,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
for (CommandSender recipient : recipients) { for (CommandSender recipient : recipients) {
recipient.sendMessage(message); recipient.sendMessage(message);
@@ -1896,6 +1919,14 @@ public final class CraftServer implements Server { @@ -1894,6 +1917,14 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, type); return CraftInventoryCreator.INSTANCE.createInventory(owner, type);
} }
@ -2935,7 +2900,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
@Override @Override
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type); Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type);
@@ -1908,13 +1939,28 @@ public final class CraftServer implements Server { @@ -1906,13 +1937,28 @@ public final class CraftServer implements Server {
return CraftInventoryCreator.INSTANCE.createInventory(owner, size); return CraftInventoryCreator.INSTANCE.createInventory(owner, size);
} }
@ -2964,7 +2929,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
public Merchant createMerchant(String title) { public Merchant createMerchant(String title) {
return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title);
} }
@@ -1979,6 +2025,12 @@ public final class CraftServer implements Server { @@ -1977,6 +2023,12 @@ public final class CraftServer implements Server {
return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
} }
@ -2977,7 +2942,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
@Override @Override
public String getMotd() { public String getMotd() {
return this.console.getMotd(); return this.console.getMotd();
@@ -2405,4 +2457,53 @@ public final class CraftServer implements Server { @@ -2403,4 +2455,53 @@ public final class CraftServer implements Server {
return this.spigot; return this.spigot;
} }
// Spigot end // Spigot end
@ -3032,7 +2997,7 @@ index 1177d64793be0d82c99dcd9e037c3e4cef2f74d3..26033d5f44efe81cab9085155587afe9
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e75f3d6f0c14f49cb828e919e12d0f69c898d46f..7a3e6cc4d29d541c1075d5956b0b72f7aa8269da 100644 index c8a035d396a56e3f4c437c5524e8e67a946b1674..1440b6b8b71ece71b076601752b06bdcff45542f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -153,6 +153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -153,6 +153,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@ -3103,7 +3068,7 @@ index e75f3d6f0c14f49cb828e919e12d0f69c898d46f..7a3e6cc4d29d541c1075d5956b0b72f7
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index e8fb9e3454282ad328e6bc0d078142285d9cfa76..ab22205c758768cd0c8a4fc6bca3d7de2e823078 100644 index 60ca15373b489941555315bf6fb311326670e7de..15b886634112b2a18b7952107b49ae1430376a3d 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -20,6 +20,12 @@ public class Main { @@ -20,6 +20,12 @@ public class Main {
@ -3213,11 +3178,11 @@ index 0beb96dc896f63003e1b1ae458b73902bdbe648a..102eb86bad3000f258775ac06ecd1a6d
public String getCustomName() { public String getCustomName() {
EnchantmentTableBlockEntity enchant = this.getSnapshot(); EnchantmentTableBlockEntity enchant = this.getSnapshot();
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
index 3bdf17b1cc28c390e40299c3edf7941f98393661..46b18cac2c40db01ebd29528d529fe631b03ddbb 100644 index 0d5ea9d065f0b471a97b84ffc80fadc9e7953d04..1a49daed4fe43d4513561e03937374c312d09efb 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
@@ -23,6 +23,23 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState< @@ -25,6 +25,23 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
this.front = new CraftSignSide(this.getSnapshot()); this.back = new CraftSignSide(this.getSnapshot().getBackText());
} }
+ // Paper start + // Paper start
@ -3240,8 +3205,8 @@ index 3bdf17b1cc28c390e40299c3edf7941f98393661..46b18cac2c40db01ebd29528d529fe63
@Override @Override
public String[] getLines() { public String[] getLines() {
return this.front.getLines(); return this.front.getLines();
@@ -94,6 +111,20 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState< @@ -103,6 +120,20 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
((CraftPlayer) player).getHandle().openTextEdit(handle); ((CraftPlayer) player).getHandle().openTextEdit(handle, true);
} }
+ // Paper start + // Paper start
@ -3262,10 +3227,10 @@ index 3bdf17b1cc28c390e40299c3edf7941f98393661..46b18cac2c40db01ebd29528d529fe63
Component[] components = new Component[4]; Component[] components = new Component[4];
diff --git a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java
index 5a6bd104a823f011a977f5d8a681dc9d29fbe8f6..e38414fe568e0d84ecacf71dd85c1a12ec7bc053 100644 index d9cc425919d3c07607e36557a5b109e0212483c7..0c3716e5e91a9791b28f4d308d99dbac90e7f34b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java --- a/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java +++ b/src/main/java/org/bukkit/craftbukkit/block/sign/CraftSignSide.java
@@ -11,36 +11,69 @@ import org.jetbrains.annotations.Nullable; @@ -12,37 +12,69 @@ import org.jetbrains.annotations.Nullable;
public class CraftSignSide implements SignSide { public class CraftSignSide implements SignSide {
// Lazily initialized only if requested: // Lazily initialized only if requested:
@ -3275,9 +3240,9 @@ index 5a6bd104a823f011a977f5d8a681dc9d29fbe8f6..e38414fe568e0d84ecacf71dd85c1a12
+ private java.util.ArrayList<net.kyori.adventure.text.Component> originalLines = null; // ArrayList for RandomAccess + private java.util.ArrayList<net.kyori.adventure.text.Component> originalLines = null; // ArrayList for RandomAccess
+ private java.util.ArrayList<net.kyori.adventure.text.Component> lines = null; // ArrayList for RandomAccess + private java.util.ArrayList<net.kyori.adventure.text.Component> lines = null; // ArrayList for RandomAccess
+ // Paper end + // Paper end
private final SignBlockEntity signText; private final SignText signText;
public CraftSignSide(SignBlockEntity signText) { public CraftSignSide(SignText signText) {
this.signText = signText; this.signText = signText;
} }
@ -3305,7 +3270,7 @@ index 5a6bd104a823f011a977f5d8a681dc9d29fbe8f6..e38414fe568e0d84ecacf71dd85c1a12
+ return; + return;
+ } + }
+ // Lazy initialization: + // Lazy initialization:
+ this.lines = io.papermc.paper.adventure.PaperAdventure.asAdventure(com.google.common.collect.Lists.newArrayList(this.signText.messages)); + this.lines = io.papermc.paper.adventure.PaperAdventure.asAdventure(com.google.common.collect.Lists.newArrayList(this.signText.getMessages(false)));
+ this.originalLines = new java.util.ArrayList<>(this.lines); + this.originalLines = new java.util.ArrayList<>(this.lines);
+ } + }
+ // Paper end + // Paper end
@ -3315,8 +3280,9 @@ index 5a6bd104a823f011a977f5d8a681dc9d29fbe8f6..e38414fe568e0d84ecacf71dd85c1a12
public String[] getLines() { public String[] getLines() {
- if (this.lines == null) { - if (this.lines == null) {
- // Lazy initialization: - // Lazy initialization:
- this.lines = new String[signText.messages.length]; - Component[] messages = this.signText.getMessages(false);
- System.arraycopy(CraftSign.revertComponents(signText.messages), 0, lines, 0, lines.length); - this.lines = new String[messages.length];
- System.arraycopy(CraftSign.revertComponents(messages), 0, lines, 0, lines.length);
- this.originalLines = new String[lines.length]; - this.originalLines = new String[lines.length];
- System.arraycopy(lines, 0, originalLines, 0, originalLines.length); - System.arraycopy(lines, 0, originalLines, 0, originalLines.length);
- } - }
@ -3347,7 +3313,7 @@ index 5a6bd104a823f011a977f5d8a681dc9d29fbe8f6..e38414fe568e0d84ecacf71dd85c1a12
} }
@Override @Override
@@ -66,13 +99,16 @@ public class CraftSignSide implements SignSide { @@ -68,13 +100,16 @@ public class CraftSignSide implements SignSide {
public void applyLegacyStringToSignSide() { public void applyLegacyStringToSignSide() {
if (this.lines != null) { if (this.lines != null) {
@ -3506,7 +3472,7 @@ index f6c614bb1184f9c79121f64a2a030bf3f094b671..e8334e2264510f5101e80b4f130e7ae1
public net.minecraft.world.item.enchantment.Enchantment getHandle() { public net.minecraft.world.item.enchantment.Enchantment getHandle() {
return this.target; return this.target;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index cf9bbc1334a151dfd96be91e6f2cf3cb9afd9384..2849f70314f1cd8aeac38c8ab37d293732d4504c 100644 index 6807507017bbb171657ba230223f281b083da28a..db585082251005e2d2f861a0b292f229bd43485d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -202,6 +202,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -202,6 +202,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -3569,7 +3535,7 @@ index cf9bbc1334a151dfd96be91e6f2cf3cb9afd9384..2849f70314f1cd8aeac38c8ab37d2937
@Override @Override
public boolean isPermissionSet(String name) { public boolean isPermissionSet(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 1ea310624abbc949eaa16c1e2b85de6c31dd3d43..a26743682edcd9329d70ae1ff38310c8379f94e1 100644 index 32e1b60876482035c9fbd0dfc5d1a47947eabb38..d39869056d0ac57279e0e9e479ace4a7d402a941 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -322,9 +322,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -322,9 +322,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@ -3621,7 +3587,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa
public boolean isOp() { public boolean isOp() {
return true; return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac96fbc8007 100644 index a3a8c94b576c917428ac5c8fcab3f75b6e28880b..2118aac177923da4239ccd926af0daab87268bc8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -285,14 +285,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -285,14 +285,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -3740,7 +3706,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
@Override @Override
public void setCompassTarget(Location loc) { public void setCompassTarget(Location loc) {
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;
@@ -706,6 +748,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -711,6 +753,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet); this.getHandle().connection.send(packet);
} }
@ -3765,7 +3731,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
@Override @Override
public void sendSignChange(Location loc, String[] lines) { public void sendSignChange(Location loc, String[] lines) {
this.sendSignChange(loc, lines, DyeColor.BLACK); this.sendSignChange(loc, lines, DyeColor.BLACK);
@@ -733,6 +793,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -738,6 +798,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
Component[] components = CraftSign.sanitizeLines(lines); Component[] components = CraftSign.sanitizeLines(lines);
@ -3775,10 +3741,10 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
+ +
+ private void sendSignChange0(Component[] components, Location loc, DyeColor dyeColor, boolean hasGlowingText) { + private void sendSignChange0(Component[] components, Location loc, DyeColor dyeColor, boolean hasGlowingText) {
SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState()); SignBlockEntity sign = new SignBlockEntity(CraftLocation.toBlockPosition(loc), Blocks.OAK_SIGN.defaultBlockState());
sign.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData())); SignText text = sign.getFrontText();
sign.setHasGlowingText(hasGlowingText); text.setColor(net.minecraft.world.item.DyeColor.byId(dyeColor.getWoolData()));
@@ -740,7 +805,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -746,7 +811,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
sign.setMessage(i, components[i]); text.setMessage(i, components[i]);
} }
- this.getHandle().connection.send(sign.getUpdatePacket()); - this.getHandle().connection.send(sign.getUpdatePacket());
@ -3787,7 +3753,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
} }
@Override @Override
@@ -1633,7 +1699,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1639,7 +1705,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void setResourcePack(String url) { public void setResourcePack(String url) {
@ -3796,7 +3762,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
} }
@Override @Override
@@ -1648,7 +1714,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1654,7 +1720,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public void setResourcePack(String url, byte[] hash, boolean force) { public void setResourcePack(String url, byte[] hash, boolean force) {
@ -3805,7 +3771,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
} }
@Override @Override
@@ -1664,6 +1730,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1670,6 +1736,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }
@ -3827,7 +3793,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
public void addChannel(String channel) { public void addChannel(String channel) {
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
channel = StandardMessenger.validateAndCorrectChannel(channel); channel = StandardMessenger.validateAndCorrectChannel(channel);
@@ -2068,6 +2149,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2074,6 +2155,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance; return (this.getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : this.getHandle().clientViewDistance;
} }
@ -3840,7 +3806,7 @@ index 4176633bf32c1e28694f3af1cda2033df05bca94..2162df3654bcad4073f499138f9faac9
@Override @Override
public int getPing() { public int getPing() {
return this.getHandle().latency; return this.getHandle().latency;
@@ -2118,6 +2205,232 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2124,6 +2211,232 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return this.getHandle().allowsListing(); return this.getHandle().allowsListing();
} }
@ -4096,7 +4062,7 @@ index 2becf197a5c2d94f23f72a9b20cb2cd05a0807df..99096c1e3f045e4a99335faedfb8e77e
@Override @Override
public int getLineWidth() { public int getLineWidth() {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f81248294a4ccc4a9c88b071654f8a62713e397c..f1dc8eaa571f54e5885ceada9929d965992d7760 100644 index 3c3d5a527604d6f14abb1815816153747fcc0839..1b9a08098199f305606289724ee047e8075ffcea 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -838,9 +838,9 @@ public class CraftEventFactory { @@ -838,9 +838,9 @@ public class CraftEventFactory {
@ -4121,7 +4087,7 @@ index f81248294a4ccc4a9c88b071654f8a62713e397c..f1dc8eaa571f54e5885ceada9929d965
return event; return event;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index a2b1e3a8747cc26c617f06f9000b7b40b5b9c6c7..fe54d5cb2414c7b6f42d192c74f810e7b5e43f0e 100644 index 7cd70d53e5816938beab9019db40cd7faedba745..8ea031537c27b219c22316bff191670c48ebd602 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -72,6 +72,13 @@ public class CraftContainer extends AbstractContainerMenu { @@ -72,6 +72,13 @@ public class CraftContainer extends AbstractContainerMenu {
@ -4243,10 +4209,10 @@ index 4dd9a80af9901287ab6740b072f2b89678c3d0cb..b2586684295b295a3196a2a9cf724cec
public String getTitle() { public String getTitle() {
return this.title; return this.title;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 309a0a7e26651a7a675326382df838b423830f33..eeb01a1b54e450f95b33864b030d2183d29309da 100644 index 4f9be48ebe8ec71272b19c9ab43c293cc069011f..6e050a5cbb877c85595fc97a569c2aafb272ad41 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -440,4 +440,17 @@ public final class CraftItemFactory implements ItemFactory { @@ -442,4 +442,17 @@ public final class CraftItemFactory implements ItemFactory {
public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException { public Material updateMaterial(ItemMeta meta, Material material) throws IllegalArgumentException {
return ((CraftMetaItem) meta).updateMaterial(material); return ((CraftMetaItem) meta).updateMaterial(material);
} }
@ -4866,7 +4832,7 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318
boolean hadFormat = false; boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 3c41b9d3d7bdb0b2657eeb337499dfcca5ec4068..e785bf77ddb37b2409fbc5982927161b36504fb7 100644 index 381cfd86fc1158dc9a7c1e76c3ada962b0964373..0137b414a75894cb8b8413f96eba4f591453f61b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -74,6 +74,43 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -74,6 +74,43 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -603,7 +603,7 @@ index 0000000000000000000000000000000000000000..ae60bd96b5284d54676d8e7e4dd5d170
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 1fe07773cf9664164b29164caba22800e5a6bdae..cb6f192c11cda6230ec365e6cefb44a37416236d 100644 index 2ac30ef2dd72582f2b7f6a05b1f94b12b44fafc9..a01d423f44b3e547b4fa4d6654f9df636d69525f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -186,6 +186,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -186,6 +186,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -615,7 +615,7 @@ index 1fe07773cf9664164b29164caba22800e5a6bdae..cb6f192c11cda6230ec365e6cefb44a3
this.setPvpAllowed(dedicatedserverproperties.pvp); this.setPvpAllowed(dedicatedserverproperties.pvp);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 26033d5f44efe81cab9085155587afe90887c110..6752bae2a976906609d05e3d0c8a18c7413fa5b1 100644 index 19fdfbe49108b1e757ed89d995f5440815c51311..6024046b18027e7db68280b957e964605a9854a7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -927,6 +927,7 @@ public final class CraftServer implements Server { @@ -927,6 +927,7 @@ public final class CraftServer implements Server {
@ -626,7 +626,7 @@ index 26033d5f44efe81cab9085155587afe90887c110..6752bae2a976906609d05e3d0c8a18c7
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2497,6 +2498,34 @@ public final class CraftServer implements Server { @@ -2495,6 +2496,34 @@ public final class CraftServer implements Server {
// Paper end // Paper end
// Paper start // Paper start

View File

@ -698,7 +698,7 @@ index 0000000000000000000000000000000000000000..6aaed8e8bf8c721fc834da5c76ac72a4
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index cb6f192c11cda6230ec365e6cefb44a37416236d..11006df8797334da69801cdb9aa34b0f941cf90d 100644 index a01d423f44b3e547b4fa4d6654f9df636d69525f..59eed41e1c6012650597f1faa85063a2d536873f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -187,6 +187,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -187,6 +187,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface

View File

@ -6928,10 +6928,10 @@ index f7114d5b8f2f93f62883e24da29afaf9f74ee1a6..8bf0630c0e06950cd99b7ae9898137f7
return foundFrame.orElse(null); return foundFrame.orElse(null);
diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
index a969cd46694ce3094b4a65cf188677d38ae72198..35c9af90dfcb99fac58577174115b59b0d1262ca 100644 index baa88201c4d08fb4f32f1198e187d7ca138b0f0e..7d09adf27da249851cfc87b7916b915240a65a7e 100644
--- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java --- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
+++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java +++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
@@ -312,7 +312,13 @@ public class BuiltInRegistries { @@ -319,7 +319,13 @@ public class BuiltInRegistries {
} }
public static void bootStrap() { public static void bootStrap() {
@ -6946,24 +6946,23 @@ index a969cd46694ce3094b4a65cf188677d38ae72198..35c9af90dfcb99fac58577174115b59b
validate(REGISTRY); validate(REGISTRY);
} }
diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java
index b5aa358638b9d0638dfe47f7ebac04cca1dd80b9..e43096e69a00f9ea96badd7c966443cfcf3e7b95 100644 index 1eabd8b5a99850298838b11ba97e3d220f444378..89343863d0cf58ff65c66230855e1e83df078e26 100644
--- a/src/main/java/net/minecraft/server/Bootstrap.java --- a/src/main/java/net/minecraft/server/Bootstrap.java
+++ b/src/main/java/net/minecraft/server/Bootstrap.java +++ b/src/main/java/net/minecraft/server/Bootstrap.java
@@ -69,7 +69,11 @@ public class Bootstrap { @@ -77,6 +77,11 @@ public class Bootstrap {
EntitySelectorOptions.bootStrap();
DispenseItemBehavior.bootStrap(); DispenseItemBehavior.bootStrap();
CauldronInteraction.bootStrap(); CauldronInteraction.bootStrap();
- BuiltInRegistries.bootStrap(); BuiltInRegistries.bootStrap();
+ // Paper start + // Paper start
+ BuiltInRegistries.bootStrap(() -> { + BuiltInRegistries.bootStrap(() -> {
+ io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enterBootstrappers(); // Paper - Entrypoint for bootstrapping + io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enterBootstrappers(); // Paper - Entrypoint for bootstrapping
+ }); + });
+ // Paper end + // Paper end
CreativeModeTabs.validate();
Bootstrap.wrapStreams(); Bootstrap.wrapStreams();
} Bootstrap.bootstrapDuration.set(Duration.between(instant, Instant.now()).toMillis());
// CraftBukkit start - easier than fixing the decompile
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index aa054369cef3da4f90ce17788dcb9ca80dc98010..d9f2518a08bc4ae978051be51e467597f9325ecb 100644 index 35e7f8e7b19c217fa5f3f55abb0f8b9cd6b16f18..72c2f0bf9434e09a0dd51294d3a2200f1e0ed1b1 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -122,6 +122,7 @@ public class Main { @@ -122,6 +122,7 @@ public class Main {
@ -6975,7 +6974,7 @@ index aa054369cef3da4f90ce17788dcb9ca80dc98010..d9f2518a08bc4ae978051be51e467597
Bootstrap.validate(); Bootstrap.validate();
Util.startTimerHackThread(); Util.startTimerHackThread();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6752bae2a976906609d05e3d0c8a18c7413fa5b1..6e1f782938992debbfd9617ab9e2cce4e423876c 100644 index 6024046b18027e7db68280b957e964605a9854a7..5acdd3253a33d9c9f5e1af955b6e1dc072f77858 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -269,7 +269,8 @@ public final class CraftServer implements Server { @@ -269,7 +269,8 @@ public final class CraftServer implements Server {
@ -7064,7 +7063,7 @@ index 909b2c98e7a9117d2f737245e4661792ffafb744..d96399e9bf1a58db5a4a22e58abb99e7
@Override @Override
public FileConfiguration getConfig() { public FileConfiguration getConfig() {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index e785bf77ddb37b2409fbc5982927161b36504fb7..a90bfabd166afcd248c5d467d18ec9c0324b7858 100644 index 0137b414a75894cb8b8413f96eba4f591453f61b..39a9a47ce7150445e1b00a32152c0429b3114302 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -439,6 +439,12 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -439,6 +439,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@ -7873,7 +7872,7 @@ index 0000000000000000000000000000000000000000..ba271c35eb2804f94cfc893bf94affb9
+ } + }
+} +}
diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java diff --git a/src/test/java/io/papermc/paper/testing/DummyServer.java b/src/test/java/io/papermc/paper/testing/DummyServer.java
index c6503ff76f56bab5f383f0ca17d137155e9be447..f3db8d2875eaef86223da51b30e9dd722d417daa 100644 index e944e9dca13883c57e93e480ae5adfe51c342532..f482cb4dc5394de3cf88b4c4e13c18f9c61caf45 100644
--- a/src/test/java/io/papermc/paper/testing/DummyServer.java --- a/src/test/java/io/papermc/paper/testing/DummyServer.java
+++ b/src/test/java/io/papermc/paper/testing/DummyServer.java +++ b/src/test/java/io/papermc/paper/testing/DummyServer.java
@@ -58,7 +58,7 @@ public final class DummyServer { @@ -58,7 +58,7 @@ public final class DummyServer {

View File

@ -732,7 +732,7 @@ index fc4dcd801480fe6d89a985de411baa9a3a66f6ef..4a1148a76020089caf01f888f87afdbb
} catch (Exception exception) { } catch (Exception exception) {
if (listener.shouldPropagateHandlingExceptions()) { if (listener.shouldPropagateHandlingExceptions()) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022db631a903 100644 index 2d35572157b28f2e637d9b47a82c5e7adecde96e..96897d883671e018bae5f71545c5f7af205e309c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -189,7 +189,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent; @@ -189,7 +189,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
@ -744,7 +744,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
@@ -865,6 +865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -863,6 +863,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");
@ -752,7 +752,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@@ -1103,9 +1104,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1101,9 +1102,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean haveTime() { private boolean haveTime() {
// CraftBukkit start // CraftBukkit start
@ -774,7 +774,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
private void executeModerately() { private void executeModerately() {
this.runAllTasks(); this.runAllTasks();
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
@@ -1113,9 +1126,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1111,9 +1124,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end // CraftBukkit end
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
@ -786,7 +786,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
}); });
} }
@@ -1200,9 +1213,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1198,9 +1211,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {} public void onServerExit() {}
public void tickServer(BooleanSupplier shouldKeepTicking) { public void tickServer(BooleanSupplier shouldKeepTicking) {
@ -805,7 +805,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
++this.tickCount; ++this.tickCount;
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
@@ -1211,15 +1232,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1209,15 +1230,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@ -826,7 +826,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
this.profiler.push("tallying"); this.profiler.push("tallying");
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1229,8 +1253,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1227,8 +1251,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.frameTimer.logFrameDuration(k - i); this.frameTimer.logFrameDuration(k - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@ -836,7 +836,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
} }
private ServerStatus buildServerStatus() { private ServerStatus buildServerStatus() {
@@ -1262,26 +1285,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1260,26 +1283,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void tickChildren(BooleanSupplier shouldKeepTicking) { public void tickChildren(BooleanSupplier shouldKeepTicking) {
@ -870,8 +870,8 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) { if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -1289,7 +1312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1287,7 +1310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level().getGameTime(), entityplayer.getPlayerTime(), entityplayer.level().getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
} }
} }
- SpigotTimings.timeUpdateTimer.stopTiming(); // Spigot - SpigotTimings.timeUpdateTimer.stopTiming(); // Spigot
@ -879,7 +879,7 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -1335,24 +1358,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1333,24 +1356,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.popPush("connection"); this.profiler.popPush("connection");
@ -911,10 +911,10 @@ index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022d
this.profiler.pop(); this.profiler.pop();
} }
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
index f20320a5278ebf647e2b05a6165d87705c57f9cd..6483a1d461904a0584b6808b2f86ac7329bba963 100644 index 009ef03e520aeb57b29b5375a65634ed76aa9163..4a610b712acfe0b1b4dcf4988bc22c6a71616050 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java --- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java +++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
@@ -88,7 +88,7 @@ public class ServerFunctionManager { @@ -89,7 +89,7 @@ public class ServerFunctionManager {
} else { } else {
int i; int i;
@ -924,7 +924,7 @@ index f20320a5278ebf647e2b05a6165d87705c57f9cd..6483a1d461904a0584b6808b2f86ac73
i = this.context.runTopCommand(function, source); i = this.context.runTopCommand(function, source);
} finally { } finally {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 11006df8797334da69801cdb9aa34b0f941cf90d..5e5c4de89784db702256ee765091e929066116e4 100644 index 59eed41e1c6012650597f1faa85063a2d536873f..51eac8b7177db66c005e4eaca689cf96d10edeaa 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -58,8 +58,9 @@ import org.apache.logging.log4j.Level; @@ -58,8 +58,9 @@ import org.apache.logging.log4j.Level;
@ -956,7 +956,7 @@ index 11006df8797334da69801cdb9aa34b0f941cf90d..5e5c4de89784db702256ee765091e929
} }
@Override @Override
@@ -665,6 +666,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -667,6 +668,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override @Override
public String runCommand(String command) { public String runCommand(String command) {
@ -964,7 +964,7 @@ index 11006df8797334da69801cdb9aa34b0f941cf90d..5e5c4de89784db702256ee765091e929
this.rconConsoleSource.prepareForCommand(); this.rconConsoleSource.prepareForCommand();
this.executeBlocking(() -> { this.executeBlocking(() -> {
// CraftBukkit start - fire RemoteServerCommandEvent // CraftBukkit start - fire RemoteServerCommandEvent
@@ -673,10 +675,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -675,10 +677,39 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
if (event.isCancelled()) { if (event.isCancelled()) {
return; return;
} }
@ -1005,7 +1005,7 @@ index 11006df8797334da69801cdb9aa34b0f941cf90d..5e5c4de89784db702256ee765091e929
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 714b36e4942fda9d6c8a202b9e7a34ef67d3d13c..091c9e9bdbe4e956386df011ddf01cba42c30da1 100644 index c943e64d70bab240f8dc733e78a185172664c5e4..a645263f148a25e5b4baeed51775eb8e7f596fe8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
@ -1019,15 +1019,15 @@ index 714b36e4942fda9d6c8a202b9e7a34ef67d3d13c..091c9e9bdbe4e956386df011ddf01cba
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Queues; import com.google.common.collect.Queues;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -867,6 +869,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -886,6 +888,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
ChunkStatus chunkstatus = ChunkHolder.getStatus(chunkHolder.getTicketLevel()); ChunkStatus chunkstatus = ChunkLevel.generationStatus(chunkHolder.getTicketLevel());
return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> { return !chunkstatus.isOrAfter(ChunkStatus.FULL) ? ChunkHolder.UNLOADED_CHUNK : either.mapLeft((ichunkaccess) -> {
+ try (Timing ignored = level.timings.chunkPostLoad.startTimingIfSync()) { // Paper + try (Timing ignored = level.timings.chunkPostLoad.startTimingIfSync()) { // Paper
ChunkPos chunkcoordintpair = chunkHolder.getPos(); ChunkPos chunkcoordintpair = chunkHolder.getPos();
ProtoChunk protochunk = (ProtoChunk) ichunkaccess; ProtoChunk protochunk = (ProtoChunk) ichunkaccess;
LevelChunk chunk; LevelChunk chunk;
@@ -891,6 +894,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -910,6 +913,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
return chunk; return chunk;
@ -1035,7 +1035,7 @@ index 714b36e4942fda9d6c8a202b9e7a34ef67d3d13c..091c9e9bdbe4e956386df011ddf01cba
}); });
}, (runnable) -> { }, (runnable) -> {
ProcessorHandle mailbox = this.mainThreadMailbox; ProcessorHandle mailbox = this.mainThreadMailbox;
@@ -1443,6 +1447,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1465,6 +1469,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList(); List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players(); List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator(); ObjectIterator objectiterator = this.entityMap.values().iterator();
@ -1043,7 +1043,7 @@ index 714b36e4942fda9d6c8a202b9e7a34ef67d3d13c..091c9e9bdbe4e956386df011ddf01cba
ChunkMap.TrackedEntity playerchunkmap_entitytracker; ChunkMap.TrackedEntity playerchunkmap_entitytracker;
@@ -1467,14 +1472,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1489,14 +1494,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges(); playerchunkmap_entitytracker.serverEntity.sendChanges();
} }
} }
@ -1062,7 +1062,7 @@ index 714b36e4942fda9d6c8a202b9e7a34ef67d3d13c..091c9e9bdbe4e956386df011ddf01cba
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f982743e4 100644 index 07e1c75c0df7362ced6cffd125aec4fd553a9243..fc1afda5a60ab0f3c275f849d8af08d308b36c3f 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -415,13 +415,15 @@ public class ServerChunkCache extends ChunkSource { @@ -415,13 +415,15 @@ public class ServerChunkCache extends ChunkSource {
@ -1083,7 +1083,7 @@ index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
return ichunkaccess1; return ichunkaccess1;
}, (playerchunk_failure) -> { }, (playerchunk_failure) -> {
@@ -619,7 +621,9 @@ public class ServerChunkCache extends ChunkSource { @@ -620,7 +622,9 @@ public class ServerChunkCache extends ChunkSource {
public void save(boolean flush) { public void save(boolean flush) {
this.runDistanceManagerUpdates(); this.runDistanceManagerUpdates();
@ -1093,7 +1093,7 @@ index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f
} }
@Override @Override
@@ -658,7 +662,9 @@ public class ServerChunkCache extends ChunkSource { @@ -659,7 +663,9 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.doChunkMap.stopTiming(); // Spigot this.level.timings.doChunkMap.stopTiming(); // Spigot
this.level.getProfiler().popPush("chunks"); this.level.getProfiler().popPush("chunks");
if (tickChunks) { if (tickChunks) {
@ -1103,7 +1103,7 @@ index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f
} }
this.level.timings.doChunkUnload.startTiming(); // Spigot this.level.timings.doChunkUnload.startTiming(); // Spigot
@@ -687,13 +693,16 @@ public class ServerChunkCache extends ChunkSource { @@ -688,13 +694,16 @@ public class ServerChunkCache extends ChunkSource {
boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit boolean flag1 = level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && worlddata.getGameTime() % level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
gameprofilerfiller.push("naturalSpawnCount"); gameprofilerfiller.push("naturalSpawnCount");
@ -1120,7 +1120,7 @@ index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f
while (iterator.hasNext()) { while (iterator.hasNext()) {
ChunkHolder playerchunk = (ChunkHolder) iterator.next(); ChunkHolder playerchunk = (ChunkHolder) iterator.next();
@@ -722,27 +731,27 @@ public class ServerChunkCache extends ChunkSource { @@ -723,27 +732,27 @@ public class ServerChunkCache extends ChunkSource {
} }
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
@ -1154,7 +1154,7 @@ index 794ad2dbaea2555d4557124e9d942d3e6919ea09..28c8a3ba1caddf0ea334a6ef43cae25f
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be364a8dff 100644 index 7be97441aed66fa3a21d13ad2211b3e0e08120c0..7cb5abfa89f842194325d26c6e95b49460c5968f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
@ -1166,7 +1166,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.datafixers.DataFixer; import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.util.Pair; import com.mojang.datafixers.util.Pair;
@@ -162,7 +164,6 @@ import org.slf4j.Logger; @@ -165,7 +167,6 @@ import org.slf4j.Logger;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.WeatherType; import org.bukkit.WeatherType;
@ -1174,7 +1174,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.generator.CustomWorldChunkManager; import org.bukkit.craftbukkit.generator.CustomWorldChunkManager;
import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -451,7 +452,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -469,7 +470,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.updateSkyBrightness(); this.updateSkyBrightness();
this.tickTime(); this.tickTime();
gameprofilerfiller.popPush("tickPending"); gameprofilerfiller.popPush("tickPending");
@ -1183,7 +1183,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
if (!this.isDebug()) { if (!this.isDebug()) {
j = this.getGameTime(); j = this.getGameTime();
gameprofilerfiller.push("blockTicks"); gameprofilerfiller.push("blockTicks");
@@ -460,12 +461,16 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -478,12 +479,16 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.fluidTicks.tick(j, 65536, this::tickFluid); this.fluidTicks.tick(j, 65536, this::tickFluid);
gameprofilerfiller.pop(); gameprofilerfiller.pop();
} }
@ -1201,15 +1201,15 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
gameprofilerfiller.popPush("blockEvents"); gameprofilerfiller.popPush("blockEvents");
timings.doSounds.startTiming(); // Spigot timings.doSounds.startTiming(); // Spigot
this.runBlockEvents(); this.runBlockEvents();
@@ -649,6 +654,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -667,6 +672,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
gameprofilerfiller.popPush("tickBlocks"); gameprofilerfiller.popPush("tickBlocks");
+ timings.chunkTicksBlocks.startTiming(); // Paper + timings.chunkTicksBlocks.startTiming(); // Paper
if (randomTickSpeed > 0) { if (randomTickSpeed > 0) {
LevelChunkSection[] achunksection = chunk.getSections(); LevelChunkSection[] achunksection = chunk.getSections();
int j1 = achunksection.length;
@@ -681,6 +687,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -699,6 +705,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
} }
@ -1217,7 +1217,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
gameprofilerfiller.pop(); gameprofilerfiller.pop();
} }
@@ -915,14 +922,22 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -933,14 +940,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
public void tickNonPassenger(Entity entity) { public void tickNonPassenger(Entity entity) {
@ -1241,7 +1241,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
entity.setOldPosAndRot(); entity.setOldPosAndRot();
ProfilerFiller gameprofilerfiller = this.getProfiler(); ProfilerFiller gameprofilerfiller = this.getProfiler();
@@ -941,7 +956,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -959,7 +974,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickPassenger(entity, entity1); this.tickPassenger(entity, entity1);
} }
@ -1250,7 +1250,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
} }
@@ -983,6 +998,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1001,6 +1016,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!savingDisabled) { if (!savingDisabled) {
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit
@ -1258,7 +1258,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
if (progressListener != null) { if (progressListener != null) {
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel")); progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
} }
@@ -992,7 +1008,10 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1010,7 +1026,10 @@ public class ServerLevel extends Level implements WorldGenLevel {
progressListener.progressStage(Component.translatable("menu.savingChunks")); progressListener.progressStage(Component.translatable("menu.savingChunks"));
} }
@ -1270,7 +1270,7 @@ index aa164a81d072d9390fa1400120e801979e5d74d0..f2798373e7d07cc0e46c39297c29e7be
this.entityManager.saveAll(); this.entityManager.saveAll();
} else { } else {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 531c8e74e7aa81a483650ec891a994ff7ff70a5c..26128f53ee00ab914e9ec84ef45edfbb48005ab0 100644 index a1b9a2eeba2febef1b568a4c5aea99829210dbe1..403f7c7f31e0072b0cad0706bc981ece24733a1d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -339,7 +339,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -339,7 +339,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -1289,7 +1289,7 @@ index 531c8e74e7aa81a483650ec891a994ff7ff70a5c..26128f53ee00ab914e9ec84ef45edfbb
} }
@@ -2145,7 +2143,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2144,7 +2142,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
private void handleCommand(String s) { private void handleCommand(String s) {
@ -1298,7 +1298,7 @@ index 531c8e74e7aa81a483650ec891a994ff7ff70a5c..26128f53ee00ab914e9ec84ef45edfbb
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
@@ -2155,7 +2153,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2154,7 +2152,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.cserver.getPluginManager().callEvent(event); this.cserver.getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@ -1307,7 +1307,7 @@ index 531c8e74e7aa81a483650ec891a994ff7ff70a5c..26128f53ee00ab914e9ec84ef45edfbb
return; return;
} }
@@ -2168,7 +2166,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2167,7 +2165,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
return; return;
} finally { } finally {
@ -1317,7 +1317,7 @@ index 531c8e74e7aa81a483650ec891a994ff7ff70a5c..26128f53ee00ab914e9ec84ef45edfbb
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 857ce5715e4ea68df2964a3f6595cdb8526cd32a..7e91d802f4b97f0ede734e2cedcf3a81cb06af6c 100644 index e65c889dd1a84a1a8959d1cb80a8c233c3600a6f..b0fc8e4f369d656f90500ea3d64ceb27909b82ef 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -1327,7 +1327,7 @@ index 857ce5715e4ea68df2964a3f6595cdb8526cd32a..7e91d802f4b97f0ede734e2cedcf3a81
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1039,10 +1040,11 @@ public abstract class PlayerList { @@ -1046,10 +1047,11 @@ public abstract class PlayerList {
} }
public void saveAll() { public void saveAll() {
@ -1341,7 +1341,7 @@ index 857ce5715e4ea68df2964a3f6595cdb8526cd32a..7e91d802f4b97f0ede734e2cedcf3a81
public UserWhiteList getWhiteList() { public UserWhiteList getWhiteList() {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 956c39b6d0c208366508f2064f7b98270eebaedc..e3b5c93f42a2ef01ecc9f1827802f3014ada3a34 100644 index cde2df65bf2e33494c9e893d2c944c2e33f5419f..f668a80c6bff67bf766207985c1af73f09e1bd1c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -134,7 +134,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -134,7 +134,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent;
@ -1352,7 +1352,7 @@ index 956c39b6d0c208366508f2064f7b98270eebaedc..e3b5c93f42a2ef01ecc9f1827802f301
import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
@@ -303,7 +302,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -307,7 +306,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled
public boolean persistentInvisibility = false; public boolean persistentInvisibility = false;
public BlockPos lastLavaContact; public BlockPos lastLavaContact;
@ -1360,7 +1360,7 @@ index 956c39b6d0c208366508f2064f7b98270eebaedc..e3b5c93f42a2ef01ecc9f1827802f301
// Spigot start // Spigot start
public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState; public final boolean defaultActivationState;
@@ -753,7 +751,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -804,7 +802,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
public void move(MoverType movementType, Vec3 movement) { public void move(MoverType movementType, Vec3 movement) {
@ -1368,16 +1368,16 @@ index 956c39b6d0c208366508f2064f7b98270eebaedc..e3b5c93f42a2ef01ecc9f1827802f301
if (this.noPhysics) { if (this.noPhysics) {
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
} else { } else {
@@ -917,7 +914,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -965,7 +962,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.level.getProfiler().pop(); this.level().getProfiler().pop();
} }
} }
- org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
} }
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) { private boolean isStateClimbable(BlockState state) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index ac3a8a4460175985e0d580f7926cce14f804562c..bb0f57be7ecb6a36f447294cc04edc74708427af 100644 index 1d40d2f70ad72aa392b3699d71f20f69d3820696..93a43ef867d0961b46f9ecadc2c7be6a4b17c72b 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -322,6 +322,15 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT @@ -322,6 +322,15 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@ -1419,10 +1419,10 @@ index ac3a8a4460175985e0d580f7926cce14f804562c..bb0f57be7ecb6a36f447294cc04edc74
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 592e41884ffda0075ec16e5538d5004efeb80f78..aa34f59f7ffaa40fb43b6784361c0f7edb0461c5 100644 index 0a070ff26a1e9b2583e95adac0b2dd85b567c8d1..3fa9f639a598294b4956c6525fc8a630ae10da2d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -139,7 +139,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -141,7 +141,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent; import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end // CraftBukkit end
@ -1431,7 +1431,7 @@ index 592e41884ffda0075ec16e5538d5004efeb80f78..aa34f59f7ffaa40fb43b6784361c0f7e
public abstract class LivingEntity extends Entity implements Attackable { public abstract class LivingEntity extends Entity implements Attackable {
@@ -2805,7 +2805,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -2844,7 +2844,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Override @Override
public void tick() { public void tick() {
@ -1439,7 +1439,7 @@ index 592e41884ffda0075ec16e5538d5004efeb80f78..aa34f59f7ffaa40fb43b6784361c0f7e
super.tick(); super.tick();
this.updatingUsingItem(); this.updatingUsingItem();
this.updateSwimAmount(); this.updateSwimAmount();
@@ -2847,9 +2846,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -2886,9 +2885,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
if (!this.isRemoved()) { if (!this.isRemoved()) {
@ -1449,7 +1449,7 @@ index 592e41884ffda0075ec16e5538d5004efeb80f78..aa34f59f7ffaa40fb43b6784361c0f7e
} }
double d0 = this.getX() - this.xo; double d0 = this.getX() - this.xo;
@@ -2931,8 +2928,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -2970,8 +2967,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.isSleeping()) { if (this.isSleeping()) {
this.setXRot(0.0F); this.setXRot(0.0F);
} }
@ -1458,50 +1458,50 @@ index 592e41884ffda0075ec16e5538d5004efeb80f78..aa34f59f7ffaa40fb43b6784361c0f7e
} }
public void detectEquipmentUpdates() { public void detectEquipmentUpdates() {
@@ -3110,7 +3105,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3149,7 +3144,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.setDeltaMovement(d4, d5, d6); this.setDeltaMovement(d4, d5, d6);
this.level.getProfiler().push("ai"); this.level().getProfiler().push("ai");
- SpigotTimings.timerEntityAI.startTiming(); // Spigot - SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.isImmobile()) { if (this.isImmobile()) {
this.jumping = false; this.jumping = false;
this.xxa = 0.0F; this.xxa = 0.0F;
@@ -3120,7 +3114,6 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3159,7 +3153,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.serverAiStep(); this.serverAiStep();
this.level.getProfiler().pop(); this.level().getProfiler().pop();
} }
- SpigotTimings.timerEntityAI.stopTiming(); // Spigot - SpigotTimings.timerEntityAI.stopTiming(); // Spigot
this.level.getProfiler().pop(); this.level().getProfiler().pop();
this.level.getProfiler().push("jump"); this.level().getProfiler().push("jump");
@@ -3157,13 +3150,13 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3199,7 +3192,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
LivingEntity entityliving = this.getControllingPassenger(); this.resetFallDistance();
Vec3 vec3d1 = new Vec3((double) this.xxa, (double) this.yya, (double) this.zza); }
- SpigotTimings.timerEntityAIMove.startTiming(); // Spigot - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
+ //SpigotTimings.timerEntityAIMove.startTiming(); // Spigot // Paper label104:
if (entityliving != null && this.isAlive()) { {
this.travelRidden(entityliving, vec3d1); LivingEntity entityliving = this.getControllingPassenger();
} else { @@ -3215,7 +3207,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.travel(vec3d1); this.travel(vec3d1);
} }
- SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
+ //SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper
this.level.getProfiler().pop(); this.level().getProfiler().pop();
this.level.getProfiler().push("freezing"); this.level().getProfiler().push("freezing");
@@ -3190,9 +3183,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3242,9 +3233,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox()); this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
} }
- SpigotTimings.timerEntityAICollision.startTiming(); // Spigot - SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.pushEntities(); this.pushEntities();
- SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.level.getProfiler().pop(); this.level().getProfiler().pop();
if (!this.level.isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) { if (!this.level().isClientSide && this.isSensitiveToWater() && this.isInWaterRainOrBubble()) {
this.hurt(this.damageSources().drown(), 1.0F); this.hurt(this.damageSources().drown(), 1.0F);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e4ebdf81b7907e1054c356091ebcd35264b015f4..69f55f7207b8c03ca886947c57c9d13a8e8eb576 100644 index 003e2064f64115d1f5c48ac97e16100d4c10c5d7..d87f02c748fe2e5b4ea251f6691e8907a152cb6d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -88,7 +88,6 @@ import org.bukkit.Bukkit; @@ -88,7 +88,6 @@ import org.bukkit.Bukkit;
@ -1512,7 +1512,7 @@ index e4ebdf81b7907e1054c356091ebcd35264b015f4..69f55f7207b8c03ca886947c57c9d13a
import org.bukkit.craftbukkit.block.CapturedBlockState; import org.bukkit.craftbukkit.block.CapturedBlockState;
import org.bukkit.craftbukkit.block.CraftBlockState; import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData;
@@ -164,7 +163,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -163,7 +162,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
} }
// Paper end // Paper end
@ -1521,7 +1521,7 @@ index e4ebdf81b7907e1054c356091ebcd35264b015f4..69f55f7207b8c03ca886947c57c9d13a
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter; private org.spigotmc.TickLimiter tileLimiter;
@@ -262,7 +261,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -261,7 +260,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {} public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
}); });
// CraftBukkit end // CraftBukkit end
@ -1530,7 +1530,7 @@ index e4ebdf81b7907e1054c356091ebcd35264b015f4..69f55f7207b8c03ca886947c57c9d13a
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
} }
@@ -721,15 +720,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -714,15 +713,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
timings.tileEntityTick.stopTiming(); // Spigot timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false; this.tickingBlockEntities = false;
@ -1548,10 +1548,10 @@ index e4ebdf81b7907e1054c356091ebcd35264b015f4..69f55f7207b8c03ca886947c57c9d13a
CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking entity"); CrashReport crashreport = CrashReport.forThrowable(throwable, "Ticking entity");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being ticked"); CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Entity being ticked");
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 24eda8fa698d480e0295c84a5e4be8916223e69f..6603be2c0906c8d78e7de5c3dbed56f9552ff9c1 100644 index 96ff9373e89a3f0b174c82a75e09dd91a3639508..7ed82beb538a25a5246f6288c1dddb4f5f85e997 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java --- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -89,6 +89,15 @@ public class Block extends BlockBehaviour implements ItemLike { @@ -87,6 +87,15 @@ public class Block extends BlockBehaviour implements ItemLike {
public static final int UPDATE_LIMIT = 512; public static final int UPDATE_LIMIT = 512;
protected final StateDefinition<Block, BlockState> stateDefinition; protected final StateDefinition<Block, BlockState> stateDefinition;
private BlockState defaultBlockState; private BlockState defaultBlockState;
@ -1586,10 +1586,10 @@ index c02fa35cefc9194d1838abbe4f2dc2b226a41e41..b300d12e9e00519028b53aca9c3fb01f
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
public CraftPersistentDataContainer persistentDataContainer; public CraftPersistentDataContainer persistentDataContainer;
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index bedafac1c29f4b2a820822b01814b871f88528d4..13202fc9f73f3485328b923de8c1e6080f08e773 100644 index 5aa89166e854136f366eb36ff02a37ae9ba77ab1..6e1ace21431f679d55a2580dc23c32cf5f75b2af 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -674,6 +674,7 @@ public class LevelChunk extends ChunkAccess { @@ -682,6 +682,7 @@ public class LevelChunk extends ChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration)); server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(bukkitChunk, this.needsDecoration));
if (this.needsDecoration) { if (this.needsDecoration) {
@ -1597,7 +1597,7 @@ index bedafac1c29f4b2a820822b01814b871f88528d4..13202fc9f73f3485328b923de8c1e608
this.needsDecoration = false; this.needsDecoration = false;
java.util.Random random = new java.util.Random(); java.util.Random random = new java.util.Random();
random.setSeed(this.level.getSeed()); random.setSeed(this.level.getSeed());
@@ -693,6 +694,7 @@ public class LevelChunk extends ChunkAccess { @@ -701,6 +702,7 @@ public class LevelChunk extends ChunkAccess {
} }
} }
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk)); server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@ -1606,10 +1606,10 @@ index bedafac1c29f4b2a820822b01814b871f88528d4..13202fc9f73f3485328b923de8c1e608
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index 9c3ce492051199acb8d38ade121ec8a0cbc50f54..aa4f2dc63dd79e6c3d7594d2fd63fa0091df5f53 100644 index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae7ab07172 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -512,13 +512,10 @@ public class ChunkSerializer { @@ -483,13 +483,10 @@ public class ChunkSerializer {
ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities"); ListTag nbttaglist1 = ChunkSerializer.getListOfCompoundsOrNull(nbt, "block_entities");
return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> { return nbttaglist == null && nbttaglist1 == null ? null : (chunk) -> {
@ -1623,7 +1623,7 @@ index 9c3ce492051199acb8d38ade121ec8a0cbc50f54..aa4f2dc63dd79e6c3d7594d2fd63fa00
if (nbttaglist1 != null) { if (nbttaglist1 != null) {
for (int i = 0; i < nbttaglist1.size(); ++i) { for (int i = 0; i < nbttaglist1.size(); ++i) {
CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i); CompoundTag nbttagcompound1 = nbttaglist1.getCompound(i);
@@ -536,7 +533,6 @@ public class ChunkSerializer { @@ -507,7 +504,6 @@ public class ChunkSerializer {
} }
} }
} }
@ -1632,7 +1632,7 @@ index 9c3ce492051199acb8d38ade121ec8a0cbc50f54..aa4f2dc63dd79e6c3d7594d2fd63fa00
}; };
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6e1f782938992debbfd9617ab9e2cce4e423876c..ff78f576472434eb8299012a146d0e4d8659d82c 100644 index 5acdd3253a33d9c9f5e1af955b6e1dc072f77858..1b6ca18237de5f154a1b0ddaea34347869fa637e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -369,7 +369,7 @@ public final class CraftServer implements Server { @@ -369,7 +369,7 @@ public final class CraftServer implements Server {
@ -1644,7 +1644,7 @@ index 6e1f782938992debbfd9617ab9e2cce4e423876c..ff78f576472434eb8299012a146d0e4d
this.overrideSpawnLimits(); this.overrideSpawnLimits();
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
@@ -2414,12 +2414,31 @@ public final class CraftServer implements Server { @@ -2412,12 +2412,31 @@ public final class CraftServer implements Server {
private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot()
{ {
@ -1846,10 +1846,10 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000
- } - }
-} -}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2162df3654bcad4073f499138f9faac96fbc8007..12676b0e8860d98693c176287c3904c3f87f1db7 100644 index 2118aac177923da4239ccd926af0daab87268bc8..ebe5ed6ec66ec5f0979c8ff2998a9d6c1539b2fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2516,6 +2516,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2522,6 +2522,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR)); CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR));
} }
@ -2046,7 +2046,7 @@ index f97eccb6a17c7876e1e002d798eb67bbe80571a0..76effc345d362047e64d064eb64a5222
+ } // Paper + } // Paper
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index a90bfabd166afcd248c5d467d18ec9c0324b7858..a2203cd809810eb8793ae730d163192d87f615c8 100644 index 39a9a47ce7150445e1b00a32152c0429b3114302..24319441ea6655c5cbd760c77cdde1e05c1877c4 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -224,6 +224,12 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -224,6 +224,12 @@ public final class CraftMagicNumbers implements UnsafeValues {
@ -2077,7 +2077,7 @@ index a90bfabd166afcd248c5d467d18ec9c0324b7858..a2203cd809810eb8793ae730d163192d
* This helper class represents the different NBT Tags. * This helper class represents the different NBT Tags.
* <p> * <p>
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index a7675df12d509ae0ff585566b395165f55f8a8cf..38cf408899cef72bc9d2888109a7ac7ce0aec638 100644 index b7abac39ea685db1672dc7ba527bce8bfe025f8b..3e5d541d3d7fc3956b2fc68da9f22a0ab0367ce9 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java --- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -27,7 +27,7 @@ import net.minecraft.world.entity.projectile.ThrownTrident; @@ -27,7 +27,7 @@ import net.minecraft.world.entity.projectile.ThrownTrident;