more patch

This commit is contained in:
Jason Penilla 2023-12-05 20:57:46 -07:00
parent c7a463a736
commit fc12258f24
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8
58 changed files with 277 additions and 282 deletions

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 97e91910c2c30b4f838e78794c9107bdfe8d7668..b52c4d659fa4ea1a9119f932a381c4982f158deb 100644
index c58fc7d950ea2aa136c3922fb14e4f183f45f2d3..833e17796a75c24eb4f2eb76ed00160229458e39 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -289,12 +289,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@@ -285,12 +285,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
public void fireEvents(GameProfile gameprofile) throws Exception {
String playerName = gameprofile.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#close
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index 3680f101036d98814fe47b707baeeb8e55bfc4b7..471ae4458e7ea7c29d7551b32cec98180fbccd4e 100644
index e824fe361286a5f41b137be92d799eef54ae4b87..3b0d3e9a067fccb10122c273aaf658ba240aa716 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -450,6 +450,14 @@ public class CraftInventory implements Inventory {
@@ -451,6 +451,14 @@ public class CraftInventory implements Inventory {
this.clear(i);
}
}

View File

@ -92,10 +92,10 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dda032b2b4e7b699d62b6bec43aa120d8b385700..40773e62218fabd91b64615868c3a3262ea6dfd7 100644
index f9e8882b1a85fbdf1901d96b4e8ce69ba230ae65..c644374b3f24b6ca7830df1b95007d1cb7383dea 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -305,6 +305,7 @@ public final class CraftServer implements Server {
@@ -306,6 +306,7 @@ public final class CraftServer implements Server {
public boolean ignoreVanillaPermissions = false;
private final List<CraftPlayer> playerView;
public int reloadCount;
@ -103,7 +103,7 @@ index dda032b2b4e7b699d62b6bec43aa120d8b385700..40773e62218fabd91b64615868c3a326
public static Exception excessiveVelEx; // Paper - Velocity warnings
static {
@@ -394,6 +395,7 @@ public final class CraftServer implements Server {
@@ -389,6 +390,7 @@ public final class CraftServer implements Server {
if (this.configuration.getBoolean("settings.use-map-color-cache")) {
MapPalette.setMapColorCache(new CraftMapColorCache(this.logger));
}
@ -111,7 +111,7 @@ index dda032b2b4e7b699d62b6bec43aa120d8b385700..40773e62218fabd91b64615868c3a326
}
public boolean getCommandBlockOverride(String command) {
@@ -2913,5 +2915,11 @@ public final class CraftServer implements Server {
@@ -2945,5 +2947,11 @@ public final class CraftServer implements Server {
public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
return mobGoals;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add environment variable to disable server gui
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 0368c64403eacf98b85ab15ed71312d932cb59c9..0ea4b588ae7426c59a47ec30e39c878c5fe3df85 100644
index 0cb453b03977e90addc26f71d0518f134af3c36a..444b21bbc596ce79007560bfb0a4008ccab1dab8 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -300,6 +300,7 @@ public class Main {
@@ -326,6 +326,7 @@ public class Main {
*/
boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");

View File

@ -45,10 +45,10 @@ index aee8618e27b893b72931e925724dd683d2e6d2aa..5cb15e2209d7b315904a1fc6d650ce1e
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 86b870e8316d2c27861c85ee5a8f7ddd857e8297..176a966ed1cc1c2e436e1d1fd849bfa0cbf9f799 100644
index e460d3f66ef58e0788fd9dfb35a6ce0e3c171289..c82f4f6f023ac8f416613db4fbfe2f4af61fd2de 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1887,8 +1887,16 @@ public class ServerPlayer extends Player {
@@ -1988,8 +1988,16 @@ public class ServerPlayer extends Player {
}
public boolean setGameMode(GameType gameMode) {
@ -67,7 +67,7 @@ index 86b870e8316d2c27861c85ee5a8f7ddd857e8297..176a966ed1cc1c2e436e1d1fd849bfa0
} else {
this.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.CHANGE_GAME_MODE, (float) gameMode.getId()));
if (gameMode == GameType.SPECTATOR) {
@@ -1900,7 +1908,7 @@ public class ServerPlayer extends Player {
@@ -2001,7 +2009,7 @@ public class ServerPlayer extends Player {
this.onUpdateAbilities();
this.updateEffectVisibility();
@ -76,7 +76,7 @@ index 86b870e8316d2c27861c85ee5a8f7ddd857e8297..176a966ed1cc1c2e436e1d1fd849bfa0
}
}
@@ -2312,6 +2320,16 @@ public class ServerPlayer extends Player {
@@ -2413,6 +2421,16 @@ public class ServerPlayer extends Player {
}
public void loadGameTypes(@Nullable CompoundTag nbt) {
@ -94,7 +94,7 @@ index 86b870e8316d2c27861c85ee5a8f7ddd857e8297..176a966ed1cc1c2e436e1d1fd849bfa0
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 49828aa38e06d7a2f0c7c5b7c4be374996ef4524..70107194d690eb51d77bc76f0d5830bba087c0b2 100644
index c61754976fab6654f55b1403d769eb1721871dca..236dabc1d4ae9dc9a2a2c07a4a27fc0bfae72f66 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -73,21 +73,28 @@ public class ServerPlayerGameMode {
@ -131,10 +131,10 @@ index 49828aa38e06d7a2f0c7c5b7c4be374996ef4524..70107194d690eb51d77bc76f0d5830bb
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4d641005076c200ffea9f30a5ee447d2b624ae09..71eb195d2f464a434a770e5299836c6fffd9bf8d 100644
index 14e967c71ae44caab604d8d758deb660d62cfff3..1b1b38ecb01d9b84c0006b486993d5257bc0c41d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2638,7 +2638,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2646,7 +2646,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH);
if (this.server.isHardcore()) {
@ -144,10 +144,10 @@ index 4d641005076c200ffea9f30a5ee447d2b624ae09..71eb195d2f464a434a770e5299836c6f
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c7090918ef8ad62742f44eb98756dc9a59d30a45..82616cc51a84425edc3f6c5db36945551d74b55f 100644
index 5e502235fc72b7cacf1b460065bd0d0f68add5f3..40553b12460b6f5b4db253134b09d4b3dcd0afb1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1554,7 +1554,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1561,7 +1561,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(mode != null, "GameMode cannot be null");
if (this.getHandle().connection == null) return;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 35484b3ad8a767b4d74ca926d9d8610d142624a1..5cb6fe52514a94eeda2676659f1a990071befecd 100644
index bd6b9a3058a75d7fad15920d9580bb0a0f0a0957..893bc4334b72db328711221496e57e872dc1f6d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -538,6 +538,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -535,6 +535,14 @@ public final class CraftMagicNumbers implements UnsafeValues {
return io.papermc.paper.inventory.ItemRarity.values()[getItem(itemStack.getType()).getRarity(CraftItemStack.asNMSCopy(itemStack)).ordinal()];
}

View File

@ -9,19 +9,19 @@ public net.minecraft.world.item.enchantment.Enchantment slots
Co-authored-by: Luis <luisc99@icloud.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
index 5b09e7e08c61b10044ac5f481bf10bb79feda8a3..21e83238a0bad86ffacf60d5c5612771a49ef33d 100644
index e8f03a40db4505c1e7f2aeb8946c207833acd416..8f42ee46759b007055b71fd70ab85a3bf4c4c8bc 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -71,7 +71,7 @@ public class CraftEnchantment extends Enchantment {
@@ -90,7 +90,7 @@ public class CraftEnchantment extends Enchantment {
@Override
public boolean isCursed() {
- return this.target instanceof BindingCurseEnchantment || this.target instanceof VanishingCurseEnchantment;
+ return this.target.isCurse(); // Paper
- return this.handle instanceof BindingCurseEnchantment || this.handle instanceof VanishingCurseEnchantment;
+ return this.handle.isCurse(); // Paper
}
@Override
@@ -199,6 +199,55 @@ public class CraftEnchantment extends Enchantment {
@@ -166,6 +166,55 @@ public class CraftEnchantment extends Enchantment {
public String translationKey() {
return this.target.getDescriptionId();
}
@ -76,12 +76,12 @@ index 5b09e7e08c61b10044ac5f481bf10bb79feda8a3..21e83238a0bad86ffacf60d5c5612771
+ }
// Paper end
public net.minecraft.world.item.enchantment.Enchantment getHandle() {
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 62700f1190bda9cb05514096e426eb3eeb87504c..3d3f7198a6134ced5c2dd25e369cb4e8d8f45fd1 100644
index 23e1d67bb239fb1ceb66d7b4a69bdba4917fa19c..d54a67c9942b986adc9e0a06640c90d99bdcdada 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -949,5 +949,21 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -954,5 +954,21 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setHurtDirection(float hurtDirection) {
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 71eb195d2f464a434a770e5299836c6fffd9bf8d..e579a249e3d441458aa05ea99787b668fae78021 100644
index 1b1b38ecb01d9b84c0006b486993d5257bc0c41d..aa8aa1585cd9fe6f10805203183253100ef61192 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1712,6 +1712,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1739,6 +1739,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (itemstack.isItemEnabled(worldserver.enabledFeatures())) {
BlockHitResult movingobjectpositionblock = packet.getHitResult();
Vec3 vec3d = movingobjectpositionblock.getLocation();

View File

@ -247,18 +247,10 @@ index 0000000000000000000000000000000000000000..513833c2ea23df5b079d157bc5cb89d5
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 0ea4b588ae7426c59a47ec30e39c878c5fe3df85..963e9887bda7bbcd9555fcbb17d63362ef1be5a6 100644
index 444b21bbc596ce79007560bfb0a4008ccab1dab8..62f4c2c9485f7700a46f33cf9d158ce3d0552185 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -16,6 +16,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
import java.util.function.BooleanSupplier;
+import io.papermc.paper.world.ThreadedWorldUpgrader;
import joptsimple.NonOptionArgumentSpec;
import joptsimple.OptionParser;
import joptsimple.OptionSet;
@@ -358,6 +359,15 @@ public class Main {
@@ -385,6 +385,15 @@ public class Main {
return new WorldLoader.InitConfig(worldloader_d, Commands.CommandSelection.DEDICATED, serverPropertiesHandler.functionPermissionLevel);
}
@ -266,7 +258,7 @@ index 0ea4b588ae7426c59a47ec30e39c878c5fe3df85..963e9887bda7bbcd9555fcbb17d63362
+ public static void convertWorldButItWorks(net.minecraft.resources.ResourceKey<net.minecraft.world.level.dimension.LevelStem> dimensionType, net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess worldSession,
+ DataFixer dataFixer, Optional<net.minecraft.resources.ResourceKey<com.mojang.serialization.Codec<? extends net.minecraft.world.level.chunk.ChunkGenerator>>> generatorKey, boolean removeCaches) {
+ int threads = Runtime.getRuntime().availableProcessors() * 3 / 8;
+ final ThreadedWorldUpgrader worldUpgrader = new ThreadedWorldUpgrader(dimensionType, worldSession.getLevelId(), worldSession.levelDirectory.path().toFile(), threads, dataFixer, generatorKey, removeCaches);
+ final io.papermc.paper.world.ThreadedWorldUpgrader worldUpgrader = new io.papermc.paper.world.ThreadedWorldUpgrader(dimensionType, worldSession.getLevelId(), worldSession.levelDirectory.path().toFile(), threads, dataFixer, generatorKey, removeCaches);
+ worldUpgrader.convert();
+ }
+ // Paper end - fix and optimise world upgrading
@ -275,10 +267,10 @@ index 0ea4b588ae7426c59a47ec30e39c878c5fe3df85..963e9887bda7bbcd9555fcbb17d63362
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 992aa1fa85f0b0240d317773be5086e64889996a..1400fd3f8eb38c15e85221b5805080e1d792215f 100644
index 36ca381445102fee1960410aa56e8b2a28dca615..8937b71511bc1dce082683b4107d52e0e632e7a2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -540,11 +540,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -586,11 +586,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worlddata = new PrimaryLevelData(worldsettings, worldoptions, worlddimensions_b.specialWorldProperty(), lifecycle);
}
worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
@ -291,7 +283,7 @@ index 992aa1fa85f0b0240d317773be5086e64889996a..1400fd3f8eb38c15e85221b5805080e1
PrimaryLevelData iworlddataserver = worlddata;
boolean flag = worlddata.isDebugWorld();
@@ -559,6 +555,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -605,6 +601,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
}
@ -306,10 +298,10 @@ index 992aa1fa85f0b0240d317773be5086e64889996a..1400fd3f8eb38c15e85221b5805080e1
if (dimensionKey == LevelStem.OVERWORLD) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index e22214b99472b23ffc95c011b19bdb59e2d9bb40..b3833da06ec8882f09b01fc596eafe519f0873c1 100644
index bdf11c543fe8904585eda72dc92206ac22daff58..aa6b7d93d8dc18e8ee475c89af465f8b7b4eab7d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -184,6 +184,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -187,6 +187,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
@ -360,10 +352,10 @@ index b850dba2b0fa5bc762b170ed7083cf8904761f17..7dee0f7d49f3492c92fceff7750e6962
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 40773e62218fabd91b64615868c3a3262ea6dfd7..bc75c1295427dc1c0e4f7c708e944f10e54ae8b9 100644
index c644374b3f24b6ca7830df1b95007d1cb7383dea..f3f15463332056ae108e49e3f72bbaa061ed7270 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1218,9 +1218,7 @@ public final class CraftServer implements Server {
@@ -1250,9 +1250,7 @@ public final class CraftServer implements Server {
worlddata.checkName(name);
worlddata.setModdedInfo(this.console.getServerModName(), this.console.getModdedStatus().shouldReportAsModified());
@ -374,7 +366,7 @@ index 40773e62218fabd91b64615868c3a3262ea6dfd7..bc75c1295427dc1c0e4f7c708e944f10
long j = BiomeManager.obfuscateSeed(creator.seed());
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
@@ -1231,6 +1229,13 @@ public final class CraftServer implements Server {
@@ -1263,6 +1261,13 @@ public final class CraftServer implements Server {
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
}

View File

@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm <proximyst@proximyst.com>
Reviewed-by: Mariell Hoversholm <proximyst@proximyst.com>
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 16a32e2baebe01d1f2d077500b775aeca7ec61aa..96de992ea9bc9182ea6a30a33e86d7970b70611b 100644
index 8f9ea1907ed4574cca8d362a0f207fb546cb6484..0008e63e96841c48fa039001f282ffa70c88494f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -219,6 +219,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -93,10 +93,10 @@ index 6641fd04821240b1bbeff1bd8d996a8f2fff8385..5f625acf04ddb56e3596d086252f9bfc
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e579a249e3d441458aa05ea99787b668fae78021..b35f4ab4ff034f7b59f3970fc18af2f777ec2a40 100644
index aa8aa1585cd9fe6f10805203183253100ef61192..3f5b5208066cf8836deb00c81f4ff9283a7c620f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2461,6 +2461,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2469,6 +2469,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
public SocketAddress getRawAddress()
{

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityInsideBlockEvent
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
index 4066dd6a638cf2186c628905915f635326442b3e..f89234dbfd03ba5192423bb75d58f8951f289761 100644
index 0e56fbe8836020a0e36c0b6df01ae82d0aa8cf38..02cbb25b8b1fdaf6e2b771067ca132245eab13dc 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -120,6 +120,7 @@ public abstract class BaseFireBlock extends Block {
@@ -124,6 +124,7 @@ public abstract class BaseFireBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -17,10 +17,10 @@ index 4066dd6a638cf2186c628905915f635326442b3e..f89234dbfd03ba5192423bb75d58f895
entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
if (entity.getRemainingFireTicks() == 0) {
diff --git a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
index b51e18d01fa9a06a3478694884f465f12dd89b8a..ee4b3ac212483995bb8ae990bebfb8aa2fbe86a5 100644
index 040e55edea53a2ebab7cc8fe6f85206c9301e11a..e074c126cd3117dc3233f39913b94b3e3fd94973 100644
--- a/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BasePressurePlateBlock.java
@@ -72,6 +72,7 @@ public abstract class BasePressurePlateBlock extends Block {
@@ -76,6 +76,7 @@ public abstract class BasePressurePlateBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -29,10 +29,10 @@ index b51e18d01fa9a06a3478694884f465f12dd89b8a..ee4b3ac212483995bb8ae990bebfb8aa
int i = this.getSignalForState(state);
diff --git a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
index a6f245a516714615cf1f204e54eb7ab5248cafe7..54cf35b0c48d96ecfb27ff13cd685c16a1cd616b 100644
index 546dbe28edbba32ab2aede1260fbd2c9baa9fe1a..8e4a6a1188b2ce2825dc5750505212c72efb5c7b 100644
--- a/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BigDripleafBlock.java
@@ -170,6 +170,7 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone
@@ -177,6 +177,7 @@ public class BigDripleafBlock extends HorizontalDirectionalBlock implements Bone
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -41,10 +41,10 @@ index a6f245a516714615cf1f204e54eb7ab5248cafe7..54cf35b0c48d96ecfb27ff13cd685c16
if (state.getValue(BigDripleafBlock.TILT) == Tilt.NONE && BigDripleafBlock.canEntityTilt(pos, entity) && !world.hasNeighborSignal(pos)) {
// CraftBukkit start - tilt dripleaf
diff --git a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
index 42265fa901aeb2bb7a564cc94162a938208c1f90..ed36a378b79f62c3dce3da637a337595415f14ac 100644
index 240e01063b5d684020ed2d7d73fc60c64fd8cf2e..115506fceb9a406e844880fb523d2ff09a66cf7b 100644
--- a/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BubbleColumnBlock.java
@@ -40,6 +40,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
@@ -47,6 +47,7 @@ public class BubbleColumnBlock extends Block implements BucketPickup {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -53,22 +53,22 @@ index 42265fa901aeb2bb7a564cc94162a938208c1f90..ed36a378b79f62c3dce3da637a337595
if (blockState.isAir()) {
entity.onAboveBubbleCol(state.getValue(DRAG_DOWN));
diff --git a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
index 56d5229dc4654fc9b2f50aee094cb595b49bcf44..a387246aeb5e03d9c5bac52b51180ae8fcfb1528 100644
index 3356f327c9adae6c2f3354b4417f3954012c945a..c6e13cc12ec8817870eb55a82ceb6f1ef77e2d9a 100644
--- a/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ButtonBlock.java
@@ -181,6 +181,7 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
@@ -206,6 +206,7 @@ public class ButtonBlock extends FaceAttachedHorizontalDirectionalBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper
if (!world.isClientSide && this.arrowsCanPress && !(Boolean) state.getValue(ButtonBlock.POWERED)) {
if (!world.isClientSide && this.type.canButtonBeActivatedByArrows() && !(Boolean) state.getValue(ButtonBlock.POWERED)) {
this.checkPressed(state, world, pos);
}
diff --git a/src/main/java/net/minecraft/world/level/block/CactusBlock.java b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
index 2c3bbe4f295be9782c11af13c2cf9c05f27313d9..0003fb51ae3a6575575e10b4c86719f3061e2577 100644
index 3c7bbfcb3a88f23056cd0db3da2a281a81dc8c85..a9629a102c4fa4e5720e63fcf4590e9231426c62 100644
--- a/src/main/java/net/minecraft/world/level/block/CactusBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CactusBlock.java
@@ -114,6 +114,7 @@ public class CactusBlock extends Block {
@@ -121,6 +121,7 @@ public class CactusBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -77,10 +77,10 @@ index 2c3bbe4f295be9782c11af13c2cf9c05f27313d9..0003fb51ae3a6575575e10b4c86719f3
entity.hurt(world.damageSources().cactus(), 1.0F);
CraftEventFactory.blockDamage = null; // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
index 495be2b5c4c52d4925385a12f63774d827c8907a..7700461b8cd0bde1bf6c0d5e4b73184bed1adc4e 100644
index cbabee578a6fd62234d0aa350d911c6c7d02e0b2..7302d07c6ff69608e75ac52fdb19f2ec1d105129 100644
--- a/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CampfireBlock.java
@@ -93,6 +93,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
@@ -108,6 +108,7 @@ public class CampfireBlock extends BaseEntityBlock implements SimpleWaterloggedB
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -89,10 +89,10 @@ index 495be2b5c4c52d4925385a12f63774d827c8907a..7700461b8cd0bde1bf6c0d5e4b73184b
org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, pos); // CraftBukkit
entity.hurt(world.damageSources().inFire(), (float) this.fireDamage);
diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java
index feb82a1c55c94702e484a6170c25e72110ecbe8b..c5608f72a8f2ad2640f32fa63c69a6ef69d746da 100644
index a7809bb2a468c7ad7ef7ba795afd93dd2a63cadc..76c12b34aac276fc9375135dac1c2018fdd7d756 100644
--- a/src/main/java/net/minecraft/world/level/block/CropBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java
@@ -167,6 +167,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
@@ -174,6 +174,7 @@ public class CropBlock extends BushBlock implements BonemealableBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -101,10 +101,10 @@ index feb82a1c55c94702e484a6170c25e72110ecbe8b..c5608f72a8f2ad2640f32fa63c69a6ef
world.destroyBlock(pos, true, entity);
}
diff --git a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
index 932a2c279f46c951182d2604b525b473b6945895..05dfb1790a292f9f85b641377c2ca3675726c127 100644
index 8eff69cb70ba094f9dcc0849f0436d4a3498fceb..034a3bc5b5e526e28088a9715a41ad8ab843860b 100644
--- a/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DetectorRailBlock.java
@@ -44,6 +44,7 @@ public class DetectorRailBlock extends BaseRailBlock {
@@ -51,6 +51,7 @@ public class DetectorRailBlock extends BaseRailBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -113,10 +113,10 @@ index 932a2c279f46c951182d2604b525b473b6945895..05dfb1790a292f9f85b641377c2ca367
if (!(Boolean) state.getValue(DetectorRailBlock.POWERED)) {
this.checkPressed(world, pos, state);
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index d8ff821bf35275b8792f38ec786767026e368bba..45b427f314da778cc13da9ad6e4e1316790bf1b1 100644
index 07629f6106f384751c376d2a99ba2e8b905e49c6..c8f1bdbfcb2df3d4be05d185e97857a6181b076e 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -44,6 +44,7 @@ public class EndPortalBlock extends BaseEntityBlock {
@@ -52,6 +52,7 @@ public class EndPortalBlock extends BaseEntityBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -125,10 +125,10 @@ index d8ff821bf35275b8792f38ec786767026e368bba..45b427f314da778cc13da9ad6e4e1316
ResourceKey<Level> resourcekey = world.getTypeKey() == LevelStem.END ? Level.OVERWORLD : Level.END; // CraftBukkit - SPIGOT-6152: send back to main overworld in custom ends
ServerLevel worldserver = ((ServerLevel) world).getServer().getLevel(resourcekey);
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
index b63835fe3eda974746163e7a9e26080da7538c4d..834c5e3fbff3819f3f72e95a1072d9b9e57f25b3 100644
index d5c83f3b9d398b2a025e6729980b1b87b35f38a8..a4ca58384ae2a39ec568b153cc1a4f7704136108 100644
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
@@ -71,6 +71,7 @@ public class FrogspawnBlock extends Block {
@@ -78,6 +78,7 @@ public class FrogspawnBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -137,10 +137,10 @@ index b63835fe3eda974746163e7a9e26080da7538c4d..834c5e3fbff3819f3f72e95a1072d9b9
this.destroyBlock(world, pos);
}
diff --git a/src/main/java/net/minecraft/world/level/block/HoneyBlock.java b/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
index f2206cea243b2281471bc9e939dd79971b0025eb..745f33ce496a7ce8c788f24c093b37933a74148a 100644
index 8b84359316e559b94ae6a2d757bda2286d99a903..b9d89cce40e4cbeaf98eeb85c254db353e573c95 100644
--- a/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HoneyBlock.java
@@ -54,6 +54,7 @@ public class HoneyBlock extends HalfTransparentBlock {
@@ -61,6 +61,7 @@ public class HoneyBlock extends HalfTransparentBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -149,7 +149,7 @@ index f2206cea243b2281471bc9e939dd79971b0025eb..745f33ce496a7ce8c788f24c093b3793
this.maybeDoSlideAchievement(entity, pos);
this.doSlideMovement(entity);
diff --git a/src/main/java/net/minecraft/world/level/block/HopperBlock.java b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
index 67833347206a913f0eb2d8d9ae14f14fe0e4d181..4311c97edd2a70e9ed8fed3fdf9471c513ddc1d4 100644
index 99a5821a55f2d2947722d64d60f4ee4ba5dfa74c..5012de7e58092a11f8022a1aa33986604da840b3 100644
--- a/src/main/java/net/minecraft/world/level/block/HopperBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HopperBlock.java
@@ -200,6 +200,7 @@ public class HopperBlock extends BaseEntityBlock {
@ -161,10 +161,10 @@ index 67833347206a913f0eb2d8d9ae14f14fe0e4d181..4311c97edd2a70e9ed8fed3fdf9471c5
if (blockEntity instanceof HopperBlockEntity) {
HopperBlockEntity.entityInside(world, pos, state, entity, (HopperBlockEntity)blockEntity);
diff --git a/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
index f0a3ef0529951e7732602d358ddea1782001db7e..6588b207d93d96934e72176874ba60c81e9a098c 100644
index 7e926a4546f89da22080ef28c3858ac7b3cf80f1..bc099abfda6555cade0a83eddfe1be9c243fa83b 100644
--- a/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LavaCauldronBlock.java
@@ -24,6 +24,7 @@ public class LavaCauldronBlock extends AbstractCauldronBlock {
@@ -32,6 +32,7 @@ public class LavaCauldronBlock extends AbstractCauldronBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -173,10 +173,10 @@ index f0a3ef0529951e7732602d358ddea1782001db7e..6588b207d93d96934e72176874ba60c8
entity.lavaHurt();
}
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
index 2d0191eeb746d496a481d66cdfa77078313a13ec..24d2da792bc498adf4251555a538df4cafe2e827 100644
index 64247c3a81273277b95656885c78eca3e883ef13..a8b2c49ebf531d730d681ca3bceb4dc74b433fdb 100644
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -60,6 +60,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -65,6 +65,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -185,10 +185,10 @@ index 2d0191eeb746d496a481d66cdfa77078313a13ec..24d2da792bc498adf4251555a538df4c
// CraftBukkit start
if (entity.mayInteract(world, pos)) {
diff --git a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
index 69f34c566bf825259253abbefd7d7ba2e847231b..a6ab0d0defc05e56a91084c49897059670a1324b 100644
index 4e52e92846428b0d01635b90f3480b4a2c13a0b4..ee998d06804e344ea9d5b84ef0074b84aaba04c2 100644
--- a/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NetherPortalBlock.java
@@ -82,6 +82,7 @@ public class NetherPortalBlock extends Block {
@@ -90,6 +90,7 @@ public class NetherPortalBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -197,10 +197,10 @@ index 69f34c566bf825259253abbefd7d7ba2e847231b..a6ab0d0defc05e56a91084c498970596
// CraftBukkit start - Entity in portal
EntityPortalEnterEvent event = new EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(world.getWorld(), pos.getX(), pos.getY(), pos.getZ()));
diff --git a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
index 2762ec1b3404e8761733119a8ead0aecef328c85..20fdd6cc35bec8f707a83fb682257f68163ed6fc 100644
index f7154d56ad42e0dde497e0e585cc554d34865e3b..c80a3ee02f3af146926a3611779fd0af298a8ac1 100644
--- a/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PitcherCropBlock.java
@@ -87,6 +87,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
@@ -94,6 +94,7 @@ public class PitcherCropBlock extends DoublePlantBlock implements BonemealableBl
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -209,10 +209,10 @@ index 2762ec1b3404e8761733119a8ead0aecef328c85..20fdd6cc35bec8f707a83fb682257f68
world.destroyBlock(pos, true, entity);
}
diff --git a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
index 022484a7386a8a02468134fc7b2d7916398cf015..e6fcea4482d5d87ed78beefad4c57bc86089460f 100644
index b38658b84e821435ba5a3fc7218b72406da00e47..f579911b06b66e94e6311d970e93cca33fa089c6 100644
--- a/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PowderSnowBlock.java
@@ -56,6 +56,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
@@ -63,6 +63,7 @@ public class PowderSnowBlock extends Block implements BucketPickup {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -221,10 +221,10 @@ index 022484a7386a8a02468134fc7b2d7916398cf015..e6fcea4482d5d87ed78beefad4c57bc8
entity.makeStuckInBlock(state, new Vec3(0.8999999761581421D, 1.5D, 0.8999999761581421D));
if (world.isClientSide) {
diff --git a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
index 89c86d10840bc8fa73465a6a548c48fab9ac55ea..34eb7ba1adb51e394bf46a6f643db3529626d9ec 100644
index c733b9dc26370322e404b56ac3feb3417948cb90..f474ae7b3121de701f371b7d88e80086ec07d03d 100644
--- a/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SweetBerryBushBlock.java
@@ -77,6 +77,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock
@@ -84,6 +84,7 @@ public class SweetBerryBushBlock extends BushBlock implements BonemealableBlock
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -233,10 +233,10 @@ index 89c86d10840bc8fa73465a6a548c48fab9ac55ea..34eb7ba1adb51e394bf46a6f643db352
entity.makeStuckInBlock(state, new Vec3(0.800000011920929D, 0.75D, 0.800000011920929D));
if (!world.isClientSide && (Integer) state.getValue(SweetBerryBushBlock.AGE) > 0 && (entity.xOld != entity.getX() || entity.zOld != entity.getZ())) {
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
index 5aa0653b85784ece5fe09ace5c63d2c91469c823..336ffc27ea75fd8fd037c20b931233dc611084f3 100644
index d092ee2aa4a37c89642133dca7049737c55a4245..bbb7d1b03c78758d608e89129aacec151242831c 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
@@ -121,6 +121,7 @@ public class TripWireBlock extends Block {
@@ -134,6 +134,7 @@ public class TripWireBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -245,10 +245,10 @@ index 5aa0653b85784ece5fe09ace5c63d2c91469c823..336ffc27ea75fd8fd037c20b931233dc
if (!(Boolean) state.getValue(TripWireBlock.POWERED)) {
this.checkPressed(world, pos);
diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
index 63e3e6653938069557e8f6a01d5e7d4b6700345d..b13d89b1516130507402cd3b4bdb9f3c2a36e807 100644
index d89a4c30599cedcb8ce17899631cb58c8a6a2195..c01cc63497917b0c5d95424c060c69f3693fc871 100644
--- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
@@ -27,6 +27,7 @@ public class WaterlilyBlock extends BushBlock {
@@ -34,6 +34,7 @@ public class WaterlilyBlock extends BushBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
super.entityInside(state, world, pos, entity);
@ -257,10 +257,10 @@ index 63e3e6653938069557e8f6a01d5e7d4b6700345d..b13d89b1516130507402cd3b4bdb9f3c
// CraftBukkit start
if (!CraftEventFactory.callEntityChangeBlockEvent(entity, pos, Blocks.AIR.defaultBlockState())) {
diff --git a/src/main/java/net/minecraft/world/level/block/WebBlock.java b/src/main/java/net/minecraft/world/level/block/WebBlock.java
index 6964308822ebf8a7027ce426062ba43a70c20c15..763fa221c562e96c2abd09c7055e91a86ac03d43 100644
index 7206dfa5bdfb94ff98bcdfc735367c22493e925e..edf00a8c3747d0c5ac8001c70846475800fa6a84 100644
--- a/src/main/java/net/minecraft/world/level/block/WebBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WebBlock.java
@@ -14,6 +14,7 @@ public class WebBlock extends Block {
@@ -22,6 +22,7 @@ public class WebBlock extends Block {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -269,10 +269,10 @@ index 6964308822ebf8a7027ce426062ba43a70c20c15..763fa221c562e96c2abd09c7055e91a8
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
index 5cf75b8092d13e6bd3792e1313786ec603454d36..d77ef4b9809da0f18b3b5683d71f41178b19a305 100644
index c10a01013f8393c677834136babed15817b45611..8f6139d8b1fbe45b9330961ccfbe9413f9f5f225 100644
--- a/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WitherRoseBlock.java
@@ -45,6 +45,7 @@ public class WitherRoseBlock extends FlowerBlock {
@@ -61,6 +61,7 @@ public class WitherRoseBlock extends FlowerBlock {
@Override
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Attributes API for item defaults
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 5cb6fe52514a94eeda2676659f1a990071befecd..9c06e1b5853de70eb9fad444b2a97acd25328bc4 100644
index 893bc4334b72db328711221496e57e872dc1f6d8..5045af60302e1929d9f904cb74214c3c15cfe60d 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -546,6 +546,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -543,6 +543,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftMagicNumbers.getItem(itemToBeRepaired.getType()).isValidRepairItem(CraftItemStack.asNMSCopy(itemToBeRepaired), CraftItemStack.asNMSCopy(repairMaterial));
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add cause to Weather/ThunderChangeEvents
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index bc7bed7f98723a68c1d919020e9e88ad2213d7b8..5b9107557c397b3e1cbfe8378750ea5888f18af0 100644
index b3f8607221c3508fa8a8435bec1d490c7b05cd91..d021091d7ae7d62fd2199a2ffd936c45cc42797f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -666,8 +666,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -668,8 +668,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setClearWeatherTime(clearDuration);
this.serverLevelData.setRainTime(rainDuration);
this.serverLevelData.setThunderTime(rainDuration);
@ -19,7 +19,7 @@ index bc7bed7f98723a68c1d919020e9e88ad2213d7b8..5b9107557c397b3e1cbfe8378750ea58
}
@Override
@@ -1087,8 +1087,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1105,8 +1105,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.serverLevelData.setThunderTime(j);
this.serverLevelData.setRainTime(k);
this.serverLevelData.setClearWeatherTime(i);
@ -30,9 +30,9 @@ index bc7bed7f98723a68c1d919020e9e88ad2213d7b8..5b9107557c397b3e1cbfe8378750ea58
}
this.oThunderLevel = this.thunderLevel;
@@ -1154,14 +1154,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
private void resetWeatherCycle() {
@@ -1173,14 +1173,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
@VisibleForTesting
public void resetWeatherCycle() {
// CraftBukkit start
- this.serverLevelData.setRaining(false);
+ this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - when passing the night
@ -48,10 +48,10 @@ index bc7bed7f98723a68c1d919020e9e88ad2213d7b8..5b9107557c397b3e1cbfe8378750ea58
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
diff --git a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java
index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f60ddf101f 100644
index f5ac36fa54f3d3b39de103c95abb9ca3adfe8dda..47266d2b86e7f2022de7ea0c9347b4f55ad6fbe1 100644
--- a/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java
+++ b/src/main/java/net/minecraft/world/level/storage/PrimaryLevelData.java
@@ -394,6 +394,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@@ -373,6 +373,11 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@Override
public void setThundering(boolean thundering) {
@ -63,7 +63,7 @@ index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f6
// CraftBukkit start
if (this.thundering == thundering) {
return;
@@ -401,7 +406,7 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@@ -380,7 +385,7 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
org.bukkit.World world = Bukkit.getWorld(this.getLevelName());
if (world != null) {
@ -72,7 +72,7 @@ index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f6
Bukkit.getServer().getPluginManager().callEvent(thunder);
if (thunder.isCancelled()) {
return;
@@ -428,6 +433,12 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@@ -407,6 +412,12 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@Override
public void setRaining(boolean raining) {
@ -85,7 +85,7 @@ index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f6
// CraftBukkit start
if (this.raining == raining) {
return;
@@ -435,7 +446,7 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
@@ -414,7 +425,7 @@ public class PrimaryLevelData implements ServerLevelData, WorldData {
org.bukkit.World world = Bukkit.getWorld(this.getLevelName());
if (world != null) {
@ -95,10 +95,10 @@ index 8f661e3080f8145c1e78ff7bd84d77707eef6d9e..6357ac8640fdf9f47a94ad69e77a67f6
if (weather.isCancelled()) {
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d2b8fa11c1f78aadab79cb296da192a0e9b493b7..8f3847dd4585ef4ae275a77af32ccd6076a38260 100644
index 6252d231e072fcd1fd8ca2eb0b74c66cac9950e9..7df7b95bf81fde54bb88554fb7509b4092094bda 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1189,7 +1189,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1195,7 +1195,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setStorm(boolean hasStorm) {
@ -107,7 +107,7 @@ index d2b8fa11c1f78aadab79cb296da192a0e9b493b7..8f3847dd4585ef4ae275a77af32ccd60
this.setWeatherDuration(0); // Reset weather duration (legacy behaviour)
this.setClearWeatherDuration(0); // Reset clear weather duration (reset "/weather clear" commands)
}
@@ -1211,7 +1211,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1217,7 +1217,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public void setThundering(boolean thundering) {

View File

@ -5,11 +5,23 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834b268f0dc 100644
index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..b96bf00bc6cd10ced89939424150bd3c5baf12c3 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -39,7 +39,7 @@ public class SignedMessageChain {
@@ -35,16 +35,16 @@ public class SignedMessageChain {
return (signature, body) -> {
SignedMessageLink signedMessageLink = this.advanceLink();
if (signedMessageLink == null) {
- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false);
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - TODO 1.20.3 - new kick cause?
} else if (playerPublicKey.data().hasExpired()) {
- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false);
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey", org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY), false); // Paper - kick event causes
} else if (body.timeStamp().isBefore(this.lastTimeStamp)) {
- throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true);
+ throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat", org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT), true); // Paper - kick event causes
} else {
this.lastTimeStamp = body.timeStamp();
PlayerChatMessage playerChatMessage = new PlayerChatMessage(signedMessageLink, signature, body, (Component)null, FilterMask.PASS_THROUGH);
if (!playerChatMessage.verify(signatureValidator)) {
- throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.unsigned_chat"), true);
@ -17,7 +29,7 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834
} else {
if (playerChatMessage.hasExpiredServer(Instant.now())) {
LOGGER.warn("Received expired chat: '{}'. Is the client/server system time unsynchronized?", (Object)body.content());
@@ -63,10 +63,17 @@ public class SignedMessageChain {
@@ -68,10 +68,17 @@ public class SignedMessageChain {
public static class DecodeException extends ThrowingComponent {
private final boolean shouldDisconnect;
@ -36,10 +48,10 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834
public boolean shouldDisconnect() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1400fd3f8eb38c15e85221b5805080e1d792215f..d74313b58b660f3c03b8a6db4f80b6b073b6b795 100644
index 8937b71511bc1dce082683b4107d52e0e632e7a2..6f17e5631aace53f75e6badf514dbb77c50065b9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2151,7 +2151,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2250,7 +2250,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
@ -75,20 +87,20 @@ index 46f45b315011d43c081fb3f004ab62f3da67036a..42c930443505e94ca91a02e65a8df868
}
}
diff --git a/src/main/java/net/minecraft/server/commands/KickCommand.java b/src/main/java/net/minecraft/server/commands/KickCommand.java
index c68bac4727f6b2ca95fc8c438303097af14286f2..bb629ec263959c8268de88ca807bddb62e9f877e 100644
index b9560b4ae5c0867396006119c5dadd7f3b47f78b..f3e32da770f379d46c65a0ba5a100b5f10be8422 100644
--- a/src/main/java/net/minecraft/server/commands/KickCommand.java
+++ b/src/main/java/net/minecraft/server/commands/KickCommand.java
@@ -22,7 +22,7 @@ public class KickCommand {
@@ -33,7 +33,7 @@ public class KickCommand {
private static int kickPlayers(CommandSourceStack source, Collection<ServerPlayer> targets, Component reason) {
for(ServerPlayer serverPlayer : targets) {
- serverPlayer.connection.disconnect(reason);
+ serverPlayer.connection.disconnect(reason, org.bukkit.event.player.PlayerKickEvent.Cause.KICK_COMMAND); // Paper - kick event cause
source.sendSuccess(() -> {
return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason);
}, true);
for(ServerPlayer serverPlayer : targets) {
if (!source.getServer().isSingleplayerOwner(serverPlayer.getGameProfile())) {
- serverPlayer.connection.disconnect(reason);
+ serverPlayer.connection.disconnect(reason, org.bukkit.event.player.PlayerKickEvent.Cause.KICK_COMMAND); // Paper - kick event cause
source.sendSuccess(() -> {
return Component.translatable("commands.kick.success", serverPlayer.getDisplayName(), reason);
}, true);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index d660041805bcd1bb97cf347d8b1cfe5c65469f56..a0328cfbe4184a2c1dc895e96fa3fefbdc52bf09 100644
index 156e49d682be26f0962cae960acaef613bd6ebba..ef43ae46c028462deec7e13e4fba80421c56043d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -94,7 +94,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -129,13 +141,13 @@ index d660041805bcd1bb97cf347d8b1cfe5c65469f56..a0328cfbe4184a2c1dc895e96fa3fefb
@@ -174,7 +174,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
PacketUtils.ensureRunningOnSameThread(packet, this, (BlockableEventLoop) this.server);
if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
ServerCommonPacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.playerProfile().getName());
if (packet.action() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) {
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"), org.bukkit.event.player.PlayerKickEvent.Cause.RESOURCE_PACK_REJECTION); // Paper - kick event cause
}
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.getAction().ordinal()];
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action().ordinal()];
@@ -194,7 +194,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
@ -197,10 +209,10 @@ index d660041805bcd1bb97cf347d8b1cfe5c65469f56..a0328cfbe4184a2c1dc895e96fa3fefb
if (this.cserver.getServer().isRunning()) {
this.cserver.getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb556bdee6 100644
index 3f5b5208066cf8836deb00c81f4ff9283a7c620f..3671969ddb6c5d513e4c87c4c1bcaf2ee05351af 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -340,7 +340,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -343,7 +343,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
@ -209,7 +221,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
} else {
@@ -359,7 +359,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -362,7 +362,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) {
if (++this.aboveGroundVehicleTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString());
@ -218,7 +230,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
} else {
@@ -390,7 +390,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -393,7 +393,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) this.server.getPlayerIdleTimeout() * 1000L * 60L) {
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
@ -227,7 +239,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
}
@@ -460,7 +460,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -463,7 +463,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) {
@ -236,7 +248,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
} else {
Entity entity = this.player.getRootVehicle();
@@ -666,7 +666,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -669,7 +669,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) {
@ -245,7 +257,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
@@ -724,7 +724,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -727,7 +727,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
// CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
@ -254,7 +266,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
// Paper start
@@ -883,7 +883,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -886,7 +886,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - validate pick item position
if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -263,7 +275,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed
@@ -1066,7 +1066,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1071,7 +1071,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
if (byteLength > 256 * 4) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!");
@ -272,7 +284,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
byteTotal += byteLength;
@@ -1089,14 +1089,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1094,14 +1094,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (byteTotal > byteAllowed) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size());
@ -289,7 +301,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
this.lastBookTick = MinecraftServer.currentTick;
@@ -1220,7 +1220,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1245,7 +1245,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
@ -298,7 +310,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
} else {
ServerLevel worldserver = this.player.serverLevel();
@@ -1634,7 +1634,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1661,7 +1661,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.dropCount++;
if (this.dropCount >= 20) {
ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!");
@ -307,7 +319,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
}
@@ -1917,7 +1917,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1944,7 +1944,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.resetLastActionTime();
} else {
ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString());
@ -316,43 +328,34 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
}
@@ -1930,7 +1930,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1957,7 +1957,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
} else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
@@ -1963,7 +1963,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1989,7 +1989,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
- this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
} else {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2018,7 +2018,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.lastSeenMessages());
@@ -2045,7 +2045,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private void handleMessageDecodeFailure(SignedMessageChain.DecodeException exception) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to update secure chat state for {}: '{}'", this.player.getGameProfile().getName(), exception.getComponent().getString());
if (exception.shouldDisconnect()) {
- this.disconnect(exception.getComponent());
+ this.disconnect(exception.getComponent(), exception.kickCause); // Paper - kick event causes
} else {
this.player.sendSystemMessage(exception.getComponent().copy().withStyle(ChatFormatting.RED));
}
@@ -2049,7 +2049,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
- this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
return Optional.empty();
} else {
Optional<LastSeenMessages> optional = this.unpackAndApplyLastSeen(acknowledgment);
@@ -2072,7 +2072,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2093,7 +2093,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (optional.isEmpty()) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -361,7 +364,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
return optional;
@@ -2268,7 +2268,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2276,7 +2276,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
// CraftBukkit end
@ -370,7 +373,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
}
@@ -2280,7 +2280,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2288,7 +2288,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
synchronized (this.lastSeenMessages) {
if (!this.lastSeenMessages.applyOffset(packet.offset())) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message acknowledgements from {}", this.player.getName().getString());
@ -379,7 +382,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
}
@@ -2433,7 +2433,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2441,7 +2441,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
if (i > 4096) {
@ -388,7 +391,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
}
@@ -2490,7 +2490,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2498,7 +2498,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@ -397,7 +400,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
// Spigot End
@@ -2589,7 +2589,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2597,7 +2597,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit end
}
} else {
@ -406,7 +409,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
}
@@ -2998,7 +2998,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3006,7 +3006,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -415,7 +418,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
return;
}
}
@@ -3233,7 +3233,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3241,7 +3241,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!Objects.equals(profilepublickey_a, profilepublickey_a1)) {
if (profilepublickey_a != null && profilepublickey_a1.expiresAt().isBefore(profilepublickey_a.expiresAt())) {
@ -424,7 +427,7 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
} else {
try {
SignatureValidator signaturevalidator = this.server.getProfileKeySignatureValidator();
@@ -3246,7 +3246,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3254,7 +3254,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.resetPlayerChatState(remotechatsession_a.validate(this.player.getGameProfile(), signaturevalidator));
} catch (ProfilePublicKey.ValidationException profilepublickey_b) {
ServerGamePacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
@ -434,10 +437,10 @@ index b35f4ab4ff034f7b59f3970fc18af2f777ec2a40..ef1af985927b1291ccee1ff4f9dbd4fb
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 80e31db0fbcac487f8dec943972204cddd10e161..dd7298c41eee0f9a63416cfd6c5e5519ffde100a 100644
index 2ed83d020ec5fe2aca1a66b2196c7fc9f41bf4c5..3deb549aa3eec8947e01250ee7c6ce306973387b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -686,7 +686,7 @@ public abstract class PlayerList {
@@ -684,7 +684,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@ -488,10 +491,10 @@ index 6724d0a1af13e97bc1d3bd94fd43fef742a0deab..20ba0a0c9eae28658888a77dd2170f62
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 82616cc51a84425edc3f6c5db36945551d74b55f..31e2c25adba68ba0527f7ad0104318d454826ada 100644
index 40553b12460b6f5b4db253134b09d4b3dcd0afb1..b15ee4c8ac9e306742b0b394f0721e026f7f6f3a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -586,7 +586,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -593,7 +593,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
org.spigotmc.AsyncCatcher.catchOp("player kick"); // Spigot
if (this.getHandle().connection == null) return;
@ -500,7 +503,7 @@ index 82616cc51a84425edc3f6c5db36945551d74b55f..31e2c25adba68ba0527f7ad0104318d4
}
// Paper start
@@ -598,10 +598,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -605,10 +605,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void kick(final net.kyori.adventure.text.Component message) {
@ -517,7 +520,7 @@ index 82616cc51a84425edc3f6c5db36945551d74b55f..31e2c25adba68ba0527f7ad0104318d4
}
}
@@ -660,7 +665,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -667,7 +672,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start - Improve chat handling
if (ServerGamePacketListenerImpl.isChatMessageIllegal(msg)) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add option to fix items merging through walls
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index a7eccb2f364ed633cb6d4914491eb686ff02e647..d70abca10e84b86310ce5e4d72eb939331dc00e4 100644
index 36ccb7701cc5f6648940256b62321034eff964c6..fc14a2eb464675f8fb0bff916992687adb4e3d25 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -258,6 +258,14 @@ public class ItemEntity extends Entity implements TraceableEntity {
@@ -276,6 +276,14 @@ public class ItemEntity extends Entity implements TraceableEntity {
ItemEntity entityitem = (ItemEntity) iterator.next();
if (entityitem.isMergable()) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add ElderGuardianAppearanceEvent
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectUtil.java b/src/main/java/net/minecraft/world/effect/MobEffectUtil.java
index 4c46a843c5c7e6f735f6b5f0f3c034524a0cf1e1..2baba1ccc1acd50693e05d565784d11df27bba93 100644
index fd803cbdad0e75f43279c5d5049b0152c2d013c3..2902a06b06bedf4fba42ac37a5371b0b353e0e98 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectUtil.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectUtil.java
@@ -54,10 +54,23 @@ public final class MobEffectUtil {

View File

@ -11,10 +11,10 @@ Move the tick logic into the post tick, where portaling was
designed to happen in the first place.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3213555082444edcfbfd5db25aac50738f644d3d..21b2d4cbf399b90156200899ba0952de9a5ee7ee 100644
index 3aa34902d4325c1ac2ad9d64ae2e5fa36a6d88e9..407b713be2d2426f49e5978770e40cdf03c5ce1a 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -485,6 +485,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -490,6 +490,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper end
// Paper start - optimise entity tracking
final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this);
@ -51,7 +51,7 @@ index 3213555082444edcfbfd5db25aac50738f644d3d..21b2d4cbf399b90156200899ba0952de
public boolean isLegacyTrackingEntity = false;
@@ -2850,6 +2880,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2879,6 +2909,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
this.processPortalCooldown();
@ -60,10 +60,10 @@ index 3213555082444edcfbfd5db25aac50738f644d3d..21b2d4cbf399b90156200899ba0952de
}
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index 45b427f314da778cc13da9ad6e4e1316790bf1b1..41d7cff39fc37955877668337689b4b26cd8c7cf 100644
index c8f1bdbfcb2df3d4be05d185e97857a6181b076e..c82ebcac07033d887af499f81520982fbe5ed4f1 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -53,16 +53,10 @@ public class EndPortalBlock extends BaseEntityBlock {
@@ -61,16 +61,10 @@ public class EndPortalBlock extends BaseEntityBlock {
// return; // CraftBukkit - always fire event in case plugins wish to change it
}

View File

@ -32,10 +32,10 @@ index 5e01357208fe52c1d270c68cb19029ea0f4057bb..6d85237b21650edf1d2dc71abaf0edbe
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 0766b991079bfda1558cc17b75ff3dd06c1ad725..f6d2785b05b4c0a4393be706a90d7cc4388399bf 100644
index 9c20c225ba46f2126a43e2f879f4849081cae90a..cbf1a518406bf478811c737e6dabf0a8c451d16c 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -361,7 +361,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -362,7 +362,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CompoundTag display = tag.getCompound(CraftMetaItem.DISPLAY.NBT);
if (display.contains(CraftMetaItem.NAME.NBT)) {
@ -44,7 +44,7 @@ index 0766b991079bfda1558cc17b75ff3dd06c1ad725..f6d2785b05b4c0a4393be706a90d7cc4
}
if (display.contains(CraftMetaItem.LOCNAME.NBT)) {
@@ -372,7 +372,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -373,7 +373,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
ListTag list = display.getList(CraftMetaItem.LORE.NBT, CraftMagicNumbers.NBT.TAG_STRING);
this.lore = new ArrayList<String>(list.size());
for (int index = 0; index < list.size(); index++) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 9ce8052369e3279a89b55b56c476c1e1405c6570..1c8742e272e984d9a093d049b9420036ffc284a1 100644
index d6b80be711b11758ef0bb3187dbcb6e597ef35d3..4a11bf06a725a5c1927e24ac4ad066f7631a430a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3604,7 +3604,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -3606,7 +3606,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@ -19,10 +19,10 @@ index 9ce8052369e3279a89b55b56c476c1e1405c6570..1c8742e272e984d9a093d049b9420036
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index a8716fec24006a89bcaa1e3acb394cc557944703..b1c0baa5a535c629008960bdc94b6010a147c329 100644
index 29369cab2ccdd1d43fc67dbe2e666e477f96b26d..a31df5b8de2a18ad08f1c38fb2ccf7a1f8c9e5e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -993,5 +993,21 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -1027,5 +1027,21 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
public org.bukkit.NamespacedKey getKey() {
return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.getHandle().getLevel().dimension().location());
}
@ -45,10 +45,10 @@ index a8716fec24006a89bcaa1e3acb394cc557944703..b1c0baa5a535c629008960bdc94b6010
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 3d3f7198a6134ced5c2dd25e369cb4e8d8f45fd1..7745c32b312a7f91e6919ccfb0871d765d0e06f3 100644
index d54a67c9942b986adc9e0a06640c90d99bdcdada..72fd16ad8bc08dd3189e56d504000453a8d5cd92 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -583,6 +583,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -588,6 +588,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return this.getHandle().hasLineOfSight(((CraftEntity) other).getHandle());
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] add per world spawn limits
Taken from #2982. Credit to Chasewhip8
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 8f3847dd4585ef4ae275a77af32ccd6076a38260..40cf3f53f46537bfa4fb4c2bedc93cc840084606 100644
index 7df7b95bf81fde54bb88554fb7509b4092094bda..a5a6a1a946451e3f3f4f88eccb30eb3e870c58de 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -215,6 +215,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -216,6 +216,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
this.biomeProvider = biomeProvider;
this.environment = env;

View File

@ -5,15 +5,15 @@ Subject: [PATCH] Add more LimitedRegion API
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
index 3bf4791affe01ff986aeb6611a3622496248a52b..bb06ec1a0cee953860ce2933b892c2bdb94608b2 100644
index 50667138028ef6ae273ccbc351916e98ab5645ca..423a853192c87eb81b79cb6f17866c4665cc1655 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
@@ -249,4 +249,45 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe
public void addEntityToWorld(net.minecraft.world.entity.Entity entity, CreatureSpawnEvent.SpawnReason reason) {
@@ -254,4 +254,45 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe
public void addEntityWithPassengers(net.minecraft.world.entity.Entity entity, CreatureSpawnEvent.SpawnReason reason) {
this.entities.add(entity);
}
+
+ // Paper start
+ // Paper start - Add more LimitedRegion API
+ @Override
+ public void setBlockState(int x, int y, int z, BlockState state) {
+ BlockPos pos = new BlockPos(x, y, z);
@ -52,5 +52,5 @@ index 3bf4791affe01ff986aeb6611a3622496248a52b..bb06ec1a0cee953860ce2933b892c2bd
+ public int getCenterChunkZ() {
+ return centerChunkZ;
+ }
+ // Paper end
+ // Paper end - Add more LimitedRegion API
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 176a966ed1cc1c2e436e1d1fd849bfa0cbf9f799..aa2185e46bd47748a0a2b092ab2caf134fa4fa69 100644
index c82f4f6f023ac8f416613db4fbfe2f4af61fd2de..814754a73a8d653adc159b313fa201565db59590 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2289,7 +2289,7 @@ public class ServerPlayer extends Player {
@@ -2390,7 +2390,7 @@ public class ServerPlayer extends Player {
if (retainOwnership) {
if (!itemstack1.isEmpty()) {
@ -18,10 +18,10 @@ index 176a966ed1cc1c2e436e1d1fd849bfa0cbf9f799..aa2185e46bd47748a0a2b092ab2caf13
this.awardStat(Stats.DROP);
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 0d65e04efacef0bef245e6b5b21e430d90696c5d..4bbd46618ec0f00e0aee7f681335bcbdb375c439 100644
index 51fe3687f6f8c2ce5a5f0ac7749bc7cad135a69a..e77a2d3a321313e8476068d895dfb39cb152f7e6 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -730,6 +730,11 @@ public abstract class Player extends LivingEntity {
@@ -725,6 +725,11 @@ public abstract class Player extends LivingEntity {
}
double d0 = this.getEyeY() - 0.30000001192092896D;

View File

@ -121,10 +121,10 @@ index 39ed3ca76d6b64ef3917280ec822721cc02afada..86b437836cb4b1f6e8ca9acd5f1f93b9
this.leader = null;
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 41f5b4fc4a4b7d2a54b08869d4afa450f34caf91..63678ff2e40d2ba0a5e97539394b18f97368f8cf 100644
index c6235be64d6fb234734dd816052695ac44aea3ae..c534589762b1361bae7c446dfec8dbbf542485fb 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -546,11 +546,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@@ -553,11 +553,13 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.setFlag(4, hasStung);
}
@ -212,10 +212,10 @@ index 71a08510a928d4570822282bb31f14013ec3834a..4aeab90e778629c355189dfe79c39c4b
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index 9f46eb8417ad19e6f1bbf369f4c6b94fdb915f5b..a974b57dfb007d14194c566421216003ffb0c5d6 100644
index a13a1725356ca4430f1f0a6d121fc08679de62db..bd0165d9ca52665a52fbd9678ed895bf4bed2fe7 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -698,6 +698,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
@@ -695,6 +695,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
}
@ -231,7 +231,7 @@ index 9f46eb8417ad19e6f1bbf369f4c6b94fdb915f5b..a974b57dfb007d14194c566421216003
@Override
public InteractionResult mobInteract(Player player, InteractionHand hand) {
if (!this.isVehicle() && !this.isBaby()) {
@@ -740,6 +749,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
@@ -737,6 +746,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
this.setFlag(16, eatingGrass);
}
@ -346,10 +346,10 @@ index c043f63ff861ccb0194fc8cf102c27af5bcfe491..d4ac3e566b47cfc8688bcc2ab08385b6
@Override
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
index 61d4877b4f74362e38104bfeacb7d66534ad798e..454dd67920826b8b62c2654abfd43fc08c2648e4 100644
index 2645f52f5071bf57daf584e21a1f5cb6098110a8..cbe8593cecd84f1598649801bebcb46364044eef 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownTrident.java
@@ -105,6 +105,20 @@ public class ThrownTrident extends AbstractArrow {
@@ -98,6 +98,20 @@ public class ThrownTrident extends AbstractArrow {
return (Boolean) this.entityData.get(ThrownTrident.ID_FOIL);
}
@ -371,10 +371,10 @@ index 61d4877b4f74362e38104bfeacb7d66534ad798e..454dd67920826b8b62c2654abfd43fc0
@Override
protected EntityHitResult findHitEntity(Vec3 currentPosition, Vec3 nextPosition) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index b1c0baa5a535c629008960bdc94b6010a147c329..e2e5b64812ee403be59b3586bf8b0334574c011f 100644
index a31df5b8de2a18ad08f1c38fb2ccf7a1f8c9e5e8..dac05caba1692025af8c930e7118b8b5706f7122 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -829,14 +829,19 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -861,14 +861,19 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
} else if (Phantom.class.isAssignableFrom(clazz)) {
entity = net.minecraft.world.entity.EntityType.PHANTOM.create(world);
} else if (Fish.class.isAssignableFrom(clazz)) {
@ -669,10 +669,10 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index b23338739b7badbb4fae1428a02a67625133b6e0..af7fec4029a5b6cd11a401d31b327c32ba79667b 100644
index 92893d2c9bb921ab40fd8a53300d71fac417eb83..6065336cd30e6400bd8875768f06c44a4be0a1e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -232,10 +232,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -237,10 +237,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else { return new CraftSquid(server, (Squid) entity); }
}
else if (entity instanceof AbstractFish) {
@ -761,10 +761,10 @@ index 2cec61a1bb050c1ef81c5fc3d0afafe9ff29d459..97fa4e1e70203194bd939618b2fad926
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 7745c32b312a7f91e6919ccfb0871d765d0e06f3..a951d4f0754a4be03ae4efa07e60726d733b03e4 100644
index 72fd16ad8bc08dd3189e56d504000453a8d5cd92..353d8b35052cb1b2ed10c89f3b062846e0c271f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -884,6 +884,22 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -889,6 +889,22 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().persistentInvisibility = invisible;
this.getHandle().setSharedFlag(5, invisible);
}
@ -1152,7 +1152,7 @@ index 451a9bfd9b9b6945e224f1bb05c7951ed934b4e3..d7c6a0bbc5671ea8f2488230c94df514
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
index 2d1fcbbaba2b88f2c19ae7553d89e50b30cf6581..c628594b981f276acae7b9337100d811f919631b 100644
index 0fa00ae2b8a84e1ba5a902c1e46e561a761c54b6..20f9735c7cb76024e15dbdca7684f5c560876175 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
@@ -31,4 +31,27 @@ public class CraftTrident extends CraftArrow implements Trident {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ef1af985927b1291ccee1ff4f9dbd4fb556bdee6..dfd4e385e2aa3c0beabc956d46ce30b84e48ebcb 100644
index 3671969ddb6c5d513e4c87c4c1bcaf2ee05351af..5654b9500468c8245ddafbcf846349fdf23d38dd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1096,7 +1096,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1101,7 +1101,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end
// CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix return value of Block#applyBoneMeal always being false
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index a33e7114ac902ae66a31e0298e7c13af2d11b07c..29be71311755de77ce854f874b1fe2b093b997cf 100644
index 2034858a53c4c887da334cdc7713997daa01124f..ce297420f695404356655b1df2847a32fb98ec59 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -557,7 +557,7 @@ public class CraftBlock implements Block {
@@ -558,7 +558,7 @@ public class CraftBlock implements Block {
}
}

View File

@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5b9107557c397b3e1cbfe8378750ea5888f18af0..4cc1cd4924aed4fddd46db9f8c76e45e7bfc661a 100644
index d021091d7ae7d62fd2199a2ffd936c45cc42797f..d2e173c644ca005afd124b30566a01c22bcb7e0e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -228,7 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -230,7 +230,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
@ -21,10 +21,10 @@ index 5b9107557c397b3e1cbfe8378750ea5888f18af0..4cc1cd4924aed4fddd46db9f8c76e45e
@Override
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index b3833da06ec8882f09b01fc596eafe519f0873c1..eea2b7f9c566b5a21fa7da7d1321469a12c45b5a 100644
index aa6b7d93d8dc18e8ee475c89af465f8b7b4eab7d..0e679bbbc000c32b840e5f3155a3c275216b20b5 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -201,6 +201,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -204,6 +204,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return (CraftServer) Bukkit.getServer();
}

View File

@ -58,10 +58,10 @@ index 0000000000000000000000000000000000000000..01a2bc1feec808790bb93618ce46adb9
+ }
+}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 7e4fbf3cd57c74b61cec75c02eb35756a243de17..e34f7426df5d6c94fcc4101b28702e6c1d9fccff 100644
index 725a921c7c8ce458d073333d6a9e8e316dbd6ea8..6a876198008d4c6487e96989c38c331b71818ad3 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -275,7 +275,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@@ -273,7 +273,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
ClickEvent chatclickable = chatmodifier.getClickEvent();
if (chatclickable != null && chatclickable.getAction() == ClickEvent.Action.RUN_COMMAND) {
@ -80,7 +80,7 @@ index 7e4fbf3cd57c74b61cec75c02eb35756a243de17..e34f7426df5d6c94fcc4101b28702e6c
flag1 = true;
}
}
@@ -312,8 +322,23 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@@ -310,8 +320,23 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
String s = player == null ? "Sign" : player.getName().getString();
Object object = player == null ? Component.literal("Sign") : player.getDisplayName();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dfd4e385e2aa3c0beabc956d46ce30b84e48ebcb..cc099315b7ecd471d363679d39ca802692b8f962 100644
index 5654b9500468c8245ddafbcf846349fdf23d38dd..f6bdfa11de5277b62f4163d20e1d7db690603e47 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2318,7 +2318,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2326,7 +2326,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} // Paper end
// Arm swing animation

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fixes kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index aa2185e46bd47748a0a2b092ab2caf134fa4fa69..a3672049abc81fa4d34443cf0303d23e0f86b284 100644
index 814754a73a8d653adc159b313fa201565db59590..ebbf5f835d619c90eae4240dbd2eb665de1e601a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -266,7 +266,6 @@ public class ServerPlayer extends Player {
@@ -273,7 +273,6 @@ public class ServerPlayer extends Player {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper
@ -17,7 +17,7 @@ index aa2185e46bd47748a0a2b092ab2caf134fa4fa69..a3672049abc81fa4d34443cf0303d23e
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index a0328cfbe4184a2c1dc895e96fa3fefbdc52bf09..598f807f0d0caac98b81e0e2991f1bd497c4534e 100644
index ef43ae46c028462deec7e13e4fba80421c56043d..e21c9b4de037664d43cfa3259d1b36dab3631557 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -76,6 +76,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@ -50,10 +50,10 @@ index a0328cfbe4184a2c1dc895e96fa3fefbdc52bf09..598f807f0d0caac98b81e0e2991f1bd4
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index cc099315b7ecd471d363679d39ca802692b8f962..c885f3dea2ef128758da59acba42765887ae41ee 100644
index f6bdfa11de5277b62f4163d20e1d7db690603e47..051ec7b3a36e0189dc36e2b430703a425f4c7dc4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1856,6 +1856,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1883,6 +1883,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void onDisconnect(Component reason) {
@ -66,7 +66,7 @@ index cc099315b7ecd471d363679d39ca802692b8f962..c885f3dea2ef128758da59acba427658
// CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) {
return;
@@ -1864,11 +1870,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1891,11 +1897,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString());
@ -86,7 +86,7 @@ index cc099315b7ecd471d363679d39ca802692b8f962..c885f3dea2ef128758da59acba427658
this.chatMessageChain.close();
// CraftBukkit start - Replace vanilla quit message handling with our own.
/*
@@ -1878,7 +1890,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1905,7 +1917,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.disconnect();
// Paper start - Adventure
@ -96,10 +96,10 @@ index cc099315b7ecd471d363679d39ca802692b8f962..c885f3dea2ef128758da59acba427658
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index dd7298c41eee0f9a63416cfd6c5e5519ffde100a..3170c0f512ff315d40ad1d4e24794e51c1429a36 100644
index 3deb549aa3eec8947e01250ee7c6ce306973387b..60a8ec8937ce8b384ca8272aae865577395afc47 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -572,6 +572,11 @@ public abstract class PlayerList {
@@ -570,6 +570,11 @@ public abstract class PlayerList {
}
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component
@ -111,7 +111,7 @@ index dd7298c41eee0f9a63416cfd6c5e5519ffde100a..3170c0f512ff315d40ad1d4e24794e51
ServerLevel worldserver = entityplayer.serverLevel();
entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -582,7 +587,7 @@ public abstract class PlayerList {
@@ -580,7 +585,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add config for mobs immune to default effects
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 1c8742e272e984d9a093d049b9420036ffc284a1..118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a 100644
index 4a11bf06a725a5c1927e24ac4ad066f7631a430a..ddfac0ec3baeff8596bea7e742707aa1fddfc1c2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1165,7 +1165,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1164,7 +1164,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.getMobType() == MobType.UNDEAD) {
MobEffect mobeffectlist = effect.getEffect();

View File

@ -11,7 +11,7 @@ It does not make a lot of sense to damage players if they get crammed,
For those who really want it a config option is provided.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a3672049abc81fa4d34443cf0303d23e0f86b284..00adb106eea35b745e98e28e6b9e0affe2d00651 100644
index ebbf5f835d619c90eae4240dbd2eb665de1e601a..d08111e8107ddffdeff3fc044fc18b915d24433c 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -95,6 +95,7 @@ import net.minecraft.util.Mth;
@ -22,7 +22,7 @@ index a3672049abc81fa4d34443cf0303d23e0f86b284..00adb106eea35b745e98e28e6b9e0aff
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
@@ -1474,7 +1475,7 @@ public class ServerPlayer extends Player {
@@ -1478,7 +1479,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isInvulnerableTo(DamageSource damageSource) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Stinger API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index a951d4f0754a4be03ae4efa07e60726d733b03e4..c5f8b461b8315d3db029dea2d5f7e9a764fc3443 100644
index 353d8b35052cb1b2ed10c89f3b062846e0c271f8..faf32ed224f5471d8994ad09e493c1fb724904a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -338,7 +338,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
@@ -339,7 +339,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
// Paper end
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix incosistency issue with empty map items in CB
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 53515854d05a0c27a65f71193424236a21b11f5f..c368b437597edf7e165326727ae778a69c3fcc83 100644
index b27a464cecb0efc2656d85e3c546f262e79de9a4..cd841f027edbe7e000d633034a2aa6a214c20b5b 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -73,7 +73,7 @@ public class MapItem extends ComplexItem {

View File

@ -105,10 +105,10 @@ index 0000000000000000000000000000000000000000..a8e813ca89b033f061e695288b3383bd
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bc75c1295427dc1c0e4f7c708e944f10e54ae8b9..b18bf7b943fe2bb009babf9414559b832a51d505 100644
index f3f15463332056ae108e49e3f72bbaa061ed7270..0b422ba3241b31ad9e4f227bcb5033df2545d84b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -307,6 +307,7 @@ public final class CraftServer implements Server {
@@ -308,6 +308,7 @@ public final class CraftServer implements Server {
public int reloadCount;
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
public static Exception excessiveVelEx; // Paper - Velocity warnings

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Improve boat collision performance
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 5e9401f0c2de0743aca9237ee8c4dfba586cfdb9..25b2d7016b60ee9bad0a2fb4a2c7c8ee34af50eb 100644
index 8188febd6f1039a31619b42af23df18afd2e985c..e67a2aa92f9c9bb5a4ba9fc869aa738a43cd8595 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -114,6 +114,7 @@ public class Util {
@@ -121,6 +121,7 @@ public class Util {
}).findFirst().orElseThrow(() -> {
return new IllegalStateException("No jar file system provider found");
});
@ -17,10 +17,10 @@ index 5e9401f0c2de0743aca9237ee8c4dfba586cfdb9..25b2d7016b60ee9bad0a2fb4a2c7c8ee
};
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a..eca3c85b2b24a59b6c3b316e2535f2a4354f50f9 100644
index ddfac0ec3baeff8596bea7e742707aa1fddfc1c2..b0e8a2f4a223cfe3652ad45c26bcf96f21bb7853 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1414,7 +1414,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1413,7 +1413,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (!source.is(DamageTypeTags.IS_PROJECTILE)) {
Entity entity = source.getDirectEntity();
@ -29,7 +29,7 @@ index 118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a..eca3c85b2b24a59b6c3b316e2535f2a4
LivingEntity entityliving = (LivingEntity) entity;
this.blockUsingShield(entityliving);
@@ -1508,11 +1508,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1507,11 +1507,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
if (entity1 != null && !source.is(DamageTypeTags.NO_KNOCKBACK)) {
@ -44,7 +44,7 @@ index 118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a..eca3c85b2b24a59b6c3b316e2535f2a4
d0 = (Math.random() - Math.random()) * 0.01D;
}
@@ -2244,7 +2245,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2241,7 +2242,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.hurtCurrentlyUsedShield((float) -event.getDamage(DamageModifier.BLOCKING));
Entity entity = damagesource.getDirectEntity();
@ -54,10 +54,10 @@ index 118f1c6a349ad49d87f14a1b8ae9ef64ccb1148a..eca3c85b2b24a59b6c3b316e2535f2a4
}
}
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
index d958715094c8581c5b008568f8384169c507290b..5c07da62c82bc70138f6cb5007629d6974be69ac 100644
index 8b0efc4d78a04effddae0799b7ee5759ed5c720f..c041c0b81be41cfd128c2f5ba56a5329d50b2efc 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
@@ -746,8 +746,8 @@ public class Boat extends Entity implements VariantHolder<Boat.Type> {
@@ -689,8 +689,8 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
this.invFriction = 0.05F;
if (this.oldStatus == Boat.Status.IN_AIR && this.status != Boat.Status.IN_AIR && this.status != Boat.Status.ON_LAND) {
this.waterLevel = this.getY(1.0D);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent AFK kick while watching end credits.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c885f3dea2ef128758da59acba42765887ae41ee..f9c9c3b2f9c6796e4799a829dffc86b90b62559f 100644
index 051ec7b3a36e0189dc36e2b430703a425f4c7dc4..711842dda404b5e0ecbb753ce08dfdf70b556c20 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -388,7 +388,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -391,7 +391,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
--this.dropSpamTickCount;
}

View File

@ -49,10 +49,10 @@ index a2d0699e8427b2262a2396495111125eccafbb66..d797637f61bdf8a424f56fbb48e28b7c
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 00adb106eea35b745e98e28e6b9e0affe2d00651..c358a078bdbb672b41f606cf83353fc35bcb4b15 100644
index d08111e8107ddffdeff3fc044fc18b915d24433c..b1be9c5d7346841ea4c0f9b8aec5e7c4d9367dc8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1351,7 +1351,7 @@ public class ServerPlayer extends Player {
@@ -1355,7 +1355,7 @@ public class ServerPlayer extends Player {
} else if (this.bedBlocked(blockposition, enumdirection)) {
return Either.left(Player.BedSleepingProblem.OBSTRUCTED);
} else {
@ -61,7 +61,7 @@ index 00adb106eea35b745e98e28e6b9e0affe2d00651..c358a078bdbb672b41f606cf83353fc3
if (this.level().isDay()) {
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
@@ -2209,44 +2209,50 @@ public class ServerPlayer extends Player {
@@ -2310,44 +2310,50 @@ public class ServerPlayer extends Player {
return this.respawnForced;
}
@ -145,7 +145,7 @@ index 00adb106eea35b745e98e28e6b9e0affe2d00651..c358a078bdbb672b41f606cf83353fc3
} else {
this.respawnPosition = null;
this.respawnDimension = Level.OVERWORLD;
@@ -2254,6 +2260,7 @@ public class ServerPlayer extends Player {
@@ -2355,6 +2361,7 @@ public class ServerPlayer extends Player {
this.respawnForced = false;
}
@ -154,10 +154,10 @@ index 00adb106eea35b745e98e28e6b9e0affe2d00651..c358a078bdbb672b41f606cf83353fc3
public SectionPos getLastSectionPos() {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 3170c0f512ff315d40ad1d4e24794e51c1429a36..b06f36138bfda3f9802ee15e57e1895d8fe16c54 100644
index 60a8ec8937ce8b384ca8272aae865577395afc47..3b5a498a602b2cafb58a0130227eb6d4e8f3802d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -876,7 +876,7 @@ public abstract class PlayerList {
@@ -874,7 +874,7 @@ public abstract class PlayerList {
location = CraftLocation.toBukkit(vec3d, worldserver1.getWorld(), f1, 0.0F);
} else if (blockposition != null) {
entityplayer1.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.NO_RESPAWN_BLOCK_AVAILABLE, 0.0F));
@ -167,10 +167,10 @@ index 3170c0f512ff315d40ad1d4e24794e51c1429a36..b06f36138bfda3f9802ee15e57e1895d
}
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
index 1a27b7faa22e6b3dc5fce329ed06425de56c4315..b9903c29bdea8d1e3b6fce0e97be6bd9493cfdf4 100644
index ecaa7f0b2bf795f16187f11fa27f6d5d435ccbfe..c83ffba568f33323b0f8b9a03fa0b7bbbfed4355 100644
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
@@ -80,9 +80,14 @@ public class RespawnAnchorBlock extends Block {
@@ -87,9 +87,14 @@ public class RespawnAnchorBlock extends Block {
ServerPlayer entityplayer = (ServerPlayer) player;
if (entityplayer.getRespawnDimension() != world.dimension() || !pos.equals(entityplayer.getRespawnPosition())) {
@ -187,10 +187,10 @@ index 1a27b7faa22e6b3dc5fce329ed06425de56c4315..b9903c29bdea8d1e3b6fce0e97be6bd9
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 31e2c25adba68ba0527f7ad0104318d454826ada..1b677c30a0d4fb03676698b6ea2c775b8474835d 100644
index b15ee4c8ac9e306742b0b394f0721e026f7f6f3a..feb92e1e0a5688fdf2adcfebd6a80b5f772aff7d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1313,9 +1313,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1320,9 +1320,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setBedSpawnLocation(Location location, boolean override) {
if (location == null) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Added EntityDamageItemEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index a9707ecebb175663acb0f7285c759d938c5dae8b..9eb6ad597a0e2605eae367038d7541fe538f9a86 100644
index 385b7e907c535a153d86fbec11eb3070edf66dd4..87b65caa8abf15317ad158e96548553a3c062e07 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -601,7 +601,7 @@ public final class ItemStack {
@@ -622,7 +622,7 @@ public final class ItemStack {
return this.getItem().getMaxDamage();
}
@ -17,7 +17,7 @@ index a9707ecebb175663acb0f7285c759d938c5dae8b..9eb6ad597a0e2605eae367038d7541fe
if (!this.isDamageableItem()) {
return false;
} else {
@@ -619,8 +619,8 @@ public final class ItemStack {
@@ -640,8 +640,8 @@ public final class ItemStack {
amount -= k;
// CraftBukkit start
@ -28,7 +28,7 @@ index a9707ecebb175663acb0f7285c759d938c5dae8b..9eb6ad597a0e2605eae367038d7541fe
event.getPlayer().getServer().getPluginManager().callEvent(event);
if (amount != event.getDamage() || event.isCancelled()) {
@@ -631,6 +631,14 @@ public final class ItemStack {
@@ -652,6 +652,14 @@ public final class ItemStack {
}
amount = event.getDamage();
@ -43,7 +43,7 @@ index a9707ecebb175663acb0f7285c759d938c5dae8b..9eb6ad597a0e2605eae367038d7541fe
}
// CraftBukkit end
if (amount <= 0) {
@@ -638,8 +646,8 @@ public final class ItemStack {
@@ -659,8 +667,8 @@ public final class ItemStack {
}
}
@ -54,7 +54,7 @@ index a9707ecebb175663acb0f7285c759d938c5dae8b..9eb6ad597a0e2605eae367038d7541fe
}
j = this.getDamageValue() + amount;
@@ -651,7 +659,7 @@ public final class ItemStack {
@@ -672,7 +680,7 @@ public final class ItemStack {
public <T extends LivingEntity> void hurtAndBreak(int amount, T entity, Consumer<T> breakCallback) {
if (!entity.level().isClientSide && (!(entity instanceof net.minecraft.world.entity.player.Player) || !((net.minecraft.world.entity.player.Player) entity).getAbilities().instabuild)) {
if (this.isDamageableItem()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 21b2d4cbf399b90156200899ba0952de9a5ee7ee..c65986830ce27a2fac7b3154df8db47a021a064e 100644
index 407b713be2d2426f49e5978770e40cdf03c5ce1a..2731b44b3cd5de300ffcf93c690a617091b199ef 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3888,20 +3888,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3926,20 +3926,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
private Stream<Entity> getIndirectPassengersStream() {
@ -43,11 +43,11 @@ index 21b2d4cbf399b90156200899ba0952de9a5ee7ee..c65986830ce27a2fac7b3154df8db47a
return () -> {
return this.getIndirectPassengersStream().iterator();
};
@@ -3918,6 +3932,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3962,6 +3976,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper end - rewrite chunk system
public boolean hasExactlyOnePlayerPassenger() {
+ if (this.passengers.isEmpty()) { return false; } // Paper
return this.getIndirectPassengersStream().filter((entity) -> {
return entity instanceof Player;
}).count() == 1L;
return this.countPlayerPassengers() == 1;
}