More more more work

This commit is contained in:
Nassim Jahnke 2023-12-05 20:54:55 +01:00
parent d7fc0c5ab2
commit 2efd9bb99f
46 changed files with 167 additions and 202 deletions

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Disabling Cat Chest Detection
Offers a gameplay feature to stop cats from blocking chests Offers a gameplay feature to stop cats from blocking chests
diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
index e89be04aed49723aca35c7b17b2a623eac0587e0..af6e245b02d5fb78764d2db0ac200056277b212a 100644 index 3d153e5c48bc80ec969de9a32113537e03fb812b..9804ee2020e5cef23d3f5174d153fc149e611503 100644
--- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java --- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java
@@ -361,6 +361,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements @@ -364,6 +364,11 @@ public class ChestBlock extends AbstractChestBlock<ChestBlockEntity> implements
} }
private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) { private static boolean isCatSittingOnChest(LevelAccessor world, BlockPos pos) {

View File

@ -17,10 +17,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: SoSeDiK <mrsosedik@gmail.com> Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 70fe4e973f41c2e5b12c0d96be418dd40e69c0f2..adef64b955170dc00c75c06bf0f41a09b2516520 100644 index b41351783ea9795afaddce453c82ab32cb8134a1..870a1d6679fa062d90bcfa1a21a8af0cf67f2950 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1926,7 +1926,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1934,7 +1934,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
OutgoingChatMessage outgoing = OutgoingChatMessage.create(original); OutgoingChatMessage outgoing = OutgoingChatMessage.create(original);
@ -29,7 +29,7 @@ index 70fe4e973f41c2e5b12c0d96be418dd40e69c0f2..adef64b955170dc00c75c06bf0f41a09
this.handleCommand(s); this.handleCommand(s);
} else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) {
// Do nothing, this is coming from a plugin // Do nothing, this is coming from a plugin
@@ -2010,7 +2010,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2018,7 +2018,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} }
} }
@ -40,10 +40,10 @@ index 70fe4e973f41c2e5b12c0d96be418dd40e69c0f2..adef64b955170dc00c75c06bf0f41a09
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6f66f8514170e5686ed9410d1c755eeef5b61f8a..56fb2dfc920bde3554706fa218913af448a99fd9 100644 index 7102165a09afdf6f33257f9fcd6c2c96aefd566a..21f7a4d8ad251468b78399df04587991e3df3a65 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -889,7 +889,7 @@ public final class CraftServer implements Server { @@ -884,7 +884,7 @@ public final class CraftServer implements Server {
public boolean dispatchCommand(CommandSender sender, String commandLine) { public boolean dispatchCommand(CommandSender sender, String commandLine) {
Preconditions.checkArgument(sender != null, "sender cannot be null"); Preconditions.checkArgument(sender != null, "sender cannot be null");
Preconditions.checkArgument(commandLine != null, "commandLine cannot be null"); Preconditions.checkArgument(commandLine != null, "commandLine cannot be null");
@ -53,10 +53,10 @@ index 6f66f8514170e5686ed9410d1c755eeef5b61f8a..56fb2dfc920bde3554706fa218913af4
if (this.commandMap.dispatch(sender, commandLine)) { if (this.commandMap.dispatch(sender, commandLine)) {
return true; return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d0448d310fde607a006acf37e86cd3eede93a2ba..4c4219ffe5c172d263106f522ea3ec7ba0d7dfad 100644 index 1e395d14382c79231dc81d6cf7ea864e45906add..445e1349256a788a59831893ba7238ae95ae6bef 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -494,7 +494,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -501,7 +501,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (this.getHandle().connection == null) return; if (this.getHandle().connection == null) return;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index 2e343d108714bd136ab8e7b20acbf241166177de..382cdfd7d7dceeeffed1cdc34b9e475a69b5c76b 100644 index 8b2206c5c56341ecd96837bdb3e0c6ab7c874af5..ef382b08ff8e7f24500aed6752c76e6ffc3f0729 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -331,7 +331,7 @@ public class Slime extends Mob implements Enemy { @@ -338,7 +338,7 @@ public class Slime extends Mob implements Enemy {
} }
ChunkPos chunkcoordintpair = new ChunkPos(pos); ChunkPos chunkcoordintpair = new ChunkPos(pos);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 56fb2dfc920bde3554706fa218913af448a99fd9..b1779442254a582f2563e99bb50e47ba9d98b1d8 100644 index 21f7a4d8ad251468b78399df04587991e3df3a65..0ef715796926076042705d48a20b80c4b4b29466 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2080,6 +2080,7 @@ public final class CraftServer implements Server { @@ -2112,6 +2112,7 @@ public final class CraftServer implements Server {
return this.helpMap; return this.helpMap;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 8d7124a9efce888ccfbef320a90c750f6009f551..aaf8ad36078554aa2783874f395da0997f6af92c 100644 index 0ecfcf1b3a7a7ccdbb0d55f1b1e57feee4e724c3..bde3486b5eb89f8e35778eb59a44c7208ae38743 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -102,7 +102,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -103,7 +103,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@Override @Override
public void setHealth(double health) { public void setHealth(double health) {
health = (float) health; health = (float) health;

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 7720470396d3ade926c4c75c5fab5a3f435b0033..9c211b0db837b16d50aee63d0caf45e1a12bcc83 100644 index bc7d0cc8d66f07b45cffd9952829cc9bed9ce260..00beadec2ad995d724758d051457a3d780d9d813 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -532,6 +532,11 @@ public class FriendlyByteBuf extends ByteBuf { @@ -532,6 +532,11 @@ public class FriendlyByteBuf extends ByteBuf {
public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { // TODO this.adventure$locale
return this.writeUtf(io.papermc.paper.adventure.PaperAdventure.asJsonString(component, this.adventure$locale), 262144); return this.writeWithCodec(NbtOps.INSTANCE, ComponentSerialization.CODEC, io.papermc.paper.adventure.PaperAdventure.asVanilla(component));
} }
+ +
+ @Deprecated + @Deprecated
@ -21,7 +21,7 @@ index 7720470396d3ade926c4c75c5fab5a3f435b0033..9c211b0db837b16d50aee63d0caf45e1
public FriendlyByteBuf writeComponent(Component text) { public FriendlyByteBuf writeComponent(Component text) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java
index c44a276d201fdfa5144d45d319d7761583c60639..f68a1a6dc6add9496e25cb52c318e086e356e2bb 100644 index e77bd5bb66279f579fad4fdcc8b0606410922e9e..4c05fee93eb20044a4198c43d5ae1eebebaabaf7 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java
@@ -7,6 +7,7 @@ import net.minecraft.network.protocol.Packet; @@ -7,6 +7,7 @@ import net.minecraft.network.protocol.Packet;
@ -42,7 +42,7 @@ index c44a276d201fdfa5144d45d319d7761583c60639..f68a1a6dc6add9496e25cb52c318e086
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java
index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a43420b437 100644 index 7bb08db97c324d13836303cc8a4623c71d6c8a2c..5e9045f7722481e1f83a3d36d7b3d86e9f45d5b1 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket.java
@@ -7,6 +7,7 @@ import net.minecraft.network.protocol.Packet; @@ -7,6 +7,7 @@ import net.minecraft.network.protocol.Packet;
@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4
// Paper end // Paper end
buf.writeComponent(this.text); buf.writeComponent(this.text);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4c4219ffe5c172d263106f522ea3ec7ba0d7dfad..ab8b584eb1c98d10caeb7d9581f826b4ae984c7c 100644 index 445e1349256a788a59831893ba7238ae95ae6bef..136dd30ae472a58845a2d8f399d2040faed09345 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -73,7 +73,7 @@ index 4c4219ffe5c172d263106f522ea3ec7ba0d7dfad..ab8b584eb1c98d10caeb7d9581f826b4
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.io.BaseEncoding; import com.google.common.io.BaseEncoding;
@@ -336,6 +337,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -343,6 +344,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable portal search radius
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5d5cdcc3d6ba9b76b083404beb532eecf3f83f50..0d24d283ce035ab89136f4fc49a0ae08d90fd268 100644 index 450a55fd1b01ac67d911d152a04a3dee3aa0a2e9..6fe0883a6746a31acff7ede501e058b68ad6e78d 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3200,7 +3200,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -3233,7 +3233,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType()); double d0 = DimensionType.getTeleportationScale(this.level().dimensionType(), destination.dimensionType());
BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0);
// CraftBukkit start // CraftBukkit start

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b1779442254a582f2563e99bb50e47ba9d98b1d8..3771ac5c7663bbd2cc2c4c1acfe8fd8848713ce8 100644 index 0ef715796926076042705d48a20b80c4b4b29466..8fbd8d021fe638505dc70188779f6b92ef2696cf 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -302,6 +302,7 @@ public final class CraftServer implements Server { @@ -303,6 +303,7 @@ public final class CraftServer implements Server {
public boolean ignoreVanillaPermissions = false; public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView; private final List<CraftPlayer> playerView;
public int reloadCount; public int reloadCount;
@ -17,10 +17,10 @@ index b1779442254a582f2563e99bb50e47ba9d98b1d8..3771ac5c7663bbd2cc2c4c1acfe8fd88
static { static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 402b6e5d6428c5a34d722888670f94c7fbe34fe4..68d00a158751d24c7f0e38920d78c0547f1928eb 100644 index beae7b8cf726f61b25c5afb553da8c34dce1dd37..6100b2e718954b40f63ed30ab32e1dea4edba9a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -470,10 +470,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -477,10 +477,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public void setVelocity(Vector velocity) { public void setVelocity(Vector velocity) {
Preconditions.checkArgument(velocity != null, "velocity"); Preconditions.checkArgument(velocity != null, "velocity");
velocity.checkFinite(); velocity.checkFinite();

View File

@ -16,10 +16,10 @@ The wanted destination was on top of the emerald block however the player ended
This only is the case if the player is teleporting between worlds. This only is the case if the player is teleporting between worlds.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ab8b584eb1c98d10caeb7d9581f826b4ae984c7c..c87cba2252f091b026c9169ebf1117cd82d7942b 100644 index 136dd30ae472a58845a2d8f399d2040faed09345..a58b0d10d73310587a05e40e072029ee258063e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1164,7 +1164,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1171,7 +1171,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
entity.connection.teleport(to); entity.connection.teleport(to);
} else { } else {
// The respawn reason should never be used if the passed location is non null. // The respawn reason should never be used if the passed location is non null.

View File

@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
index 0650b1eee2ae8caa5268f4df82f740440ce16fdf..0214830d9bc98b8d435ff11f40df65596980cf77 100644 index 8d06e8d286da2573e40794adab695ff77e5afd86..78b11d6fd74fb0714a8013fdc78d096643c4f83c 100644
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -59,15 +59,15 @@ index 0650b1eee2ae8caa5268f4df82f740440ce16fdf..0214830d9bc98b8d435ff11f40df6559
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.io.Files; import com.google.common.io.Files;
@@ -358,6 +359,7 @@ public class OldUsersConverter { @@ -357,6 +358,7 @@ public class OldUsersConverter {
root = NbtIo.readCompressed(new java.io.FileInputStream(file5)); root = NbtIo.readCompressed(new java.io.FileInputStream(file5), NbtAccounter.unlimitedHeap());
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
+ ServerInternalException.reportInternalException(exception); // Paper + ServerInternalException.reportInternalException(exception); // Paper
} }
if (root != null) { if (root != null) {
@@ -371,6 +373,7 @@ public class OldUsersConverter { @@ -370,6 +372,7 @@ public class OldUsersConverter {
NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2)); NbtIo.writeCompressed(root, new java.io.FileOutputStream(file2));
} catch (Exception exception) { } catch (Exception exception) {
exception.printStackTrace(); exception.printStackTrace();
@ -88,7 +88,7 @@ index c6fb4c33d7ea52b88d8fc0d90748cbab7387c565..fed09b886f4fa0006d160e5f2abb00df
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index c2dd635cba209962d24b43fbf0ee0e9d9e82fee0..f7c69de5227a9b3fc409374d715aaecdf6330e70 100644 index ac169632113c3d2177910723ce920cd9a4f7af66..5c42b38ab337a3fd4e4b4ac8d0aa2db43540446c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
@ -102,7 +102,7 @@ index c2dd635cba209962d24b43fbf0ee0e9d9e82fee0..f7c69de5227a9b3fc409374d715aaecd
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import java.io.IOException; import java.io.IOException;
@@ -730,6 +735,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -741,6 +746,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper start - Prevent tile entity and entity crashes // Paper start - Prevent tile entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable); MinecraftServer.LOGGER.error(msg, throwable);

View File

@ -11,22 +11,22 @@ So avoid looking up scoreboards and short circuit to the "not on a team"
logic which is most likely to be true. logic which is most likely to be true.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0d24d283ce035ab89136f4fc49a0ae08d90fd268..25dbd41c5eb35b4d6cb1af159f665a1709e107d1 100644 index 6fe0883a6746a31acff7ede501e058b68ad6e78d..08e3e87b2aa9d586cd1b441e7314d0775f7537c8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2831,6 +2831,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2860,6 +2860,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@Nullable @Nullable
public Team getTeam() { public PlayerTeam getTeam() {
+ if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper + if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper
return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName()); return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName());
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f6cfed5ac40726475d1c121d0095c105f9426ae7..0bf4e33a67adf515b2675037b763632f1629ba34 100644 index 4afd257f30ab063c4805e8a3144f51d643c49db3..a43539db71a7344e9477918dc5c7b07d46903bea 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -833,6 +833,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -832,6 +832,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (nbt.contains("Team", 8)) { if (nbt.contains("Team", 8)) {
String s = nbt.getString("Team"); String s = nbt.getString("Team");
PlayerTeam scoreboardteam = this.level().getScoreboard().getPlayerTeam(s); PlayerTeam scoreboardteam = this.level().getScoreboard().getPlayerTeam(s);

View File

@ -7,10 +7,10 @@ Upstream added methods for this, original methods are now
deprecated deprecated
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index aaf8ad36078554aa2783874f395da0997f6af92c..2be4b3f8129e38f72c6c0013cc0de7060a78ae76 100644 index bde3486b5eb89f8e35778eb59a44c7208ae38743..afbf6af7198bc69053882ac200892b5b695a4d36 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -267,9 +267,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -268,9 +268,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
@Override @Override
@ -27,7 +27,7 @@ index aaf8ad36078554aa2783874f395da0997f6af92c..2be4b3f8129e38f72c6c0013cc0de706
} }
@Override @Override
@@ -783,4 +789,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -788,4 +794,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().persistentInvisibility = invisible; this.getHandle().persistentInvisibility = invisible;
this.getHandle().setSharedFlag(5, invisible); this.getHandle().setSharedFlag(5, invisible);
} }

View File

@ -5,16 +5,16 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 0a0a9f1be333911b6de7502a9541063ab9ea0164..a258a252e749e3b7ebb1a6304b7f143e93a67178 100644 index 0a6feccc657e62d7bad5e1461d5538a4c3a16b76..53833e155cf0d2328f2c2b36702970925045be3d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @@ -156,7 +156,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName()); ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack {} rejection", this.playerProfile().getName(), packet.id());
this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect"));
} }
- this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()])); // CraftBukkit - this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()])); // CraftBukkit
+ // Paper start + // Paper start
+ PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()]; + PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()];
+ player.getBukkitEntity().setResourcePackStatus(packStatus); + player.getBukkitEntity().setResourcePackStatus(packStatus);
+ this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit + this.cserver.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(this.getCraftPlayer(), packStatus)); // CraftBukkit
+ // Paper end + // Paper end
@ -22,10 +22,10 @@ index 0a0a9f1be333911b6de7502a9541063ab9ea0164..a258a252e749e3b7ebb1a6304b7f143e
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c87cba2252f091b026c9169ebf1117cd82d7942b..e542d86dbf44e91058ad026e1bf9105d92fa687c 100644 index a58b0d10d73310587a05e40e072029ee258063e1..06c0f72a83de5866f4c734c0809d60446a736af6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -191,6 +191,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -192,6 +192,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private double healthScale = 20; private double healthScale = 20;
private CraftWorldBorder clientWorldBorder = null; private CraftWorldBorder clientWorldBorder = null;
private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener(); private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener();
@ -36,7 +36,7 @@ index c87cba2252f091b026c9169ebf1117cd82d7942b..e542d86dbf44e91058ad026e1bf9105d
public CraftPlayer(CraftServer server, ServerPlayer entity) { public CraftPlayer(CraftServer server, ServerPlayer entity) {
super(server, entity); super(server, entity);
@@ -2372,6 +2376,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2387,6 +2391,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public boolean getAffectsSpawning() { public boolean getAffectsSpawning() {
return this.getHandle().affectsSpawning; return this.getHandle().affectsSpawning;
} }

View File

@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe
A config option has been added for those who depend on the previous behavior, but I don't expect that. A config option has been added for those who depend on the previous behavior, but I don't expect that.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3771ac5c7663bbd2cc2c4c1acfe8fd8848713ce8..231f59b2b2e90915787dfa80519ec55eed789d2d 100644 index 8fbd8d021fe638505dc70188779f6b92ef2696cf..4b10f55ffe8a63de437ff821970f8924c13f6f24 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -465,6 +465,7 @@ public final class CraftServer implements Server { @@ -460,6 +460,7 @@ public final class CraftServer implements Server {
if (type == PluginLoadOrder.STARTUP) { if (type == PluginLoadOrder.STARTUP) {
this.helpMap.clear(); this.helpMap.clear();
this.helpMap.initializeGeneralTopics(); this.helpMap.initializeGeneralTopics();
@ -27,7 +27,7 @@ index 3771ac5c7663bbd2cc2c4c1acfe8fd8848713ce8..231f59b2b2e90915787dfa80519ec55e
} }
Plugin[] plugins = this.pluginManager.getPlugins(); Plugin[] plugins = this.pluginManager.getPlugins();
@@ -484,7 +485,7 @@ public final class CraftServer implements Server { @@ -479,7 +480,7 @@ public final class CraftServer implements Server {
this.commandMap.registerServerAliases(); this.commandMap.registerServerAliases();
DefaultPermissions.registerCorePermissions(); DefaultPermissions.registerCorePermissions();
CraftDefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions();

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions
https://github.com/PaperMC/Paper/issues/49 https://github.com/PaperMC/Paper/issues/49
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 231f59b2b2e90915787dfa80519ec55eed789d2d..111d86f1828b55844302b80b2855fb2ea88d67b6 100644 index 4b10f55ffe8a63de437ff821970f8924c13f6f24..bf194d40a3078c0dda6da2d80d8dbd220f6af749 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2684,5 +2684,23 @@ public final class CraftServer implements Server { @@ -2716,5 +2716,23 @@ public final class CraftServer implements Server {
} }
return this.adventure$audiences; return this.adventure$audiences;
} }

View File

@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it. This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 111d86f1828b55844302b80b2855fb2ea88d67b6..f6e6b929c3ce5091a44bba4ab354b8dae73e7cc8 100644 index bf194d40a3078c0dda6da2d80d8dbd220f6af749..e85017f62eb90efda8d4f3910fe543c9a4a2243a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -956,8 +956,16 @@ public final class CraftServer implements Server { @@ -951,8 +951,16 @@ public final class CraftServer implements Server {
world.spigotConfig.init(); // Spigot world.spigotConfig.init(); // Spigot
} }

View File

@ -18,10 +18,10 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's. ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 1b2c0fda262ca6d5bd2ce22bc2e934803bd6f602..cae548dbb5a3027e2de0bfbe38918ec7c2803e8e 100644 index 9861cd23b07f8fbacb1d125af835dee58c2debbb..e6a47317eb24fc65ed02a4d4f9c4b19b5abc920d 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java --- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -157,6 +157,23 @@ public final class ItemStack { @@ -180,6 +180,23 @@ public final class ItemStack {
return this.getItem().getTooltipImage(this); return this.getItem().getTooltipImage(this);
} }
@ -45,15 +45,15 @@ index 1b2c0fda262ca6d5bd2ce22bc2e934803bd6f602..cae548dbb5a3027e2de0bfbe38918ec7
public ItemStack(ItemLike item) { public ItemStack(ItemLike item) {
this(item, 1); this(item, 1);
} }
@@ -205,6 +222,7 @@ public final class ItemStack { @@ -226,6 +243,7 @@ public final class ItemStack {
// CraftBukkit start - make defensive copy as this data may be coming from the save thread this.count = nbttagcompound.getByte("Count");
if (nbttagcompound.contains("tag", 10)) {
this.tag = nbttagcompound.getCompound("tag").copy(); this.tag = nbttagcompound.getCompound("tag").copy();
// CraftBukkit end
+ this.processEnchantOrder(this.tag); // Paper + this.processEnchantOrder(this.tag); // Paper
this.getItem().verifyTagAfterLoad(this.tag); this.getItem().verifyTagAfterLoad(this.tag);
} }
@@ -819,6 +837,7 @@ public final class ItemStack { @@ -844,6 +862,7 @@ public final class ItemStack {
public void setTag(@Nullable CompoundTag nbt) { public void setTag(@Nullable CompoundTag nbt) {
this.tag = nbt; this.tag = nbt;
@ -61,7 +61,7 @@ index 1b2c0fda262ca6d5bd2ce22bc2e934803bd6f602..cae548dbb5a3027e2de0bfbe38918ec7
if (this.getItem().canBeDepleted()) { if (this.getItem().canBeDepleted()) {
this.setDamageValue(this.getDamageValue()); this.setDamageValue(this.getDamageValue());
} }
@@ -1116,6 +1135,7 @@ public final class ItemStack { @@ -1141,6 +1160,7 @@ public final class ItemStack {
ListTag nbttaglist = this.tag.getList("Enchantments", 10); ListTag nbttaglist = this.tag.getList("Enchantments", 10);
nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level)); nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level));
@ -70,7 +70,7 @@ index 1b2c0fda262ca6d5bd2ce22bc2e934803bd6f602..cae548dbb5a3027e2de0bfbe38918ec7
public boolean isEnchanted() { public boolean isEnchanted() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 8eb170bd71c7158dcd1b90f9c8d46a13a2202509..f42f6f5fb7a2398c183eb9fa1a964a7680b687b8 100644 index 7278ac809eff364e8b838d63a2ec1291493869f8..ee5989e52ce0b55d8bf867ab10801ba3252c88a5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -188,28 +188,11 @@ public final class CraftItemStack extends ItemStack { @@ -188,28 +188,11 @@ public final class CraftItemStack extends ItemStack {
@ -111,7 +111,7 @@ index 8eb170bd71c7158dcd1b90f9c8d46a13a2202509..f42f6f5fb7a2398c183eb9fa1a964a76
if (this.handle == null) { if (this.handle == null) {
return 0; return 0;
} }
- return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.getRaw(ench), this.handle); - return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.bukkitToMinecraft(ench), this.handle);
+ // Paper start - replace to allow custom enchantments + // Paper start - replace to allow custom enchantments
+ final ListTag enchantments = this.handle.getEnchantmentTags(); + final ListTag enchantments = this.handle.getEnchantmentTags();
+ for (int i = 0; i < enchantments.size(); i++) { + for (int i = 0; i < enchantments.size(); i++) {
@ -187,7 +187,7 @@ index 8eb170bd71c7158dcd1b90f9c8d46a13a2202509..f42f6f5fb7a2398c183eb9fa1a964a76
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) { static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610aca5401e 100644 index 0874c65c15fa66f61dfe8c440921b45e00b2f8b3..cd0c885ed63a3c43b915da239a8dddfee2622c76 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -214,7 +214,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
@@ -276,7 +279,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -277,7 +280,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private List<String> lore; // null and empty are two different states internally private List<String> lore; // null and empty are two different states internally
private Integer customModelData; private Integer customModelData;
private CompoundTag blockData; private CompoundTag blockData;
@ -223,7 +223,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
private Multimap<Attribute, AttributeModifier> attributeModifiers; private Multimap<Attribute, AttributeModifier> attributeModifiers;
private int repairCost; private int repairCost;
private int hideFlag; private int hideFlag;
@@ -287,7 +290,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -288,7 +291,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
private CompoundTag internalTag; private CompoundTag internalTag;
@ -232,7 +232,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY);
private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only
@@ -308,7 +311,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -309,7 +312,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
this.blockData = meta.blockData; this.blockData = meta.blockData;
if (meta.enchantments != null) { // Spigot if (meta.enchantments != null) { // Spigot
@ -241,7 +241,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
} }
if (meta.hasAttributeModifiers()) { if (meta.hasAttributeModifiers()) {
@@ -391,13 +394,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -392,13 +395,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -257,7 +257,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
for (int i = 0; i < ench.size(); i++) { for (int i = 0; i < ench.size(); i++) {
String id = ((CompoundTag) ench.get(i)).getString(CraftMetaItem.ENCHANTMENTS_ID.NBT); String id = ((CompoundTag) ench.get(i)).getString(CraftMetaItem.ENCHANTMENTS_ID.NBT);
@@ -550,13 +553,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -551,13 +554,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
} }
} }
@ -273,7 +273,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
for (Map.Entry<?, ?> entry : ench.entrySet()) { for (Map.Entry<?, ?> entry : ench.entrySet()) {
// Doctor older enchants // Doctor older enchants
String enchantKey = entry.getKey().toString(); String enchantKey = entry.getKey().toString();
@@ -832,14 +835,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -833,14 +836,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@Override @Override
public Map<Enchantment, Integer> getEnchants() { public Map<Enchantment, Integer> getEnchants() {
@ -290,7 +290,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
} }
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
@@ -1228,7 +1231,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1229,7 +1232,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
clone.customModelData = this.customModelData; clone.customModelData = this.customModelData;
clone.blockData = this.blockData; clone.blockData = this.blockData;
if (this.enchantments != null) { if (this.enchantments != null) {
@ -299,7 +299,7 @@ index 3d5abdf6986457e39fb216d8f5e257c9df880078..57bd07e7aa9d09e843bf33f4c6c2c610
} }
if (this.hasAttributeModifiers()) { if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1470,4 +1473,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1471,4 +1474,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftMetaItem.HANDLED_TAGS; return CraftMetaItem.HANDLED_TAGS;
} }
} }

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Non Player Arrow Despawn Rate
Can set a much shorter despawn rate for arrows that players can not pick up. Can set a much shorter despawn rate for arrows that players can not pick up.
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java 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 e147c56ad30a8e634052385ee9fee97c1ac48dcd..8d9e78efcd07e0fea627c2a5a128c7f15cf3413c 100644 index 95d49d1f47a9c04535e94350bdcb4da88a1e5d27..b24f828d39fc26b4f85f5c76010f0ba47e9fe05f 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -312,7 +312,7 @@ public abstract class AbstractArrow extends Projectile { @@ -319,7 +319,7 @@ public abstract class AbstractArrow extends Projectile {
protected void tickDespawn() { protected void tickDespawn() {
++this.life; ++this.life;

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic. Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3ec4c76f8c41beb822acbb19b58e19ac2f3f2ef4..e24b6ee29c26b3cff85de592f60e7cac5c3a8f92 100644 index fa6cec1933582fefeffd9382cbc24fea83b5eb13..a95fad7e0de2a6a1e3f37b40b82e3a51548dd3a4 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -221,7 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -223,7 +223,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid; public final UUID uuid;
@ -19,10 +19,10 @@ index 3ec4c76f8c41beb822acbb19b58e19ac2f3f2ef4..e24b6ee29c26b3cff85de592f60e7cac
} }
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index f7c69de5227a9b3fc409374d715aaecdf6330e70..633dec47d91046f22f143421c9c9e20652a5b200 100644 index 5c42b38ab337a3fd4e4b4ac8d0aa2db43540446c..ed38ad96b9344903097962a5bf94fb861651fcba 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -342,6 +342,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -345,6 +345,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return chunk == null ? null : chunk.getFluidState(blockposition); return chunk == null ? null : chunk.getFluidState(blockposition);
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 0bf4e33a67adf515b2675037b763632f1629ba34..85d36961dc90bb48e8462138e3ed503515fb313b 100644 index a43539db71a7344e9477918dc5c7b07d46903bea..08ffa37aaf23c410c670ed1703c5eb2c10efa0f4 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3696,10 +3696,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3698,10 +3698,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.triggerItemUseEffects(this.useItem, 16); this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent // CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack; ItemStack itemstack;
@ -21,7 +21,7 @@ index 0bf4e33a67adf515b2675037b763632f1629ba34..85d36961dc90bb48e8462138e3ed5035
this.level().getCraftServer().getPluginManager().callEvent(event); this.level().getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@@ -3713,6 +3714,12 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3715,6 +3716,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
} else { } else {
itemstack = this.useItem.finishUsingItem(this.level(), this); itemstack = this.useItem.finishUsingItem(this.level(), this);
} }
@ -34,7 +34,7 @@ index 0bf4e33a67adf515b2675037b763632f1629ba34..85d36961dc90bb48e8462138e3ed5035
// CraftBukkit end // CraftBukkit end
if (itemstack != this.useItem) { if (itemstack != this.useItem) {
@@ -3720,6 +3727,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3722,6 +3729,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
this.stopUsingItem(); this.stopUsingItem();

View File

@ -26,10 +26,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 85d36961dc90bb48e8462138e3ed503515fb313b..9b9e02f27f4281d3d39130521b1cc4e6979f8ea5 100644 index 08ffa37aaf23c410c670ed1703c5eb2c10efa0f4..b76ac10fe0d4b860a4b30fae365cf38400afb456 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3464,7 +3464,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3466,7 +3466,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@ -63,10 +63,10 @@ index d6d8bbc98fc71997cb52521d59ebb59d727d3c22..3b31a1927aaed7fffc1b4f4bcefc1212
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) { default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
BlockState iblockdata = this.getBlockState(blockposition); BlockState iblockdata = this.getBlockState(blockposition);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 633dec47d91046f22f143421c9c9e20652a5b200..374e37bc235aa17c7bf8fa4197f7ec244fda8664 100644 index ed38ad96b9344903097962a5bf94fb861651fcba..272679dbd643487cf7b096828bb52b36031086a3 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -283,6 +283,90 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -286,6 +286,90 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null; return null;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6522bd952 100644 index b76ac10fe0d4b860a4b30fae365cf38400afb456..1e2d3040bb3e8b1901fbc933caa5ad3b82d3468c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -794,7 +794,13 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -793,7 +793,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Override @Override
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
@ -23,7 +23,7 @@ index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6
if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) { if (nbt.contains("Attributes", 9) && this.level() != null && !this.level().isClientSide) {
this.getAttributes().load(nbt.getList("Attributes", 10)); this.getAttributes().load(nbt.getList("Attributes", 10));
} }
@@ -1344,6 +1350,10 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1343,6 +1349,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public void setHealth(float health) { public void setHealth(float health) {
@ -34,7 +34,7 @@ index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6
// CraftBukkit start - Handle scaled health // CraftBukkit start - Handle scaled health
if (this instanceof ServerPlayer) { if (this instanceof ServerPlayer) {
org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity(); org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity();
@@ -3529,7 +3539,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3531,7 +3541,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public final void setAbsorptionAmount(float absorptionAmount) { public final void setAbsorptionAmount(float absorptionAmount) {
@ -44,10 +44,10 @@ index 9b9e02f27f4281d3d39130521b1cc4e6979f8ea5..2cf9d80494c6b70992d8ec74fe1697c6
protected void internalSetAbsorptionAmount(float absorptionAmount) { protected void internalSetAbsorptionAmount(float absorptionAmount) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e542d86dbf44e91058ad026e1bf9105d92fa687c..7363c80d35d4ff61d771fb77125a4e520f745bba 100644 index 06c0f72a83de5866f4c734c0809d60446a736af6..07960b6ff0cd42622315a27beb1496d41950f9f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2167,6 +2167,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2182,6 +2182,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
public void setRealHealth(double health) { public void setRealHealth(double health) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created. Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 25dbd41c5eb35b4d6cb1af159f665a1709e107d1..6b577914e6b7603f3cef4c4698d5f81b7ebff19c 100644 index 08e3e87b2aa9d586cd1b441e7314d0775f7537c8..cc762d3eb68d2f8bf9529ecf07adfc343953c7a2 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -162,6 +162,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -163,6 +163,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
} }
@ -89,7 +89,7 @@ index 25dbd41c5eb35b4d6cb1af159f665a1709e107d1..6b577914e6b7603f3cef4c4698d5f81b
private CraftEntity bukkitEntity; private CraftEntity bukkitEntity;
public CraftEntity getBukkitEntity() { public CraftEntity getBukkitEntity() {
@@ -406,7 +479,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -411,7 +484,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.bb = Entity.INITIAL_AABB; this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO; this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F; this.nextStep = 1.0F;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e24b6ee29c26b3cff85de592f60e7cac5c3a8f92..98468620840258701969abaf6d0df040d74f2298 100644 index a95fad7e0de2a6a1e3f37b40b82e3a51548dd3a4..0fda3954f914889f9f3339f1ba231fb4818876af 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -830,7 +830,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -847,7 +847,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (this.isRainingAt(blockposition)) { if (this.isRainingAt(blockposition)) {
DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);

View File

@ -29,10 +29,10 @@ index 1b29c6872ebe54351f28c1f1f38b22561ba785ee..40950db0c242c65dfd4de247c8624935
this.x = x; this.x = x;
this.y = y; this.y = y;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 374e37bc235aa17c7bf8fa4197f7ec244fda8664..a9d04b3fd53532b4b380123fceab1ab5e4b206c2 100644 index 272679dbd643487cf7b096828bb52b36031086a3..a589b70303bf66c41e6ea1dbf493d14304df25ab 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -368,7 +368,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -371,7 +371,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end // Paper end
public boolean isInWorldBounds(BlockPos pos) { public boolean isInWorldBounds(BlockPos pos) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4627eb980d5ac1571f57756bc90f2ae6d361f522..26015e5bf2c0f5c176c5e9d7c9eb98419617c509 100644 index 6986109ca6de3c73d63c4539477997361044e64f..3b13d7b760ac2df6e21c0ac7064fae8240866399 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1351,6 +1351,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1453,6 +1453,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@ -18,10 +18,10 @@ index 4627eb980d5ac1571f57756bc90f2ae6d361f522..26015e5bf2c0f5c176c5e9d7c9eb9841
this.profiler.push(() -> { this.profiler.push(() -> {
return worldserver + " " + worldserver.dimension().location(); return worldserver + " " + worldserver.dimension().location();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 98468620840258701969abaf6d0df040d74f2298..ab55fd417a8914eac912ef4c40527df80f72e2e4 100644 index 0fda3954f914889f9f3339f1ba231fb4818876af..0718f8745fed4cd0cbb29372159ff39bdce7d0fd 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -220,6 +220,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start // CraftBukkit start
public final LevelStorageSource.LevelStorageAccess convertable; public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid; public final UUID uuid;
@ -30,10 +30,10 @@ index 98468620840258701969abaf6d0df040d74f2298..ab55fd417a8914eac912ef4c40527df8
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false); return this.chunkSource.getChunk(x, z, false);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a9d04b3fd53532b4b380123fceab1ab5e4b206c2..d9a03a3d262fee9f93b1ccf3a08ec0b77efa1c33 100644 index a589b70303bf66c41e6ea1dbf493d14304df25ab..9bb380e7c8973b4728b5d4aad663af9e477dda0c 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -580,7 +580,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -583,7 +583,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start // CraftBukkit start
iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam
CraftWorld world = ((ServerLevel) this).getWorld(); CraftWorld world = ((ServerLevel) this).getWorld();
@ -43,10 +43,10 @@ index a9d04b3fd53532b4b380123fceab1ab5e4b206c2..d9a03a3d262fee9f93b1ccf3a08ec0b7
this.getCraftServer().getPluginManager().callEvent(event); this.getCraftServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/world/level/block/BushBlock.java b/src/main/java/net/minecraft/world/level/block/BushBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BushBlock.java b/src/main/java/net/minecraft/world/level/block/BushBlock.java
index d40e791529911ca81398ac267a819415da91502a..03fde6e47c4a347c62fe9b4a3351769aedf874f6 100644 index 1d46dd41b51a449ed8e032e36e65aad8043fba56..bed3d9c781c7d3ca260027b4737970889a54689c 100644
--- a/src/main/java/net/minecraft/world/level/block/BushBlock.java --- a/src/main/java/net/minecraft/world/level/block/BushBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BushBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BushBlock.java
@@ -24,7 +24,7 @@ public class BushBlock extends Block { @@ -28,7 +28,7 @@ public abstract class BushBlock extends Block {
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
// CraftBukkit start // CraftBukkit start
if (!state.canSurvive(world, pos)) { if (!state.canSurvive(world, pos)) {
@ -56,12 +56,12 @@ index d40e791529911ca81398ac267a819415da91502a..03fde6e47c4a347c62fe9b4a3351769a
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
index ec66f00703fcb68aa567b2d14a756729371320e0..9db66b393e057d93a8025b803ae0ad2a1bca61f6 100644 index db67c85810cd42e1c9dee96e8b51d194393c1eb7..0f0750f8c790d0db72a0e6b277449a1461674890 100644
--- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java --- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
@@ -95,7 +95,7 @@ public class DoublePlantBlock extends BushBlock { @@ -102,7 +102,7 @@ public class DoublePlantBlock extends BushBlock {
protected static void preventCreativeDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) { protected static void preventDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
// CraftBukkit start // CraftBukkit start
- if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) { - if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) {
+ if (((net.minecraft.server.level.ServerLevel)world).hasPhysicsEvent && org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) { // Paper + if (((net.minecraft.server.level.ServerLevel)world).hasPhysicsEvent && org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPhysicsEvent(world, pos).isCancelled()) { // Paper

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ab55fd417a8914eac912ef4c40527df80f72e2e4..3078aa3b6b4ba5afbe5f216a90f58834e6f72957 100644 index 0718f8745fed4cd0cbb29372159ff39bdce7d0fd..3d826b82034dc12daa521414142dfe3cdd41365b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2366,6 +2366,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2402,6 +2402,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.setOrigin(entity.getOriginVector().toLocation(getWorld())); entity.setOrigin(entity.getOriginVector().toLocation(getWorld()));
} }
// Paper end // Paper end
@ -16,7 +16,7 @@ index ab55fd417a8914eac912ef4c40527df80f72e2e4..3078aa3b6b4ba5afbe5f216a90f58834
} }
public void onTrackingEnd(Entity entity) { public void onTrackingEnd(Entity entity) {
@@ -2441,6 +2442,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2477,6 +2478,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} }
} }
// CraftBukkit end // CraftBukkit end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Do not load chunks for Pathfinding
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
index b7995e6159c865f8e2e7865f7eb51936a9720311..10503d6d8b6daf645cf4360ee289d5e25144c976 100644 index cd6778fa1d4261caf846ae71702621d2ec6b98c1..8e90b284fb576738b834626bb52c9962ccbc5ad2 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -459,7 +459,12 @@ public class WalkNodeEvaluator extends NodeEvaluator { @@ -465,7 +465,12 @@ public class WalkNodeEvaluator extends NodeEvaluator {
for(int n = -1; n <= 1; ++n) { for(int n = -1; n <= 1; ++n) {
if (l != 0 || n != 0) { if (l != 0 || n != 0) {
pos.set(i + l, j + m, k + n); pos.set(i + l, j + m, k + n);
@ -22,7 +22,7 @@ index b7995e6159c865f8e2e7865f7eb51936a9720311..10503d6d8b6daf645cf4360ee289d5e2
if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) {
return BlockPathTypes.DANGER_OTHER; return BlockPathTypes.DANGER_OTHER;
} }
@@ -475,6 +480,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { @@ -481,6 +486,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
if (blockState.is(Blocks.WITHER_ROSE) || blockState.is(Blocks.POINTED_DRIPSTONE)) { if (blockState.is(Blocks.WITHER_ROSE) || blockState.is(Blocks.POINTED_DRIPSTONE)) {
return BlockPathTypes.DAMAGE_CAUTIOUS; return BlockPathTypes.DAMAGE_CAUTIOUS;
} }
@ -30,7 +30,7 @@ index b7995e6159c865f8e2e7865f7eb51936a9720311..10503d6d8b6daf645cf4360ee289d5e2
} }
} }
} }
@@ -484,7 +490,8 @@ public class WalkNodeEvaluator extends NodeEvaluator { @@ -490,7 +496,8 @@ public class WalkNodeEvaluator extends NodeEvaluator {
} }
protected static BlockPathTypes getBlockPathTypeRaw(BlockGetter world, BlockPos pos) { protected static BlockPathTypes getBlockPathTypeRaw(BlockGetter world, BlockPos pos) {

View File

@ -28,10 +28,10 @@ index 644a0fdea6576647539b96528717dbaeab498d93..221e64a66ff12a8de5c75992fc26a54a
+ // Paper end - PlayerUseUnknownEntityEvent + // Paper end - PlayerUseUnknownEntityEvent
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index adef64b955170dc00c75c06bf0f41a09b2516520..3fbe132d278928a55115dce116f14ac1ce1ebc69 100644 index 870a1d6679fa062d90bcfa1a21a8af0cf67f2950..d03d5629e3605626bba6ea806990443bfb151c61 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2393,8 +2393,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -2401,8 +2401,38 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}); });
} }
} }

View File

@ -9,10 +9,10 @@ of a variety of blocks that are random ticked.
Co-authored-by: MrPowerGamerBR <git@mrpowergamerbr.com> Co-authored-by: MrPowerGamerBR <git@mrpowergamerbr.com>
diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
index 3b4d8a47e7fe08284b79fab2d147629e902db026..eb6056c5051e5e8a872a10dc993dbd5232787663 100644 index 3ce4bb344dbb8b50ef4041801e034e79f0b0d19d..6c1e8ba518c883aa5c079b4c94f068833609acc3 100644
--- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java --- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java
@@ -85,6 +85,8 @@ public class FarmBlock extends Block { @@ -92,6 +92,8 @@ public class FarmBlock extends Block {
@Override @Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
int i = (Integer) state.getValue(FarmBlock.MOISTURE); int i = (Integer) state.getValue(FarmBlock.MOISTURE);
@ -22,18 +22,18 @@ index 3b4d8a47e7fe08284b79fab2d147629e902db026..eb6056c5051e5e8a872a10dc993dbd52
if (!FarmBlock.isNearWater(world, pos) && !world.isRainingAt(pos.above())) { if (!FarmBlock.isNearWater(world, pos) && !world.isRainingAt(pos.above())) {
if (i > 0) { if (i > 0) {
diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
index 1df22561b2d39066b6b30f10ea43edd734e3b50a..1fe07f8f9b28faf076209f7ad235fd5dc948b294 100644 index 65db2229dae0547c7a3e2847bba7b1a1795ce30f..f38524cbcaa908644d901bf0929331d6dfd99ed9 100644
--- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java --- a/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SpreadingSnowyDirtBlock.java
@@ -2,6 +2,7 @@ package net.minecraft.world.level.block; @@ -3,6 +3,7 @@ package net.minecraft.world.level.block;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
+import net.minecraft.server.MinecraftServer; +import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.FluidTags; import net.minecraft.tags.FluidTags;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
@@ -39,6 +40,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock { @@ -43,6 +44,7 @@ public abstract class SpreadingSnowyDirtBlock extends SnowyDirtBlock {
@Override @Override
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3078aa3b6b4ba5afbe5f216a90f58834e6f72957..b9fcfaf683d9c0e90a287506afd759d8877f4b24 100644 index 3d826b82034dc12daa521414142dfe3cdd41365b..af16cabd57a5fb28c2e70856730dd0df6c8abf9c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1600,6 +1600,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -1619,6 +1619,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override @Override
public void updateNeighborsAt(BlockPos pos, Block sourceBlock) { public void updateNeighborsAt(BlockPos pos, Block sourceBlock) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
index 1294b38262505b0d54089e428df9b363219de1f0..ee37ec0de1ca969144824427ae42b0c81434a1b4 100644 index 3d2a689d11bfa230bab61a2a65c6051328f6b78d..e52644010dc2cf41bbf508b16b8ec2f0003e9d0b 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java +++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetPlayerTeamPacket.java
@@ -193,7 +193,7 @@ public class ClientboundSetPlayerTeamPacket implements Packet<ClientGamePacketLi @@ -193,7 +193,7 @@ public class ClientboundSetPlayerTeamPacket implements Packet<ClientGamePacketLi
@ -18,10 +18,10 @@ index 1294b38262505b0d54089e428df9b363219de1f0..ee37ec0de1ca969144824427ae42b0c8
buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix); buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 26015e5bf2c0f5c176c5e9d7c9eb98419617c509..a6758b10f106eba19e508be8fbdb4f7903c1f185 100644 index 3b13d7b760ac2df6e21c0ac7064fae8240866399..450a9336a8a39a4ace147c73f82f9281fb5cc787 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -575,6 +575,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -621,6 +621,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
} }
@ -43,18 +43,18 @@ index 26015e5bf2c0f5c176c5e9d7c9eb98419617c509..a6758b10f106eba19e508be8fbdb4f79
this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP)); this.server.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.STARTUP));
this.connection.acceptConnections(); this.connection.acceptConnections();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 703f006bee56bc198f0711ad464570fca406284c..2ceb330e087fd397887d2f4383fcc7590119ca6c 100644 index b74689297ca20efee391fe1da80377082d1758e5..64be8c7b88b958a31ada6e8c7ef6fc368af2125e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -100,6 +100,7 @@ import net.minecraft.world.phys.Vec3; @@ -100,6 +100,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraft.world.scores.DisplaySlot; import net.minecraft.world.scores.DisplaySlot;
import net.minecraft.world.scores.Objective; import net.minecraft.world.scores.Objective;
import net.minecraft.world.scores.PlayerTeam; import net.minecraft.world.scores.PlayerTeam;
+import net.minecraft.world.scores.Scoreboard; // Paper +import net.minecraft.world.scores.Team;
import net.minecraft.world.scores.Team;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -157,6 +158,7 @@ public abstract class PlayerList { // CraftBukkit start
@@ -156,6 +157,7 @@ public abstract class PlayerList {
// CraftBukkit start // CraftBukkit start
private CraftServer cserver; private CraftServer cserver;
private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>(); private final Map<String,ServerPlayer> playersByName = new java.util.HashMap<>();
@ -62,12 +62,12 @@ index 703f006bee56bc198f0711ad464570fca406284c..2ceb330e087fd397887d2f4383fcc759
public PlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registryManager, PlayerDataStorage saveHandler, int maxPlayers) { public PlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registryManager, PlayerDataStorage saveHandler, int maxPlayers) {
this.cserver = server.server = new CraftServer((DedicatedServer) server, this); this.cserver = server.server = new CraftServer((DedicatedServer) server, this);
@@ -399,6 +401,13 @@ public abstract class PlayerList { @@ -398,6 +400,13 @@ public abstract class PlayerList {
player.initInventoryMenu(); player.initInventoryMenu();
// CraftBukkit - Moved from above, added world // CraftBukkit - Moved from above, added world
+ // Paper start - Add to collideRule team if needed + // Paper start - Add to collideRule team if needed
+ final Scoreboard scoreboard = this.getServer().getLevel(Level.OVERWORLD).getScoreboard(); + final net.minecraft.world.scores.Scoreboard scoreboard = this.getServer().getLevel(Level.OVERWORLD).getScoreboard();
+ final PlayerTeam collideRuleTeam = scoreboard.getPlayerTeam(this.collideRuleTeamName); + final PlayerTeam collideRuleTeam = scoreboard.getPlayerTeam(this.collideRuleTeamName);
+ if (this.collideRuleTeamName != null && collideRuleTeam != null && player.getTeam() == null) { + if (this.collideRuleTeamName != null && collideRuleTeam != null && player.getTeam() == null) {
+ scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam); + scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
@ -76,13 +76,13 @@ index 703f006bee56bc198f0711ad464570fca406284c..2ceb330e087fd397887d2f4383fcc759
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ()); PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
} }
@@ -522,6 +531,16 @@ public abstract class PlayerList { @@ -521,6 +530,16 @@ public abstract class PlayerList {
entityplayer.doTick(); // SPIGOT-924 entityplayer.doTick(); // SPIGOT-924
// CraftBukkit end // CraftBukkit end
+ // Paper start - Remove from collideRule team if needed + // Paper start - Remove from collideRule team if needed
+ if (this.collideRuleTeamName != null) { + if (this.collideRuleTeamName != null) {
+ final Scoreboard scoreBoard = this.server.getLevel(Level.OVERWORLD).getScoreboard(); + final net.minecraft.world.scores.Scoreboard scoreBoard = this.server.getLevel(Level.OVERWORLD).getScoreboard();
+ final PlayerTeam team = scoreBoard.getPlayersTeam(this.collideRuleTeamName); + final PlayerTeam team = scoreBoard.getPlayersTeam(this.collideRuleTeamName);
+ if (entityplayer.getTeam() == team && team != null) { + if (entityplayer.getTeam() == team && team != null) {
+ scoreBoard.removePlayerFromTeam(entityplayer.getScoreboardName(), team); + scoreBoard.removePlayerFromTeam(entityplayer.getScoreboardName(), team);
@ -93,7 +93,7 @@ index 703f006bee56bc198f0711ad464570fca406284c..2ceb330e087fd397887d2f4383fcc759
this.save(entityplayer); this.save(entityplayer);
if (entityplayer.isPassenger()) { if (entityplayer.isPassenger()) {
Entity entity = entityplayer.getRootVehicle(); Entity entity = entityplayer.getRootVehicle();
@@ -1160,6 +1179,13 @@ public abstract class PlayerList { @@ -1161,6 +1180,13 @@ public abstract class PlayerList {
} }
// CraftBukkit end // CraftBukkit end

View File

@ -9,10 +9,10 @@ For servers with multiple IP's, ability to bind to a specific interface.
public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String; public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String;
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 20d02405b8e6476b11a8c8518c9a3949d3df11a4..bdf520c32847658fefaf2bde33bac16ea807002f 100644 index d64ac84d4c5ef3dd3054a601deee128d3069686b..7edce6f8d1f313a9e1e100704d625e317f779fa0 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -109,6 +109,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -108,6 +108,8 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
private final DedicatedServerProperties.WorldDimensionData worldDimensionData; private final DedicatedServerProperties.WorldDimensionData worldDimensionData;
public final WorldOptions worldOptions; public final WorldOptions worldOptions;
@ -21,9 +21,9 @@ index 20d02405b8e6476b11a8c8518c9a3949d3df11a4..bdf520c32847658fefaf2bde33bac16e
// CraftBukkit start // CraftBukkit start
public DedicatedServerProperties(Properties properties, OptionSet optionset) { public DedicatedServerProperties(Properties properties, OptionSet optionset) {
super(properties, optionset); super(properties, optionset);
@@ -167,6 +169,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie @@ -166,6 +168,10 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
}, WorldPresets.NORMAL.location().toString())); }, WorldPresets.NORMAL.location().toString()));
this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", "")); this.serverResourcePackInfo = DedicatedServerProperties.getServerPackInfo(this.get("resource-pack-id", ""), this.get("resource-pack", ""), this.get("resource-pack-sha1", ""), this.getLegacyString("resource-pack-hash"), this.get("require-resource-pack", false), this.get("resource-pack-prompt", ""));
this.initialDataPackConfiguration = DedicatedServerProperties.getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled()))); this.initialDataPackConfiguration = DedicatedServerProperties.getDatapackConfig(this.get("initial-enabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getEnabled())), this.get("initial-disabled-packs", String.join(",", WorldDataConfiguration.DEFAULT.dataPacks().getDisabled())));
+ // Paper start - Configurable rcon ip + // Paper start - Configurable rcon ip
+ final String rconIp = this.getStringRaw("rcon.ip"); + final String rconIp = this.getStringRaw("rcon.ip");

View File

@ -6,10 +6,10 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started Don't even get me started
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2cf9d80494c6b70992d8ec74fe1697c6522bd952..b60e970c604ae778cc0b5eb54cdfebceef91b2df 100644 index 1e2d3040bb3e8b1901fbc933caa5ad3b82d3468c..043c42d303970920f40bd65a90c147192ed6900b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1323,10 +1323,16 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1322,10 +1322,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add ability to configure frosted_ice properties
diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
index e1916fe8a7aa736d9266efde954bbfbda38a3a65..331b642c36af97f7f05bd63f96d42d1af443e5a3 100644 index 5c8f0751def701359b388eabeb14d1dc83438c5a..0d08a9d5555ebc296a1461aefbf48e8eee6b462d 100644
--- a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java --- a/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FrostedIceBlock.java
@@ -32,6 +32,7 @@ public class FrostedIceBlock extends IceBlock { @@ -40,6 +40,7 @@ public class FrostedIceBlock extends IceBlock {
@Override @Override
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
@ -16,7 +16,7 @@ index e1916fe8a7aa736d9266efde954bbfbda38a3a65..331b642c36af97f7f05bd63f96d42d1a
if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4)) && world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock(world, pos) && this.slightlyMelt(state, world, pos)) { if ((random.nextInt(3) == 0 || this.fewerNeigboursThan(world, pos, 4)) && world.getMaxLocalRawBrightness(pos) > 11 - state.getValue(AGE) - state.getLightBlock(world, pos) && this.slightlyMelt(state, world, pos)) {
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(); BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
@@ -39,12 +40,12 @@ public class FrostedIceBlock extends IceBlock { @@ -47,12 +48,12 @@ public class FrostedIceBlock extends IceBlock {
mutableBlockPos.setWithOffset(pos, direction); mutableBlockPos.setWithOffset(pos, direction);
BlockState blockState = world.getBlockState(mutableBlockPos); BlockState blockState = world.getBlockState(mutableBlockPos);
if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) { if (blockState.is(this) && !this.slightlyMelt(blockState, world, mutableBlockPos)) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a6758b10f106eba19e508be8fbdb4f7903c1f185..937de8ff1f8c25861ae09af197d75577088b70fe 100644 index 450a9336a8a39a4ace147c73f82f9281fb5cc787..ee751fb9580064682e650cf1c959a0e159a89bf2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -189,6 +189,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -190,6 +190,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
@ -17,7 +17,7 @@ index a6758b10f106eba19e508be8fbdb4f7903c1f185..937de8ff1f8c25861ae09af197d75577
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
public static final String VANILLA_BRAND = "vanilla"; public static final String VANILLA_BRAND = "vanilla";
@@ -314,6 +315,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -320,6 +321,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) { public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server"); super("Server");
@ -25,7 +25,7 @@ index a6758b10f106eba19e508be8fbdb4f7903c1f185..937de8ff1f8c25861ae09af197d75577
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler(); this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> { this.onMetricsRecordingStopped = (methodprofilerresults) -> {
@@ -2319,9 +2321,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2433,9 +2435,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return false; return false;
} }

View File

@ -13,10 +13,10 @@ custom renderers are in use, defaulting to the much simpler Vanilla system.
Additionally, numerous issues to player position tracking on maps has been fixed. Additionally, numerous issues to player position tracking on maps has been fixed.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b9fcfaf683d9c0e90a287506afd759d8877f4b24..b82f5d7eeb934d92f858a04f018c3bb05483fff6 100644 index af16cabd57a5fb28c2e70856730dd0df6c8abf9c..98ea55455d365b8d25ecb998daacbcbb1b45e5a7 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2387,6 +2387,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2423,6 +2423,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
{ {
if ( iter.next().player == entity ) if ( iter.next().player == entity )
{ {
@ -25,10 +25,10 @@ index b9fcfaf683d9c0e90a287506afd759d8877f4b24..b82f5d7eeb934d92f858a04f018c3bb0
} }
} }
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 45a5baf2f6e868fd5b41be1204bee46fb2e631b5..ca56004082460bc422d5898407eef9dae49071ab 100644 index 86d187cadb73dbe0757f9417c4549e358ff303ca..c2725113b3ec36a79c88bcf9837c0ef2955b613e 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -769,6 +769,14 @@ public abstract class Player extends LivingEntity { @@ -764,6 +764,14 @@ public abstract class Player extends LivingEntity {
return null; return null;
} }
// CraftBukkit end // CraftBukkit end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't save empty scoreboard teams to scoreboard.dat
diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java diff --git a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
index a6d23b23e5b5c02427ec538d1d7fd89f51e9e59c..4def212655cea0fd998b52e924f8b671d6aeb559 100644 index 28e631be85fb06245e152e1f5e0bae16b7358cfd..b49d60d20d170d16a7daf2bc874e5d8d04552b3e 100644
--- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java --- a/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
+++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java +++ b/src/main/java/net/minecraft/world/scores/ScoreboardSaveData.java
@@ -143,6 +143,7 @@ public class ScoreboardSaveData extends SavedData { @@ -148,6 +148,7 @@ public class ScoreboardSaveData extends SavedData {
ListTag listTag = new ListTag(); ListTag listTag = new ListTag();
for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) { for(PlayerTeam playerTeam : this.scoreboard.getPlayerTeams()) {

View File

@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Tue, 8 Mar 2016 18:28:43 -0800
Subject: [PATCH] Don't nest if we don't need to when cerealising text
components
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
index 55e21c7b13826f60e3c656f76e1507e0242e0af3..1387e3597c43fd652f2fc82ca6fc2e83039604e2 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSystemChatPacket.java
@@ -14,7 +14,7 @@ public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.a
}
public ClientboundSystemChatPacket(net.md_5.bungee.api.chat.BaseComponent[] content, boolean overlay) {
- this(null, net.md_5.bungee.chat.ComponentSerializer.toString(content), overlay); // Paper - Adventure
+ this(null, improveBungeeComponentSerialization(content), overlay); // Paper - Adventure
}
// Spigot end
// Paper start
@@ -25,6 +25,14 @@ public record ClientboundSystemChatPacket(@javax.annotation.Nullable net.kyori.a
public ClientboundSystemChatPacket(net.kyori.adventure.text.Component content, boolean overlay) {
this(content, null, overlay);
}
+
+ private static String improveBungeeComponentSerialization(net.md_5.bungee.api.chat.BaseComponent[] content) {
+ if (content.length == 1) {
+ return net.md_5.bungee.chat.ComponentSerializer.toString(content[0]);
+ } else {
+ return net.md_5.bungee.chat.ComponentSerializer.toString(content);
+ }
+ }
// Paper end
public ClientboundSystemChatPacket(FriendlyByteBuf buf) {