more more more more more more work

This commit is contained in:
Noah van der Aa 2023-09-22 09:24:44 +02:00
parent 2cee84193c
commit fc84aee124
No known key found for this signature in database
GPG key ID: 547D90BC6FF753CF
22 changed files with 103 additions and 100 deletions

View file

@ -14,11 +14,11 @@ contention situations.
And this is extremely a low contention situation. And this is extremely a low contention situation.
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbdeaa4faf52 100644 index 1219200cd915d6239a32a2bd09d325cd8fa9b346..dfae0918079425df92d958b04275be8ae60d4b60 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -32,14 +32,14 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -32,14 +32,14 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
private final T @org.jetbrains.annotations.Nullable [] presetValues; // Paper - Anti-Xray - Add preset values public final IdMap<T> registry;
private volatile PalettedContainer.Data<T> data; private volatile PalettedContainer.Data<T> data;
private final PalettedContainer.Strategy strategy; private final PalettedContainer.Strategy strategy;
- private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); - private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer");
@ -34,17 +34,17 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde
+ // this.threadingDetector.checkAndUnlock(); // Paper - disable this + // this.threadingDetector.checkAndUnlock(); // Paper - disable this
} }
// Paper start - Anti-Xray - Add preset values public static <T> Codec<PalettedContainer<T>> codecRW(IdMap<T> idList, Codec<T> entryCodec, PalettedContainer.Strategy paletteProvider, T defaultValue) {
@@ -129,7 +129,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -91,7 +91,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
} }
@Override @Override
- public int onResize(int newBits, T object) { - public int onResize(int newBits, T object) {
+ public synchronized int onResize(int newBits, T object) { // Paper - synchronize + public synchronized int onResize(int newBits, T object) { // Paper - synchronize
PalettedContainer.Data<T> data = this.data; PalettedContainer.Data<T> data = this.data;
PalettedContainer.Data<T> data2 = this.createOrReuseData(data, newBits);
// Paper start - Anti-Xray - Add preset values data2.copyFrom(data.palette, data.storage);
@@ -176,7 +176,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -116,7 +116,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
return this.getAndSet(this.strategy.getIndex(x, y, z), value); return this.getAndSet(this.strategy.getIndex(x, y, z), value);
} }
@ -53,7 +53,7 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde
int i = this.data.palette.idFor(value); int i = this.data.palette.idFor(value);
int j = this.data.storage.getAndSet(index, i); int j = this.data.storage.getAndSet(index, i);
return this.data.palette.valueFor(j); return this.data.palette.valueFor(j);
@@ -193,7 +193,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -133,7 +133,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
} }
@ -62,7 +62,7 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde
int i = this.data.palette.idFor(value); int i = this.data.palette.idFor(value);
this.data.storage.set(index, i); this.data.storage.set(index, i);
} }
@@ -218,7 +218,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -158,7 +158,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
}); });
} }
@ -71,16 +71,16 @@ index 5f832a684067f4770ade1f24a29047f0f1fe0860..de91ed0d5f7f472cb2f24a8f6e4ebbde
this.acquire(); this.acquire();
try { try {
@@ -238,7 +238,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -174,7 +174,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
}
@Override @Override
@Deprecated @io.papermc.paper.annotation.DoNotUse public void write(FriendlyByteBuf buf) { this.write(buf, null, 0); } - public void write(FriendlyByteBuf buf) {
@Override + public synchronized void write(FriendlyByteBuf buf) { // Paper - synchronize
- public void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int chunkSectionIndex) {
+ public synchronized void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo<T> chunkPacketInfo, int chunkSectionIndex) { // Paper - synchronize
this.acquire(); this.acquire();
try { try {
@@ -298,7 +298,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer @@ -229,7 +229,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
} }
@Override @Override

View file

@ -52,14 +52,14 @@ index cc3f1532a2108ea915d0e8c840e87bc56ab60a65..ffc5b68c4246a7111845230a75552bb1
} }
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
index 32903759e94e43328de38a985cc121252c81f481..570c0646e245a1527b3a569f2c8a6fae5b18b373 100644 index 4b685e185ebac8553f1f81d1a5a04be8166a6ca4..dbd1e440ced5d23f2f813b12808f9400a49c3f8f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java --- a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java +++ b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
@@ -100,6 +100,7 @@ public class SpikeFeature extends Feature<SpikeConfiguration> { @@ -101,6 +101,7 @@ public class SpikeFeature extends Feature<SpikeConfiguration> {
endCrystal.setBeamTarget(config.getCrystalBeamTarget()); endCrystal.setBeamTarget(config.getCrystalBeamTarget());
endCrystal.setInvulnerable(config.isCrystalInvulnerable()); endCrystal.setInvulnerable(config.isCrystalInvulnerable());
endCrystal.moveTo((double)spike.getCenterX() + 0.5D, (double)(spike.getHeight() + 1), (double)spike.getCenterZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F); endCrystal.moveTo((double)spike.getCenterX() + 0.5D, (double)(spike.getHeight() + 1), (double)spike.getCenterZ() + 0.5D, random.nextFloat() * 360.0F, 0.0F);
+ endCrystal.generatedByDragonFight = true; // Paper + endCrystal.generatedByDragonFight = true; // Paper
world.addFreshEntity(endCrystal); world.addFreshEntity(endCrystal);
this.setBlock(world, new BlockPos(spike.getCenterX(), spike.getHeight(), spike.getCenterZ()), Blocks.BEDROCK.defaultBlockState()); BlockPos blockPos2 = endCrystal.blockPosition();
} this.setBlock(world, blockPos2.below(), Blocks.BEDROCK.defaultBlockState());

View file

@ -34,10 +34,10 @@ index 4c46a843c5c7e6f735f6b5f0f3c034524a0cf1e1..2baba1ccc1acd50693e05d565784d11d
list.forEach((entityplayer) -> { list.forEach((entityplayer) -> {
diff --git a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java diff --git a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java
index 4e4b68904151d0d851b13f14f89c1c305e95fd5a..8f481e11815d7162dd62a2b850b3d2af6d904519 100644 index 1dfdb378a2491b0ae64a4152e4cd8b539dfdf65b..efc1d49c5bfea7d1674b8a9de2c8b617657eda0f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java --- a/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java +++ b/src/main/java/net/minecraft/world/entity/monster/ElderGuardian.java
@@ -67,7 +67,7 @@ public class ElderGuardian extends Guardian { @@ -70,7 +70,7 @@ public class ElderGuardian extends Guardian {
super.customServerAiStep(); super.customServerAiStep();
if ((this.tickCount + this.getId()) % 1200 == 0) { if ((this.tickCount + this.getId()) % 1200 == 0) {
MobEffectInstance mobeffect = new MobEffectInstance(MobEffects.DIG_SLOWDOWN, 6000, 2); MobEffectInstance mobeffect = new MobEffectInstance(MobEffects.DIG_SLOWDOWN, 6000, 2);

View file

@ -11,13 +11,13 @@ Move the tick logic into the post tick, where portaling was
designed to happen in the first place. designed to happen in the first place.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3d1cde6740e2b68d8d6e372cb52a6485fc3f7316..e3024f2fff1cd8de618216a42716da8caf37d5be 100644 index f30bafd45d038d6abcb929b138b332a18aa84307..55deac13e5af70689fe74127aebd0e3f880f0cb4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -515,6 +515,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -431,6 +431,37 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
} }
// Paper end - optimise entity tracking // Paper end
+ // Paper start - make end portalling safe + // Paper start - make end portalling safe
+ public BlockPos portalBlock; + public BlockPos portalBlock;
+ public ServerLevel portalWorld; + public ServerLevel portalWorld;
@ -48,10 +48,11 @@ index 3d1cde6740e2b68d8d6e372cb52a6485fc3f7316..e3024f2fff1cd8de618216a42716da8c
+ this.teleportTo(worldserver, null); + this.teleportTo(worldserver, null);
+ } + }
+ // Paper end - make end portalling safe + // Paper end - make end portalling safe
+
public Entity(EntityType<?> type, Level world) { public Entity(EntityType<?> type, Level world) {
this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.id = Entity.ENTITY_COUNTER.incrementAndGet();
@@ -2839,6 +2869,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.passengers = ImmutableList.of();
@@ -2786,6 +2817,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
} }
this.processPortalCooldown(); this.processPortalCooldown();

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Line Of Sight Changes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index c0c864bcad6ba6466d7a6453ce920a3603f6066a..4246122a794018b526e1619dcd066c2c88f4786c 100644 index 59a377a291927b843b9e4fb4a558eeb729f3d6a8..1427616a0f1c80d381831d8928a4b632107fe0f5 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3548,7 +3548,8 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3607,7 +3607,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ()); Vec3 vec3d = new Vec3(this.getX(), this.getEyeY(), this.getZ());
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ()); Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
@ -45,7 +45,7 @@ index 42b6369015cdfea983b1489f7b99428eaa8c62a5..5a949e1d482e2485742e24b63395204b
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index dcc7c8efe0b9d6b57841d8318499d490a3f7aa73..a2865fe8fdc5f77a84e72f516d8f1fd1b4b579e0 100644 index 9d9616a4adcbcc0d2567bdcf0d57efdabda076d4..40dd8ef6f034be2d5866a0c253566026d59ed91a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -583,6 +583,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -583,6 +583,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] add per world spawn limits
Taken from #2982. Credit to Chasewhip8 Taken from #2982. Credit to Chasewhip8
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index af8cf7c594dc1c099785559f11f3ed7415676895..78ba220b74c1cca26e3b1243622a317eb1e4e78b 100644 index 47a880bfabcd950ff985c2763531c68db80347f2..d3489601ec89c9deea6beb3153bef9b30be85366 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -212,6 +212,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -212,6 +212,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View file

@ -8,10 +8,10 @@ Fixes SPIGOT-6221: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6
Fix splash events cancellation that still show particles/sound Fix splash events cancellation that still show particles/sound
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
index 089b5fbb240d494bf86a05078d534165bfc2f7ee..135cd9c154a90d5c2351d8bdd8217134114af5a0 100644 index 50712c4c7f007123a0735acf958fd860d4e76cf8..a3ee89cb4acfa475076e65f06f1047232bcf684f 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -104,56 +104,77 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -105,56 +105,77 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
Potion potionregistry = PotionUtils.getPotion(itemstack); Potion potionregistry = PotionUtils.getPotion(itemstack);
List<MobEffectInstance> list = PotionUtils.getMobEffects(itemstack); List<MobEffectInstance> list = PotionUtils.getMobEffects(itemstack);
boolean flag = potionregistry == Potions.WATER && list.isEmpty(); boolean flag = potionregistry == Potions.WATER && list.isEmpty();
@ -104,7 +104,7 @@ index 089b5fbb240d494bf86a05078d534165bfc2f7ee..135cd9c154a90d5c2351d8bdd8217134
AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D); AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
List<net.minecraft.world.entity.LivingEntity> list1 = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); List<net.minecraft.world.entity.LivingEntity> list1 = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb);
Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit
@@ -171,6 +192,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @@ -172,6 +193,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
if (d0 < 16.0D) { if (d0 < 16.0D) {
double d1; double d1;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0162c504673f5809b28ca58177773c005460f039..e100534a676bd950513f3b9217e4949b65f20960 100644 index 26733cb73d117af56457f7119f372c33a7dd1649..63a3f714f0a85966fe23507179d39cbfdaa0a1ee 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2294,7 +2294,7 @@ public class ServerPlayer extends Player { @@ -2241,7 +2241,7 @@ public class ServerPlayer extends Player {
if (retainOwnership) { if (retainOwnership) {
if (!itemstack1.isEmpty()) { if (!itemstack1.isEmpty()) {
@ -18,10 +18,10 @@ index 0162c504673f5809b28ca58177773c005460f039..e100534a676bd950513f3b9217e4949b
this.awardStat(Stats.DROP); this.awardStat(Stats.DROP);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java 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 b3634a1d92182c746948862fc64b2e47d11320ba..8f604924b47ed4027f4212007530b6d0c39f73a9 100644 index dee00042a780b053cd094081874aad221abf1b2b..786ef24e97cfb96ddee2be9e02272e6f572cd64d 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -724,6 +724,11 @@ public abstract class Player extends LivingEntity { @@ -730,6 +730,11 @@ public abstract class Player extends LivingEntity {
} }
double d0 = this.getEyeY() - 0.30000001192092896D; double d0 = this.getEyeY() - 0.30000001192092896D;

View file

@ -201,10 +201,10 @@ index 71a08510a928d4570822282bb31f14013ec3834a..4aeab90e778629c355189dfe79c39c4b
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884dd710604 100644 index 9f46eb8417ad19e6f1bbf369f4c6b94fdb915f5b..a974b57dfb007d14194c566421216003ffb0c5d6 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -696,6 +696,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -698,6 +698,15 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
} }
@ -220,7 +220,7 @@ index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884
@Override @Override
public InteractionResult mobInteract(Player player, InteractionHand hand) { public InteractionResult mobInteract(Player player, InteractionHand hand) {
if (!this.isVehicle() && !this.isBaby()) { if (!this.isVehicle() && !this.isBaby()) {
@@ -738,6 +747,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -740,6 +749,11 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
this.setFlag(16, eatingGrass); this.setFlag(16, eatingGrass);
} }
@ -233,10 +233,10 @@ index 07116849e39ef891182fe603d34d7fd8aee6c046..6bab94ac458081e9ed6e1999a9a3f884
if (angry) { if (angry) {
this.setEating(false); this.setEating(false);
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
index e710d529a8b92e9b11efc9955947b72788aa542b..7379e99c4d599aa0119bae9ebdc5e2058ada10cb 100644 index edbb933d1f6f7fc6432f7a8b074c5dc20f47adfb..91fb62807b3c5600c83d4dc8d3fadf36e94e2133 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
@@ -72,7 +72,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V @@ -74,7 +74,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
@Nullable @Nullable
private Llama caravanHead; private Llama caravanHead;
@Nullable @Nullable
@ -271,10 +271,10 @@ index c23f05f0d951e0036fe2cf524989747fe236730b..cd59500565a305757872aaf41b03b49f
@Override @Override
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java 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 f7ad34f38d26ab08bb5dd788bc70ba01b53fc1a1..39eb9301626b191958ce42daa34b1ff3241cea80 100644 index 5b3da07def02830e4332d7d3a7f7b968e5663c7b..74a4b1cdfe643007e0afd73f8eb0b1fbe29722cf 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -450,6 +450,16 @@ public class EnderMan extends Monster implements NeutralMob { @@ -457,6 +457,16 @@ public class EnderMan extends Monster implements NeutralMob {
this.entityData.set(EnderMan.DATA_STARED_AT, true); this.entityData.set(EnderMan.DATA_STARED_AT, true);
} }
@ -292,10 +292,10 @@ index f7ad34f38d26ab08bb5dd788bc70ba01b53fc1a1..39eb9301626b191958ce42daa34b1ff3
public boolean requiresCustomPersistence() { public boolean requiresCustomPersistence() {
return super.requiresCustomPersistence() || this.getCarriedBlock() != null; return super.requiresCustomPersistence() || this.getCarriedBlock() != null;
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Ghast.java b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
index f535564035b80bc531198575acd0a7846a1197c2..592b0dae251800552a0771ec46b4b8532b63075d 100644 index e398a7d5c560b1d94b21fe3241365ef8592d9fc8..c135bc245f59a1af706f98b9d140dee77016b12f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java --- a/src/main/java/net/minecraft/world/entity/monster/Ghast.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ghast.java
@@ -66,6 +66,12 @@ public class Ghast extends FlyingMob implements Enemy { @@ -67,6 +67,12 @@ public class Ghast extends FlyingMob implements Enemy {
return this.explosionPower; return this.explosionPower;
} }
@ -309,10 +309,10 @@ index f535564035b80bc531198575acd0a7846a1197c2..592b0dae251800552a0771ec46b4b853
protected boolean shouldDespawnInPeaceful() { protected boolean shouldDespawnInPeaceful() {
return true; return true;
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index d673c4ff3274452433c9aa630ff320a38f68163a..59ed51907fc21784b37a55ee01207d8a730ae29a 100644 index 4657bfce13ad95edf1964eb361d5679f93ca2ab2..4b2cd6d34ea4081cad86041f57ccda41807d4279 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -198,6 +198,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -201,6 +201,12 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
} }
public void startConverting(@Nullable UUID uuid, int delay) { public void startConverting(@Nullable UUID uuid, int delay) {
@ -325,7 +325,7 @@ index d673c4ff3274452433c9aa630ff320a38f68163a..59ed51907fc21784b37a55ee01207d8a
this.conversionStarter = uuid; this.conversionStarter = uuid;
this.villagerConversionTime = delay; this.villagerConversionTime = delay;
this.getEntityData().set(ZombieVillager.DATA_CONVERTING_ID, true); this.getEntityData().set(ZombieVillager.DATA_CONVERTING_ID, true);
@@ -205,7 +211,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -208,7 +214,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, delay, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); this.addEffect(new MobEffectInstance(MobEffects.DAMAGE_BOOST, delay, Math.min(this.level().getDifficulty().getId() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION);
// CraftBukkit end // CraftBukkit end
@ -431,10 +431,10 @@ index 3f1f4d65525562b3117fdc21c8a7f535b12c3c46..90a989c7c9de6f9ba55ab640761915e9
+ // Paper end - Horse API + // Paper end - Horse API
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
index 710176514a55ff6de87d29ed90f4e14c080a2ac7..00201cf495355939a4f35306b0e7b130c07e5c02 100644 index 1d910c34bc1154243b5a3bd774c70f1808d60a25..e2cfb4a162efaa3cae1fdae95ec74efe4a3af627 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAreaEffectCloud.java
@@ -222,4 +222,17 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud @@ -223,4 +223,17 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
this.getHandle().setOwner(null); this.getHandle().setOwner(null);
} }
} }
@ -657,7 +657,7 @@ index fc0f0e841dc974d080e1abb9bbafb5165801131f..d657fd2c507a5b215aeab0a5f3e9c2ee
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index fa31c69a84acd20c23f6d466fb0fb36eb4209206..e29e1af97c1d50603135723a7a16fc1806718ca2 100644 index de7deb9c27ffb7628124270091a5ba81b075c824..4fe558a882e87912e408b5bbd223666969e30029 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -233,10 +233,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @@ -233,10 +233,16 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 08a69f7a2d153aee1b9637085be04d3065b6df08..006035b94ab0490c0dd5747906398965016b3e42 100644 index e73208ed05109b64b3607762224b62a98dd9f9b7..870707223be5478805ec55e02f17a8c17d3d9f00 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1211,7 +1211,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1088,7 +1088,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper end // Paper end
// CraftBukkit start // CraftBukkit start
if (this.lastBookTick + 20 > MinecraftServer.currentTick) { if (this.lastBookTick + 20 > MinecraftServer.currentTick) {

View file

@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk
load in that case). load in that case).
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e63cb62affc88d1482f9926ae459986e2d213fb0..bc7daf89e30152a3bcb215e91b30c9680be5c343 100644 index c16d0e4f30e7b3c6d2c0b320353646589a84c6c8..a81f77b6d057182a716549940f40052fe27e845c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -228,7 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -228,7 +228,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@ -21,10 +21,10 @@ index e63cb62affc88d1482f9926ae459986e2d213fb0..bc7daf89e30152a3bcb215e91b30c968
@Override @Override
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 51dc136b9a5006382de4b12275a9c2f299d5d1f9..7113fdf06bc526af62d08313f8c47e14a2f4b652 100644 index 24949c13b6e6c2297812e8a3988d4e52aca9136a..5b735d018a4b0b1c212f63d941c2aa6a00d129f6 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -201,6 +201,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -200,6 +200,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return (CraftServer) Bukkit.getServer(); return (CraftServer) Bukkit.getServer();
} }
@ -37,7 +37,7 @@ index 51dc136b9a5006382de4b12275a9c2f299d5d1f9..7113fdf06bc526af62d08313f8c47e14
+ +
public abstract ResourceKey<LevelStem> getTypeKey(); public abstract ResourceKey<LevelStem> getTypeKey();
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator) { // Paper
diff --git a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java diff --git a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java b/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java
index 0d5ae91a9b43df7b412968ab5faf5498c09169f9..744160405680babbb83c99abcbe2dc89bf312398 100644 index 0d5ae91a9b43df7b412968ab5faf5498c09169f9..744160405680babbb83c99abcbe2dc89bf312398 100644
--- a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java --- a/src/main/java/net/minecraft/world/level/gameevent/GameEventDispatcher.java

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 006035b94ab0490c0dd5747906398965016b3e42..b673f6a43e4b057b1a5c78398a6e40bf73340112 100644 index 870707223be5478805ec55e02f17a8c17d3d9f00..483fc6b3df30d298b023c7bd05cbc05e688229a9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2479,7 +2479,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2310,7 +2310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} // Paper end } // Paper end
// Arm swing animation // Arm swing animation

View file

@ -5,39 +5,22 @@ Subject: [PATCH] Fixes kick event leave message not being sent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index e100534a676bd950513f3b9217e4949b65f20960..0a25e2bb95fa249fa5cde1a174702bb311a45171 100644 index 63a3f714f0a85966fe23507179d39cbfdaa0a1ee..5614d8ed30a005fd7c11e47ced4331b464cddd96 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -270,7 +270,6 @@ public class ServerPlayer extends Player { @@ -267,7 +267,6 @@ public class ServerPlayer extends Player {
public boolean joining = true;
public boolean sentListPacket = false; public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper public boolean supressTrackerForLogin = false; // Paper
public Integer clientViewDistance;
- public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent - public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent
// CraftBukkit end // CraftBukkit end
public boolean isRealPlayer; // Paper public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d127a11321 100644 index 483fc6b3df30d298b023c7bd05cbc05e688229a9..0ed553e02ced432b5f6761ff295c6ee70deefa78 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -516,7 +516,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1848,6 +1848,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Do not kick the player
return;
}
- this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent
// Send the possibly modified leave message
final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure
// CraftBukkit end
@@ -525,7 +524,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> {
this.connection.disconnect(ichatbasecomponent);
}));
- this.onDisconnect(ichatbasecomponent); // CraftBukkit - fire quit instantly
+ this.onDisconnect(ichatbasecomponent, event.leaveMessage()); // CraftBukkit - fire quit instantly // Paper - use kick event leave message
this.connection.setReadOnly();
MinecraftServer minecraftserver = this.server;
Connection networkmanager = this.connection;
@@ -1988,6 +1987,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void onDisconnect(Component reason) { public void onDisconnect(Component reason) {
@ -49,7 +32,26 @@ index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d1
// CraftBukkit start - Rarely it would send a disconnect line twice // CraftBukkit start - Rarely it would send a disconnect line twice
if (this.processedDisconnect) { if (this.processedDisconnect) {
return; return;
@@ -2005,7 +2009,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1856,11 +1861,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.info("{} lost connection: {}", this.player.getName().getString(), reason.getString());
- this.removePlayerFromWorld();
+ this.removePlayerFromWorld(quitMessage); // Paper
super.onDisconnect(reason);
}
+ // Paper start
private void removePlayerFromWorld() {
+ this.removePlayerFromWorld(null);
+ }
+
+ private void removePlayerFromWorld(@Nullable net.kyori.adventure.text.Component quitMessage) {
+ // Paper end
this.chatMessageChain.close();
// CraftBukkit start - Replace vanilla quit message handling with our own.
/*
@@ -1870,7 +1881,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player.disconnect(); this.player.disconnect();
// Paper start - Adventure // Paper start - Adventure
@ -59,10 +61,10 @@ index b673f6a43e4b057b1a5c78398a6e40bf73340112..9d519076d8ae50ab04c1a3c83c92b6d1
this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false);
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 77d80170cabc358c75d58ac7ff19054ba6b7617f..c8e38ed5e14fb137a7d169c57bc58bdf4421e0cc 100644 index 53c453814c840ce8afed27cea4c6f5e01cddf17f..2e9812e83a7471bfe314274276b8a3d44208e27d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -564,6 +564,11 @@ public abstract class PlayerList { @@ -551,6 +551,11 @@ public abstract class PlayerList {
} }
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer) { // CraftBukkit - return string // Paper - return Component
@ -74,11 +76,11 @@ index 77d80170cabc358c75d58ac7ff19054ba6b7617f..c8e38ed5e14fb137a7d169c57bc58bdf
ServerLevel worldserver = entityplayer.serverLevel(); ServerLevel worldserver = entityplayer.serverLevel();
entityplayer.awardStat(Stats.LEAVE_GAME); entityplayer.awardStat(Stats.LEAVE_GAME);
@@ -574,7 +579,7 @@ public abstract class PlayerList { @@ -561,7 +566,7 @@ public abstract class PlayerList {
entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper entityplayer.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper
} }
- 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())), entityplayer.quitReason); // Paper - Adventure & quit reason - 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() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())), entityplayer.quitReason); // Paper - Adventure & quit reason
+ PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), leaveMessage, entityplayer.quitReason); // Paper - Adventure & quit reason + PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(entityplayer.getBukkitEntity(), leaveMessage, entityplayer.quitReason); // Paper - Adventure & quit reason
this.cserver.getPluginManager().callEvent(playerQuitEvent); this.cserver.getPluginManager().callEvent(playerQuitEvent);
entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage()); entityplayer.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add config for mobs immune to default effects
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 4246122a794018b526e1619dcd066c2c88f4786c..463ae3d9e75b32da0aa91ebbbf1a34ee74825224 100644 index 1427616a0f1c80d381831d8928a4b632107fe0f5..f33ac871d08672a78774a3a9642954bdcaa2e9d9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1163,7 +1163,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -1165,7 +1165,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (this.getMobType() == MobType.UNDEAD) { if (this.getMobType() == MobType.UNDEAD) {
MobEffect mobeffectlist = effect.getEffect(); MobEffect mobeffectlist = effect.getEffect();
@ -31,10 +31,10 @@ index cd59500565a305757872aaf41b03b49ffc005af5..703068eaff84bcce83f61d805afa6cc0
private class WitherDoNothingGoal extends Goal { private class WitherDoNothingGoal extends Goal {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index b9acef460ff7e8bc9e24997771beeba6bea1f28a..d506091a739b04caf213e8fb0f71b5b78035aa0e 100644 index 6241baccd3fdee59175f616cdf69d3873074f855..9e5d68fe86d17118df3d6a1c36b296f32b4d7fc1 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java --- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java +++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -133,7 +133,7 @@ public class Spider extends Monster { @@ -135,7 +135,7 @@ public class Spider extends Monster {
@Override @Override
public boolean canBeAffected(MobEffectInstance effect) { public boolean canBeAffected(MobEffectInstance effect) {
@ -44,10 +44,10 @@ index b9acef460ff7e8bc9e24997771beeba6bea1f28a..d506091a739b04caf213e8fb0f71b5b7
public boolean isClimbing() { public boolean isClimbing() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
index ea6233cb3ca30864e54d553a5d1071ea9147a868..9a81cb0c3a5ac40ff50dc7c81f6196a447cd03c6 100644 index 62943d43b701d9ae6d955003f4e7658f76d5bdb3..3dcd43279ce1295b37c3504ecbdaac5275df2b80 100644
--- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/WitherSkeleton.java
@@ -123,6 +123,6 @@ public class WitherSkeleton extends AbstractSkeleton { @@ -128,6 +128,6 @@ public class WitherSkeleton extends AbstractSkeleton {
@Override @Override
public boolean canBeAffected(MobEffectInstance effect) { public boolean canBeAffected(MobEffectInstance effect) {

View file

@ -5,15 +5,15 @@ Subject: [PATCH] Fix incorrect message for outdated client
diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
index 8393c1a2d15d5ad255c9808b0d0edd6aeb447893..63cf71940f6480c593a43bd39900c50676367404 100644 index 2824369960130fa3d0ad416a3961024c8f8d5f52..74ad6baea209bb0152198d48671e3f1c80ac73e2 100644
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
@@ -82,7 +82,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL @@ -82,7 +82,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
if (packet.getProtocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) { if (packet.protocolVersion() != SharedConstants.getCurrentVersion().getProtocolVersion()) {
Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages Component ichatmutablecomponent; // Paper - Fix hex colors not working in some kick messages
- if (packet.getProtocolVersion() < 754) { - if (packet.protocolVersion() < 754) {
+ if (packet.getProtocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients + if (packet.protocolVersion() < SharedConstants.getCurrentVersion().getProtocolVersion()) { // Paper - Fix incorrect message for outdated clients
ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages
} else { } else {
ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) , true )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages ichatmutablecomponent = org.bukkit.craftbukkit.util.CraftChatMessage.fromString( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), SharedConstants.getCurrentVersion().getName() ) )[0]; // Spigot // Paper - Fix hex colors not working in some kick messages