3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

even moaaar patches

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-07 16:20:26 -07:00
Ursprung c31a22c563
Commit f0889559f3
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: ECE0B3C133C016C5
36 geänderte Dateien mit 132 neuen und 131 gelöschten Zeilen

Datei anzeigen

@ -32,10 +32,10 @@ This patch fixes https://bugs.mojang.com/browse/MC-188840
This patch also fixes rail duping and carpet duping.
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
index 29755807fdb6c30e31c0ec2bbf33bed9afd5d478..8d73893100884c08aa552ff41c2a07a3e714df47 100644
index 4f6b7ed4809086811f0460544ba2ec0606f0f5da..9abae63e06c1dde9b8434d32bac8798808428d10 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonBaseBlock.java
@@ -411,14 +411,26 @@ public class PistonBaseBlock extends DirectionalBlock {
@@ -412,14 +412,26 @@ public class PistonBaseBlock extends DirectionalBlock {
}
for (k = list.size() - 1; k >= 0; --k) {
@ -66,7 +66,7 @@ index 29755807fdb6c30e31c0ec2bbf33bed9afd5d478..8d73893100884c08aa552ff41c2a07a3
}
diff --git a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
index 4f7b12d8f213d43f4ef5538b7e05809a1a106cbd..221c5d080d55326e458c1182823d6b49224ef498 100644
index 17a6327ab7b26dfab38881bbc0689b0b25f8f025..30fafbb26a347b73c72b9f5c30da3b01e42b851c 100644
--- a/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -288,7 +288,7 @@ public class PistonMovingBlockEntity extends BlockEntity {

Datei anzeigen

@ -7,7 +7,7 @@ If the falling block dies during teleportation (entity#move), then we need
to detect that by placing a check after the move.
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3a4065107 100644
index 95bcd8f03a784287c5a6106c784448e54c4b531b..4a44109df0aece6661567dac5ebf6355de5d58c7 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -129,6 +129,11 @@ public class FallingBlockEntity extends Entity {
@ -22,10 +22,11 @@ index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3
if (this.blockState.isAir()) {
this.discard();
} else {
@@ -141,6 +146,12 @@ public class FallingBlockEntity extends Entity {
@@ -140,6 +145,13 @@ public class FallingBlockEntity extends Entity {
}
this.move(MoverType.SELF, this.getDeltaMovement());
+
+ // Paper start - fix sand duping
+ if (this.isRemoved()) {
+ return;
@ -33,5 +34,5 @@ index d5c30c48a6b59b01041dffc8b4b7b70ea27f0c7d..5967e5093af785b5ad33e0b0da2044b3
+ // Paper end - fix sand duping
+
// Paper start - Configurable EntityFallingBlock height nerf
if (this.level.paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {

Datei anzeigen

@ -14,18 +14,18 @@ behaviour, we need to move all of this dangerous logic outside
of the move call and into an appropriate place in the tick method.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f77abe31d6d56c11dba390cca4b8069bc535103a..16eaffffd78e60a79cdd6a15abab90c81affce78 100644
index a9cdf3e774dbc8b689c7bbd95d94c8be32b33d92..76407e0d9081e848380c17b5f680a8560173edbc 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1438,6 +1438,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1434,6 +1434,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
this.player.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
+ // Paper start - prevent position desync
+ if (this.awaitingPositionFromClient != null) {
+ return; // ... thanks Mojang for letting move calls teleport across dimensions.
+ }
+ // Paper end - prevent position desync
double d12 = d8;
double d11 = d7;
d7 = d0 - this.player.getX();
d6 = d0 - this.player.getX();

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 38ee1f5b16e60405947b171030fc7d828440aeb0..cf1034b252d95913a3888a04b1658644c0e8e374 100644
index 76407e0d9081e848380c17b5f680a8560173edbc..4e90349313c7e8a94949c94127dee24780a631eb 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3115,9 +3115,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3107,9 +3107,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add permission for command blocks
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 051cbce8394c7a629a7ea8ac422308d96bbad6a6..52d71b08c8338254a0e50780363155da4f4c1934 100644
index 562534d15f6f70ff286be90fb512b807e00ad807..c185083abf2b4527a7fe046d83c64cd2cc5b5bb9 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -404,7 +404,7 @@ public class ServerPlayerGameMode {
@@ -402,7 +402,7 @@ public class ServerPlayerGameMode {
BlockEntity tileentity = this.level.getBlockEntity(pos);
Block block = iblockdata.getBlock();
@ -18,11 +18,11 @@ index 051cbce8394c7a629a7ea8ac422308d96bbad6a6..52d71b08c8338254a0e50780363155da
return false;
} else if (this.player.blockActionRestricted(this.level, pos, this.gameModeForPlayer)) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 16baa852df509a3180dc38c8e1c262bf5602b539..cf065dc3a37080fd74c240271d4699ea278ac333 100644
index 4e90349313c7e8a94949c94127dee24780a631eb..792cc9567e1982f0cea75078045d70bc806934a4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -870,7 +870,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -871,7 +871,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
- } else if (!this.player.canUseGameMasterBlocks()) {
@ -30,17 +30,17 @@ index 16baa852df509a3180dc38c8e1c262bf5602b539..cf065dc3a37080fd74c240271d4699ea
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
} else {
BaseCommandBlock commandblocklistenerabstract = null;
@@ -937,7 +937,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -938,7 +938,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (!this.server.isCommandBlockEnabled()) {
this.player.sendSystemMessage(Component.translatable("advMode.notEnabled"));
- } else if (!this.player.canUseGameMasterBlocks()) {
+ } else if (!this.player.canUseGameMasterBlocks() && (!this.player.isCreative() || !this.player.getBukkitEntity().hasPermission("minecraft.commandblock"))) { // Paper - command block permission
this.player.sendSystemMessage(Component.translatable("advMode.notAllowed"));
} else {
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level);
BaseCommandBlock commandblocklistenerabstract = packet.getCommandBlock(this.player.level());
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
index 7dac559fd35e7ba646b84bb28315001375723643..7c7e5f3c0f9cd1f16192a8fc8163da9b2d9519d5 100644
index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..c138678fe82e6c1dd7ce634f90bcbfcad6159276 100644
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
@@ -198,7 +198,7 @@ public abstract class BaseCommandBlock implements CommandSource {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c64a0e654e 100644
index e17237a1fe56bf04516b0ee0489c781a225b6a81..316597f54e6ce8da0869e6398b048c618b4a1a7b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -715,8 +715,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -636,8 +636,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public void setPos(double x, double y, double z) {
@ -19,7 +19,7 @@ index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c6
}
protected AABB makeBoundingBox() {
@@ -4075,6 +4075,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4112,6 +4112,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public final void setPosRaw(double x, double y, double z) {
@ -28,10 +28,10 @@ index 2c9a829c3376e8767627fc94bb063486c7d0d81c..24ba8dc2a5fc72ade003fa14d337f2c6
+ }
+ public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
+ // Paper end
// Paper start - rewrite chunk system
if (this.updatingSectionStatus) {
LOGGER.error("Refusing to update position for entity " + this + " to position " + new Vec3(x, y, z) + " since it is processing a section status update", new Throwable());
@@ -4098,6 +4103,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (this.position.x != x || this.position.y != y || this.position.z != z) {
this.position = new Vec3(x, y, z);
int i = Mth.floor(x);
@@ -4129,6 +4134,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.levelCallback.onMove();
}

Datei anzeigen

@ -8,11 +8,11 @@ makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68b318381f 100644
index 49283b13a88402ac5b54fd8c64e90a82499d09d7..afa54e9cdb81f08cd9703a3991b90dbd53861b61 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -802,7 +802,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size
@@ -800,7 +800,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper
// CraftBukkit start
// this.updateMobSpawningFlags();
- worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());
@ -20,7 +20,7 @@ index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68
this.forceTicks = false;
// CraftBukkit end
@@ -1729,11 +1729,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1734,11 +1734,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@ -40,7 +40,7 @@ index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68
}
}
@@ -1747,7 +1750,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1752,7 +1755,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
@ -50,20 +50,20 @@ index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68
}
diff --git a/src/main/java/net/minecraft/server/commands/DifficultyCommand.java b/src/main/java/net/minecraft/server/commands/DifficultyCommand.java
index 4bb29f86538552bb62125cc61210fd77b1ec671d..817193ca5fc15134d2985187bc2226ccbb4f0108 100644
index 89be3991ef4fb2deb7276c5409cb571a7fb1f821..9c272f7cf8cbd2bbe147e57f7fabe135b6ff5c0b 100644
--- a/src/main/java/net/minecraft/server/commands/DifficultyCommand.java
+++ b/src/main/java/net/minecraft/server/commands/DifficultyCommand.java
@@ -47,7 +47,7 @@ public class DifficultyCommand {
@@ -49,7 +49,7 @@ public class DifficultyCommand {
if (worldServer.getDifficulty() == difficulty) { // CraftBukkit
throw DifficultyCommand.ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
} else {
- worldServer.serverLevelData.setDifficulty(difficulty); // CraftBukkit
+ minecraftserver.setDifficulty(worldServer, difficulty, true); // Paper - don't skip other difficulty-changing logic (fix upstream's fix)
source.sendSuccess(Component.translatable("commands.difficulty.success", difficulty.getDisplayName()), true);
return 0;
}
source.sendSuccess(() -> {
return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
}, true);
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 771677c0e1cd7bfe089b9a5bb9095650216ff588..520cd1a6b347687b2ec6d13f034be391d1a1af85 100644
index 9d2eb13130d3b68fd0ca07243a3a41735f89c7b2..97b8c8cf85527db734e70679b29d64cdfbbddec3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -326,7 +326,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -76,25 +76,25 @@ index 771677c0e1cd7bfe089b9a5bb9095650216ff588..520cd1a6b347687b2ec6d13f034be391
@Override
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 245ac1e53bfcb1888e8f10d632b181cf31d6d030..2c052d0a8c6d58ad8eae41c22c753327342e90f1 100644
index 4495edee3b29c441d14460be1bb3f5e0ef4b9851..af06ca58e3ae488d23566b3db333067c62145ae0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1163,7 +1163,7 @@ public class ServerPlayer extends Player {
@@ -1161,7 +1161,7 @@ public class ServerPlayer extends Player {
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
this.connection.send(new ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), (byte) 3, this.getLastDeathLocation()));
- this.connection.send(new ClientboundChangeDifficultyPacket(this.level.getDifficulty(), this.level.getLevelData().isDifficultyLocked()));
+ this.connection.send(new ClientboundChangeDifficultyPacket(worldserver.getDifficulty(), this.level.getLevelData().isDifficultyLocked())); // Paper - fix difficulty sync issue
this.connection.send(new ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), (byte) 3, this.getLastDeathLocation(), this.getPortalCooldown()));
- this.connection.send(new ClientboundChangeDifficultyPacket(this.level().getDifficulty(), this.level().getLevelData().isDifficultyLocked()));
+ this.connection.send(new ClientboundChangeDifficultyPacket(worldserver.getDifficulty(), this.level().getLevelData().isDifficultyLocked())); // Paper - fix difficulty sync issue
PlayerList playerlist = this.server.getPlayerList();
playerlist.sendPlayerPermissionLevel(this);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e9902fa67719c4b40fb9524bf77798357e9a97d9..b4f17b9c195081b54d79494d9afaf0da21f292c0 100644
index 792cc9567e1982f0cea75078045d70bc806934a4..2768e46562f36bcb11cead95e65deb8db4884a12 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3390,7 +3390,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3345,7 +3345,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {
- this.server.setDifficulty(packet.getDifficulty(), false);
+ // this.server.setDifficulty(packet.getDifficulty(), false); // Paper - don't allow clients to change this
@ -102,7 +102,7 @@ index e9902fa67719c4b40fb9524bf77798357e9a97d9..b4f17b9c195081b54d79494d9afaf0da
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d4439eb165cf01f4dd7eb106d14f7b96c1989e63..dfde62de3b59b9c2473e8f320552051a8904d51b 100644
index cd04bdf3637584b6ea7298b5d833d4a71ce427ff..ae1c8ec8b1cbfd5fab89d6cf5e33e2f209f82d03 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -964,8 +964,8 @@ public final class CraftServer implements Server {
@ -117,10 +117,10 @@ index d4439eb165cf01f4dd7eb106d14f7b96c1989e63..dfde62de3b59b9c2473e8f320552051a
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index ec934c2cb6f183c43c06ba9c4d015890d5992934..6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d 100644
index 76054a4fc036b1f9577aa8da215388c5137f3611..7cca27a4bedbb4b1f5cf0707e72052b6e155acfd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1145,7 +1145,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1150,7 +1150,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setDifficulty(Difficulty difficulty) {

Datei anzeigen

@ -6,12 +6,12 @@ Subject: [PATCH] Paper dumpitem command
Let's you quickly view the item in your hands NBT data
diff --git a/src/main/java/io/papermc/paper/command/PaperCommand.java b/src/main/java/io/papermc/paper/command/PaperCommand.java
index 1e9f191dc0f9d98f4404d2796f15b13912860b13..6d56c812262f7f109598ef4a941d0226b1eb638a 100644
index 1188d221be8a4f1dece514e3f66b99f60b556488..65209c7d15fc1b51e20c4f18cd44d1f61c769d09 100644
--- a/src/main/java/io/papermc/paper/command/PaperCommand.java
+++ b/src/main/java/io/papermc/paper/command/PaperCommand.java
@@ -42,6 +42,7 @@ public final class PaperCommand extends Command {
@@ -41,6 +41,7 @@ public final class PaperCommand extends Command {
commands.put(Set.of("dumpplugins"), new DumpPluginsCommand());
commands.put(Set.of("fixlight"), new FixLightCommand());
commands.put(Set.of("debug", "chunkinfo", "holderinfo"), new ChunkDebugCommand());
commands.put(Set.of("syncloadinfo"), new SyncLoadInfoCommand());
+ commands.put(Set.of("dumpitem"), new DumpItemCommand());

Datei anzeigen

@ -7,10 +7,10 @@ Inline bit operations and reduce instruction count to make these hot
operations faster
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b123501498140238a 100644
index fbdbf61f49bd6867eea609d5572fb31ece094944..441ea6b9fd55a5288f264472d7297728d0546d6b 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -30,15 +30,16 @@ public class BlockPos extends Vec3i {
@@ -37,15 +37,16 @@ public class BlockPos extends Vec3i {
}).stable();
private static final Logger LOGGER = LogUtils.getLogger();
public static final BlockPos ZERO = new BlockPos(0, 0, 0);
@ -36,7 +36,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149
public BlockPos(int x, int y, int z) {
super(x, y, z);
@@ -48,28 +49,29 @@ public class BlockPos extends Vec3i {
@@ -55,28 +56,29 @@ public class BlockPos extends Vec3i {
this(pos.getX(), pos.getY(), pos.getZ());
}
@ -71,7 +71,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149
}
public static BlockPos containing(double x, double y, double z) {
@@ -85,10 +87,7 @@ public class BlockPos extends Vec3i {
@@ -92,10 +94,7 @@ public class BlockPos extends Vec3i {
}
public static long asLong(int x, int y, int z) {
@ -84,7 +84,7 @@ index cf7b12993090e72802a966b3cb40e5d33c1bc5ed..5a42e0315fb44c2a0390c51b12350149
public static long getFlatIndex(long y) {
diff --git a/src/main/java/net/minecraft/core/SectionPos.java b/src/main/java/net/minecraft/core/SectionPos.java
index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd881a0f00d3 100644
index eb97928380384b8c33cf142dd9a5db65951c94c6..392c3681c08d9e3d99cbabaf72d22c1d1518998d 100644
--- a/src/main/java/net/minecraft/core/SectionPos.java
+++ b/src/main/java/net/minecraft/core/SectionPos.java
@@ -38,7 +38,7 @@ public class SectionPos extends Vec3i {
@ -167,8 +167,8 @@ index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd88
+ return (((long) (int) (blockPos >> 42) & 4194303L) << 42) | (((long) (int) ((blockPos << 52) >> 56) & 1048575L)) | (((long) (int) ((blockPos << 26) >> 42) & 4194303L) << 20); // Simplify to reduce instruction count
}
public static long getZeroNode(long pos) {
@@ -201,15 +207,18 @@ public class SectionPos extends Vec3i {
public static long getZeroNode(int x, int z) {
@@ -205,15 +211,18 @@ public class SectionPos extends Vec3i {
return asLong(blockToSectionCoord(pos.getX()), blockToSectionCoord(pos.getY()), blockToSectionCoord(pos.getZ()));
}
@ -192,7 +192,7 @@ index a481bd6328fe9e66f6911bf32ed11947c504c93c..a9d0d72aad7b1b708617a082c5efcd88
}
@Override
@@ -222,16 +231,11 @@ public class SectionPos extends Vec3i {
@@ -226,16 +235,11 @@ public class SectionPos extends Vec3i {
}
public static Stream<SectionPos> cube(SectionPos center, int radius) {

Datei anzeigen

@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead
Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dfde62de3b59b9c2473e8f320552051a8904d51b..e9c52523142df3a0dd9ae9389c69024eb2fe5386 100644
index ae1c8ec8b1cbfd5fab89d6cf5e33e2f209f82d03..fcf6585a66a95c3414c2b4eb384b9321aa678c22 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -377,7 +377,7 @@ public final class CraftServer implements Server {
@ -44,7 +44,7 @@ index dfde62de3b59b9c2473e8f320552051a8904d51b..e9c52523142df3a0dd9ae9389c69024e
this.printSaveWarning = false;
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea46f75bd2 100644
index 7cca27a4bedbb4b1f5cf0707e72052b6e155acfd..4ee07d866c23ffe3061ccf0d663e5d4235b9007e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -280,7 +280,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@ -84,7 +84,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea
}
return true;
@@ -445,9 +457,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -437,9 +449,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
// Paper start - Optimize this method
ChunkPos chunkPos = new ChunkPos(x, z);
@ -98,7 +98,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea
if (immediate == null) {
immediate = world.getChunkSource().chunkMap.getUnloadingChunk(x, z);
}
@@ -455,7 +470,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -447,7 +462,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
if (!(immediate instanceof ImposterProtoChunk) && !(immediate instanceof net.minecraft.world.level.chunk.LevelChunk)) {
return false; // not full status
}
@ -107,7 +107,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
return true;
}
@@ -481,7 +496,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -473,7 +488,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// we do this so we do not re-read the chunk data on disk
}
@ -116,7 +116,7 @@ index 6a5405265b2cb2f4e681c5e3a84ffccbac4fc79d..3711c2842d4830b4a7dd0cd9fd5a4dea
world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true);
return true;
// Paper end
@@ -2201,6 +2216,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -2167,6 +2182,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> {
net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> {
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c;

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 55625495437e94d5dc98fabe68550f68b318381f..4fec26c84cb435756fe4b2dcdfc90716f342f9f1 100644
index afa54e9cdb81f08cd9703a3991b90dbd53861b61..b5cc8a2c46b928796c47832ee7430f63f616bfd2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -875,7 +875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -863,7 +863,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try {
this.isSaving = true;
@ -17,7 +17,7 @@ index 55625495437e94d5dc98fabe68550f68b318381f..4fec26c84cb435756fe4b2dcdfc90716
flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally {
this.isSaving = false;
@@ -1384,13 +1384,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1389,13 +1389,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus();
}
@ -53,10 +53,10 @@ index 55625495437e94d5dc98fabe68550f68b318381f..4fec26c84cb435756fe4b2dcdfc90716
// Paper start - move executeAll() into full server tick timing
try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 298e4468f7b5346733257f7117f76c66e9a1d8f0..d1652c237b2b272f0dfe80f774cff16056f39046 100644
index 2cbb2a02da1e5de18613ee977dafc92af9b552e9..fc66799e2a60ac9f67373e227e5955e88df8a039 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -602,6 +602,15 @@ public class ServerChunkCache extends ChunkSource {
@@ -603,6 +603,15 @@ public class ServerChunkCache extends ChunkSource {
} // Paper - Timings
}
@ -73,10 +73,10 @@ index 298e4468f7b5346733257f7117f76c66e9a1d8f0..d1652c237b2b272f0dfe80f774cff160
public void close() throws IOException {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 51e8070864ffc4a35377021a7ded9813a40c1a11..06d20e9fde26540d1575975345f3d69405f767d0 100644
index 8cdb2bdd404f2f091493bb7a93f62f764a8e511b..1a904c0d832197b5f820b9dd417c6d38f7fcc311 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1140,6 +1140,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1051,6 +1051,37 @@ public class ServerLevel extends Level implements WorldGenLevel {
return !this.server.isUnderSpawnProtection(this, pos, player) && this.getWorldBorder().isWithinBounds(pos);
}
@ -112,10 +112,10 @@ index 51e8070864ffc4a35377021a7ded9813a40c1a11..06d20e9fde26540d1575975345f3d694
+ // Paper end
+
public void save(@Nullable ProgressListener progressListener, boolean flush, boolean savingDisabled) {
// Paper start - rewrite chunk system - add close param
this.save(progressListener, flush, savingDisabled, false);
ServerChunkCache chunkproviderserver = this.getChunkSource();
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2c052d0a8c6d58ad8eae41c22c753327342e90f1..5b6ecebcb4585877a2761eb17f4810042320e681 100644
index af06ca58e3ae488d23566b3db333067c62145ae0..ad33c444100243b45bd8ee8603b21b41109faa2e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -189,6 +189,7 @@ import org.bukkit.inventory.MainHand;
@ -127,10 +127,10 @@ index 2c052d0a8c6d58ad8eae41c22c753327342e90f1..5b6ecebcb4585877a2761eb17f481004
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
public ServerGamePacketListenerImpl connection;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0e2a84148e721a8f799f0746e379c16a5f7f0dd3..5abcdc6901de56e4ba264f395b5ff0aac1b84c23 100644
index 498516c98f396e601e67b9e47a62e89f709f98a5..bc2bf0fc3bd169caadba9a2e3faf2fa333a41f04 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -528,6 +528,7 @@ public abstract class PlayerList {
@@ -535,6 +535,7 @@ public abstract class PlayerList {
protected void save(ServerPlayer player) {
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
@ -138,7 +138,7 @@ index 0e2a84148e721a8f799f0746e379c16a5f7f0dd3..5abcdc6901de56e4ba264f395b5ff0aa
this.playerIo.save(player);
ServerStatsCounter serverstatisticmanager = (ServerStatsCounter) player.getStats(); // CraftBukkit
@@ -1118,10 +1119,22 @@ public abstract class PlayerList {
@@ -1125,10 +1126,22 @@ public abstract class PlayerList {
}
public void saveAll() {

Datei anzeigen

@ -23,7 +23,7 @@ index 7bc60901297d27d88efb401d02b4bc06d8b28874..6dac24354192bea79a4b9eb721543110
String string3 = compoundTag2.getString("Value");
if (compoundTag2.contains("Signature", 8)) {
diff --git a/src/main/java/net/minecraft/world/item/PlayerHeadItem.java b/src/main/java/net/minecraft/world/item/PlayerHeadItem.java
index 8fb0d34e3c9a15e763f3ad493a31ba8d59b240d7..045a988fc11587e2d7bd78b43f058092c880272c 100644
index 98465d012357b76103d73952527c43c317d0f1bd..4969353e3a02ad70d973ae8780d018710f2462a3 100644
--- a/src/main/java/net/minecraft/world/item/PlayerHeadItem.java
+++ b/src/main/java/net/minecraft/world/item/PlayerHeadItem.java
@@ -53,6 +53,18 @@ public class PlayerHeadItem extends StandingAndWallBlockItem {

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Remove some streams from structures
This showed up a lot in the spark profiler, should have a low-medium performance improvement.
diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
index ad82bed470471dcb11035be2cb54972e4f2c1c9b..af63ad44103e0ca1dfe17d468e41531728c957aa 100644
index bb8d8edb47621665872a5e8fc01512ba40c1b913..5d721dc196a6bde511f46dbdedb2e1d98553ac52 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {

Datei anzeigen

@ -5,11 +5,11 @@ Subject: [PATCH] Improve/fix EntityTargetLivingEntityEvent
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
index 7ae873f391b1c22a57f504490eabe7da558a6ec2..212e307077dfa274a4d4e4192760de23a75ef12a 100644
index 5aeef564cdaabeed88a52635e56073cca3a9d1f1..2fd7763f125421cf6bb3c0faf26253c9034183fc 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/StopAttackingIfTargetInvalid.java
@@ -47,17 +47,30 @@ public class StopAttackingIfTargetInvalid {
if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level == entityinsentient.level && !alternativeCondition.test(entityliving)) {
if (entityinsentient.canAttack(entityliving) && (!shouldForgetIfTargetUnreachable || !StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entityinsentient, behaviorbuilder_b.tryGet(memoryaccessor1))) && entityliving.isAlive() && entityliving.level() == entityinsentient.level() && !alternativeCondition.test(entityliving)) {
return true;
} else {
+ // Paper start - better track target change reason

Datei anzeigen

@ -8,7 +8,7 @@ public net.minecraft.world.entity.Entity isInRain()Z
public net.minecraft.world.entity.Entity isInBubbleColumn()Z
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 13169525ce6260f6d4a0501af0f5bea284a5ba96..b1697227b34858da01603abbf7a7476494ce59be 100644
index 5d8532bc2c4253aa3941ff8c4d48cc8c3860b3b0..5d01b33df41ecc51e2c2b44bad34a65e823d69ce 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1308,5 +1308,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Update itemstack legacy name and lore
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 57661672d02b19c864bb267c09b2fa433e716b7b..3cb83cfeb2709384ef4f7dd74694d47d55698c1f 100644
index 441fbeb3226b698648788de5ad58b94a66499a41..020737fba27b6615905da4ac1724bbac8ec0bf4f 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -173,6 +173,44 @@ public final class ItemStack {
@@ -171,6 +171,44 @@ public final class ItemStack {
list.sort((java.util.Comparator<? super net.minecraft.nbt.Tag>) enchantSorter); // Paper
} catch (Exception ignored) {}
}
@ -53,7 +53,7 @@ index 57661672d02b19c864bb267c09b2fa433e716b7b..3cb83cfeb2709384ef4f7dd74694d47d
// Paper end
public ItemStack(ItemLike item) {
@@ -227,6 +265,7 @@ public final class ItemStack {
@@ -222,6 +260,7 @@ public final class ItemStack {
this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
this.processEnchantOrder(this.tag); // Paper

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Spawn player in correct world on login
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 44ead3a9831d913f7337a447b73a94e06fb0f06a..ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba 100644
index bc2bf0fc3bd169caadba9a2e3faf2fa333a41f04..2d75a19def131b63e238dd81bb651834ed53df6b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -205,7 +205,18 @@ public abstract class PlayerList {
@@ -212,7 +212,18 @@ public abstract class PlayerList {
}
// CraftBukkit end

Datei anzeigen

@ -8,19 +8,19 @@ Adds a new event for all crafting stations that generate a result slot item
Anvil, Grindstone and Smithing now extend this event
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index 0a132fbbc58f52e51f50a44e887a3f20d2e0a61c..b7a2295290227045e6426ee0f71707185d95b943 100644
index d15f01f5a4f14d25ded9de015c70cbc7977a6a77..e0c3a4ba27e21c3692e601acd0af60873bcbb84c 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -332,6 +332,7 @@ public class AnvilMenu extends ItemCombinerMenu {
}
@@ -338,6 +338,7 @@ public class AnvilMenu extends ItemCombinerMenu {
}
this.createResult();
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
}
public int getCost() {
this.createResult();
+ org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareResultEvent(this, RESULT_SLOT); // Paper
return true;
} else {
return false;
diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
index 8e4f331b9d90c98943e93a70b574d59cbb6d2909..310e447d8db86a322ca33d4e803b03ead8a7b202 100644
index fe1ce65b35e83ee0ada77e44b080729346bb3c2d..819187dbcf468d9278ce33bd97688476aab53f8e 100644
--- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java
@@ -150,6 +150,7 @@ public class CartographyTableMenu extends AbstractContainerMenu {
@ -32,7 +32,7 @@ index 8e4f331b9d90c98943e93a70b574d59cbb6d2909..310e447d8db86a322ca33d4e803b03ea
private void setupResultSlot(ItemStack map, ItemStack item, ItemStack oldResult) {
diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
index 5bcd3857fd30ec43e0191a862fc9c7712149e3dd..4770f2b19847be6002f9fea9c258f8239b735589 100644
index 2c263447aa8853f18d1c1d476b49a47f6e9ca2ad..03d3edadf39d4871a332808458870ea9479669c4 100644
--- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java
@@ -159,6 +159,7 @@ public class GrindstoneMenu extends AbstractContainerMenu {
@ -56,7 +56,7 @@ index 4087e381b2250be387b608d8742f6a6009a52879..ff770b9ce68a62418de0c7ed38965062
}
diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
index cdc7334b21120dde30705138436608a3af4acf05..6e2784938e1e1a29ac133567ae6c2d29429478f0 100644
index edc8da447a531cec3a0590ee39811f0949ca7dda..c4766df6d64b484375e5e3474e97dee196c0fef4 100644
--- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java
@@ -248,7 +248,8 @@ public class LoomMenu extends AbstractContainerMenu {
@ -70,10 +70,10 @@ index cdc7334b21120dde30705138436608a3af4acf05..6e2784938e1e1a29ac133567ae6c2d29
this.resultSlot.set(ItemStack.EMPTY);
this.selectablePatterns = List.of();
diff --git a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
index d8437b76488e26451f3ed13c392fab6c2badc085..db73a4dda83a128aa0cd5f19e2f233b86479839a 100644
index a56061fe2a12254827209b17fb0b9d89032649ba..dbfd36859010a1f950769708fbc5fc604c0754a9 100644
--- a/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/SmithingMenu.java
@@ -107,6 +107,7 @@ public class SmithingMenu extends ItemCombinerMenu {
@@ -114,6 +114,7 @@ public class SmithingMenu extends ItemCombinerMenu {
}
}
@ -82,10 +82,10 @@ index d8437b76488e26451f3ed13c392fab6c2badc085..db73a4dda83a128aa0cd5f19e2f233b8
@Override
diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
index 665b01ff3579c8fd87074edfc6da6b7ef07693b2..24c31e96be460bcb5062a1fcf7f86c1affc4978c 100644
index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66c66a28b6 100644
--- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java
@@ -176,6 +176,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
@@ -180,6 +180,7 @@ public class StonecutterMenu extends AbstractContainerMenu {
this.setupRecipeList(inventory, itemstack);
}
@ -94,7 +94,7 @@ index 665b01ff3579c8fd87074edfc6da6b7ef07693b2..24c31e96be460bcb5062a1fcf7f86c1a
private void setupRecipeList(Container input, ItemStack stack) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0ad0d6e15f57c16fb71f988ac7d0d2e243493801..a1948b59e5c6bcc4c85d175d3267e9dd091768a6 100644
index 7af0710c40c1453bd0bd8ecb4ea7606bbe76c20f..2502da6e68f97a7c37f1756d6845e531da1663c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1624,26 +1624,53 @@ public class CraftEventFactory {

Datei anzeigen

@ -5,15 +5,15 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b0a57ff0780c3f37110a9c3640f29cb08daa52d5..164c22a70f4b916615da36819cae09d94cd88d39 100644
index d9ee22bbd654a2f39c443262b4a11f997ed1559e..84f56d1eb0075f1f3d3d52d1b893732c3804c276 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3435,7 +3435,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3484,7 +3484,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Entity entity = this.getVehicle();
super.stopRiding(suppressCancellation); // Paper - suppress
- if (entity != null && entity != this.getVehicle() && !this.level.isClientSide) {
+ if (entity != null && entity != this.getVehicle() && !this.level.isClientSide && entity.valid) { // Paper - don't process on world gen
- if (entity != null && entity != this.getVehicle() && !this.level().isClientSide) {
+ if (entity != null && entity != this.getVehicle() && !this.level().isClientSide && entity.valid) { // Paper - don't process on world gen
this.dismountVehicle(entity);
}

Datei anzeigen

@ -9,7 +9,7 @@ instead of getting stuck in a never despawn state (bubble columns,
etc).
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index 01ccd4f90ad8aed84a89630cf6df9f7ba9bc3fec..6486fa86e4bf3c90c09c0425d825bab568a68757 100644
index 86a82ecdcffc27b523fddc2709bbd92f315e8590..a0d688128a1268fa1acf7c339cde15df5dce1c82 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -200,6 +200,7 @@ public abstract class AbstractArrow extends Projectile {

Datei anzeigen

@ -26,19 +26,19 @@ index 20a7cdf87f307878d66922aaac0c60cff218e46c..39844531b03eb8a6c70700b4ecbf0ff1
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index efad6dc30ff2731fdaed9c7f8d974aba8d8a4bcf..24172c3b7b1d2faa13b18bedf89ad051267feb6c 100644
index 66bd75ee66840f17cc7d00ff89adcb88d83e4dc9..308b3a36f063c401a447f9b7f0364700eee5a54c 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -61,7 +61,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
private final Vec2 rotation;
@@ -64,7 +64,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
private final CommandSigningContext signingContext;
private final TaskChainer chatMessageChainer;
private final IntConsumer returnValueConsumer;
- public volatile CommandNode currentCommand; // CraftBukkit
+ public java.util.Map<Thread, CommandNode> currentCommand = new java.util.concurrent.ConcurrentHashMap<>(); // CraftBukkit // Paper
public boolean bypassSelectorPermissions = false; // Paper
public CommandSourceStack(CommandSource output, Vec3 pos, Vec2 rot, ServerLevel world, int level, String name, Component displayName, MinecraftServer server, @Nullable Entity entity) {
@@ -194,9 +194,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
@@ -203,9 +203,11 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
@Override
public boolean hasPermission(int level) {
// CraftBukkit start

Datei anzeigen

@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is
still at a respawn anchor.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837ecb424d65 100644
index 2d75a19def131b63e238dd81bb651834ed53df6b..20fe7dd46b8b641fe628695f17edac42fd000bb6 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -787,6 +787,7 @@ public abstract class PlayerList {
@@ -794,6 +794,7 @@ public abstract class PlayerList {
// Paper start
boolean isBedSpawn = false;
boolean isRespawn = false;
@ -21,7 +21,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e
// Paper end
// CraftBukkit start - fire PlayerRespawnEvent
@@ -797,7 +798,7 @@ public abstract class PlayerList {
@@ -804,7 +805,7 @@ public abstract class PlayerList {
Optional optional;
if (blockposition != null) {
@ -30,7 +30,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e
} else {
optional = Optional.empty();
}
@@ -841,7 +842,12 @@ public abstract class PlayerList {
@@ -848,7 +849,12 @@ public abstract class PlayerList {
}
// Spigot End
@ -44,7 +44,7 @@ index ff5f15fef219b4ce5907b7eb8a489fc5c09d55ba..14d00939b9a8488eba040bf435e6837e
if (!flag) entityplayer.reset(); // SPIGOT-4785
isRespawn = true; // Paper
} else {
@@ -881,8 +887,14 @@ public abstract class PlayerList {
@@ -888,8 +894,14 @@ public abstract class PlayerList {
}
// entityplayer1.initInventoryMenu();
entityplayer1.setHealth(entityplayer1.getHealth());

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 12ff7071a5b78a8ae5567aa42b69191166a7cbca..51640f991f23ad9c10a969a2c8100bcfab882050 100644
index 13797f0a55d62a022eda19f3134fe6256d15ff67..62bcf73e0ea23a610b67709457a8c6d0cdf3233b 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -169,8 +169,17 @@ public class Main {
@ -29,10 +29,10 @@ index 12ff7071a5b78a8ae5567aa42b69191166a7cbca..51640f991f23ad9c10a969a2c8100bcf
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
index d7d65d0faefa5551480a4090de3a881828238ffd..ef6ff78af2ae747e939895b82ee9d11c75012dcd 100644
index f1cc27809c1e8612f7c4fa912f5e39c07b09d808..a9b2c8cd4dcd3f884e4306bebee9334d3848fce5 100644
--- a/src/main/java/net/minecraft/server/Services.java
+++ b/src/main/java/net/minecraft/server/Services.java
@@ -19,12 +19,12 @@ public record Services(MinecraftSessionService sessionService, SignatureValidato
@@ -22,12 +22,12 @@ public record Services(MinecraftSessionService sessionService, ServicesKeySet se
return java.util.Objects.requireNonNull(this.paperConfigurations);
}
// Paper end
@ -45,6 +45,6 @@ index d7d65d0faefa5551480a4090de3a881828238ffd..ef6ff78af2ae747e939895b82ee9d11c
GameProfileRepository gameProfileRepository = authenticationService.createProfileRepository();
- GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, new File(rootDirectory, "usercache.json"));
+ GameProfileCache gameProfileCache = new GameProfileCache(gameProfileRepository, userCacheFile); // Paper
SignatureValidator signatureValidator = SignatureValidator.from(authenticationService.getServicesKey());
// Paper start
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 51640f991f23ad9c10a969a2c8100bcfab882050..5516888e72adf3f0b39119ed4f24e9aab09b1f37 100644
index 62bcf73e0ea23a610b67709457a8c6d0cdf3233b..b51636545036ee7492c9f907f94295b1dd66a811 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -169,6 +169,7 @@ public class Main {

Datei anzeigen

@ -9,7 +9,7 @@ itself, so the criterion object stores no references - and thus
needs no cleanup.
diff --git a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java
index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fdd3e0489e 100644
index 70d4467e8e4dd9be38a7bfe8494efb6e67e18b9a..4b0e967fac5adb54b2d26ee8f7a1ced259ad11db 100644
--- a/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java
+++ b/src/main/java/net/minecraft/advancements/critereon/SimpleCriterionTrigger.java
@@ -14,22 +14,24 @@ import net.minecraft.server.level.ServerPlayer;
@ -49,7 +49,7 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd
+ tracker.criterionData.remove(this); // Paper - fix AdvancementDataPlayer leak
}
protected abstract T createInstance(JsonObject obj, EntityPredicate.Composite playerPredicate, DeserializationContext predicateDeserializer);
protected abstract T createInstance(JsonObject obj, ContextAwarePredicate playerPredicate, DeserializationContext predicateDeserializer);
@@ -50,7 +52,7 @@ public abstract class SimpleCriterionTrigger<T extends AbstractCriterionTriggerI
protected void trigger(ServerPlayer player, Predicate<T> predicate) {
@ -60,7 +60,7 @@ index 06fc39b19385d36fd0c5bb9a7042a238eb6e8a57..bb1f0e9dbcb792d015d1cb65664a96fd
LootContext lootContext = EntityPredicate.createContext(player, player);
List<CriterionTrigger.Listener<T>> list = null;
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index 6802e1def5e93c208d01a68f5cfc4c8809bb910f..7116b0752c8d790a6eae0cb4ea851beac59faaa4 100644
index 100781852965e09c92aca34785673c5de51c7107..9034faaf7b169788abad01d3da9c65ad5ddc4b8b 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -62,6 +62,7 @@ public class PlayerAdvancements {