9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00

Updated Upstream (Leaves)

Upstream has released updates that appear to apply and compile correctly

Leaves Changes:
LeavesMC/Leaves@08bfa446 Lithium Sleeping Block Entity(#618) (#630)
LeavesMC/Leaves@610eee60 fix: fix bot resume CME (#635)
LeavesMC/Leaves@04dac366 Fix vanilla display name (#638)
LeavesMC/Leaves@e5aba7eb feat: hopper counter unlimited speed(#625) (#639)
LeavesMC/Leaves@e44e469a fix: fix SleepingBlockEntity crash when /tick freeze (#640)
LeavesMC/Leaves@5d653e31 fix: fix faster chunk serialization patch (#641)
LeavesMC/Leaves@cb6cd658 [ci/skip] chore: fix patch header
LeavesMC/Leaves@8d9a5b2f [ci/skip]chore: rename hopper counter enable config (#644)
LeavesMC/Leaves@cc019e8f [ci/skip] feat: add Bukkit.getFeatureManager api (#645)
LeavesMC/Leaves@81da0c5e [ci/skip] Bring back LivingEntity effect CME (#648)
LeavesMC/Leaves@ea91106a fix: fix hopper counter config (#646)
LeavesMC/Leaves@230e0987 feat: mount action(#619) (#649)
LeavesMC/Leaves@d9f7afc4 fix: fix sleeping block entity(#654) (#655)
LeavesMC/Leaves@12f665c0 Refactor actions (#650)
LeavesMC/Leaves@c29ff9a8 feat: swap action (#657)
LeavesMC/Leaves@3c09044e fix: fix grindstone curse book overstacking(#658) (#659)
LeavesMC/Leaves@e05f3f7c Update paper, revert #632 (#662)
LeavesMC/Leaves@0c866281 Bot Improvements (#661)
LeavesMC/Leaves@956f0227 feat: add skipTripwireHookPlacementValidation to mc-technical-mode, and format config (#664)
LeavesMC/Leaves@e047327c fix: fix bot use raytrace (#669)
LeavesMC/Leaves@29327349 Fix #667 (#668)
LeavesMC/Leaves@08f53c97 Fix bot cant get entity tracker (#670)
LeavesMC/Leaves@e0d62b4e fix photographer bugs (#666)
LeavesMC/Leaves@d094bdad fix: fix raid(#626) (#671)
LeavesMC/Leaves@678d4e20 Revert "Fix bot cant get entity tracker (#670)"
LeavesMC/Leaves@e298d097 [ci/skip] fix: fix patch name (#672)
LeavesMC/Leaves@099be5b8 [ci/skip] fix: fix push to api fail when commit contains double quotation marks (#677)
LeavesMC/Leaves@ba8993d3 Fix fakeplayer cant get entity tracker correctly (#676)
LeavesMC/Leaves@d93e9766  feat: merge old raid config, fix bugs (#680)
LeavesMC/Leaves@bf55b2a4 fix: fix sleeping block entity bug (#682)
LeavesMC/Leaves@5366b382 Fix creative no clip with projectile (#683)
LeavesMC/Leaves@e55edbf8 Resolves #685  (#687)
LeavesMC/Leaves@a591ec57 Do not tick Arrow life regardless (#688)
LeavesMC/Leaves@3623aea8 fix: stupid me (#689)
LeavesMC/Leaves@73e63912 feat: update leavesclip to 3.0.7 (#681)
LeavesMC/Leaves@bb5a1dff [ci/skip] fix: fix comment (#692)
LeavesMC/Leaves@d87bc544 Fix #690 (#691)
LeavesMC/Leaves@79d9ef74 Update paper (#693)
LeavesMC/Leaves@71790286 Fix optimize noise generation
LeavesMC/Leaves@3ffbde0b Optimize config transfer and remove
LeavesMC/Leaves@62e62242 feat: add logger for internal plugin, and format api code (#696)
LeavesMC/Leaves@f37e9d37 Fix fakeplayer break action
LeavesMC/Leaves@aeb8e07d Fix fakeplayer break action * 2
LeavesMC/Leaves@40af0399 Fix StackableShulker config validator
LeavesMC/Leaves@122c7365 Fix fakeplayer use action
LeavesMC/Leaves@0ee80784 fix: fix photographer bugs (#699)
LeavesMC/Leaves@a30c9abb Remove, and opt config and config command
LeavesMC/Leaves@4b21a968 New shears wrench (#700)
LeavesMC/Leaves@0f40159c Enhance update suppression (#701)
LeavesMC/Leaves@374605cd Fix bot (#705)
LeavesMC/Leaves@ff563baf Fix creative no clip can attract xp-orb (#706)
LeavesMC/Leaves@f0de3ecd refactor: use client side judgement instead of special judgement (#708)
This commit is contained in:
Dreeam
2025-08-20 05:53:22 +08:00
parent ff7c6beeb6
commit e7915c3726
15 changed files with 302 additions and 104 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Leaves: Protocol Core
Original license: GPLv3
Original project: https://github.com/LeavesMC/Leaves
Commit: c581f1311edc4787b08fe31c5a9996ab9b369a7c
Commit: f0de3ecd91c89fc7da1230eb5633eac76982fd06
diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
index fb263fa1f30a7dfcb7ec2656abfb38e5fe88eac9..56fd1ed7ccaf96e7eedea60fbdbf7f934939d563 100644

View File

@@ -24,7 +24,7 @@ index 51caf352e77df49fc04bf84f1fab29b6f4f4fc14..3fb3afb4171e6ff57c73cd228c2b41b2
@Override
diff --git a/net/minecraft/commands/arguments/selector/EntitySelector.java b/net/minecraft/commands/arguments/selector/EntitySelector.java
index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..bbaf1a29f86a9bfc13795249d545b6f7f1bb53eb 100644
index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..6fb844999589ac17c8586c9b3f202345aa80d7fb 100644
--- a/net/minecraft/commands/arguments/selector/EntitySelector.java
+++ b/net/minecraft/commands/arguments/selector/EntitySelector.java
@@ -128,11 +128,12 @@ public class EntitySelector {
@@ -58,7 +58,7 @@ index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..bbaf1a29f86a9bfc13795249d545b6f7
return this.sortAndLimit(vec3, list);
}
@@ -192,27 +194,29 @@ public class EntitySelector {
@@ -192,26 +194,28 @@ public class EntitySelector {
this.checkPermissions(source);
if (this.playerName != null) {
ServerPlayer playerByName = source.getServer().getPlayerList().getPlayerByName(this.playerName);
@@ -79,20 +79,19 @@ index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..bbaf1a29f86a9bfc13795249d545b6f7
int resultLimit = this.getResultLimit();
List<ServerPlayer> players;
if (this.isWorldLimited()) {
- players = source.getLevel().getPlayers(predicate, resultLimit);
+ players = source.getLevel().getPlayers((player -> !(player instanceof org.leavesmc.leaves.replay.ServerPhotographer) && predicate.test(player)), resultLimit); // Leaves - skip photographer
players.removeIf(entityplayer3 -> !canSee(source, entityplayer3)); // Purpur - Hide hidden players from entity selector
players = source.getLevel().getPlayers(predicate, resultLimit);
- players.removeIf(entityplayer3 -> !canSee(source, entityplayer3)); // Purpur - Hide hidden players from entity selector
+ players.removeIf(entityplayer3 -> entityplayer3 instanceof org.leavesmc.leaves.replay.ServerPhotographer || !canSee(source, entityplayer3)); // Purpur - Hide hidden players from entity selector // Leaves - skip photographer
} else {
players = new ObjectArrayList<>();
for (ServerPlayer serverPlayer1 : source.getServer().getPlayerList().getPlayers()) {
- if (predicate.test(serverPlayer1) && canSee(source, serverPlayer1)) { // Purpur - Hide hidden players from entity selector
+ if (predicate.test(serverPlayer1) && canSee(source, serverPlayer1) && !(serverPlayer1 instanceof org.leavesmc.leaves.replay.ServerPhotographer)) { // Purpur - Hide hidden players from entity selector // Leaves - skip photographer
- for (ServerPlayer serverPlayer1 : source.getServer().getPlayerList().getPlayers()) {
+ for (ServerPlayer serverPlayer1 : source.getServer().getPlayerList().realPlayers) { // Leaves - only real players
if (predicate.test(serverPlayer1) && canSee(source, serverPlayer1)) { // Purpur - Hide hidden players from entity selector
players.add(serverPlayer1);
if (players.size() >= resultLimit) {
return players;
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 73c63330b67b3d16ceebc644ce177980af25266b..68b72a7461a89ba7bd29fc9bc98171fb7f990df8 100644
index 73c63330b67b3d16ceebc644ce177980af25266b..688e6684f6e0890dda8124b85b24a3da8c5b3292 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1642,7 +1642,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -104,6 +103,33 @@ index 73c63330b67b3d16ceebc644ce177980af25266b..68b72a7461a89ba7bd29fc9bc98171fb
int maxPlayers = this.getMaxPlayers();
if (this.hidesOnlinePlayers()) {
return new ServerStatus.Players(maxPlayers, players.size(), List.of());
@@ -1828,7 +1828,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override
public int getPlayerCount() {
- return this.playerList.getPlayerCount();
+ return this.playerList.realPlayers.size(); // Leaves - only real player
}
@Override
@@ -2222,7 +2222,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (Thread.currentThread() != this.serverThread) return; // Paper
// Paper start - we don't need to save everything, just advancements
// this.getPlayerList().saveAll();
- for (final ServerPlayer player : this.getPlayerList().getPlayers()) {
+ for (final ServerPlayer player : this.getPlayerList().realPlayers) { // Leaves - only real players
player.getAdvancements().save();
}
// Paper end - we don't need to save everything, just advancements
@@ -2361,7 +2361,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (!playerList.isUsingWhitelist()) return; // Paper - whitelist not enabled
UserWhiteList whiteList = playerList.getWhiteList();
- for (ServerPlayer serverPlayer : Lists.newArrayList(playerList.getPlayers())) {
+ for (ServerPlayer serverPlayer : Lists.newArrayList(playerList.realPlayers)) { // Leaves - only real player
if (!whiteList.isWhiteListed(serverPlayer.getGameProfile()) && !this.getPlayerList().isOp(serverPlayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
serverPlayer.connection.disconnect(net.kyori.adventure.text.Component.text(org.spigotmc.SpigotConfig.whitelistMessage), org.bukkit.event.player.PlayerKickEvent.Cause.WHITELIST); // Paper - use configurable message & kick event cause
}
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
index 9ecc19b8a7d4e6b27335b542308f78e5005b0e15..eee5aaca8219802a56b8ba08986da672c40dc8b4 100644
--- a/net/minecraft/server/PlayerAdvancements.java
@@ -120,6 +146,54 @@ index 9ecc19b8a7d4e6b27335b542308f78e5005b0e15..eee5aaca8219802a56b8ba08986da672
boolean flag = false;
AdvancementProgress orStartProgress = this.getOrStartProgress(advancement);
boolean isDone = orStartProgress.isDone();
diff --git a/net/minecraft/server/ServerScoreboard.java b/net/minecraft/server/ServerScoreboard.java
index fc1c377ad05edcefacd407671801ae605f3fc31a..5635f0940b4b70f27c8dfdc1aa666fcb7e26d55d 100644
--- a/net/minecraft/server/ServerScoreboard.java
+++ b/net/minecraft/server/ServerScoreboard.java
@@ -242,7 +242,7 @@ public class ServerScoreboard extends Scoreboard {
public void startTrackingObjective(Objective objective) {
List<Packet<?>> startTrackingPackets = this.getStartTrackingPackets(objective);
- for (ServerPlayer serverPlayer : this.server.getPlayerList().getPlayers()) {
+ for (ServerPlayer serverPlayer : this.server.getPlayerList().realPlayers) { // Leaves - only real players
if (serverPlayer.getBukkitEntity().getScoreboard().getHandle() != this) continue; // CraftBukkit - Only players on this board
for (Packet<?> packet : startTrackingPackets) {
serverPlayer.connection.send(packet);
@@ -268,7 +268,7 @@ public class ServerScoreboard extends Scoreboard {
public void stopTrackingObjective(Objective objective) {
List<Packet<?>> stopTrackingPackets = this.getStopTrackingPackets(objective);
- for (ServerPlayer serverPlayer : this.server.getPlayerList().getPlayers()) {
+ for (ServerPlayer serverPlayer : this.server.getPlayerList().realPlayers) { // Leaves - only real players
if (serverPlayer.getBukkitEntity().getScoreboard().getHandle() != this) continue; // CraftBukkit - Only players on this board
for (Packet<?> packet : stopTrackingPackets) {
serverPlayer.connection.send(packet);
diff --git a/net/minecraft/server/commands/DefaultGameModeCommands.java b/net/minecraft/server/commands/DefaultGameModeCommands.java
index 84baf29ad8af6a8af0cd00ce3921b3c5b8b89451..17f5543b802d88811c3e373e579a6e8b4c9f263a 100644
--- a/net/minecraft/server/commands/DefaultGameModeCommands.java
+++ b/net/minecraft/server/commands/DefaultGameModeCommands.java
@@ -27,7 +27,7 @@ public class DefaultGameModeCommands {
server.setDefaultGameType(gamemode);
GameType forcedGameType = server.getForcedGameType();
if (forcedGameType != null) {
- for (ServerPlayer serverPlayer : server.getPlayerList().getPlayers()) {
+ for (ServerPlayer serverPlayer : server.getPlayerList().realPlayers) { // Leaves - only real players
// Paper start - Expand PlayerGameModeChangeEvent
org.bukkit.event.player.PlayerGameModeChangeEvent event = serverPlayer.setGameMode(gamemode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.DEFAULT_GAMEMODE, net.kyori.adventure.text.Component.empty());
if (event != null && event.isCancelled()) {
diff --git a/net/minecraft/server/commands/ListPlayersCommand.java b/net/minecraft/server/commands/ListPlayersCommand.java
index c6ae34f91b3629990294fc5e69237a1e600ef038..712d7b66f1b701acf2f411e811648e5c18112ee9 100644
--- a/net/minecraft/server/commands/ListPlayersCommand.java
+++ b/net/minecraft/server/commands/ListPlayersCommand.java
@@ -33,7 +33,7 @@ public class ListPlayersCommand {
private static int format(CommandSourceStack source, Function<ServerPlayer, Component> nameExtractor) {
PlayerList playerList = source.getServer().getPlayerList();
// CraftBukkit start
- List<ServerPlayer> playersTemp = playerList.getPlayers();
+ List<ServerPlayer> playersTemp = playerList.realPlayers; // Leaves - only real players
if (source.getBukkitSender() instanceof org.bukkit.entity.Player) {
org.bukkit.entity.Player sender = (org.bukkit.entity.Player) source.getBukkitSender();
playersTemp = playersTemp.stream().filter((ep) -> sender.canSee(ep.getBukkitEntity())).collect(java.util.stream.Collectors.toList());
diff --git a/net/minecraft/server/commands/OpCommand.java b/net/minecraft/server/commands/OpCommand.java
index f2286b96b8f40b4588f817913c42ae7b4a92340f..dbe6c37642d35ac6ee8b428cf1e45878a5dfa9da 100644
--- a/net/minecraft/server/commands/OpCommand.java
@@ -133,8 +207,98 @@ index f2286b96b8f40b4588f817913c42ae7b4a92340f..dbe6c37642d35ac6ee8b428cf1e45878
.stream()
.filter(serverPlayer -> !playerList.isOp(serverPlayer.getGameProfile()))
.map(serverPlayer -> serverPlayer.getGameProfile().getName()),
diff --git a/net/minecraft/server/commands/ParticleCommand.java b/net/minecraft/server/commands/ParticleCommand.java
index 33d96239f4b72a5587dc70f9602847a870d6d6a5..a83ce2cd112fca02cf3545f8c38e5cafae2c7c0e 100644
--- a/net/minecraft/server/commands/ParticleCommand.java
+++ b/net/minecraft/server/commands/ParticleCommand.java
@@ -36,7 +36,7 @@ public class ParticleCommand {
0.0F,
0,
false,
- commandContext.getSource().getServer().getPlayerList().getPlayers()
+ commandContext.getSource().getServer().getPlayerList().realPlayers // Leaves - only real player
)
)
.then(
@@ -50,7 +50,7 @@ public class ParticleCommand {
0.0F,
0,
false,
- context1.getSource().getServer().getPlayerList().getPlayers()
+ context1.getSource().getServer().getPlayerList().realPlayers // Leaves - only real player
)
)
.then(
@@ -68,7 +68,7 @@ public class ParticleCommand {
FloatArgumentType.getFloat(context1, "speed"),
IntegerArgumentType.getInteger(context1, "count"),
false,
- context1.getSource().getServer().getPlayerList().getPlayers()
+ context1.getSource().getServer().getPlayerList().realPlayers // Leaves - only real player
)
)
.then(
@@ -82,7 +82,7 @@ public class ParticleCommand {
FloatArgumentType.getFloat(context1, "speed"),
IntegerArgumentType.getInteger(context1, "count"),
true,
- context1.getSource().getServer().getPlayerList().getPlayers()
+ context1.getSource().getServer().getPlayerList().realPlayers // Leaves - only real player
)
)
.then(
@@ -112,7 +112,7 @@ public class ParticleCommand {
FloatArgumentType.getFloat(context1, "speed"),
IntegerArgumentType.getInteger(context1, "count"),
false,
- context1.getSource().getServer().getPlayerList().getPlayers()
+ context1.getSource().getServer().getPlayerList().realPlayers // Leaves - only real player
)
)
.then(
diff --git a/net/minecraft/server/commands/TeamMsgCommand.java b/net/minecraft/server/commands/TeamMsgCommand.java
index 134d7b1a9d5a5a47ebf4aabff110dde914cd6fe1..894dd1d048904b8a775416ea6cb3112215c567bc 100644
--- a/net/minecraft/server/commands/TeamMsgCommand.java
+++ b/net/minecraft/server/commands/TeamMsgCommand.java
@@ -40,7 +40,7 @@ public class TeamMsgCommand {
} else {
List<ServerPlayer> list = commandSourceStack.getServer()
.getPlayerList()
- .getPlayers()
+ .realPlayers // Leaves - only real players
.stream()
.filter(player -> player == entityOrException || player.getTeam() == team)
.toList();
diff --git a/net/minecraft/server/commands/WhitelistCommand.java b/net/minecraft/server/commands/WhitelistCommand.java
index 763a51d9a0859296eb4ea52b6879d6c7703db673..25b4fcf79dbf3e227451b3321d8fd38bab55ffe9 100644
--- a/net/minecraft/server/commands/WhitelistCommand.java
+++ b/net/minecraft/server/commands/WhitelistCommand.java
@@ -43,7 +43,7 @@ public class WhitelistCommand {
(commandContext, suggestionsBuilder) -> {
PlayerList playerList = commandContext.getSource().getServer().getPlayerList();
return SharedSuggestionProvider.suggest(
- playerList.getPlayers()
+ playerList.realPlayers // Leaves - only real player
.stream()
.filter(serverPlayer -> !playerList.getWhiteList().isWhiteListed(serverPlayer.getGameProfile()))
.map(serverPlayer -> serverPlayer.getGameProfile().getName()),
diff --git a/net/minecraft/server/gui/PlayerListComponent.java b/net/minecraft/server/gui/PlayerListComponent.java
index f5ba0c9a4c3f9eaa38eeb689de915c25c7165433..24bbc32bc17802edbd9cc14310fe8141c0ad85b0 100644
--- a/net/minecraft/server/gui/PlayerListComponent.java
+++ b/net/minecraft/server/gui/PlayerListComponent.java
@@ -17,8 +17,8 @@ public class PlayerListComponent extends JList<String> {
if (this.tickCount++ % 20 == 0) {
Vector<String> list = new Vector<>();
- for (int i = 0; i < this.server.getPlayerList().getPlayers().size(); i++) {
- list.add(this.server.getPlayerList().getPlayers().get(i).getGameProfile().getName());
+ for (int i = 0; i < this.server.getPlayerList().realPlayers.size(); i++) { // Leaves - only real players
+ list.add(this.server.getPlayerList().realPlayers.get(i).getGameProfile().getName()); // Leaves - only real players
}
this.setListData(list);
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 95c128f028c3cce7d0b37821a6e75208323fb4e9..2cf0fa70ae3d7675cac3cf7a0002097b4e773fe1 100644
index 95c128f028c3cce7d0b37821a6e75208323fb4e9..66b7205ea7da8b452e6e66676d75d2b29ed6b6d5 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -215,6 +215,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -158,7 +322,7 @@ index 95c128f028c3cce7d0b37821a6e75208323fb4e9..2cf0fa70ae3d7675cac3cf7a0002097b
if (entity instanceof ServerPlayer serverPlayer) {
ServerLevel.this.players.add(serverPlayer);
+ // Leaves start - skip
+ if (!(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer)) {
+ if (!(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer)) { // and photographer
+ ServerLevel.this.realPlayers.add(serverPlayer);
+ }
+ // Leaves end - skip
@@ -170,28 +334,15 @@ index 95c128f028c3cce7d0b37821a6e75208323fb4e9..2cf0fa70ae3d7675cac3cf7a0002097b
if (entity instanceof ServerPlayer serverPlayer) {
ServerLevel.this.players.remove(serverPlayer);
+ // Leaves start - skip
+ if (!(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer)) {
+ if (!(serverPlayer instanceof org.leavesmc.leaves.replay.ServerPhotographer)) { // and photographer
+ ServerLevel.this.realPlayers.remove(serverPlayer);
+ }
+ // Leaves end - skip
ServerLevel.this.getWaypointManager().removePlayer(serverPlayer);
ServerLevel.this.updateSleepingPlayerList();
}
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 880bf83929e636872eeb53c5c3ec9357972267db..47d9495ea2cf347f268bd84bf731c5b5ec63ead1 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -216,7 +216,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
private static final boolean DEFAULT_SEEN_CREDITS = false;
private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false;
public ServerGamePacketListenerImpl connection;
- private final MinecraftServer server;
+ public final MinecraftServer server; // Leaves - private -> public
public ServerPlayerGameMode gameMode;
private final PlayerAdvancements advancements;
private final ServerStatsCounter stats;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index a2d5b58eef4b6def8032d2421f8f3d34e64cb70e..10502ed26662f13fafcafc644aecd98828ef4aec 100644
index a2d5b58eef4b6def8032d2421f8f3d34e64cb70e..5812f425870c8db5a48d3717bba40ff6ace2f0c6 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -131,6 +131,7 @@ public abstract class PlayerList {
@@ -323,7 +474,15 @@ index a2d5b58eef4b6def8032d2421f8f3d34e64cb70e..10502ed26662f13fafcafc644aecd988
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
this.playersByUUID.put(player.getUUID(), player);
this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
@@ -522,6 +630,43 @@ public abstract class PlayerList {
@@ -508,6 +616,7 @@ public abstract class PlayerList {
}
protected void save(ServerPlayer player) {
+ if (player instanceof org.leavesmc.leaves.replay.ServerPhotographer) return; // Leaves - skip photographer
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
player.lastSave = MinecraftServer.currentTick; // Paper - Incremental chunk and player saving
this.playerIo.save(player);
@@ -522,6 +631,43 @@ public abstract class PlayerList {
}
}
@@ -367,7 +526,7 @@ index a2d5b58eef4b6def8032d2421f8f3d34e64cb70e..10502ed26662f13fafcafc644aecd988
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player) { // CraftBukkit - return string // Paper - return Component
// Paper start - Fix kick event leave message not being sent
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
@@ -596,6 +741,7 @@ public abstract class PlayerList {
@@ -596,6 +742,7 @@ public abstract class PlayerList {
player.retireScheduler(); // Paper - Folia schedulers
player.getAdvancements().stopListening();
this.players.remove(player);
@@ -375,7 +534,21 @@ index a2d5b58eef4b6def8032d2421f8f3d34e64cb70e..10502ed26662f13fafcafc644aecd988
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.removeFromSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
this.server.getCustomBossEvents().onPlayerDisconnect(player);
@@ -1092,7 +1238,7 @@ public abstract class PlayerList {
@@ -1009,10 +1156,10 @@ public abstract class PlayerList {
}
public String[] getPlayerNamesArray() {
- String[] strings = new String[this.players.size()];
+ String[] strings = new String[this.realPlayers.size()]; // Leaves - fakeplayer support, and skip photographer
- for (int i = 0; i < this.players.size(); i++) {
- strings[i] = this.players.get(i).getGameProfile().getName();
+ for (int i = 0; i < this.realPlayers.size(); i++) { // Leaves - only real players
+ strings[i] = this.realPlayers.get(i).getGameProfile().getName(); // Leaves - only real players
}
return strings;
@@ -1092,7 +1239,7 @@ public abstract class PlayerList {
// Paper start - whitelist verify event / login event
public LoginResult canBypassFullServerLogin(final GameProfile profile, final LoginResult currentResult) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Remove useless creating stats json bases on player name logic
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 10502ed26662f13fafcafc644aecd98828ef4aec..cedc4531e9a072e953943596311b9695b45cb548 100644
index 5812f425870c8db5a48d3717bba40ff6ace2f0c6..f86560200a8625c82961683198541e52c02d7e7f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1545,6 +1545,8 @@ public abstract class PlayerList {
@@ -1546,6 +1546,8 @@ public abstract class PlayerList {
if (serverStatsCounter == null) {
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
File file1 = new File(file, uuid + ".json");
@@ -17,7 +17,7 @@ index 10502ed26662f13fafcafc644aecd98828ef4aec..cedc4531e9a072e953943596311b9695
if (!file1.exists()) {
File file2 = new File(file, displayName + ".json"); // CraftBukkit
Path path = file2.toPath();
@@ -1552,6 +1554,8 @@ public abstract class PlayerList {
@@ -1553,6 +1555,8 @@ public abstract class PlayerList {
file2.renameTo(file1);
}
}

View File

@@ -19,7 +19,7 @@ index 287c0936930ff4f3ca6dc2a4cbfc796a120fe4c0..3f32da75ee0a8a993b54e4156f7e4be9
org.purpurmc.purpur.command.DemoCommand.register(this.dispatcher); // Purpur - Add demo command
org.purpurmc.purpur.command.PingCommand.register(this.dispatcher); // Purpur - Add ping command
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 47d9495ea2cf347f268bd84bf731c5b5ec63ead1..15fdcc84a72c272428115eb08b07fafc0c17fded 100644
index 880bf83929e636872eeb53c5c3ec9357972267db..37fe4bbc117c434293689c0a4a1e79e07cff7fd6 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -2434,6 +2434,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -152,10 +152,10 @@ index 2e504082ba5d68874b2d56baa8676b840caf1abe..e61ff0c5051a855e10310d4e6f76d79e
synchronized (this.lastSeenMessages) {
Optional var10000;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index cedc4531e9a072e953943596311b9695b45cb548..a332253d11564818a24d78e4dff262e55d7cc450 100644
index f86560200a8625c82961683198541e52c02d7e7f..cd7e2e7bdfff90b7147de20dd44fdf2709c4c28f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -675,6 +675,7 @@ public abstract class PlayerList {
@@ -676,6 +676,7 @@ public abstract class PlayerList {
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
// Paper end - Fix kick event leave message not being sent
org.purpurmc.purpur.task.BossBarTask.removeFromAll(player.getBukkitEntity()); // Purpur - Implement TPSBar

View File

@@ -138,10 +138,10 @@ index 82c22ca54cc7c8371b744c93f133dfc2b798195b..6b73679351f786362daf988b02b2a226
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index a332253d11564818a24d78e4dff262e55d7cc450..47d0af92cb0d744f4188597ad3f4b096aca84a9e 100644
index cd7e2e7bdfff90b7147de20dd44fdf2709c4c28f..f09c1472d465de94b16e958ec7051f34aae7402f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1505,7 +1505,7 @@ public abstract class PlayerList {
@@ -1506,7 +1506,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
// Paper end
boolean flag = this.verifyChatTrusted(message);
@@ -150,7 +150,7 @@ index a332253d11564818a24d78e4dff262e55d7cc450..47d0af92cb0d744f4188597ad3f4b096
OutgoingChatMessage outgoingChatMessage = OutgoingChatMessage.create(message);
boolean flag1 = false;
@@ -1530,6 +1530,7 @@ public abstract class PlayerList {
@@ -1531,6 +1531,7 @@ public abstract class PlayerList {
}
public boolean verifyChatTrusted(PlayerChatMessage message) {

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable connection message
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 47d0af92cb0d744f4188597ad3f4b096aca84a9e..ab79b6c3978e7a1b3935e18353841dfa44c9af29 100644
index f09c1472d465de94b16e958ec7051f34aae7402f..b24e03e941da6e90b1b8419c7f33973aebec7818 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -445,7 +445,7 @@ public abstract class PlayerList {
@@ -26,7 +26,7 @@ index 47d0af92cb0d744f4188597ad3f4b096aca84a9e..ab79b6c3978e7a1b3935e18353841dfa
joinMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(jm); // Paper - Adventure
this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure
}
@@ -684,7 +684,7 @@ public abstract class PlayerList {
@@ -685,7 +685,7 @@ public abstract class PlayerList {
player.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
}
@@ -35,7 +35,7 @@ index 47d0af92cb0d744f4188597ad3f4b096aca84a9e..ab79b6c3978e7a1b3935e18353841dfa
this.cserver.getPluginManager().callEvent(playerQuitEvent);
player.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
@@ -1658,4 +1658,40 @@ public abstract class PlayerList {
@@ -1659,4 +1659,40 @@ public abstract class PlayerList {
public boolean isAllowCommandsForAllPlayers() {
return this.allowCommandsForAllPlayers;
}

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Do not place player if the server is full
Fix https://github.com/PaperMC/Paper/issues/10668
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index ab79b6c3978e7a1b3935e18353841dfa44c9af29..92b37775282ca1f35edfc51305b98af5a9adc5cb 100644
index b24e03e941da6e90b1b8419c7f33973aebec7818..9a2e11ff1ed5b8d07b1d6c66ba1a6109c290ff8b 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -349,6 +349,13 @@ public abstract class PlayerList {
@@ -23,7 +23,7 @@ index ab79b6c3978e7a1b3935e18353841dfa44c9af29..92b37775282ca1f35edfc51305b98af5
org.bukkit.Location loc = ev.getSpawnLocation();
serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle();
@@ -1239,7 +1246,7 @@ public abstract class PlayerList {
@@ -1240,7 +1247,7 @@ public abstract class PlayerList {
// Paper start - whitelist verify event / login event
public LoginResult canBypassFullServerLogin(final GameProfile profile, final LoginResult currentResult) {

View File

@@ -95,7 +95,7 @@ index 582e012222123e5001c34153f2ee1ab1d08935fd..c0bce2293d07ca58cc5bc9e036ab8dca
List<org.bukkit.block.BlockState> states = new java.util.ArrayList<>(level.capturedBlockStates.values());
level.capturedBlockStates.clear();
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index a780cba7e2e95412226d9e80b892ab0126f50666..20e3c60ccf069ce491df8c5c9ea6ffec7b0920da 100644
index 88829d89434e7688c274937604b0568096e2bde1..29933ba4ac17bd190f423b8bd4b2dc47fcc40688 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -290,6 +290,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -423,7 +423,7 @@ index eaaa66c4d86d4ebda0acf8f1dbe8ecb55aa28285..3a6c894178829cec8daa08ea9f0294f7
continue;
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index 91752678f887559132921cff61697478e5f44e3d..42d7a205717762af03af48ba7a0606a19cb35606 100644
index 06294e4036991a803deefc20e35160c5ff76a81b..78062a93c63da07cf9d92b03fc72e97933342cc9 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -180,7 +180,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@@ -673,7 +673,7 @@ index 91752678f887559132921cff61697478e5f44e3d..42d7a205717762af03af48ba7a0606a1
// Paper start - extra debug info
if (entity.valid) {
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 50b452c428c637a537c71b70a7758ec3c76ab280..258a90b1a35c2899481c6b37f949670d4d44e2f5 100644
index b8f5cc4540c4a992ae4cf5673886ce6107eb82a8..6c2b7818ff6535f73fcbb87ef25b2992656ce348 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -463,6 +463,8 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -728,7 +728,7 @@ index 50b452c428c637a537c71b70a7758ec3c76ab280..258a90b1a35c2899481c6b37f949670d
// Paper end - Inventory close reason
this.connection.send(new ClientboundContainerClosePacket(this.containerMenu.containerId));
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 92b37775282ca1f35edfc51305b98af5a9adc5cb..52e5a87ed1e425b74f7428798bf0f0564f6747ae 100644
index 9a2e11ff1ed5b8d07b1d6c66ba1a6109c290ff8b..f4cd57fe41caf6422bfe80ee42cb520515ff4bdc 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -257,6 +257,8 @@ public abstract class PlayerList {
@@ -740,7 +740,7 @@ index 92b37775282ca1f35edfc51305b98af5a9adc5cb..52e5a87ed1e425b74f7428798bf0f056
player.isRealPlayer = true; // Paper
player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed
GameProfile gameProfile = player.getGameProfile();
@@ -851,6 +853,15 @@ public abstract class PlayerList {
@@ -852,6 +854,15 @@ public abstract class PlayerList {
}
public ServerPlayer respawn(ServerPlayer player, boolean keepInventory, Entity.RemovalReason reason, @Nullable org.bukkit.event.player.PlayerRespawnEvent.RespawnReason eventReason, @Nullable org.bukkit.Location location) {
@@ -756,7 +756,7 @@ index 92b37775282ca1f35edfc51305b98af5a9adc5cb..52e5a87ed1e425b74f7428798bf0f056
player.stopRiding(); // CraftBukkit
this.players.remove(player);
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
@@ -862,6 +873,7 @@ public abstract class PlayerList {
@@ -863,6 +874,7 @@ public abstract class PlayerList {
ServerPlayer serverPlayer = player;
Level fromWorld = player.level();
player.wonGame = false;

View File

@@ -22,7 +22,7 @@ index 56fd1ed7ccaf96e7eedea60fbdbf7f934939d563..d2f522ea6d0a209496848af073c9af1c
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 01da8faee1bc8d656949106d5f88dea0c1ebfc89..926d0cf31be80fe1298c14411e65cd39a0962b32 100644
index 462328b74bfa081033edb54491985162c39fe208..39898c9429612b0cc690361be971c1fb3e71b278 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -1803,6 +1803,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -34,7 +34,7 @@ index 01da8faee1bc8d656949106d5f88dea0c1ebfc89..926d0cf31be80fe1298c14411e65cd39
for (int i = 0; i < this.tickables.size(); i++) {
this.tickables.get(i).run();
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index 258a90b1a35c2899481c6b37f949670d4d44e2f5..29f250f78bdd3c523b859d09d5561db088c6e72b 100644
index 6c2b7818ff6535f73fcbb87ef25b2992656ce348..be9d5c760e192df17a6513b819f956ad526e6d67 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -810,6 +810,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@@ -63,10 +63,10 @@ index 6b73679351f786362daf988b02b2a226d6b43984..3e66777b784825e28b4055e9a981cb38
final byte[] data = discardedPayload.data();
try {
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index 76e7133c580725635d517bc8dd20aa10210133aa..d8bfb169b10bb2a742ecd0f4919db38da77998ad 100644
index 504ba8622d87c73e9a640de9b96285474685c77e..f0bdc2bbf358d4c5f113b395c6409ff9fa759e2f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -689,6 +689,7 @@ public abstract class PlayerList {
@@ -690,6 +690,7 @@ public abstract class PlayerList {
}
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Op lock
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
index d8bfb169b10bb2a742ecd0f4919db38da77998ad..aa5d6309b2194174ddc3163ce8b3839e59805f06 100644
index f0bdc2bbf358d4c5f113b395c6409ff9fa759e2f..203160ddf928b86d12a25c94550bf13b86598e03 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
@@ -1201,6 +1201,9 @@ public abstract class PlayerList {
@@ -1202,6 +1202,9 @@ public abstract class PlayerList {
}
public void op(GameProfile profile) {
@@ -18,7 +18,7 @@ index d8bfb169b10bb2a742ecd0f4919db38da77998ad..aa5d6309b2194174ddc3163ce8b3839e
this.ops.add(new ServerOpListEntry(profile, this.server.getOperatorUserPermissionLevel(), this.ops.canBypassPlayerLimit(profile)));
ServerPlayer player = this.getPlayer(profile.getId());
if (player != null) {
@@ -1209,6 +1212,9 @@ public abstract class PlayerList {
@@ -1210,6 +1213,9 @@ public abstract class PlayerList {
}
public void deop(GameProfile profile) {

View File

@@ -85,3 +85,29 @@ index 2d9725d2e61bb2baa0313542925e620e9bcb4942..3d3d9c795a6e5be65fe0329e82dd018c
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 756f08f25924c2128a0c8d4ea21f1bc905c33301..586c13070cf0fbbe339bfc5a7b1023f8d1d16cad 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -338,7 +338,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex);
}
- MinecraftServer.getServer().getPlayerList().getPlayers().forEach(player -> {
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().realPlayers.forEach(player -> { // Leaves - only real players
player.getAdvancements().reload(MinecraftServer.getServer().getAdvancements());
player.getAdvancements().flushDirty(player, false);
});
diff --git a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java
index 25aae550dcdcef2df268d0dd99bdcc9bbd49fcf8..83af50de50a03e164d572f3c3466b6d0b42ed138 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/LazyPlayerSet.java
@@ -23,7 +23,7 @@ public class LazyPlayerSet extends LazyHashSet<Player> {
}
public static Set<Player> makePlayerSet(final MinecraftServer server) {
- List<ServerPlayer> players = server.getPlayerList().players;
+ List<ServerPlayer> players = server.getPlayerList().realPlayers; // Leaves - only real players
Set<Player> reference = new HashSet<>(players.size());
for (ServerPlayer player : players) {
reference.add(player.getBukkitEntity());

View File

@@ -1,11 +1,15 @@
package org.leavesmc.leaves.plugin;
import io.papermc.paper.plugin.configuration.PluginMeta;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.generator.BiomeProvider;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginBase;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
@@ -24,10 +28,12 @@ public class MinecraftInternalPlugin extends PluginBase {
private boolean enabled = true;
private final PluginDescriptionFile pdf;
private final PluginLogger logger;
public MinecraftInternalPlugin() {
String pluginName = "Minecraft";
pdf = new PluginDescriptionFile(pluginName, "1.0", "nms");
logger = new PluginLogger(this);
}
public void setEnabled(boolean enabled) {
@@ -35,27 +41,47 @@ public class MinecraftInternalPlugin extends PluginBase {
}
@Override
public File getDataFolder() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public PluginDescriptionFile getDescription() {
public @NotNull PluginDescriptionFile getDescription() {
return pdf;
}
@Override
public io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() {
public @NotNull PluginMeta getPluginMeta() {
return pdf;
}
@Override
public FileConfiguration getConfig() {
public @NotNull PluginLogger getLogger() {
return logger;
}
@Override
public @NotNull Server getServer() {
return Bukkit.getServer();
}
@Override
public boolean isEnabled() {
return enabled;
}
@Override
public @NotNull PluginLoader getPluginLoader() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public InputStream getResource(String filename) {
public @NotNull File getDataFolder() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public @NotNull FileConfiguration getConfig() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public InputStream getResource(@NotNull String filename) {
throw new UnsupportedOperationException("Not supported.");
}
@@ -70,7 +96,7 @@ public class MinecraftInternalPlugin extends PluginBase {
}
@Override
public void saveResource(String resourcePath, boolean replace) {
public void saveResource(@NotNull String resourcePath, boolean replace) {
throw new UnsupportedOperationException("Not supported.");
}
@@ -79,26 +105,6 @@ public class MinecraftInternalPlugin extends PluginBase {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public PluginLogger getLogger() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public PluginLoader getPluginLoader() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public Server getServer() {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public boolean isEnabled() {
return enabled;
}
@Override
public void onDisable() {
throw new UnsupportedOperationException("Not supported.");
@@ -125,7 +131,7 @@ public class MinecraftInternalPlugin extends PluginBase {
}
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
public ChunkGenerator getDefaultWorldGenerator(@NotNull String worldName, String id) {
throw new UnsupportedOperationException("Not supported.");
}
@@ -135,17 +141,17 @@ public class MinecraftInternalPlugin extends PluginBase {
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String @NotNull [] args) {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String @NotNull [] args) {
throw new UnsupportedOperationException("Not supported.");
}
@Override
public @NotNull io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager<org.bukkit.plugin.Plugin> getLifecycleManager() {
public @NotNull LifecycleEventManager<@NotNull Plugin> getLifecycleManager() {
throw new UnsupportedOperationException("Not supported.");
}
}

View File

@@ -224,7 +224,7 @@ public class Recorder extends Connection {
try {
replayFile.saveMetaData(metaData);
} catch (IOException e) {
e.printStackTrace();
LOGGER.severe("Error saving metadata", e);
}
});
}
@@ -234,13 +234,8 @@ public class Recorder extends Connection {
}
private void savePacket(Packet<?> packet, final ConnectionProtocol protocol) {
try {
final long timestamp = getCurrentTimeAndUpdate();
replayFile.savePacket(timestamp, packet, protocol);
} catch (Exception e) {
LOGGER.severe("Error saving packet");
e.printStackTrace();
}
}
public boolean isSaved() {

View File

@@ -121,7 +121,7 @@ public class ReplayFile {
}
}
public void savePacket(long timestamp, Packet<?> packet, ConnectionProtocol protocol) throws Exception {
public void savePacket(long timestamp, Packet<?> packet, ConnectionProtocol protocol) {
byte[] data = getPacketBytes(packet, protocol);
saveService.execute(() -> {
try {
@@ -129,8 +129,7 @@ public class ReplayFile {
packetStream.writeInt(data.length);
packetStream.write(data);
} catch (Exception e) {
LOGGER.severe("Error saving packet");
e.printStackTrace();
LOGGER.severe("Error saving packet", e);
}
});
}

View File

@@ -77,7 +77,6 @@ public class ServerPhotographer extends ServerPlayer {
@Override
public void tick() {
super.tick();
super.doTick();
if (this.getServer().getTickCount() % 10 == 0) {
connection.resetPosition();