More more more patches

This commit is contained in:
Nassim Jahnke 2023-03-14 19:59:51 +01:00
parent 562e74263b
commit bdeb519d1b
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B
98 changed files with 321 additions and 341 deletions

View file

@ -9,4 +9,3 @@
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
minecraft net.minecraft.WorldVersion

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash
diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
index 49cd7fea60d3d962e88a1380608e1b7174d44c28..5ad029e3c1eaeae33784b55d04181cdd119ef8c0 100644
index 290a20bf54b3651c1c7cced04041a1aa1224bd01..f889e86bd6355ed72b85bf322d09ac2be4fb4954 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java
@@ -133,7 +133,7 @@ public class Ocelot extends Animal {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Reset spawner timer when spawner event is cancelled
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 7e436a2cbf1920c985cb9febf1839adc589c2619..b3df6184b1b7f7e3b5cf87c76acb7f103e0dc1db 100644
index faa4b1bfe8dcd2dcf897470964e7d0619bfcffaf..bd85887e4497be2f8aeccc6c0260a96a3b9c615f 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -164,6 +164,7 @@ public abstract class BaseSpawner {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 897b72d230976594c33cdb80706e9ce594d0b0f5..3813f62907e6582b5fa310d3df750f4a460188d4 100644
index bab2b06992800885dca42868186163a712ef9d73..06f3e1f42da85a54187f3decc35c338a3eeb8de4 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -294,7 +294,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View file

@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts
index 26987f66704ae01dc25edc52734c95b9b73f4b57..c909ad3e263cdce6766dcc2ac64412effaa9a784 100644
index 3e8f983cd7c69e9a95bcd863349adaf22be85128..2134a7d28cdf1a1b6ef50d4978e80e4411cf3c5a 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,7 +17,7 @@ dependencies {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3757be5d859ca388569b391df0b9bddd87181265..95da0857b94d48830d4528b72370a18c244cae04 100644
index 38a45efcd2ff3cba9d2e15d7b6939c5ec873a1c5..5c60baafd997aed3168d60284dcbb2a3e002029c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1285,7 +1285,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1287,7 +1287,34 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag = d8 > 0.0D;
if (this.player.isOnGround() && !packet.isOnGround() && flag) {

View file

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 95da0857b94d48830d4528b72370a18c244cae04..9d764b32b669c8970ac472faa3000f7a95d20342 100644
index 5c60baafd997aed3168d60284dcbb2a3e002029c..f52ed21255e2ae5efed2a095a220d132b3ef91f6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3128,14 +3128,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3137,14 +3137,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

View file

@ -60,10 +60,10 @@ index 0000000000000000000000000000000000000000..a5a7624f1f372a26b982836cd31cff15
+
+}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 463d54c6c808808d3d7fe6d5303be48844bb4444..8774d3f1a1b0019751e515ad94c85ba2f11e80c7 100644
index da13fd2cde9b54ab5bf87fbb4e90b5da47b6b8f2..07b2d28c5cba543b104ade6a180b0940a794e08c 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -112,6 +112,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -114,6 +114,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
}
// Paper end - add pending task queue
@ -75,10 +75,10 @@ index 463d54c6c808808d3d7fe6d5303be48844bb4444..8774d3f1a1b0019751e515ad94c85ba2
public Connection(PacketFlow side) {
this.receiving = side;
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 8284d49c8e30645d00be952c847bab7ce5753d78..a738b79e775a0a4abed1a05e12495d85f3de14bb 100644
index 2be1bd39ee1341128f02e38afe5698b837735827..cca08b8c6e1e15f13326a2a7e33e7f3225ad894b 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -154,6 +154,10 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
@@ -157,6 +157,10 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
throw new UnsupportedOperationException("Invalid intention " + packet.getIntention());
}
@ -90,10 +90,10 @@ index 8284d49c8e30645d00be952c847bab7ce5753d78..a738b79e775a0a4abed1a05e12495d85
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index aa81018c455629659df34802002105966bd89de3..dfc5a445744520388bd09cf4a68a232885c6e2c9 100644
index 981ac7ad6efb4024216a0967fd4c2f01245a8816..75017f7464247a4766859250453954c4b775d36f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -301,6 +301,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -302,6 +302,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
}

View file

@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients,
at the cost of dead connections being kept open for longer.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9d764b32b669c8970ac472faa3000f7a95d20342..4c978604cdbc1f6a1590dc13951a0f0963901fae 100644
index f52ed21255e2ae5efed2a095a220d132b3ef91f6..e2e640149913db7951d5c90c084bdb24f9257e8b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -255,7 +255,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -257,7 +257,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public ServerPlayer player;
private int tickCount;
private int ackBlockChangesUpTo = -1;
@ -29,7 +29,7 @@ index 9d764b32b669c8970ac472faa3000f7a95d20342..4c978604cdbc1f6a1590dc13951a0f09
private boolean keepAlivePending;
private long keepAliveChallenge;
// CraftBukkit start - multithreaded fields
@@ -293,6 +293,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -295,6 +295,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private final LastSeenMessagesValidator lastSeenMessages;
private final MessageSignatureCache messageSignatureCache;
private final FutureChain chatMessageChain;
@ -37,7 +37,7 @@ index 9d764b32b669c8970ac472faa3000f7a95d20342..4c978604cdbc1f6a1590dc13951a0f09
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
@@ -384,18 +385,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -386,18 +387,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
this.server.getProfiler().push("keepAlive");

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
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 095d459962841f7247a9365aff3bdf83bc0b3589..4066cde038732fadad753b0b5a1ca14d95aee0b0 100644
index f98e25965c9d8fe348a209ef8d2a2109cd2294f2..32ee62d4d8d0cdd4719959fc55a40d2673a9a744 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1228,7 +1228,7 @@ public abstract class Player extends LivingEntity {
@@ -1227,7 +1227,7 @@ public abstract class Player extends LivingEntity {
int i = b0 + EnchantmentHelper.getKnockbackBonus(this);
if (this.isSprinting() && flag) {
@ -18,7 +18,7 @@ index 095d459962841f7247a9365aff3bdf83bc0b3589..4066cde038732fadad753b0b5a1ca14d
++i;
flag1 = true;
}
@@ -1303,7 +1303,7 @@ public abstract class Player extends LivingEntity {
@@ -1302,7 +1302,7 @@ public abstract class Player extends LivingEntity {
}
}
@ -27,7 +27,7 @@ index 095d459962841f7247a9365aff3bdf83bc0b3589..4066cde038732fadad753b0b5a1ca14d
this.sweepAttack();
}
@@ -1331,15 +1331,15 @@ public abstract class Player extends LivingEntity {
@@ -1330,15 +1330,15 @@ public abstract class Player extends LivingEntity {
}
if (flag2) {
@ -46,7 +46,7 @@ index 095d459962841f7247a9365aff3bdf83bc0b3589..4066cde038732fadad753b0b5a1ca14d
}
}
@@ -1391,7 +1391,7 @@ public abstract class Player extends LivingEntity {
@@ -1390,7 +1390,7 @@ public abstract class Player extends LivingEntity {
this.causeFoodExhaustion(level.spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value
} else {
@ -55,7 +55,7 @@ index 095d459962841f7247a9365aff3bdf83bc0b3589..4066cde038732fadad753b0b5a1ca14d
if (flag4) {
target.clearFire();
}
@@ -1843,6 +1843,14 @@ public abstract class Player extends LivingEntity {
@@ -1838,6 +1838,14 @@ public abstract class Player extends LivingEntity {
public int getXpNeededForNextLevel() {
return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2);
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b6aaebb5359c8162359b377b3485c3fcf91587e1..6d599fb38607cf841eef6d48bcaad81b378f667e 100644
index 2cd9c02fd664e263d9dae030d2c438a082c9e1b4..5ae5f58a6b521318703cf8ba044044992f0ef3f9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1,5 +1,6 @@
@ -15,7 +15,7 @@ index b6aaebb5359c8162359b377b3485c3fcf91587e1..6d599fb38607cf841eef6d48bcaad81b
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -3019,6 +3020,13 @@ public abstract class LivingEntity extends Entity {
@@ -2987,6 +2988,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
ItemStack itemstack1 = this.getItemBySlot(enumitemslot);
if (this.equipmentHasChanged(itemstack, itemstack1)) {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3813f62907e6582b5fa310d3df750f4a460188d4..82b1bdc0e4bce2762fa226fb54d9945dc1e5c736 100644
index 06f3e1f42da85a54187f3decc35c338a3eeb8de4..9607c3297c1a977cb33fb730eacb35ce9604b74c 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -78,7 +78,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 94e527fa7db9822a15711c80107a2d99eacbaac5..edb12eb2a567febe01dd3160b193b0d8a7d17270 100644
index 35eecb719a813fda6113da24a858188aef31466b..bc0b693b260368e1876bf3cc18a919acfaaf324d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -722,6 +722,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -728,6 +728,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Spigot start
// Iterator iterator = this.blockEntityTickers.iterator();
int tilesThisCycle = 0;
@ -17,7 +17,7 @@ index 94e527fa7db9822a15711c80107a2d99eacbaac5..edb12eb2a567febe01dd3160b193b0d8
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(tileTickPosition);
@@ -729,7 +731,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -735,7 +737,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity == null) {
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
tilesThisCycle--;
@ -25,7 +25,7 @@ index 94e527fa7db9822a15711c80107a2d99eacbaac5..edb12eb2a567febe01dd3160b193b0d8
continue;
}
// Spigot end
@@ -737,12 +738,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -743,12 +744,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
if (tickingblockentity.isRemoved()) {
// Spigot start
tilesThisCycle--;

View file

@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
information on restoration when the event is cancelled.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index edb12eb2a567febe01dd3160b193b0d8a7d17270..7b4fe58cb6b9e0b4b9a09c79a5385c785983c955 100644
index bc0b693b260368e1876bf3cc18a919acfaaf324d..7c8069e237a41bf5d9fc09199ff1ac247e245d9d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -151,7 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -155,7 +155,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710
public boolean captureBlockStates = false;
public boolean captureTreeGeneration = false;
@ -30,7 +30,7 @@ index edb12eb2a567febe01dd3160b193b0d8a7d17270..7b4fe58cb6b9e0b4b9a09c79a5385c78
public Map<BlockPos, BlockEntity> capturedTileEntities = new HashMap<>();
public List<ItemEntity> captureDrops;
public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<SpawnCategory> ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>();
@@ -380,7 +380,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -386,7 +386,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {
@ -39,7 +39,7 @@ index edb12eb2a567febe01dd3160b193b0d8a7d17270..7b4fe58cb6b9e0b4b9a09c79a5385c78
if (blockstate == null) {
blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags);
this.capturedBlockStates.put(pos.immutable(), blockstate);
@@ -400,7 +400,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -406,7 +406,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// CraftBukkit start - capture blockstates
boolean captured = false;
if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) {
@ -49,7 +49,7 @@ index edb12eb2a567febe01dd3160b193b0d8a7d17270..7b4fe58cb6b9e0b4b9a09c79a5385c78
this.capturedBlockStates.put(pos.immutable(), blockstate);
captured = true;
}
@@ -612,7 +613,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -618,7 +619,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public BlockState getBlockState(BlockPos pos) {
// CraftBukkit start - tree generation
if (this.captureTreeGeneration) {

View file

@ -114,10 +114,10 @@ index 7629a51ec284cab0db7e9238027d6acfa4f3083c..a76cce199acdcecfdd8b998ec08974c2
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
index 55cf35ec1bd867ae8106d00c101fd4797b6e9919..812eb8c75bf5308a3a0771a1faabdb22a3d80c28 100644
index 7de568a342244cadbc8d4bb6e923a5daa35540aa..cf76ca2ebead64d194ce03ee024085d32d02077a 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java
@@ -368,15 +368,30 @@ public final class CraftBlockStates {
@@ -376,15 +376,30 @@ public final class CraftBlockStates {
}
public static BlockState getBlockState(Block block) {

View file

@ -16,10 +16,10 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent
Co-authored-by: Aikar <aikar@aikar.co>
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4c978604cdbc1f6a1590dc13951a0f0963901fae..e6c44e29e6b5bbb49c486685077cb5b1bff24f84 100644
index e2e640149913db7951d5c90c084bdb24f9257e8b..2985032eb3e97653f96fdbc7a4e986b0f9f15983 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -776,12 +776,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -778,12 +778,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
@ -38,7 +38,7 @@ index 4c978604cdbc1f6a1590dc13951a0f0963901fae..e6c44e29e6b5bbb49c486685077cb5b1
return;
}
// Paper start
@@ -792,18 +796,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -794,18 +798,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Paper end
// CraftBukkit end
@ -91,10 +91,10 @@ index 4c978604cdbc1f6a1590dc13951a0f0963901fae..e6c44e29e6b5bbb49c486685077cb5b1
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 527e22973cb0f7fca9d19a41abf943e48980db19..23b0a829ab5d7a9b45d72c786c218548962dff11 100644
index 3b110b947b13f1d3bec1e48e1abf530c425bb043..60eded2e31c5f353980e574e863e3ad0397c57b1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2096,7 +2096,7 @@ public final class CraftServer implements Server {
@@ -2095,7 +2095,7 @@ public final class CraftServer implements Server {
offers = this.tabCompleteChat(player, message);
}

View file

@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent
Allows plugins to cancel a player picking up an experience orb
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index 2ba92563f95e2899db29bf9b017e1b385a5bda3c..cc3c1d6b76f66cd0f511c5fd57ffa606eba0d387 100644
index f9488311524bb8ff8a5686763973c9ae0053668d..28949deb54e89742541c1a14e8b69bb5b13848a9 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -304,7 +304,7 @@ public class ExperienceOrb extends Entity {

View file

@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I
public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index dfc5a445744520388bd09cf4a68a232885c6e2c9..43fed86150b15294ed4aeb1a6139891456754c97 100644
index 75017f7464247a4766859250453954c4b775d36f..a1ab7a666e429f0ac9afc1bd8a65866364655b70 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1470,7 +1470,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1493,7 +1493,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override

View file

@ -9,10 +9,10 @@ from triggering monster spawns on a server.
Also a highly more effecient way to blanket block spawns in a world
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3c5b6231dc6f3dcc275e032d03989ed638fb03a9..61039a4b61317e293ea054a6a2c0e849e5a302f0 100644
index 9246ce9f654ad4db6155b026778a83d4ee79624d..526ffddc27d85237dd2f8a1028945fa58ffaefb2 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -692,7 +692,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -695,7 +695,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
chunkRange = (chunkRange > level.spigotConfig.viewDistance) ? (byte) level.spigotConfig.viewDistance : chunkRange;
chunkRange = (chunkRange > 8) ? 8 : chunkRange;
@ -23,7 +23,7 @@ index 3c5b6231dc6f3dcc275e032d03989ed638fb03a9..61039a4b61317e293ea054a6a2c0e849
// Spigot end
long i = chunkcoordintpair.toLong();
@@ -709,6 +711,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -712,6 +714,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
entityplayer = (ServerPlayer) iterator.next();
@ -60,7 +60,7 @@ index 80d108ae7faf3fdcb024931e93032215935fe70b..c021733342c09adb04ce3f675209543f
while (iterator1.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 04912bd14a2b03ca123561a3e21a812b8f806366..ac6acdd08e808dfadf2de1075fea0d0ee51dad3b 100644
index 66705a8fb0ba4ca27136ee75420a08bc99ebd965..0e44abb38eb90d1943137e8e0f297f5529d3f25b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1,5 +1,6 @@
@ -68,9 +68,9 @@ index 04912bd14a2b03ca123561a3e21a812b8f806366..ac6acdd08e808dfadf2de1075fea0d0e
+import com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent;
import com.google.common.collect.Lists;
import com.google.common.net.InetAddresses;
import com.mojang.authlib.GameProfile;
import com.mojang.datafixers.util.Either;
@@ -252,6 +253,7 @@ public class ServerPlayer extends Player {
@@ -257,6 +258,7 @@ public class ServerPlayer extends Player {
// CraftBukkit end
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper

View file

@ -59,10 +59,10 @@ index 1b3c7b3fb869215badacdb604199d5b96f74e384..83ef8cb27db685cceb5c2b7c9674e17b
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index a2c4267f0001b276d848377e4dbcc407ee8d1ff9..c33550137ea83f23885341545c4a7f4985e07cfc 100644
index bb0f57be7ecb6a36f447294cc04edc74708427af..fa54a27d224113d5565b300693bd58b460bf086d 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -405,6 +405,20 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@@ -413,6 +413,20 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@Nullable
public T spawn(ServerLevel worldserver, @Nullable CompoundTag nbttagcompound, @Nullable Consumer<T> consumer, BlockPos blockposition, MobSpawnType enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
// CraftBukkit end
@ -84,10 +84,10 @@ index a2c4267f0001b276d848377e4dbcc407ee8d1ff9..c33550137ea83f23885341545c4a7f49
if (t0 != null) {
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index bbbb26550b0c5b36d9c7204f075aa90b79b85ff0..bc778aadb2604756b783d4d024e3154576ab3236 100644
index 806c49c127578a8f0a0bde11a4ad213e18d629af..caab72b733eabfe6a78c2a75e252817def49cbd0 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -951,7 +951,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -963,7 +963,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}).limit(5L).collect(Collectors.toList());
if (list1.size() >= requiredCount) {
@ -97,7 +97,7 @@ index bbbb26550b0c5b36d9c7204f075aa90b79b85ff0..bc778aadb2604756b783d4d024e31545
}
}
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index b3df6184b1b7f7e3b5cf87c76acb7f103e0dc1db..64d1f0ed579ef6f6f2e24e795d8dd0e1bdb5f39d 100644
index bd85887e4497be2f8aeccc6c0260a96a3b9c615f..4e1d28fbe67bc7a3d0741acd490be8db787480ae 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -128,6 +128,27 @@ public abstract class BaseSpawner {
@ -129,7 +129,7 @@ index b3df6184b1b7f7e3b5cf87c76acb7f103e0dc1db..64d1f0ed579ef6f6f2e24e795d8dd0e1
Entity entity = EntityType.loadEntityRecursive(nbttagcompound, world, (entity1) -> {
entity1.moveTo(d0, d1, d2, entity1.getYRot(), entity1.getXRot());
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 5c58031279c0b74d2061c802e60b7bed50f27156..608be2b8bfff1b89855fc0bd181430d3a29a4cbb 100644
index b2bb9bbd3af414c50ec3f8e3e171a679e95ef75e..5338e0e1a67925da0c386735a545bb31096afbb1 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -213,7 +213,13 @@ public final class NaturalSpawner {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index 4a60665ec4bbda53464151c3b4a7e83d5de6aa8f..3f7f6a43ac0bf2efb0e66dc96438febbd92113e9 100644
index dd149e037e90067fb2f9b02520a2f29a12d90f13..6802e1def5e93c208d01a68f5cfc4c8809bb910f 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -275,6 +275,12 @@ public class PlayerAdvancements {
@@ -228,6 +228,12 @@ public class PlayerAdvancements {
boolean flag1 = advancementprogress.isDone();
if (advancementprogress.grantProgress(criterionName)) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.
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 4066cde038732fadad753b0b5a1ca14d95aee0b0..8fc8e7a6fff002a6022f5a4579a229238af08348 100644
index 32ee62d4d8d0cdd4719959fc55a40d2673a9a744..0665aa0242ca93c19b1488320168be82f85d6b16 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1235,6 +1235,7 @@ public abstract class Player extends LivingEntity {
@@ -1234,6 +1234,7 @@ public abstract class Player extends LivingEntity {
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity;

View file

@ -12,10 +12,10 @@ flushing on the netty event loop, so it won't do the flush on the main thread.
Renable flushing by passing -Dpaper.explicit-flush=true
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 8774d3f1a1b0019751e515ad94c85ba2f11e80c7..a31820cb543f3e72e461c91b3191b56b18fb33dd 100644
index 07b2d28c5cba543b104ade6a180b0940a794e08c..b1a9c75081f7e61212ea9395b35375e067fd7fc6 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -115,6 +115,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -117,6 +117,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
// Paper start - NetworkClient implementation
public int protocolVersion;
public java.net.InetSocketAddress virtualHost;
@ -23,7 +23,7 @@ index 8774d3f1a1b0019751e515ad94c85ba2f11e80c7..a31820cb543f3e72e461c91b3191b56b
// Paper end
public Connection(PacketFlow side) {
@@ -310,7 +311,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@@ -317,7 +318,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
if (this.channel != null) {

View file

@ -174,27 +174,12 @@ index 0000000000000000000000000000000000000000..4c2351b03b58511b80017b58ee9b20ab
+ }
+
+}
diff --git a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
index 67455a5ba75c9b816213e44d6872c5ddf8e27e98..23efad80934930beadf15e65781551d4ba7ff81b 100644
--- a/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/status/ClientboundStatusResponsePacket.java
@@ -10,7 +10,9 @@ import net.minecraft.util.GsonHelper;
import net.minecraft.util.LowerCaseEnumTypeAdapterFactory;
public class ClientboundStatusResponsePacket implements Packet<ClientStatusPacketListener> {
- private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory()).create();
+ private static final Gson GSON = (new GsonBuilder()).registerTypeAdapter(ServerStatus.Version.class, new ServerStatus.Version.Serializer()).registerTypeAdapter(ServerStatus.Players.class, new ServerStatus.Players.Serializer()).registerTypeAdapter(ServerStatus.class, new ServerStatus.Serializer()).registerTypeHierarchyAdapter(Component.class, new Component.Serializer()).registerTypeHierarchyAdapter(Style.class, new Style.Serializer()).registerTypeAdapterFactory(new LowerCaseEnumTypeAdapterFactory())
+ .registerTypeAdapter(io.papermc.paper.adventure.AdventureComponent.class, new io.papermc.paper.adventure.AdventureComponent.Serializer())
+ .create();
private final ServerStatus status;
public ClientboundStatusResponsePacket(ServerStatus metadata) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fc040a4424144ecae03a039899f53227777cce05..bb7da8b167b72f2b1fec2be8838545ae4ed71eb3 100644
index 44c9135e8d63df11009d5eea509c6c57e8d841c4..163993cd4fe52c5bd89db656d61ff795b6ddc896 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2,6 +2,9 @@ package net.minecraft.server;
@@ -3,6 +3,9 @@ package net.minecraft.server;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
+import co.aikar.timings.Timings;
@ -203,29 +188,29 @@ index fc040a4424144ecae03a039899f53227777cce05..bb7da8b167b72f2b1fec2be8838545ae
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
@@ -1310,7 +1313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.lastServerStatus = i;
this.status.setPlayers(new ServerStatus.Players(this.getMaxPlayers(), this.getPlayerCount()));
if (!this.hidesOnlinePlayers()) {
- GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), 12)];
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.getPlayerCount(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
int j = Mth.nextInt(this.random, 0, this.getPlayerCount() - agameprofile.length);
@@ -1348,7 +1351,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hidesOnlinePlayers()) {
return new ServerStatus.Players(i, list.size(), List.of());
} else {
- int j = Math.min(list.size(), 12);
+ int j = Math.min(list.size(), org.spigotmc.SpigotConfig.playerSample); // Paper
ObjectArrayList<GameProfile> objectarraylist = new ObjectArrayList(j);
int k = Mth.nextInt(this.random, 0, list.size() - j);
for (int k = 0; k < agameprofile.length; ++k) {
diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
index 3d7d1ba148dbc3591d8c76b99a2ee7d965d12eef..0725c39d9cbec3282f93975a0ae76f060f70d86d 100644
index d99b2235038eb1aba8cda474c4aa51e207149ef4..4eebe72d8ef4e71271c583545c7312212fabe8ec 100644
--- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java
@@ -46,6 +46,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
@@ -48,6 +48,8 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
this.connection.disconnect(ServerStatusPacketListenerImpl.DISCONNECT_REASON);
} else {
this.hasRequestedStatus = true;
+ // Paper start - Replace everything
+ /*
// CraftBukkit start
// this.connection.send(new PacketStatusOutServerInfo(this.server.getStatus()));
final Object[] players = this.server.getPlayerList().players.toArray();
@@ -149,6 +151,9 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
// this.connection.send(new PacketStatusOutServerInfo(this.status));
MinecraftServer server = MinecraftServer.getServer();
@@ -150,6 +152,9 @@ public class ServerStatusPacketListenerImpl implements ServerStatusPacketListene
this.connection.send(new ClientboundStatusResponsePacket(ping));
// CraftBukkit end

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 82b1bdc0e4bce2762fa226fb54d9945dc1e5c736..b1fa2b95e161996cb62f05b67d710c0f9a98b1b2 100644
index 9607c3297c1a977cb33fb730eacb35ce9604b74c..6b31b0894e52ad6fc397624e50587ec04e46c099 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -329,8 +329,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,

View file

@ -8,8 +8,21 @@ This can be useful for changing name or skins after a player has logged in.
== AT ==
public-f net.minecraft.world.entity.player.Player gameProfile
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2985032eb3e97653f96fdbc7a4e986b0f9f15983..5a8703799204c28d885edfe1f366d222270d6558 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1534,7 +1534,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet());
}
- private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) {
+ public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<RelativeMovement> set) { // Paper
// CraftBukkit start
if (Float.isNaN(f)) {
f = 0;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index b1fa2b95e161996cb62f05b67d710c0f9a98b1b2..9d3ea20adba300a38a544c3454eff2edd9b4bbb9 100644
index 6b31b0894e52ad6fc397624e50587ec04e46c099..0c7f280bae81bbb492d5780a43e5ffda0f58756a 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -330,11 +330,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@ -42,10 +55,10 @@ index e7442952ef1f03969949014492a7ddc6d0796ba5..69a1852905dd4724c30ac8ab88c14251
public Server getServer() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d1221d3b187 100644
index a1ab7a666e429f0ac9afc1bd8a65866364655b70..e3d166dd69470468e17255e994876a305f90c9ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -81,6 +81,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
@@ -82,6 +82,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.level.GameType;
import net.minecraft.world.level.block.Blocks;
@ -53,7 +66,7 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
import net.minecraft.world.level.block.entity.SignBlockEntity;
import net.minecraft.world.level.border.BorderChangeListener;
import net.minecraft.world.level.saveddata.maps.MapDecoration;
@@ -284,11 +285,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -285,11 +286,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return server.getPlayer(getUniqueId()) != null;
}
@ -65,9 +78,9 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
@Override
public InetSocketAddress getAddress() {
if (this.getHandle().connection == null) return null;
@@ -1603,8 +1599,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.hiddenEntities.put(entity.getUniqueId(), hidingPlugins);
@@ -1643,8 +1639,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private void untrackAndHideEntity(org.bukkit.entity.Entity entity) {
// Remove this entity from the hidden player's EntityTrackerEntry
- ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
+ // Paper start
@ -82,7 +95,7 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId());
if (entry != null) {
entry.removePlayer(this.getHandle());
@@ -1617,8 +1620,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1657,8 +1660,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID())));
}
}
@ -90,28 +103,12 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
- server.getPluginManager().callEvent(new PlayerHideEntityEvent(this, entity));
}
@Override
@@ -1655,8 +1656,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
this.hiddenEntities.remove(entity.getUniqueId());
- ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
+ // Paper start
Entity other = ((CraftEntity) entity).getHandle();
+ registerEntity(other);
+
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ }
+ private void registerEntity(Entity other) {
+ ChunkMap tracker = ((ServerLevel) this.getHandle().level).getChunkSource().chunkMap;
+ // Paper end
if (other instanceof ServerPlayer) {
ServerPlayer otherPlayer = (ServerPlayer) other;
@@ -1667,10 +1675,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
void resetAndHideEntity(org.bukkit.entity.Entity entity) {
@@ -1730,8 +1731,38 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
if (entry != null && !entry.seenBy.contains(this.getHandle().connection)) {
entry.updatePlayer(this.getHandle());
}
+ server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper
+ }
+ // Paper start
+ @Override
@ -130,22 +127,28 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
+ bukkitPlayer.unregisterEntity(self);
+ }
+ }
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+
+ // Set the game profile here, we should have unregistered the entity via iterating all player entities above.
+ self.gameProfile = gameProfile;
+
- server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
+ // Re-register the game profile for all players
+ for (ServerPlayer player : players) {
+ CraftPlayer bukkitPlayer = player.getBukkitEntity();
+ if (bukkitPlayer.canSee(this)) {
+ bukkitPlayer.registerEntity(self);
+ bukkitPlayer.trackAndShowEntity(self);
+ }
+ }
+ // Refresh misc player things AFTER sending game profile
+ this.refreshPlayer();
}
void resetAndShowEntity(org.bukkit.entity.Entity entity) {
@@ -1739,6 +1770,30 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.trackAndShowEntity(entity);
}
}
+ // Paper start
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone();
+ }
@ -160,7 +163,7 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
+ ServerLevel worldserver = handle.getLevel();
+ connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), net.minecraft.world.level.biome.BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), net.minecraft.network.protocol.game.ClientboundRespawnPacket.KEEP_ALL_DATA, this.getHandle().getLastDeathLocation()));
+ handle.onUpdateAbilities();
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false);
+ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet());
+ net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle);
+
+ if (this.isOp()) {
@ -169,10 +172,9 @@ index 43fed86150b15294ed4aeb1a6139891456754c97..8e36073d0519f341c3356cb460b26d12
+ }
+ }
+ // Paper end
+
public void onEntityRemove(Entity entity) {
this.hiddenEntities.remove(entity.getUUID());
}
this.invertedVisibilityEntities.remove(entity.getUUID());
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index a679133a3de51e26eb19932ece9ade292879aefd..e342ea27a8a689ea080c7881711a5dcd6322c914 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java

View file

@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 23b0a829ab5d7a9b45d72c786c218548962dff11..969dc6197ae9c65c9a76bda76e48312bbb38d2d5 100644
index 60eded2e31c5f353980e574e863e3ad0397c57b1..d770063b7e17c55b7e13e9ea44c05870cadb9fe7 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1718,6 +1718,25 @@ public final class CraftServer implements Server {
@@ -1717,6 +1717,25 @@ public final class CraftServer implements Server {
return recipients.size();
}

View file

@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs.
provide an optional flag to disable this check, at your own risk.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8e36073d0519f341c3356cb460b26d1221d3b187..1d217d3795abe2e0e0d40746a523f78c84127ea4 100644
index e3d166dd69470468e17255e994876a305f90c9ba..9d4c164e43915c10821b332c18d440637ef19a8b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -175,6 +175,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -176,6 +176,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper start
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
private String resourcePackHash;
@ -20,7 +20,7 @@ index 8e36073d0519f341c3356cb460b26d1221d3b187..1d217d3795abe2e0e0d40746a523f78c
// Paper end
public CraftPlayer(CraftServer server, ServerPlayer entity) {
@@ -1934,7 +1935,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2002,7 +2003,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Paper end
public void addChannel(String channel) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable sprint interruption on attack
If the sprint interruption is disabled players continue sprinting when they attack entities.
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 8fc8e7a6fff002a6022f5a4579a229238af08348..3bdd77d2e91be5182c32761f736e7cccccb08978 100644
index 0665aa0242ca93c19b1488320168be82f85d6b16..0d34089b28c6f89df81a93e7032a8c52a89187c5 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1284,7 +1284,11 @@ public abstract class Player extends LivingEntity {
@@ -1283,7 +1283,11 @@ public abstract class Player extends LivingEntity {
}
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e6c44e29e6b5bbb49c486685077cb5b1bff24f84..e29fffb8f91b52f0da77303c61c0e4fbef13370c 100644
index 5a8703799204c28d885edfe1f366d222270d6558..ed910ec48845cbf7fad163771b409ea7485e9bf4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3142,9 +3142,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3151,9 +3151,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
FilteredText filteredtext = (FilteredText) signText.get(i);
if (this.player.isTextFilteringEnabled()) {

View file

@ -8,7 +8,7 @@ Fires an event anytime an enderman intends to teleport away from the player
You may cancel this, enabling ranged attacks to damage the enderman for example.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 9e93f8ab0f8e9a1287fdbae24f2dc1d3364e98d9..82896e98cb4704db0480b6b3342b09a697d39770 100644
index d5f6769a50dee22349713bd313858c799a5a3960..167be7bc35f83fb3563044492195181c75b0bd1d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -118,6 +118,12 @@ public class EnderMan extends Monster implements NeutralMob {
@ -33,28 +33,21 @@ index 9e93f8ab0f8e9a1287fdbae24f2dc1d3364e98d9..82896e98cb4704db0480b6b3342b09a6
this.setTarget((LivingEntity) null);
this.teleport();
}
@@ -394,17 +400,19 @@ public class EnderMan extends Monster implements NeutralMob {
flag = false;
}
@@ -398,11 +404,13 @@ public class EnderMan extends Monster implements NeutralMob {
} else {
flag1 = flag && this.hurtWithCleanWater(source, (ThrownPotion) source.getDirectEntity(), amount);
+ if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
if (this.teleport()) {
return true;
+ if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
if (this.teleport()) {
return true;
}
}
+ } // Paper end
return flag1;
}
+ } // Paper end
return flag;
} else {
boolean flag1 = super.hurt(source, amount);
- if (!this.level.isClientSide() && !(source.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0) {
+ if (!this.level.isClientSide() && !(source.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0 && this.tryEscape(source == DamageSource.DROWN ? com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.DROWN : com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - use to be critical hits as else, but mojang removed critical hits in 1.16.2 due to MC-185684
this.teleport();
}
@@ -626,7 +634,7 @@ public class EnderMan extends Monster implements NeutralMob {
@@ -633,7 +641,7 @@ public class EnderMan extends Monster implements NeutralMob {
} else {
if (this.target != null && !this.enderman.isPassenger()) {
if (this.enderman.isLookingAtMe((Player) this.target)) {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Enderman.teleportRandomly()
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 82896e98cb4704db0480b6b3342b09a697d39770..6f75d7ddb4b28c8ab94cecdb1556a6a7e31daa2a 100644
index 167be7bc35f83fb3563044492195181c75b0bd1d..54088f183e218e10d48e07f3f66b2fdb892a1035 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -287,7 +287,7 @@ public class EnderMan extends Monster implements NeutralMob {

View file

@ -16,10 +16,10 @@ public net.minecraft.world.entity.projectile.Projectile cachedOwner
public net.minecraft.world.entity.projectile.Projectile ownerUUID
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 349a9f4596cd1411ec3a69cd7d6f5414971b74ef..45485383943f1ae0d4c5b5064cbaa8f56181dad3 100644
index 343e6da38413ab8dad876884241ad31172466659..d273673978c8270f2e0719412372039406e31f5e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2179,6 +2179,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2178,6 +2178,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
public void onTickingEnd(Entity entity) {
ServerLevel.this.entityTickList.remove(entity);
@ -33,10 +33,10 @@ index 349a9f4596cd1411ec3a69cd7d6f5414971b74ef..45485383943f1ae0d4c5b5064cbaa8f5
public void onTrackingStart(Entity entity) {
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index e19251bc9cb18ea3c37628b55ae73bb2e5ba69bd..95ee8f85dd7e6c32f751f5c754a351cc7bcd6245 100644
index f5ce2653489e544ca95cae9cfb1f209dd047824c..ad5c96e9a7577df1729533ec9a709387b7232844 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -89,6 +89,7 @@ public abstract class Projectile extends Entity {
@@ -91,6 +91,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
protected void readAdditionalSaveData(CompoundTag nbt) {
if (nbt.hasUUID("Owner")) {
this.ownerUUID = nbt.getUUID("Owner");

View file

@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle.
This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 45485383943f1ae0d4c5b5064cbaa8f56181dad3..d17808f6c565712dac31b0db7a4b6baed2dbdf21 100644
index d273673978c8270f2e0719412372039406e31f5e..65110445ff8a245742c4f7a7055f544ff6344f75 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1572,12 +1572,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1576,12 +1576,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public <T extends ParticleOptions> int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) {
@ -34,7 +34,7 @@ index 45485383943f1ae0d4c5b5064cbaa8f56181dad3..d17808f6c565712dac31b0db7a4b6bae
if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3f6e5e4d36e8170def4ce50e29cdfcc7e25f4f4d..68e3a09bf4adb4fe9fc3c32fdec85d90af4354bc 100644
index 030ad193dc657810709817c55fb3eb9a08d41459..eaf38f39e550699fe1ab74174896c8f1cd3b0af0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1824,11 +1824,17 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -8,7 +8,7 @@ Allow control over whether or not an enderman aggros a player.
This allows you to override/extend the pumpkin/stare logic.
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 6f75d7ddb4b28c8ab94cecdb1556a6a7e31daa2a..4fcd5e1e0641474beeaa834adce73ba10065e34e 100644
index 54088f183e218e10d48e07f3f66b2fdb892a1035..908ef284f17296c72009a5803dfefff13664fb1c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -230,7 +230,15 @@ public class EnderMan extends Monster implements NeutralMob {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] WitchConsumePotionEvent
Fires when a witch consumes the potion in their hand
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
index 1b9d1262f60224819dcd77acf09798bfc1895369..312726d7d9030146b0db432493b2efbd5e42847a 100644
index e8be8054c3d54defe5e42e2c8a48e2b69552cd9c..b1dc61cd1a3ec4a9e8f0a0b0117ead1f31942c11 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
@@ -123,7 +123,11 @@ public class Witch extends Raider implements RangedAttackMob {
@@ -124,7 +124,11 @@ public class Witch extends Raider implements RangedAttackMob {
this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
if (itemstack.is(Items.POTION)) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] WitchThrowPotionEvent
Fired when a witch throws a potion at a player
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
index 312726d7d9030146b0db432493b2efbd5e42847a..5a3bc20015ec188debd0703654b734baf20aa52a 100644
index b1dc61cd1a3ec4a9e8f0a0b0117ead1f31942c11..d9608df5227970e31ebc35a8293edb2de1e7ba76 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
@@ -235,9 +235,16 @@ public class Witch extends Raider implements RangedAttackMob {
@@ -236,9 +236,16 @@ public class Witch extends Raider implements RangedAttackMob {
potionregistry = Potions.WEAKNESS;
}

View file

@ -8,10 +8,10 @@ This API has more capabilities than .dropItem with the Consumer function
Item can be set inside of the Consumer pre spawn function.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 7e16cb08ca1ab2c0b6c0079ac7ffe00cfd758e18..100d59c37cf699bd33bdf0c3fc085dfe0065b93a 100644
index f8399f63d7b511dfeb7a7ee9d24f848afd16e8c1..2c0773fec42c7c6223e2c300086058939ec32a52 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -564,6 +564,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -572,6 +572,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
entity = net.minecraft.world.entity.EntityType.BOAT.create(world);
}
entity.moveTo(x, y, z, yaw, pitch);
@ -20,5 +20,5 @@ index 7e16cb08ca1ab2c0b6c0079ac7ffe00cfd758e18..100d59c37cf699bd33bdf0c3fc085dfe
+ entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Item.byBlock(net.minecraft.world.level.block.Blocks.DIRT)));
+ // Paper end
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
BlockPos pos = new BlockPos(x, y, z);
BlockPos pos = BlockPos.containing(x, y, z);
entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));

View file

@ -5,10 +5,10 @@ Subject: [PATCH] WitchReadyPotionEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
index 5a3bc20015ec188debd0703654b734baf20aa52a..1ee8fec8f9f581fa68497ebf4f90aad9d425ec71 100644
index d9608df5227970e31ebc35a8293edb2de1e7ba76..abbb077281eb8fc7961cf97ff23bb9822f2727f0 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
@@ -156,7 +156,11 @@ public class Witch extends Raider implements RangedAttackMob {
@@ -157,7 +157,11 @@ public class Witch extends Raider implements RangedAttackMob {
}
if (potionregistry != null) {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 3c3f5a4b7109ec8b47b550f9e766556f8d1546ec..8b3cc7b9ea8ef3ddd619bc4a6affb5bb38cad8c3 100644
index da5e660860a46227c59567f6458a9cf4ac4092eb..3726339bff55bafce9d985254c91241c0c20b4b7 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -173,6 +173,13 @@ public final class CraftItemStack extends ItemStack {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 9c4469d46cb7a2cc781f6498d3e4ec6a9415d12e..1c0c1be2b08fc8a28ff36896da01d668308570f4 100644
index 7d2b15edbd1a6bf663c29b7bc63c73d34fefd999..c7de74b7fcfb5f4d8adbe7e703087a03d9d9056d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -225,9 +225,20 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event
Otherwise the creeper infinite explodes
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index c418c0b2fa757f29dfa3c07977093c67416959f5..802a46ae9f18e0b58a7e0c38c18b367edd6b7a76 100644
index baa30d4bdc8c31d04c84e4992062575709c4f2a4..d34945bc60d2b1734ec65be444ae8745cba2029d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -272,6 +272,7 @@ public class Creeper extends Monster implements PowerableMob {
@@ -276,6 +276,7 @@ public class Creeper extends Monster implements PowerableMob {
this.spawnLingeringCloud();
} else {
this.swell = 0;

View file

@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle()
However, replaced it too to make it clearer of intent.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 5199609a6eec4f3785f31091f294612d4941e71c..9ba0135932571c815fec15d2caccc789d3af3464 100644
index 5a44b9a94992f3703ae1353dbaad40fe25e89a50..dc4060aee09ec9700a9379e0536fd758c3c1eb25 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -826,14 +826,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -837,14 +837,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return false;
}
final CraftEntity other = (CraftEntity) obj;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Print Error details when failing to save player data
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 6909b6be840e8d4feadcc8b0c5a44fc1b9c81a54..601f8099f74e81c17600566b3c9b7a6dd39c9bcb 100644
index 9d25ab52fac9e22d74f874491c7efbcaafa2ffc6..1b076dc77ea57cc779ce3c8742aba2b8c25ce92b 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -43,7 +43,7 @@ public class PlayerDataStorage {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6d599fb38607cf841eef6d48bcaad81b378f667e..4ebdf94833062cde6882f09f1d6878062f2c579e 100644
index 5ae5f58a6b521318703cf8ba044044992f0ef3f9..059223a014135cd6f6d8fbc4eee7888569fb46b5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3751,12 +3751,24 @@ public abstract class LivingEntity extends Entity {
@@ -3711,12 +3711,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.isUsingItem() && !this.useItem.isEmpty()) {
Item item = this.useItem.getItem();
@ -35,7 +35,7 @@ index 6d599fb38607cf841eef6d48bcaad81b378f667e..4ebdf94833062cde6882f09f1d687806
return this.isShiftKeyDown();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index cae153b184af9ef87ca2f335692b396800f00cf2..b9657abde59bdf3b2a464466f1a251a2c5f226e1 100644
index 31f31f0a3dcd5764fffb710111b47359f793b9a2..104be41126252f9cdde3b961f2593b1348a38799 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -791,5 +791,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -9,10 +9,10 @@ Adds missing call to Illagers and also adds Arrow ItemStack to skeletons
public net.minecraft.world.entity.projectile.AbstractArrow getPickupItem()Lnet.minecraft.world.item.ItemStack;
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 3799834a1531cd7575ca5d8ea9f3429175b8384d..60064770f08cbee19eeb43bf7c144b6eefbc4888 100644
index 1928354a7b9a4e3b03fc355ce7a1c60c23c504a9..362bc2d78e024df5a1cdfad9da6e768e3a778095 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -198,7 +198,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
@@ -201,7 +201,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4));
// CraftBukkit start
@ -22,7 +22,7 @@ index 3799834a1531cd7575ca5d8ea9f3429175b8384d..60064770f08cbee19eeb43bf7c144b6e
event.getProjectile().remove();
return;
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
index 7b3a931353e2ead4e5caade8fb12d70f290b67e4..86f7fdd42461db151221d2c0d5cff6953392fa80 100644
index bd65129ec4f1b7c80ef99c34a1d30780f21bb4bf..10573602c9bc73713cbd6989762d3dbb6f6fcf8c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
@@ -196,8 +196,18 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {

View file

@ -7,7 +7,7 @@ Called when a player is firing a bow and the server is choosing an arrow to use.
Plugins can skip selection of certain arrows and control which is used.
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 3bdd77d2e91be5182c32761f736e7cccccb08978..2010e93da4e56a6a22a8e6f8c42a799eeba62acc 100644
index 0d34089b28c6f89df81a93e7032a8c52a89187c5..87573a6ecbf9a74b32f9c686067a34d58fcd5fa1 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2226,18 +2226,29 @@ public abstract class Player extends LivingEntity {

View file

@ -9,10 +9,10 @@ Co-authored-by: aerulion <aerulion@gmail.com>
This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 66b727c533d3a2b7b5938ab9b9b7b4a76bb62966..378027b72852e5d465c8f621168605ee5c522770 100644
index 9d82842982a387287a9c2de36f26a1fc80dd948a..7b4ceab1d9988573f21df3fb1a85a640f060d3af 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1767,8 +1767,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1774,8 +1774,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public void push(double deltaX, double deltaY, double deltaZ) {
@ -33,19 +33,19 @@ index 66b727c533d3a2b7b5938ab9b9b7b4a76bb62966..378027b72852e5d465c8f621168605ee
protected void markHurt() {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 4ebdf94833062cde6882f09f1d6878062f2c579e..19cd680bd77196b99767b274599e9eb5ead80192 100644
index 059223a014135cd6f6d8fbc4eee7888569fb46b5..dd82cef26160a1794c47494c99c59eb329879b7b 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1457,7 +1457,7 @@ public abstract class LivingEntity extends Entity {
@@ -1445,7 +1445,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
d0 = (Math.random() - Math.random()) * 0.01D;
}
this.hurtDir = (float) (Mth.atan2(d1, d0) * 57.2957763671875D - (double) this.getYRot());
- this.knockback(0.4000000059604645D, d0, d1);
+ this.knockback(0.4000000059604645D, d0, d1, entity1); // Paper
} else {
this.hurtDir = (float) ((int) (Math.random() * 2.0D) * 180);
}
@@ -1505,7 +1505,7 @@ public abstract class LivingEntity extends Entity {
if (!flag) {
this.indicateDamage(d0, d1);
}
@@ -1494,7 +1494,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void blockedByShield(LivingEntity target) {
@ -54,7 +54,7 @@ index 4ebdf94833062cde6882f09f1d6878062f2c579e..19cd680bd77196b99767b274599e9eb5
}
private boolean checkTotemDeathProtection(DamageSource source) {
@@ -1761,6 +1761,11 @@ public abstract class LivingEntity extends Entity {
@@ -1750,6 +1750,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public void knockback(double strength, double x, double z) {
@ -66,7 +66,7 @@ index 4ebdf94833062cde6882f09f1d6878062f2c579e..19cd680bd77196b99767b274599e9eb5
strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE);
if (strength > 0.0D) {
this.hasImpulse = true;
@@ -1768,6 +1773,15 @@ public abstract class LivingEntity extends Entity {
@@ -1757,6 +1762,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z);
@ -83,10 +83,10 @@ index 4ebdf94833062cde6882f09f1d6878062f2c579e..19cd680bd77196b99767b274599e9eb5
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 458a90529959d3ceae424236461cdeb4c588eedb..6f728231a7b326e605d6ddb8e4cd6f0f0aec820b 100644
index dad26405e90c7a784266a336ff1b0aa58b961261..e818687adf432e7ff47c8442ed2ea32d41c06b64 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1605,7 +1605,7 @@ public abstract class Mob extends LivingEntity {
@@ -1631,7 +1631,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
if (flag) {
if (f1 > 0.0F && target instanceof LivingEntity) {
@ -96,24 +96,24 @@ index 458a90529959d3ceae424236461cdeb4c588eedb..6f728231a7b326e605d6ddb8e4cd6f0f
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java b/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
index 61328cde67c994c4ec0629b5869a878eda7c6cab..9b64a465be77bcc07e420c84f19fe75816e0ead1 100644
index e319a46a21a94314c5d496820b1ac4879dcf56b9..4a3bcd988cf63452c4277ad55ba604ad43c8a623 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/RamTarget.java
@@ -78,7 +78,7 @@ public class RamTarget extends Behavior<Goat> {
@@ -77,7 +77,7 @@ public class RamTarget extends Behavior<Goat> {
float f = 0.25F * (float)(i - j);
float g = Mth.clamp(entity.getSpeed() * 1.65F, 0.2F, 3.0F) + f;
float h = livingEntity.isDamageSourceBlocked(DamageSource.mobAttack(entity)) ? 0.5F : 1.0F;
float h = livingEntity.isDamageSourceBlocked(world.damageSources().mobAttack(entity)) ? 0.5F : 1.0F;
- livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z());
+ livingEntity.knockback((double)(h * g) * this.getKnockbackForce.applyAsDouble(entity), this.ramDirection.x(), this.ramDirection.z(), entity); // Paper
this.finishRam(world, entity);
world.playSound((Player)null, entity, this.getImpactSound.apply(entity), SoundSource.NEUTRAL, 1.0F, 1.0F);
} else if (this.hasRammedHornBreakingBlock(world, entity)) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java b/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
index c8c5a46f526b3f8823b3c2047463c2e67f12c92e..27aea5c5e284767a2a9b7de1b7912c3d50ff3c3c 100644
index 29cfd065f246bbd3d3c2a5bbd32c3f4813a02951..03ec02f9a2fb5abb5387cd0d83c9481d6cbb0bd2 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
@@ -69,7 +69,7 @@ public class SonicBoom extends Behavior<Warden> {
target.hurt(DamageSource.sonicBoom(entity), 10.0F);
@@ -68,7 +68,7 @@ public class SonicBoom extends Behavior<Warden> {
target.hurt(world.damageSources().sonicBoom(entity), 10.0F);
double d = 0.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
double e = 2.5D * (1.0D - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
- target.push(vec33.x() * e, vec33.y() * d, vec33.z() * e);
@ -122,23 +122,23 @@ index c8c5a46f526b3f8823b3c2047463c2e67f12c92e..27aea5c5e284767a2a9b7de1b7912c3d
}
}
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index a889be9dd2a94b531a227ff69a5e761e103067be..7bf3ad1ccef09b697655dc949abab9ab006a95a9 100644
index 18a9050158f71245d5d88f9c0833fd5d4e5fdca6..55a8ab31a26a16adbe78b3b34366dc81851c02d4 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -432,7 +432,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -434,7 +434,7 @@ public class EnderDragon extends Mob implements Enemy {
double d3 = entity.getZ() - d1;
double d4 = Math.max(d2 * d2 + d3 * d3, 0.1D);
- entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D);
+ entity.push(d2 / d4 * 4.0D, 0.20000000298023224D, d3 / d4 * 4.0D, this); // Paper
if (!this.phaseManager.getCurrentPhase().isSitting() && ((LivingEntity) entity).getLastHurtByMobTimestamp() < entity.tickCount - 2) {
entity.hurt(DamageSource.mobAttack(this), 5.0F);
entity.hurt(this.damageSources().mobAttack(this), 5.0F);
this.doEnchantDamageEffects(this, entity);
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
index 8517fd004727b083545082a5de26b11cb2a93623..01dfe3e29ea55b9e839a4db027fdd6a1dbb5ca23 100644
index f4aa2be477da34c37660f0f3d7997928d327545d..24dc43c7806e99be6dc37af48ec056a5edd19947 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
@@ -275,7 +275,7 @@ public class Ravager extends Raider {
@@ -274,7 +274,7 @@ public class Ravager extends Raider {
double d1 = entity.getZ() - this.getZ();
double d2 = Math.max(d0 * d0 + d1 * d1, 0.001D);
@ -148,10 +148,10 @@ index 8517fd004727b083545082a5de26b11cb2a93623..01dfe3e29ea55b9e839a4db027fdd6a1
@Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/HoglinBase.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/HoglinBase.java
index 127948e7c8620de1f4fabce0d654fbb502510156..191f7afcb23b5ee58df9dd6bd8c78ac993630034 100644
index f8ccf0cf421bf2d8d6d6ccf8dd9e7c27eb9024ed..de73183166962d84b3fcbb408e011bc9e8486374 100644
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/HoglinBase.java
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/HoglinBase.java
@@ -41,7 +41,7 @@ public interface HoglinBase {
@@ -40,7 +40,7 @@ public interface HoglinBase {
double j = f * (double)(attacker.level.random.nextFloat() * 0.5F + 0.2F);
Vec3 vec3 = (new Vec3(g, 0.0D, h)).normalize().scale(j).yRot(i);
double k = f * (double)attacker.level.random.nextFloat() * 0.5D;
@ -161,10 +161,10 @@ index 127948e7c8620de1f4fabce0d654fbb502510156..191f7afcb23b5ee58df9dd6bd8c78ac9
}
}
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 2010e93da4e56a6a22a8e6f8c42a799eeba62acc..67da749cef5241d6cbe02a494e43ae8fb24bb56d 100644
index 87573a6ecbf9a74b32f9c686067a34d58fcd5fa1..10fcfa561ec74a04934d2078eb19b0c1b67b1e6a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1278,9 +1278,9 @@ public abstract class Player extends LivingEntity {
@@ -1277,9 +1277,9 @@ public abstract class Player extends LivingEntity {
if (flag5) {
if (i > 0) {
if (target instanceof LivingEntity) {
@ -176,17 +176,17 @@ index 2010e93da4e56a6a22a8e6f8c42a799eeba62acc..67da749cef5241d6cbe02a494e43ae8f
}
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
@@ -1302,7 +1302,7 @@ public abstract class Player extends LivingEntity {
@@ -1301,7 +1301,7 @@ public abstract class Player extends LivingEntity {
if (entityliving != this && entityliving != target && !this.isAlliedTo((Entity) entityliving) && (!(entityliving instanceof ArmorStand) || !((ArmorStand) entityliving).isMarker()) && this.distanceToSqr((Entity) entityliving) < 9.0D) {
// CraftBukkit start - Only apply knockback if the damage hits
if (entityliving.hurt(DamageSource.playerAttack(this).sweep(), f4)) {
if (entityliving.hurt(this.damageSources().playerAttack(this).sweep(), f4)) {
- entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)));
+ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper
+ entityliving.knockback(0.4000000059604645D, (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Pa
}
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
index d4b8364fd860ee2cc632d8c752435b9b311c7ece..915c15faa510f4bdd3a96d8ba83280f08b12dec6 100644
index aabb5ad09dd7b11a7dfbaa0849726541c0401951..01ccd4f90ad8aed84a89630cf6df9f7ba9bc3fec 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -401,7 +401,7 @@ public abstract class AbstractArrow extends Projectile {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 68e3a09bf4adb4fe9fc3c32fdec85d90af4354bc..51689ecd87a4afcc24786f3feb82b4d0c23b2732 100644
index eaf38f39e550699fe1ab74174896c8f1cd3b0af0..c7cf5f1eaedbeff2bd82106a0a1a670c419b2211 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -702,6 +702,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index b9657abde59bdf3b2a464466f1a251a2c5f226e1..235e360df71b796a39d6c85530157097fd0c7b79 100644
index 104be41126252f9cdde3b961f2593b1348a38799..a9642e95cde4dc1c3cb9da50c921171c47665536 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -801,5 +801,30 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Implement World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 51689ecd87a4afcc24786f3feb82b4d0c23b2732..78ca1045257fa0771ddea44629e09cfac8f88ca3 100644
index c7cf5f1eaedbeff2bd82106a0a1a670c419b2211..0c3c47bfa9af7d0780e60598b703e0d9f906ed9f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1036,6 +1036,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -7,10 +7,10 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index d17808f6c565712dac31b0db7a4b6baed2dbdf21..8b28de5755ad4fe50903837700feed32e4530afd 100644
index 65110445ff8a245742c4f7a7055f544ff6344f75..718a403799246228e085280cb539236b01720d4b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1309,7 +1309,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1308,7 +1308,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
for (net.minecraft.world.level.block.entity.BlockEntity tileentity : chunk.getBlockEntities().values()) {
if (tileentity instanceof net.minecraft.world.Container) {
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((net.minecraft.world.Container) tileentity).getViewers())) {
@ -19,7 +19,7 @@ index d17808f6c565712dac31b0db7a4b6baed2dbdf21..8b28de5755ad4fe50903837700feed32
}
}
}
@@ -2269,7 +2269,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2268,7 +2268,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) {
@ -29,10 +29,10 @@ index d17808f6c565712dac31b0db7a4b6baed2dbdf21..8b28de5755ad4fe50903837700feed32
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index ac6acdd08e808dfadf2de1075fea0d0ee51dad3b..20c4ba5d00f5a40f5c7da282c9c069b365273041 100644
index 0e44abb38eb90d1943137e8e0f297f5529d3f25b..dad0368c8b55be018167bd8b113a80b7508647f1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -633,7 +633,7 @@ public class ServerPlayer extends Player {
@@ -638,7 +638,7 @@ public class ServerPlayer extends Player {
}
// Paper end
if (!this.level.isClientSide && !this.containerMenu.stillValid(this)) {
@ -41,7 +41,7 @@ index ac6acdd08e808dfadf2de1075fea0d0ee51dad3b..20c4ba5d00f5a40f5c7da282c9c069b3
this.containerMenu = this.inventoryMenu;
}
@@ -826,7 +826,7 @@ public class ServerPlayer extends Player {
@@ -831,7 +831,7 @@ public class ServerPlayer extends Player {
// SPIGOT-943 - only call if they have an inventory open
if (this.containerMenu != this.inventoryMenu) {
@ -50,7 +50,7 @@ index ac6acdd08e808dfadf2de1075fea0d0ee51dad3b..20c4ba5d00f5a40f5c7da282c9c069b3
}
net.kyori.adventure.text.Component deathMessage = event.deathMessage() != null ? event.deathMessage() : net.kyori.adventure.text.Component.empty(); // Paper - Adventure
@@ -1472,7 +1472,7 @@ public class ServerPlayer extends Player {
@@ -1450,7 +1450,7 @@ public class ServerPlayer extends Player {
}
// CraftBukkit end
if (this.containerMenu != this.inventoryMenu) {
@ -59,7 +59,7 @@ index ac6acdd08e808dfadf2de1075fea0d0ee51dad3b..20c4ba5d00f5a40f5c7da282c9c069b3
}
// this.nextContainerCounter(); // CraftBukkit - moved up
@@ -1500,7 +1500,13 @@ public class ServerPlayer extends Player {
@@ -1478,7 +1478,13 @@ public class ServerPlayer extends Player {
@Override
public void closeContainer() {
@ -75,10 +75,10 @@ index ac6acdd08e808dfadf2de1075fea0d0ee51dad3b..20c4ba5d00f5a40f5c7da282c9c069b3
this.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e29fffb8f91b52f0da77303c61c0e4fbef13370c..b6ce00b758ca935e991cd4063d85640bc51a356a 100644
index ed910ec48845cbf7fad163771b409ea7485e9bf4..ce1dcfa2f76245c6b243b030754c8b59cd5227e1 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -217,6 +217,7 @@ import org.bukkit.event.inventory.ClickType;
@@ -219,6 +219,7 @@ import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
@ -86,7 +86,7 @@ index e29fffb8f91b52f0da77303c61c0e4fbef13370c..b6ce00b758ca935e991cd4063d85640b
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
@@ -2663,10 +2664,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2672,10 +2673,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleContainerClose(ServerboundContainerClosePacket packet) {
@ -104,10 +104,10 @@ index e29fffb8f91b52f0da77303c61c0e4fbef13370c..b6ce00b758ca935e991cd4063d85640b
this.player.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index c8f17cb40d18bd03e6f612218747ecd62254ff32..0e68297edc603350010e6e7c5fe4638b3741d148 100644
index 2cde0807c224f008bd2e652ff8a46244ebc53059..2f18121596b957202dfd8227b995ea0615ecf773 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -516,7 +516,7 @@ public abstract class PlayerList {
@@ -523,7 +523,7 @@ public abstract class PlayerList {
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
// See SPIGOT-5799, SPIGOT-6145
if (entityplayer.containerMenu != entityplayer.inventoryMenu) {
@ -117,10 +117,10 @@ index c8f17cb40d18bd03e6f612218747ecd62254ff32..0e68297edc603350010e6e7c5fe4638b
PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : PaperAdventure.asAdventure(entityplayer.getDisplayName()))); // Paper - Adventure
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 67da749cef5241d6cbe02a494e43ae8fb24bb56d..48b18b824935ef922fe9f7e5860f923688a0ccc0 100644
index 10fcfa561ec74a04934d2078eb19b0c1b67b1e6a..ad000e1f7fb6b3d3ec423b6e3d44efdb46f69849 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -265,7 +265,7 @@ public abstract class Player extends LivingEntity {
@@ -268,7 +268,7 @@ public abstract class Player extends LivingEntity {
this.updateIsUnderwater();
super.tick();
if (!this.level.isClientSide && this.containerMenu != null && !this.containerMenu.stillValid(this)) {
@ -129,7 +129,7 @@ index 67da749cef5241d6cbe02a494e43ae8fb24bb56d..48b18b824935ef922fe9f7e5860f9236
this.containerMenu = this.inventoryMenu;
}
@@ -488,6 +488,13 @@ public abstract class Player extends LivingEntity {
@@ -491,6 +491,13 @@ public abstract class Player extends LivingEntity {
}
@ -173,10 +173,10 @@ index 787ccb37a39bb506cf9fd8d54cf772b346981f85..f5b3190ffb9e9f92977afc9e40ddfa15
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 1d217d3795abe2e0e0d40746a523f78c84127ea4..d9a5a6719be998b9e40ab76519e4f207ee5c6bf9 100644
index 9d4c164e43915c10821b332c18d440637ef19a8b..1beecfc947f52467bd10e454877bc0678fd2dc41 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1184,7 +1184,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1207,7 +1207,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Close any foreign inventory
if (this.getHandle().containerMenu != this.getHandle().inventoryMenu) {
@ -186,7 +186,7 @@ index 1d217d3795abe2e0e0d40746a523f78c84127ea4..d9a5a6719be998b9e40ab76519e4f207
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 24814f91088b835e398d4d5fa1c895a3b1cdb086..fab613b7c4ee48c3f0eac1405bca7bd53da19060 100644
index 71b43f56119977c8c28fc255933a851c1f88260f..358040413015cff19fc8b1858726e2d856ebf911 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1230,7 +1230,7 @@ public class CraftEventFactory {

View file

@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b6ce00b758ca935e991cd4063d85640bc51a356a..0e4db13373a3e2eda7557b872b7e2eb9e8f2ee4f 100644
index ce1dcfa2f76245c6b243b030754c8b59cd5227e1..e37a4e8654f20eb9600d675eec7a2fbbb338cdc2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2545,6 +2545,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2554,6 +2554,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
if (event.isCancelled()) {

View file

@ -5,13 +5,13 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
index c909ad3e263cdce6766dcc2ac64412effaa9a784..d2b45b70f4951e44b34a67e29d008748ba84a6bf 100644
index 2134a7d28cdf1a1b6ef50d4978e80e4411cf3c5a..6ca33c80c8bd4d87953103c06804fa9a0eef4f3c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -27,6 +27,7 @@ dependencies {
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
runtimeOnly("mysql:mysql-connector-java:8.0.29")
runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")

View file

@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
UUID, ticks lived, valid, dead
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 378027b72852e5d465c8f621168605ee5c522770..0ae266bea5be068ece32a5a2f9b677117680e67b 100644
index 7b4ceab1d9988573f21df3fb1a85a640f060d3af..c330d8e6894d9a4b6cabd36ccda7443bee33407e 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3003,7 +3003,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3024,7 +3024,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public String toString() {
String s = this.level == null ? "~NULL~" : this.level.toString();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] PlayerElytraBoostEvent
diff --git a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
index 854856ca742dff800ac5d7bf0af4f79cf631540b..b545e4d189fd9b5e80c80fd3adfa55532f912b8b 100644
index 7c627d27300247db9122ab2081049345ef306073..f17e9c6c91c02e0d36f58851522a5d3e5e423121 100644
--- a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
+++ b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
@@ -60,12 +60,19 @@ public class FireworkRocketItem extends Item {
@@ -61,12 +61,19 @@ public class FireworkRocketItem extends Item {
if (!world.isClientSide) {
FireworkRocketEntity fireworkRocketEntity = new FireworkRocketEntity(world, itemStack, user);
fireworkRocketEntity.spawningEntity = user.getUUID(); // Paper

View file

@ -132,10 +132,10 @@ index 72dfb7b652f515bf9df201d524a851ab56706544..b80bedb5f27b474d7f66e9e1cc38ca3b
return InteractionResultHolder.sidedSuccess(itemStack, world.isClientSide());
}
diff --git a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
index b545e4d189fd9b5e80c80fd3adfa55532f912b8b..783791cf501d6ed3975aa82b958d7437158909ba 100644
index f17e9c6c91c02e0d36f58851522a5d3e5e423121..82b0bda3e35ec2157a477e1a17b2b46baadc97d9 100644
--- a/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
+++ b/src/main/java/net/minecraft/world/item/FireworkRocketItem.java
@@ -46,8 +46,12 @@ public class FireworkRocketItem extends Item {
@@ -47,8 +47,12 @@ public class FireworkRocketItem extends Item {
Direction direction = context.getClickedFace();
FireworkRocketEntity fireworkRocketEntity = new FireworkRocketEntity(level, context.getPlayer(), vec3.x + (double)direction.getStepX() * 0.15D, vec3.y + (double)direction.getStepY() * 0.15D, vec3.z + (double)direction.getStepZ() * 0.15D, itemStack);
fireworkRocketEntity.spawningEntity = context.getPlayer() == null ? null : context.getPlayer().getUUID(); // Paper

View file

@ -21,10 +21,10 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt
They had 'callq' (invoke) instead of 'mov' (get from memory) instructions.
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index a6a6aaf226655d0e44bc229288112882a9c04e3b..9482d5ca34bbc098a5afa785054d6d60d6a2decb 100644
index 40950db0c242c65dfd4de247c86249354d12108f..e87ef99260bff134529e00b9a75381cecaec01a4 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -50,7 +50,7 @@ public class Vec3i implements Comparable<Vec3i> {
@@ -44,7 +44,7 @@ public class Vec3i implements Comparable<Vec3i> {
}
@Override
@ -33,7 +33,7 @@ index a6a6aaf226655d0e44bc229288112882a9c04e3b..9482d5ca34bbc098a5afa785054d6d60
if (this == object) {
return true;
} else if (!(object instanceof Vec3i)) {
@@ -68,7 +68,7 @@ public class Vec3i implements Comparable<Vec3i> {
@@ -62,7 +62,7 @@ public class Vec3i implements Comparable<Vec3i> {
}
@Override
@ -42,7 +42,7 @@ index a6a6aaf226655d0e44bc229288112882a9c04e3b..9482d5ca34bbc098a5afa785054d6d60
return (this.getY() + this.getZ() * 31) * 31 + this.getX();
}
@@ -81,15 +81,15 @@ public class Vec3i implements Comparable<Vec3i> {
@@ -75,15 +75,15 @@ public class Vec3i implements Comparable<Vec3i> {
}
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Option to prevent armor stands from doing entity lookups
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 4398a33df4e0f0e9d28c51af3d48e41d957d7c9e..3488c882c654a2cb7a470ed84066bcc0bbbbf9c4 100644
index 8de5a556d364f29706e3391825288c8a3a75c9c8..51acb26076d7de1f365f7aaf6a2ab274a4b87cdc 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -336,6 +336,7 @@ public class ArmorStand extends LivingEntity {
@@ -337,6 +337,7 @@ public class ArmorStand extends LivingEntity {
@Override
protected void pushEntities() {
@ -17,10 +17,10 @@ index 4398a33df4e0f0e9d28c51af3d48e41d957d7c9e..3488c882c654a2cb7a470ed84066bcc0
for (int i = 0; i < list.size(); ++i) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 7b4fe58cb6b9e0b4b9a09c79a5385c785983c955..bb5d49a1b002fbe9109b2fe6c31c9d4f7c3f9ac8 100644
index 7c8069e237a41bf5d9fc09199ff1ac247e245d9d..f07e70ab26fffaec5055a7dd2571dc4d29c66d35 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -766,6 +766,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -772,6 +772,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end
}
}

View file

@ -5,24 +5,25 @@ Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 95ee8f85dd7e6c32f751f5c754a351cc7bcd6245..ec5fc3293097b364b5f6d8acc756aa8adde15215 100644
index ad5c96e9a7577df1729533ec9a709387b7232844..621ecd0f3cac52d3e4cecd003c67401ec7f0a6f7 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -212,7 +212,14 @@ public abstract class Projectile extends Entity {
if (!entity.isSpectator() && entity.isAlive() && entity.isPickable()) {
@@ -216,6 +216,15 @@ public abstract class Projectile extends Entity implements TraceableEntity {
} else {
Entity entity1 = this.getOwner();
+ // Paper start - Cancel hit for vanished players
+ if (entity1 instanceof net.minecraft.server.level.ServerPlayer && entity instanceof net.minecraft.server.level.ServerPlayer) {
+ org.bukkit.entity.Player collided = (org.bukkit.entity.Player) entity.getBukkitEntity();
+ org.bukkit.entity.Player shooter = (org.bukkit.entity.Player) entity1.getBukkitEntity();
+ if (!shooter.canSee(collided)) return false;
+ if (!shooter.canSee(collided)) {
+ return false;
+ }
+ }
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
+ // Paper end
} else {
return false;
return entity1 == null || this.leftOwner || !entity1.isPassengerOfSameVehicle(entity);
}
}
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index a6638e626600e4304a973497a39e3fac52203b16..e68b7a1b03783e4f9de24c5ae8773fc359bd2d37 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
@ -38,10 +39,10 @@ index a6638e626600e4304a973497a39e3fac52203b16..e68b7a1b03783e4f9de24c5ae8773fc3
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), defaultReturn);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bb5d49a1b002fbe9109b2fe6c31c9d4f7c3f9ac8..df273fd4ffbaf8d25286e9ba713999ccab31af90 100644
index f07e70ab26fffaec5055a7dd2571dc4d29c66d35..754e1667aadef89bbaccebc0f437197b1331b7f8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -268,6 +268,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -274,6 +274,45 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
@ -88,7 +89,7 @@ index bb5d49a1b002fbe9109b2fe6c31c9d4f7c3f9ac8..df273fd4ffbaf8d25286e9ba713999cc
public boolean isClientSide() {
return this.isClientSide;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index fab613b7c4ee48c3f0eac1405bca7bd53da19060..67d820fb9aa00a3275cc3e23461864b496d738aa 100644
index 358040413015cff19fc8b1858726e2d856ebf911..c24e84e07f3f0d93da079ddf73e0e67b7d58fe8b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1267,6 +1267,14 @@ public class CraftEventFactory {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling armour stand ticking
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221269f2fdb 100644
index 51acb26076d7de1f365f7aaf6a2ab274a4b87cdc..e38cbdff34479673f1640c46d727f1a807a609c7 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -92,9 +92,16 @@ public class ArmorStand extends LivingEntity {
@@ -93,9 +93,16 @@ public class ArmorStand extends LivingEntity {
public Rotations leftLegPose;
public Rotations rightLegPose;
public boolean canMove = true; // Paper
@ -25,7 +25,7 @@ index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY);
this.headPose = ArmorStand.DEFAULT_HEAD_POSE;
@@ -189,6 +196,7 @@ public class ArmorStand extends LivingEntity {
@@ -190,6 +197,7 @@ public class ArmorStand extends LivingEntity {
this.onEquipItem(enumitemslot, (ItemStack) this.armorItems.set(enumitemslot.getIndex(), itemstack), itemstack, silent); // CraftBukkit
}
@ -33,7 +33,7 @@ index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221
}
@Override
@@ -239,6 +247,7 @@ public class ArmorStand extends LivingEntity {
@@ -240,6 +248,7 @@ public class ArmorStand extends LivingEntity {
}
nbt.put("Pose", this.writePose());
@ -41,7 +41,7 @@ index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221
}
@Override
@@ -270,6 +279,12 @@ public class ArmorStand extends LivingEntity {
@@ -271,6 +280,12 @@ public class ArmorStand extends LivingEntity {
this.setNoBasePlate(nbt.getBoolean("NoBasePlate"));
this.setMarker(nbt.getBoolean("Marker"));
this.noPhysics = !this.hasPhysics();
@ -54,7 +54,7 @@ index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221
CompoundTag nbttagcompound1 = nbt.getCompound("Pose");
this.readPose(nbttagcompound1);
@@ -652,7 +667,29 @@ public class ArmorStand extends LivingEntity {
@@ -669,7 +684,29 @@ public class ArmorStand extends LivingEntity {
@Override
public void tick() {
@ -84,7 +84,7 @@ index 3488c882c654a2cb7a470ed84066bcc0bbbbf9c4..f70f75867a8f03d42f240a0d007d2221
Rotations vector3f = (Rotations) this.entityData.get(ArmorStand.DATA_HEAD_POSE);
if (!this.headPose.equals(vector3f)) {
@@ -776,31 +813,37 @@ public class ArmorStand extends LivingEntity {
@@ -793,31 +830,37 @@ public class ArmorStand extends LivingEntity {
public void setHeadPose(Rotations angle) {
this.headPose = angle;
this.entityData.set(ArmorStand.DATA_HEAD_POSE, angle);

View file

@ -11,10 +11,10 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set.
Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves.
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 8b3cc7b9ea8ef3ddd619bc4a6affb5bb38cad8c3..f3fcaf02a7718e20c1779934687a718e28a1d55a 100644
index 3726339bff55bafce9d985254c91241c0c20b4b7..f072f5ee75890650957b1c2ca27adc1a84c2bfa1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -624,7 +624,7 @@ public final class CraftItemStack extends ItemStack {
@@ -631,7 +631,7 @@ public final class CraftItemStack extends ItemStack {
@Override
public boolean hasItemMeta() {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] AnvilDamageEvent
diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
index c5f1076a758b396a9d5726754cbfb470ff912f8b..eb22059fe008c3d3fc0364a7f85f91b4cca8b328 100644
index e0d7fffdda14038907792fd73251d5dc41f94b3f..0a132fbbc58f52e51f50a44e887a3f20d2e0a61c 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -89,6 +89,16 @@ public class AnvilMenu extends ItemCombinerMenu {
@@ -105,6 +105,16 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!player.getAbilities().instabuild && iblockdata.is(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
BlockState iblockdata1 = AnvilBlock.damage(iblockdata);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add TNTPrimeEvent
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index 7bf3ad1ccef09b697655dc949abab9ab006a95a9..c9051e80d329f1b10fa04d21f8891e85c44b5200 100644
index 55a8ab31a26a16adbe78b3b34366dc81851c02d4..da1e60206f300d64f68f5aedeba52a164829676e 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -532,6 +532,11 @@ public class EnderDragon extends Mob implements Enemy {
@@ -534,6 +534,11 @@ public class EnderDragon extends Mob implements Enemy {
});
craftBlock.getNMS().spawnAfterBreak((ServerLevel) level, blockposition, ItemStack.EMPTY, false);
}
@ -21,10 +21,10 @@ index 7bf3ad1ccef09b697655dc949abab9ab006a95a9..c9051e80d329f1b10fa04d21f8891e85
this.level.removeBlock(blockposition, false);
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
index e725168ebce3d1b2548a1bc5baa612a6e718e337..7e48326b6dc847a84e0aff2d393cadf9bace7979 100644
index 48b30ead02b0379190f794c4f245affb684aa5b4..33ece83c6d41c65042356c44eee2c76934c07d0b 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
@@ -290,12 +290,19 @@ public class FireBlock extends BaseFireBlock {
@@ -291,12 +291,19 @@ public class FireBlock extends BaseFireBlock {
world.setBlock(blockposition, this.getStateWithAge(world, blockposition, l), 3);
} else {

View file

@ -22,10 +22,10 @@ to take the burden of this into their own hand without having to rely on
plugins doing unsafe things.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0e4db13373a3e2eda7557b872b7e2eb9e8f2ee4f..23b56013e449ce4d6bd62096a20135adb87731eb 100644
index e37a4e8654f20eb9600d675eec7a2fbbb338cdc2..974b74757551bc9ad94c7198783473bb72520712 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -263,6 +263,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private long keepAliveChallenge;
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
@ -33,7 +33,7 @@ index 0e4db13373a3e2eda7557b872b7e2eb9e8f2ee4f..23b56013e449ce4d6bd62096a20135ad
// CraftBukkit end
private int dropSpamTickCount;
private double firstGoodX;
@@ -409,6 +410,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -411,6 +412,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.server.getProfiler().pop();
// CraftBukkit start
for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ;
@ -41,7 +41,7 @@ index 0e4db13373a3e2eda7557b872b7e2eb9e8f2ee4f..23b56013e449ce4d6bd62096a20135ad
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -785,7 +787,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -787,7 +789,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
// CraftBukkit start

View file

@ -8,7 +8,7 @@ Addresses two issues:
- Allay duplication cooldown is saved and exposed as a long, but loaded as an int
diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
index cc3c1d6b76f66cd0f511c5fd57ffa606eba0d387..cf5c7e8557b0084039a94ef881a36aa9e3f58daf 100644
index 28949deb54e89742541c1a14e8b69bb5b13848a9..2d3994de8e40eedc78c27ea842b6265b1c5ea822 100644
--- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
@@ -287,7 +287,7 @@ public class ExperienceOrb extends Entity {
@ -30,10 +30,10 @@ index cc3c1d6b76f66cd0f511c5fd57ffa606eba0d387..cf5c7e8557b0084039a94ef881a36aa9
this.loadPaperNBT(nbt); // Paper
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index fec05f88720fa09ed9361fd24f5abfa134013d6c..c0084b1f146a4697194c421519537e612ff737c0 100644
index cc8c99e8f260ffe5c2e3f81f928e15efdece6228..9b57d2b766f2de2d3fb4a3b5ef4df8d6756a1942 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -521,7 +521,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier {
@@ -516,7 +516,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier {
});
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary itemmeta handling
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 76914b08c17a62a117319d458a6693070fc46348..32ee4ed11aefd82dca2e3e78b3108f041fdc3695 100644
index c2f56f4628e42c130e4c55030432cb43aa0d8458..9938bb90bef84cf784f9a1ceb02a1a45aa8b48a1 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -641,7 +641,7 @@ public class FriendlyByteBuf extends ByteBuf {
@@ -688,7 +688,7 @@ public class FriendlyByteBuf extends ByteBuf {
if (item.canBeDepleted() || item.shouldOverrideMultiplayerNbt()) {
// Spigot start - filter
stack = stack.copy();
@ -17,7 +17,7 @@ index 76914b08c17a62a117319d458a6693070fc46348..32ee4ed11aefd82dca2e3e78b3108f04
// Spigot end
nbttagcompound = stack.getTag();
}
@@ -662,7 +662,7 @@ public class FriendlyByteBuf extends ByteBuf {
@@ -709,7 +709,7 @@ public class FriendlyByteBuf extends ByteBuf {
itemstack.setTag(this.readNbt());
// CraftBukkit start

View file

@ -8,10 +8,10 @@ Add -Ddebug.entities=true to your JVM flags to gain more information
1.17: Needs to be reworked for new entity storage system
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 61039a4b61317e293ea054a6a2c0e849e5a302f0..7b8a5efc73a7a0bfb51af7299341b0e2e988d4c1 100644
index 526ffddc27d85237dd2f8a1028945fa58ffaefb2..27b646341bdae8918649c5e9fdf05708638ad835 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -896,6 +896,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -899,6 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} else {
ChunkMap.TrackedEntity playerchunkmap_entitytracker = new ChunkMap.TrackedEntity(entity, i, j, entitytypes.trackDeltas());
@ -19,7 +19,7 @@ index 61039a4b61317e293ea054a6a2c0e849e5a302f0..7b8a5efc73a7a0bfb51af7299341b0e2
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
playerchunkmap_entitytracker.updatePlayers(this.level.players());
if (entity instanceof ServerPlayer) {
@@ -938,7 +939,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -941,7 +942,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
if (playerchunkmap_entitytracker1 != null) {
playerchunkmap_entitytracker1.broadcastRemoved();
}
@ -29,10 +29,10 @@ index 61039a4b61317e293ea054a6a2c0e849e5a302f0..7b8a5efc73a7a0bfb51af7299341b0e2
protected void tick() {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 8b28de5755ad4fe50903837700feed32e4530afd..2daa8e2e64829df838bde981a56d6e407b8ee004 100644
index 718a403799246228e085280cb539236b01720d4b..e46f18e342f2e682c4d5bbac22187a171df8eb33 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -219,6 +219,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -217,6 +217,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final LevelStorageSource.LevelStorageAccess convertable;
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
@ -42,7 +42,7 @@ index 8b28de5755ad4fe50903837700feed32e4530afd..2daa8e2e64829df838bde981a56d6e40
@Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
return this.chunkSource.getChunk(x, z, false);
@@ -1271,7 +1274,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1270,7 +1273,28 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit start
private boolean addEntity(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) {
org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot
@ -72,10 +72,10 @@ index 8b28de5755ad4fe50903837700feed32e4530afd..2daa8e2e64829df838bde981a56d6e40
return false;
} else {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 0ae266bea5be068ece32a5a2f9b677117680e67b..5116be3075c1249254524bf6a5b6bc28c61400e6 100644
index c330d8e6894d9a4b6cabd36ccda7443bee33407e..8663ea3cc8d5672b03b4b8345d7d970fcbc6a80b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -235,6 +235,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -237,6 +237,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
private CraftEntity bukkitEntity;
@ -85,10 +85,10 @@ index 0ae266bea5be068ece32a5a2f9b677117680e67b..5116be3075c1249254524bf6a5b6bc28
if (this.bukkitEntity == null) {
this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index df273fd4ffbaf8d25286e9ba713999ccab31af90..01e8a8c36645efc9b728c6c58e12f594d619f5a5 100644
index 754e1667aadef89bbaccebc0f437197b1331b7f8..e7e069ea6b5fc20225e6fabd98e0ffb6de497ce2 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -147,6 +147,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -151,6 +151,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public boolean pvpMode;
public boolean keepSpawnInMemory = true;
public org.bukkit.generator.ChunkGenerator generator;

View file

@ -9,11 +9,11 @@ thread dumps at an interval until the point of crash.
This will help diagnose what was going on in that time before the crash.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bb7da8b167b72f2b1fec2be8838545ae4ed71eb3..eef3b01d1304e06d0c9971df82af54d90676957a 100644
index 163993cd4fe52c5bd89db656d61ff795b6ddc896..8c64c3c1e33cb289ac2eb1b55e1febf6920fd4c6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1051,6 +1051,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.updateStatusIcon(this.status);
this.status = this.buildServerStatus();
// Spigot start
+ org.spigotmc.WatchdogThread.hasStarted = true; // Paper
@ -33,10 +33,10 @@ index e6826cd0a596f063e8737dcde3c8c6c5b3f71970..1a2607d1b257cea65c82c661a6b3d46c
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 969dc6197ae9c65c9a76bda76e48312bbb38d2d5..aa1408dc26193eb133dd5ab04c2252b49ddb60b3 100644
index d770063b7e17c55b7e13e9ea44c05870cadb9fe7..bd2cc69ff6c15615dfedcb3c88e6bf2d36fd9370 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -906,6 +906,7 @@ public final class CraftServer implements Server {
@@ -901,6 +901,7 @@ public final class CraftServer implements Server {
@Override
public void reload() {
@ -44,7 +44,7 @@ index 969dc6197ae9c65c9a76bda76e48312bbb38d2d5..aa1408dc26193eb133dd5ab04c2252b4
this.reloadCount++;
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
@@ -995,6 +996,7 @@ public final class CraftServer implements Server {
@@ -990,6 +991,7 @@ public final class CraftServer implements Server {
this.enablePlugins(PluginLoadOrder.STARTUP);
this.enablePlugins(PluginLoadOrder.POSTWORLD);
this.getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD));

View file

@ -23,10 +23,10 @@ Modified isEmpty to use the isEmpty() method instead of the slightly confusing s
The point of this is readability, but does have a side-benefit of a small microptimization
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0e68297edc603350010e6e7c5fe4638b3741d148..d1d5e0deb0dd8963424db6fc7a353c4ed397bb98 100644
index 2f18121596b957202dfd8227b995ea0615ecf773..ab83fc7c8903ed4a71824c5dcc85b9764c6c5690 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -632,7 +632,7 @@ public abstract class PlayerList {
@@ -639,7 +639,7 @@ public abstract class PlayerList {
} else if (!this.isWhiteListed(gameprofile, event)) { // Paper
//ichatmutablecomponent = Component.translatable("multiplayer.disconnect.not_whitelisted"); // Paper
//event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.whitelistMessage)); // Spigot // Paper - Adventure - moved to isWhitelisted

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Optimize BlockPosition helper methods
Resolves #1338
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
index a72dfbfa2aa636ac8bac07a62777126cf2696241..f35cc28b1fde73e9eae077f597c2822842a282ce 100644
index 4dffce4dc3434ef6adef7dc3cfac867ad89d9a5d..cf7b12993090e72802a966b3cb40e5d33c1bc5ed 100644
--- a/src/main/java/net/minecraft/core/BlockPos.java
+++ b/src/main/java/net/minecraft/core/BlockPos.java
@@ -134,67 +134,84 @@ public class BlockPos extends Vec3i {
@@ -125,67 +125,84 @@ public class BlockPos extends Vec3i {
@Override
public BlockPos above() {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Slime Pathfinder Events
diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java
index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb87fa8383 100644
index 02aca470c3b41114204da54e2365ee29adad7554..9196c51474741eb1015f7daac640b83e6c7b66e4 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -41,6 +41,12 @@ import net.minecraft.world.level.ServerLevelAccessor;
@ -50,7 +50,7 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
@Override
@@ -482,7 +494,15 @@ public class Slime extends Mob implements Enemy {
@@ -489,7 +501,15 @@ public class Slime extends Mob implements Enemy {
public boolean canUse() {
LivingEntity entityliving = this.slime.getTarget();
@ -67,7 +67,7 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
@Override
@@ -495,7 +515,15 @@ public class Slime extends Mob implements Enemy {
@@ -502,7 +522,15 @@ public class Slime extends Mob implements Enemy {
public boolean canContinueToUse() {
LivingEntity entityliving = this.slime.getTarget();
@ -84,9 +84,9 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
@Override
@@ -513,6 +541,13 @@ public class Slime extends Mob implements Enemy {
@@ -527,6 +555,13 @@ public class Slime extends Mob implements Enemy {
}
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.slime.getYRot(), this.slime.isDealsDamage());
}
+
+ // Paper start - clear timer and target when goal resets
@ -98,7 +98,7 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
private static class SlimeRandomDirectionGoal extends Goal {
@@ -528,7 +563,7 @@ public class Slime extends Mob implements Enemy {
@@ -542,7 +577,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@ -107,7 +107,7 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
@Override
@@ -536,6 +571,11 @@ public class Slime extends Mob implements Enemy {
@@ -550,6 +585,11 @@ public class Slime extends Mob implements Enemy {
if (--this.nextRandomizeTime <= 0) {
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
@ -118,8 +118,8 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
+ // Paper end
}
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setDirection(this.chosenDegrees, false);
@@ -553,7 +593,7 @@ public class Slime extends Mob implements Enemy {
MoveControl controllermove = this.slime.getMoveControl();
@@ -574,7 +614,7 @@ public class Slime extends Mob implements Enemy {
@Override
public boolean canUse() {
@ -128,8 +128,8 @@ index 85abd62434cbe3beb63f61262504372b971d9684..058ba40491f3e566c4c159978c677ceb
}
@Override
@@ -561,4 +601,15 @@ public class Slime extends Mob implements Enemy {
((Slime.SlimeMoveControl) this.slime.getMoveControl()).setWantedMovement(1.0D);
@@ -589,4 +629,15 @@ public class Slime extends Mob implements Enemy {
}
}
+

View file

@ -7,10 +7,10 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData
and cloning it when one is needed.
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 5bba39a066ede470cebc92724735c86ecfd4239d..c53b80cba9ea658d20e527a9bfcd6b5d7d9f51fc 100644
index 0eb877c80c6492d03681c70f7866ad705a62454e..7cc6dcb128f2792fc32bb8f50e4c94d600255207 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -728,6 +728,14 @@ public abstract class BlockBehaviour implements FeatureElement {
@@ -753,6 +753,14 @@ public abstract class BlockBehaviour implements FeatureElement {
this.spawnParticlesOnBreak = blockbase_info.spawnParticlesOnBreak;
this.conditionallyFullOpaque = this.isOpaque() & this.isTransparentOnSomeFaces(); // Paper
}
@ -26,10 +26,10 @@ index 5bba39a066ede470cebc92724735c86ecfd4239d..c53b80cba9ea658d20e527a9bfcd6b5d
// Paper start
protected boolean shapeExceedsCube = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 919a8a5ff0129a17f7f2b04aefe104d942da6e17..198a3f04ad6864460b9e7dd42444fab423a4ad8f 100644
index e5a496b72073f75af2df4cea0cf367f47ad9f9f3..ffdd7638d0b88f79ae981924d1c42d2fda2b284e 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -545,7 +545,17 @@ public class CraftBlockData implements BlockData {
@@ -550,7 +550,17 @@ public class CraftBlockData implements BlockData {
return craft;
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index c068eddb08898681735e483df5b9c36f5fef3878..0e96e9d7e4d636f4222f60cec556663f506c3906 100644
index 4ba55cba98d5525eaafeed4026352851637da9b0..a3663ea031f3a243f670bf1c98272a49daed71b0 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -171,6 +171,11 @@ public class Phantom extends FlyingMob implements Enemy {
@ -32,8 +32,8 @@ index c068eddb08898681735e483df5b9c36f5fef3878..0e96e9d7e4d636f4222f60cec556663f
}
@Override
@@ -231,6 +241,14 @@ public class Phantom extends FlyingMob implements Enemy {
return entitysize.scale(f);
@@ -236,6 +246,14 @@ public class Phantom extends FlyingMob implements Enemy {
return (double) this.getEyeHeight();
}
+ // Paper start
@ -48,7 +48,7 @@ index c068eddb08898681735e483df5b9c36f5fef3878..0e96e9d7e4d636f4222f60cec556663f
CIRCLE, SWOOP;
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index 42d88ce2e15477482a814a79aefd4abfcbcb5462..900a66fc7eb817509df904b71ccc3bd3976f3b35 100644
index 5e534aceb532a113f63bad36dc77b487962ad4b7..df7f23bb039a61ed26e117df934aad9ec5df3f58 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -3,6 +3,7 @@ package net.minecraft.world.level.levelgen;

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add More Creeper API
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
index 802a46ae9f18e0b58a7e0c38c18b367edd6b7a76..805e267090285d625dbeb75b06f8c5ad141a75a4 100644
index d34945bc60d2b1734ec65be444ae8745cba2029d..29c62525241e2e03686d1bceee740d4f54f33c54 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -132,7 +132,7 @@ public class Creeper extends Monster implements PowerableMob {
@ -17,7 +17,7 @@ index 802a46ae9f18e0b58a7e0c38c18b367edd6b7a76..805e267090285d625dbeb75b06f8c5ad
}
}
@@ -309,7 +309,18 @@ public class Creeper extends Monster implements PowerableMob {
@@ -313,7 +313,18 @@ public class Creeper extends Monster implements PowerableMob {
}
public void ignite() {