3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 21:10:10 +01:00

more more more more more more more more more work

Dieser Commit ist enthalten in:
Noah van der Aa 2023-09-22 17:24:59 +02:00
Ursprung 32d9c6684b
Commit 4875ee4814
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 547D90BC6FF753CF
48 geänderte Dateien mit 143 neuen und 144 gelöschten Zeilen

Datei anzeigen

@ -24,10 +24,10 @@ index 977012bfa4c42d619f2e9729c2be032999c403f7..5ca1bc3a0574c1080cb000245dbc8fa0
if (Snowball.class.isAssignableFrom(clazz)) {
entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9c7d9ab63cd24e58a0e0e5af15fc434f8811591a..3ef243039fdb1b28075c309fa5743f40d2d5efee 100644
index a37f411baab87fa0c13b1379e23cd0b62ed67de2..8a94c27fc380878f57719b1c480e18e8401c24aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1397,7 +1397,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1402,7 +1402,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Preconditions.checkArgument(material != null, "Material cannot be null");
Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material);
@ -41,7 +41,7 @@ index 9c7d9ab63cd24e58a0e0e5af15fc434f8811591a..3ef243039fdb1b28075c309fa5743f40
return (FallingBlock) entity.getBukkitEntity();
}
@@ -1406,7 +1411,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1411,7 +1416,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Preconditions.checkArgument(location != null, "Location cannot be null");
Preconditions.checkArgument(data != null, "BlockData cannot be null");

Datei anzeigen

@ -15,7 +15,7 @@ piercing arrows to avoid duplicate damage being applied.
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
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 372b9ec0c8eddf4a01b4b8203a88401db22affbf..7226be19248a1ffb8ff2c89b55882529d33a6c0c 100644
index 02574c777047b8e1375aa91e0cd75c7325837643..b5f5e251661fc17c7614d3e23a9a5192b4a5184a 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -290,6 +290,19 @@ public abstract class AbstractArrow extends Projectile {

Datei anzeigen

@ -20,10 +20,10 @@ public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecr
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
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 135cd9c154a90d5c2351d8bdd8217134114af5a0..f4342f6a36cf31066af3ee32fff059e6a318fad6 100644
index a3ee89cb4acfa475076e65f06f1047232bcf684f..3abcb29ff95c29b9b178e0a02d98bf26d60be173 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -99,6 +99,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
@@ -100,6 +100,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
@Override
protected void onHit(HitResult hitResult) {
super.onHit(hitResult);
@ -35,7 +35,7 @@ index 135cd9c154a90d5c2351d8bdd8217134114af5a0..f4342f6a36cf31066af3ee32fff059e6
if (!this.level().isClientSide) {
ItemStack itemstack = this.getItem();
Potion potionregistry = PotionUtils.getPotion(itemstack);
@@ -112,7 +117,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
@@ -113,7 +118,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
if (this.isLingering()) {
showParticles = this.makeAreaOfEffectCloud(itemstack, potionregistry); // Paper
} else {

Datei anzeigen

@ -10,10 +10,10 @@ indefinitely. Instead of using the world state, we use the already
supplied ServerLevelAccessor which will always have the chunk available.
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
index 1bc8334691147a0f52ad0e97236c9e007b95ba34..770b15f5413eb38890587aa6af2a56f15bf5934f 100644
index 534630b0161c8d869e49e7a59572193550be0671..a744cb70ac719eae376fb2ab2271e4f8ac7b12f2 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -363,7 +363,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
@@ -364,7 +364,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
});
ServerLevel worldserver = world.getLevel();

Datei anzeigen

@ -7,10 +7,10 @@ Bring the vehicle move packet behavior in line with the
regular player move packet.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 9535d8effbc588b69df9dba9aba4b3090370ae69..8b33da482a7971d6481283c37485185925bd5dd5 100644
index 46a5cc73b1fef1cfa69e110619eedc431e1b7fa9..303b6298171238d314c98bd52dda2c7bf71b13dd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -578,6 +578,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -463,6 +463,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause
} else {
Entity entity = this.player.getRootVehicle();

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 741d486f81121a8ddda71be5c8b8603d23f75799..373a72439e63479715b611ef0bd098abeae9eaed 100644
index 23057d0463af66041ab151ff5f198bb6d1fba124..2aad18226c0cc4dc32db51070b6b7c7be5686451 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1298,7 +1298,7 @@ public final class CraftServer implements Server {
@@ -1301,7 +1301,7 @@ public final class CraftServer implements Server {
try {
if (save) {

Datei anzeigen

@ -13,7 +13,7 @@ we'll also only gen a trace for the first one, I see no real pressing need
to generate more, given that that would *massively* negate this patch otherwise
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index 73b96f804079288e9c5fcc11da54e61e89a6782a..52fd12c474c01f3b53d0f6596b7a6fafee52bd0d 100644
index e96a0ca47e4701ba187555bd92c968345bc85677..d99626d529ac2d18f662e5af0264643e8582e12d 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel {

Datei anzeigen

@ -65,10 +65,10 @@ index 9be4e715faefc5f7972abf064bfff3c1c980f7fc..b0caf52d00d8cd76550ab116291f8e11
this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2);
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
index ef0c0714847c37f57ca05aaeb0ce7c217ae7ac0f..082351bd5f98d8738334b9164375f63fdc890455 100644
index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934d35e9704 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
@@ -579,7 +579,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
@@ -580,7 +580,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
if (i == 0) {
// CraftBukkit start
@ -91,10 +91,10 @@ index 703068eaff84bcce83f61d805afa6cc0fef909b1..1e07febcf7a3dfb281728cc5e3e4f15d
}
// CraftBukkit end
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 39eb9301626b191958ce42daa34b1ff3241cea80..b62457313a1e30aad0c5313d608667b5d3811455 100644
index 74a4b1cdfe643007e0afd73f8eb0b1fbe29722cf..b0a97679157a18a3c623ce3b2ae315789772c254 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -573,7 +573,7 @@ public class EnderMan extends Monster implements NeutralMob {
@@ -580,7 +580,7 @@ public class EnderMan extends Monster implements NeutralMob {
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
if (iblockdata.is(BlockTags.ENDERMAN_HOLDABLE) && flag) {
@ -104,10 +104,10 @@ index 39eb9301626b191958ce42daa34b1ff3241cea80..b62457313a1e30aad0c5313d608667b5
world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.Context.of(this.enderman, iblockdata));
this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
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 c245acdbaa84cc795e341ed042a0d8d90383f070..e87c6c8ab585d6b0b38bbb8e42c0082e38f03250 100644
index add3cd866452df727107e94fb2039bddebe909be..0c11d9bef8f0129c541e30ad057612e881703b24 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
@@ -175,7 +175,7 @@ public class Ravager extends Raider {
@@ -158,7 +158,7 @@ public class Ravager extends Raider {
if (block instanceof LeavesBlock) {
// CraftBukkit start
@ -117,10 +117,10 @@ index c245acdbaa84cc795e341ed042a0d8d90383f070..e87c6c8ab585d6b0b38bbb8e42c0082e
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
index 754bad0bd38b8a356403f4c90de26de445cbf3c7..8d1f99f95a08eac98c6a03c6e534fc1997f8fe71 100644
index 6f452605e9dc9ebd9980eae9fdeea34417a37a88..2c60a3765d22909e73b660492410ab8456304b68 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
@@ -179,7 +179,8 @@ public class Silverfish extends Monster {
@@ -181,7 +181,8 @@ public class Silverfish extends Monster {
if (block instanceof InfestedBlock) {
// CraftBukkit start
@ -131,7 +131,7 @@ index 754bad0bd38b8a356403f4c90de26de445cbf3c7..8d1f99f95a08eac98c6a03c6e534fc19
}
// CraftBukkit end
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 f4342f6a36cf31066af3ee32fff059e6a318fad6..29ea746b6df87e996081149000c6db0b562f7e97 100644
index 3abcb29ff95c29b9b178e0a02d98bf26d60be173..06f44946e6cfb7da83a65850e06a9093712e24f9 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -306,7 +306,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
@ -140,14 +140,14 @@ index f4342f6a36cf31066af3ee32fff059e6a318fad6..29ea746b6df87e996081149000c6db0b
// CraftBukkit start
- if (CraftEventFactory.callEntityChangeBlockEvent(this, pos, Blocks.AIR.defaultBlockState())) {
+ if (CraftEventFactory.callEntityChangeBlockEvent(this, pos, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
this.level().removeBlock(pos, false);
this.level().destroyBlock(pos, false, this);
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
index 9bc9fa5e51c93af320b095036e874e74a6d50acf..f19a1ea64d26723d738b007c5102fe44b963bfb6 100644
index 258d453c37b7aae09874b24f61351e35212a1a40..e9beebedf1d60e06e16c442b64d28d022a3e3164 100644
--- a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
@@ -263,7 +263,7 @@ public class ChorusFlowerBlock extends Block {
@@ -272,7 +272,7 @@ public class ChorusFlowerBlock extends Block {
if (!world.isClientSide && projectile.mayInteract(world, blockposition) && projectile.getType().is(EntityTypeTags.IMPACT_PROJECTILES)) {
// CraftBukkit
@ -196,10 +196,10 @@ index b13d89b1516130507402cd3b4bdb9f3c2a36e807..936644ec4a57e51a1c11a5bf4e8449ab
}
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index b46a37bab1ddab70dc0567df26668e28d5844469..7ec74be4ac660c85a3c9a1d60de45dfa374c9c1f 100644
index f171124710b5e731652df0074fe24360239225b2..5a2fc10fb677291df95fceccff734cb9a78c81d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1383,11 +1383,11 @@ public class CraftEventFactory {
@@ -1385,11 +1385,11 @@ public class CraftEventFactory {
return event;
}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 50f6a044385c22336e799efe471ab65e7196aaa6..a8732fe53dc0d6d5961c5e92e3ce5b500a75bcd7 100644
index aab560700503a0c3415e4aaf09a86e907106bd63..68658d9c204c5e720e81b58d0ee68003ab1030c2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -916,12 +916,14 @@ public class ServerPlayer extends Player {
@@ -874,12 +874,14 @@ public class ServerPlayer extends Player {
}
}
}

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
Bad plugins doing this would cause some obvious problems...
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ceddbc2e0fdec358bd7776af264df33696ecbd6d..5678616a48cc6d2c99b867678359ff31666be3f6 100644
index 353cf7574aea63413899a4b6d5edf43cc675c1da..0027f9ae4b184f7718778d7fc7634c05d323af26 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2778,7 +2778,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2668,7 +2668,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public boolean startRiding(Entity entity, boolean force) {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Guard against invalid entity positions
Anything not finite should be blocked and logged
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5678616a48cc6d2c99b867678359ff31666be3f6..cbb6a06265ebbdcc1210dec1c50a4384d51f6b5e 100644
index 0027f9ae4b184f7718778d7fc7634c05d323af26..0ac21fc03b26766724c14bf9275a72e2fe6f9ada 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4448,11 +4448,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4337,11 +4337,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
}
@ -41,5 +41,5 @@ index 5678616a48cc6d2c99b867678359ff31666be3f6..cbb6a06265ebbdcc1210dec1c50a4384
+ }
+ // Paper end - block invalid positions
// Paper end
// Paper start - rewrite chunk system
if (this.updatingSectionStatus) {
// Paper start - fix MC-4
if (this instanceof ItemEntity) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Allow to change the podium for the EnderDragon
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 fada988941c33e09bce5e71bcb2bb733185f6c12..92666c48620078623a451fbf68f673cb9f81c4b5 100644
index 1621a06eff438eccdbc04a2abebd718567c320b3..ccc68b1a1b1b087c52d91591ba4c63b075bfdc66 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
@@ -101,6 +101,10 @@ public class EnderDragon extends Mob implements Enemy {
@@ -103,6 +103,10 @@ public class EnderDragon extends Mob implements Enemy {
private final int[] nodeAdjacency;
private final BinaryHeap openSet;
private final Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
@ -19,7 +19,7 @@ index fada988941c33e09bce5e71bcb2bb733185f6c12..92666c48620078623a451fbf68f673cb
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
super(EntityType.ENDER_DRAGON, world);
@@ -141,6 +145,19 @@ public class EnderDragon extends Mob implements Enemy {
@@ -143,6 +147,19 @@ public class EnderDragon extends Mob implements Enemy {
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D);
}
@ -39,7 +39,7 @@ index fada988941c33e09bce5e71bcb2bb733185f6c12..92666c48620078623a451fbf68f673cb
@Override
public boolean isFlapping() {
float f = Mth.cos(this.flapTime * 6.2831855F);
@@ -1002,7 +1019,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -993,7 +1010,7 @@ public class EnderDragon extends Mob implements Enemy {
d0 = segment2[1] - segment1[1];
}
} else {
@ -48,7 +48,7 @@ index fada988941c33e09bce5e71bcb2bb733185f6c12..92666c48620078623a451fbf68f673cb
double d1 = Math.max(Math.sqrt(blockposition.distToCenterSqr(this.position())) / 4.0D, 1.0D);
d0 = (double) segmentOffset / d1;
@@ -1029,7 +1046,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -1020,7 +1037,7 @@ public class EnderDragon extends Mob implements Enemy {
vec3d = this.getViewVector(tickDelta);
}
} else {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Fix StructureGrowEvent species for RED_MUSHROOM
diff --git a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
index 09ed467f98c47dd5295f5cb7c0082fc8c1a03c28..f6f8e155223cba10c4073ddca602d1aa3aa872d7 100644
index b18fa69a040337d8ff29ab6f2a52870db57a010c..c9593c8c3b5e0502b33691ab6c5e14d389e7d0fe 100644
--- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
@@ -92,7 +92,7 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8b33da482a7971d6481283c37485185925bd5dd5..02c277f582aea0d7bd42d2ded21deecc80bd8655 100644
index 303b6298171238d314c98bd52dda2c7bf71b13dd..4e67a4689e8c373df611f90ca7ca7e7cfed66563 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3324,7 +3324,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3174,7 +3174,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
if (this.player.level().isLoaded(blockposition)) {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b56a7067faafb687ff5d529b1d4a40c1e15b2ea2..815eb218b6612b13c6deff636509bad35eeace62 100644
index fdb4e975ae67abf5aba7df8b8c34e991d08b1398..5cf97d15ac8536ce5cd5e63c00aa137e2565eea5 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1430,7 +1430,7 @@ public abstract class PlayerList {
@@ -1424,7 +1424,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

Datei anzeigen

@ -7,10 +7,10 @@ Fixes MC-50647 by just checking if the spawn type is a SPAWNER
and then bypassing the spawn check logic if on slimes if it is.
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 5aa702d68096af180340feb65a07856301b4f258..343433158507451152e5b2fc5e5fd0b0e6b229db 100644
index 48a420b7455f872c351e04be3918808e51b192ed..b14979ab7bed34a37fceff5589ecb789bab31318 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -322,6 +322,11 @@ public class Slime extends Mob implements Enemy {
@@ -329,6 +329,11 @@ public class Slime extends Mob implements Enemy {
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (world.getDifficulty() != Difficulty.PEACEFUL) {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Pass ServerLevel for gamerule callbacks
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index c9a6847b4eb29b8d0ed68741b5e6055de02d1e83..23c39cc77ae0d2ab7100fff0a3e8ff6752706dbb 100644
index 17d47e201da2bcbe55807f17dcc5e938e9944aea..f1e5798c47ee6c8d8b9d599fa503e8cefe18aa19 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -304,7 +304,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@ -18,10 +18,10 @@ index c9a6847b4eb29b8d0ed68741b5e6055de02d1e83..23c39cc77ae0d2ab7100fff0a3e8ff67
if (dedicatedserverproperties.enableQuery) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 02c277f582aea0d7bd42d2ded21deecc80bd8655..1743444a48cacfad2326c8d21974e763ea332914 100644
index 4e67a4689e8c373df611f90ca7ca7e7cfed66563..fadda21fe9e28529b48945ad075173783539c5d4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2887,7 +2887,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2737,7 +2737,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
this.player = this.server.getPlayerList().respawn(this.player, false, RespawnReason.DEATH);
if (this.server.isHardcore()) {
this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper
@ -31,7 +31,7 @@ index 02c277f582aea0d7bd42d2ded21deecc80bd8655..1743444a48cacfad2326c8d21974e763
}
break;
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a8987b784 100644
index 2e240ad721928a9a68370114ba61c21884ef1472..6c688e41b65376fdaf70de633e560f84b984dfc6 100644
--- a/src/main/java/net/minecraft/world/level/GameRules.java
+++ b/src/main/java/net/minecraft/world/level/GameRules.java
@@ -51,7 +51,7 @@ public class GameRules {
@ -43,7 +43,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
@@ -72,7 +72,7 @@ public class GameRules {
@@ -81,7 +81,7 @@ public class GameRules {
public static final GameRules.Key<GameRules.BooleanValue> RULE_DISABLE_RAIDS = GameRules.register("disableRaids", GameRules.Category.MOBS, GameRules.BooleanValue.create(false));
public static final GameRules.Key<GameRules.BooleanValue> RULE_DOINSOMNIA = GameRules.register("doInsomnia", GameRules.Category.SPAWNING, GameRules.BooleanValue.create(true));
public static final GameRules.Key<GameRules.BooleanValue> RULE_DO_IMMEDIATE_RESPAWN = GameRules.register("doImmediateRespawn", GameRules.Category.PLAYER, GameRules.BooleanValue.create(false, (minecraftserver, gamerules_gameruleboolean) -> {
@ -52,7 +52,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
@@ -166,13 +166,13 @@ public class GameRules {
@@ -176,13 +176,13 @@ public class GameRules {
((GameRules.Type<T>) type).callVisitor(consumer, (GameRules.Key<T>) key); // CraftBukkit - decompile error
}
@ -68,7 +68,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
T t0 = rules.getRule(key);
this.getRule(key).setFrom(t0, server);
@@ -240,10 +240,10 @@ public class GameRules {
@@ -250,10 +250,10 @@ public class GameRules {
private final Supplier<ArgumentType<?>> argument;
private final Function<GameRules.Type<T>, T> constructor;
@ -81,7 +81,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
this.argument = argumentType;
this.constructor = ruleFactory;
this.callback = changeCallback;
@@ -275,10 +275,10 @@ public class GameRules {
@@ -285,10 +285,10 @@ public class GameRules {
public void setFromArgument(CommandContext<CommandSourceStack> context, String name, GameRules.Key<T> gameRuleKey) { // Paper
this.updateFromArgument(context, name, gameRuleKey); // Paper
@ -94,7 +94,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
if (server != null) {
this.type.callback.accept(server, this.getSelf());
}
@@ -299,7 +299,7 @@ public class GameRules {
@@ -309,7 +309,7 @@ public class GameRules {
protected abstract T copy();
@ -103,7 +103,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
}
public interface GameRuleTypeVisitor {
@@ -315,7 +315,7 @@ public class GameRules {
@@ -325,7 +325,7 @@ public class GameRules {
private boolean value;
@ -112,7 +112,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
return new GameRules.Type<>(BoolArgumentType::bool, (gamerules_gameruledefinition) -> {
return new GameRules.BooleanValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitBoolean);
@@ -343,7 +343,7 @@ public class GameRules {
@@ -353,7 +353,7 @@ public class GameRules {
return this.value;
}
@ -121,7 +121,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
this.value = value;
this.onChanged(server);
}
@@ -373,7 +373,7 @@ public class GameRules {
@@ -383,7 +383,7 @@ public class GameRules {
return new GameRules.BooleanValue(this.type, this.value);
}
@ -130,7 +130,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
this.value = rule.value;
this.onChanged(server);
}
@@ -383,7 +383,7 @@ public class GameRules {
@@ -393,7 +393,7 @@ public class GameRules {
private int value;
@ -139,7 +139,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
return new GameRules.Type<>(IntegerArgumentType::integer, (gamerules_gameruledefinition) -> {
return new GameRules.IntegerValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitInteger);
@@ -411,7 +411,7 @@ public class GameRules {
@@ -421,7 +421,7 @@ public class GameRules {
return this.value;
}
@ -148,7 +148,7 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
this.value = value;
this.onChanged(server);
}
@@ -462,7 +462,7 @@ public class GameRules {
@@ -472,7 +472,7 @@ public class GameRules {
return new GameRules.IntegerValue(this.type, this.value);
}
@ -158,10 +158,10 @@ index de713f1ca1d61a6b1fca2b66de9162556d102449..edd2c9d0cf5a81c779011cb4215d496a
this.onChanged(server);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3ef243039fdb1b28075c309fa5743f40d2d5efee..e36c535ede104fe6c60348558e31ad5571c5ac2a 100644
index 8a94c27fc380878f57719b1c480e18e8401c24aa..2ec9d65ce7c9947021cf95f0827c3bc1cc2166ab 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1950,7 +1950,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1955,7 +1955,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper end
GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule));
handle.deserialize(event.getValue()); // Paper
@ -170,7 +170,7 @@ index 3ef243039fdb1b28075c309fa5743f40d2d5efee..e36c535ede104fe6c60348558e31ad55
return true;
}
@@ -1991,7 +1991,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1996,7 +1996,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
// Paper end
GameRules.Value<?> handle = this.getHandle().getGameRules().getRule(CraftWorld.getGameRulesNMS().get(rule.getName()));
handle.deserialize(event.getValue()); // Paper

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add pre-unbreaking amount to PlayerItemDamageEvent
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index f62585f3112886c927f1f65f982b9db9194457e9..cc58df88fc3788dcfb7e429ef899b3d558a931cc 100644
index 710369e06f66c033dbfa551b0c00362009938e44..fe153047d3198dc5c86396f5ea595fcc572496af 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -612,10 +612,11 @@ public final class ItemStack {
@@ -617,10 +617,11 @@ public final class ItemStack {
}
}

Datei anzeigen

@ -5,14 +5,14 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 373a72439e63479715b611ef0bd098abeae9eaed..3468fb9e062a3ff0c2229cb75da45955a3d8761c 100644
index 2aad18226c0cc4dc32db51070b6b7c7be5686451..6e5d942ec82a5b34c5047c978ecbff176cb8c849 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1257,6 +1257,7 @@ public final class CraftServer implements Server {
@@ -1260,6 +1260,7 @@ public final class CraftServer implements Server {
internal.setSpawnSettings(true, true);
// Paper - move up
+ internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
//internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Trigger bee_nest_destroyed trigger in the correct place
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 0cb9803e30702de1cc530c1205fe9bbb4dcb2c08..96fde7b84ce4d195d0c54deff71df9fcf8447979 100644
index 0a15cda0919c0adf5009a023c17b3e25cc365623..f968dee743f58fe71935097701866800c0f382a1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -428,12 +428,16 @@ public class ServerPlayerGameMode {
@@ -426,12 +426,16 @@ public class ServerPlayerGameMode {
block.destroy(this.level, pos, iblockdata);
}
@ -25,7 +25,7 @@ index 0cb9803e30702de1cc530c1205fe9bbb4dcb2c08..96fde7b84ce4d195d0c54deff71df9fc
itemstack.mineBlock(this.level, iblockdata, pos, this.player);
if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
@@ -454,6 +458,13 @@ public class ServerPlayerGameMode {
@@ -452,6 +456,13 @@ public class ServerPlayerGameMode {
if (flag && event != null) {
iblockdata.getBlock().popExperience(this.level, pos, event.getExpToDrop(), this.player); // Paper
}
@ -40,7 +40,7 @@ index 0cb9803e30702de1cc530c1205fe9bbb4dcb2c08..96fde7b84ce4d195d0c54deff71df9fc
return true;
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
index 26f928ad94aed7f1078a31d8a0af2dc377a48d0f..01c8394c6e6b65f40db04280458d0191c116b845 100644
index 61539bd963acf46f5f05865b235f9dbc05c771c3..5cf7b0d0331a8f10aea6dd607193795054a299dd 100644
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
@@ -88,7 +88,7 @@ public class BeehiveBlock extends BaseEntityBlock {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityDyeEvent and CollarColorable interface
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
index 770b15f5413eb38890587aa6af2a56f15bf5934f..438d7c26cc3a4a3b5a1affffbbe26e4d272b0c00 100644
index a744cb70ac719eae376fb2ab2271e4f8ac7b12f2..40af8405c6f3ecc5a8168bb62607eb79862cefa6 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -401,6 +401,13 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
@@ -402,6 +402,13 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
DyeColor enumcolor = ((DyeItem) item).getDyeColor();
if (enumcolor != this.getCollarColor()) {
@ -23,10 +23,10 @@ index 770b15f5413eb38890587aa6af2a56f15bf5934f..438d7c26cc3a4a3b5a1affffbbe26e4d
if (!player.getAbilities().instabuild) {
itemstack.shrink(1);
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index 88563894af2b6386ced89c2fbe3cba434dbb8040..57ceec70bb150afaa66962090b142048d5b50c2f 100644
index 9ebb994b62b58352525da21385f02803e8414687..eecb7511582e5e316b71fa4a4734881424be5ca7 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -367,6 +367,14 @@ public class Wolf extends TamableAnimal implements NeutralMob {
@@ -369,6 +369,14 @@ public class Wolf extends TamableAnimal implements NeutralMob {
DyeColor enumcolor = itemdye.getDyeColor();
if (enumcolor != this.getCollarColor()) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerStopUsingItemEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 50ee81007ae10f68aa40a666605203862f5e20a8..418853323314597f746b2f8e74b9766efcbf98be 100644
index 7b4a04193f783a077cfec47887fc6b76b3985d8d..a3fc80627627a4ad991ec8e674ac528fd69580df 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3976,6 +3976,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -4035,6 +4035,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
public void releaseUsingItem() {
if (!this.useItem.isEmpty()) {

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] FallingBlock auto expire setting
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 562462729d0262bac5968583b064124167437449..18eaccb39a4c81338a8cbebe3de03934913ac2a4 100644
index c64dcceabc41c11542b535d104b7f43172032842..9105418b29c89f092378da11b14e3d324332a2ba 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -66,6 +66,7 @@ public class FallingBlockEntity extends Entity {

Datei anzeigen

@ -23,10 +23,10 @@ index ff99336e0b8131ae161cfa5c4fc83c6905e3dbc8..5f43aedc6596e2b1ac7af97115157147
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b00c1df57789996fef58b2c649588c13df149abd..67e096207b08d2ba13ebc1b92ac94ed2e170f896 100644
index a5df34df91dbad954d9990b6b6c8000266746d04..fddb0f386614cb6802295861088c1f223ba9b417 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2647,6 +2647,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2274,6 +2274,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void onTickingStart(Entity entity) {
@ -35,16 +35,15 @@ index b00c1df57789996fef58b2c649588c13df149abd..67e096207b08d2ba13ebc1b92ac94ed2
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 50ddcd7ee9c3ffe7549361f942df01b8ef078932..eda7f0bb42f7269676d5d2193e1155912ede9920 100644
index b1e844b1c0dafb2dfc9904d2d4ad0e8fd5b6e572..e119f21ad06cfcbb279f20acabfa3121839d2891 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -212,7 +212,8 @@ public class ActivationRange
@@ -211,7 +211,7 @@ public class ActivationRange
ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, worldHeight, villagerActivationRange );
// Paper end
// Paper start
- java.util.List<Entity> entities = world.getEntities((Entity)null, maxBB, null);
+ java.util.function.Predicate<Entity> entityPredicate = world.paperConfig().entities.markers.tick ? null : (e) -> !(e instanceof net.minecraft.world.entity.Marker); // Configurable marker ticking
+ java.util.List<Entity> entities = world.getEntities((Entity)null, maxBB, entityPredicate);
for (int i = 0; i < entities.size(); i++) {
Entity entity = entities.get(i);
ActivationRange.activateEntity(entity);
- world.getEntities().get(maxBB, ActivationRange::activateEntity);
+ world.getEntities().get(world.paperConfig().entities.markers.tick ? null : (e) -> !(e instanceof net.minecraft.world.entity.Marker), maxBB, ActivationRange::activateEntity); // Paper - configurable marker ticking
}
MinecraftTimings.entityActivationCheckTimer.stopTiming();
}

Datei anzeigen

@ -5,20 +5,20 @@ Subject: [PATCH] Do not accept invalid client settings
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1743444a48cacfad2326c8d21974e763ea332914..42bb941af5eac6e4a4d79a59be9e1ac56468c4b4 100644
index fadda21fe9e28529b48945ad075173783539c5d4..aabd4a28cef4a31e0eed34d2e7c490199203bfd5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3466,6 +3466,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3298,6 +3298,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
+ // Paper start - do not accept invalid information
+ if (packet.viewDistance() < 0) {
+ LOGGER.warn("Disconnecting " + this.player.getScoreboardName() + " for invalid view distance: " + packet.viewDistance());
+ if (packet.information().viewDistance() < 0) {
+ LOGGER.warn("Disconnecting " + this.player.getScoreboardName() + " for invalid view distance: " + packet.information().viewDistance());
+ this.disconnect("Invalid client settings", PlayerKickEvent.Cause.ILLEGAL_ACTION);
+ return;
+ }
+ // Paper end - do not accept invalid information
this.player.updateOptions(packet);
this.player.updateOptions(packet.information());
}

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Add support for Proxy Protocol
diff --git a/build.gradle.kts b/build.gradle.kts
index 5945324724822da7cb95d4b63da07f1ace34f999..7e0580bbd0a557c7bb269507a99d25db07bf31f1 100644
index 7df1b44674ba5e826ad7c96c9d242865a3282307..26618ddf85952694ae2c78f41a19e4b9a324f059 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -30,6 +30,7 @@ dependencies {
@ -17,10 +17,10 @@ index 5945324724822da7cb95d4b63da07f1ace34f999..7e0580bbd0a557c7bb269507a99d25db
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
implementation("org.ow2.asm:asm:9.5")
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 2beddfc0532c3835d50724551e3d46cb0d7d2290..44d99e89226adb6234b9405f25ac9dab9bd84297 100644
index dbefe5450b9d8d9c32c30a06afd614725f890d00..12bdcbd265d24a0c013303246d33545c22b01595 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -108,6 +108,12 @@ public class ServerConnectionListener {
@@ -109,6 +109,12 @@ public class ServerConnectionListener {
ServerConnectionListener.LOGGER.info("Paper: Using " + com.velocitypowered.natives.util.Natives.cipher.getLoadedVariant() + " cipher from Velocity.");
// Paper end
@ -32,11 +32,11 @@ index 2beddfc0532c3835d50724551e3d46cb0d7d2290..44d99e89226adb6234b9405f25ac9dab
+
this.channels.add(((ServerBootstrap) ((ServerBootstrap) (new ServerBootstrap()).channel(oclass)).childHandler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel channel) {
try {
@@ -123,6 +129,30 @@ public class ServerConnectionListener {
int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond();
Connection.setInitialProtocolAttributes(channel);
@@ -126,6 +132,29 @@ public class ServerConnectionListener {
Connection object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND); // CraftBukkit - decompile error
//ServerConnectionListener.this.connections.add(object); // Paper
+ // Paper start - Add support for Proxy Protocol
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.proxyProtocol) {
+ channel.pipeline().addAfter("timeout", "haproxy-decoder", new io.netty.handler.codec.haproxy.HAProxyMessageDecoder());
@ -60,7 +60,6 @@ index 2beddfc0532c3835d50724551e3d46cb0d7d2290..44d99e89226adb6234b9405f25ac9dab
+ });
+ }
+ // Paper end
+
//ServerConnectionListener.this.connections.add(object);
pending.add(object); // Paper
channelpipeline.addLast("packet_handler", (ChannelHandler) object);
((Connection) object).configurePacketHandler(channelpipeline);
((Connection) object).setListenerForServerboundHandshake(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));

Datei anzeigen

@ -18,10 +18,10 @@ index d79284a790569141c2ac8178d6ecc20b17cdd0d3..3944852921335c78a04a9dc301882ab5
public static ClientboundBlockEntityDataPacket create(BlockEntity blockEntity) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
index c08440826d84f97412e2587cb98daae04e1bdd32..39b879f21f958dbd91ab0f74e5d4f3c74928fc33 100644
index 0ef3e9b472e35bd2572b04722781abf7d4a1094b..bd439aef96aeecb9c72b5f50d748d231cccbc970 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
@@ -186,6 +186,7 @@ public class ClientboundLevelChunkPacketData {
@@ -170,6 +170,7 @@ public class ClientboundLevelChunkPacketData {
CompoundTag compoundTag = blockEntity.getUpdateTag();
BlockPos blockPos = blockEntity.getBlockPos();
int i = SectionPos.sectionRelative(blockPos.getX()) << 4 | SectionPos.sectionRelative(blockPos.getZ());

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cbb6a06265ebbdcc1210dec1c50a4384d51f6b5e..34f5919448a408e7f4c72299fe72d8daabe34402 100644
index 0ac21fc03b26766724c14bf9275a72e2fe6f9ada..a45f7b96fb3afc9ebe1354d9c61c4a66a67fae69 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -796,6 +796,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -712,6 +712,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void baseTick() {
this.level().getProfiler().push("entityBaseTick");

Datei anzeigen

@ -7,10 +7,10 @@ There are no plans to support creating worlds while worlds are
being ticked themselvess.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d8747518678596586dccb636d8e9b805260e75a7..42f566c9155b70e04d457eb05934d678a92fcdb1 100644
index 624533bd0acea1a444fbd2b396528f8946cf5b2f..ff70a2d03ffb85b64829e15bfdfd7a2f35dc9323 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -309,6 +309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -304,6 +304,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
@ -18,7 +18,7 @@ index d8747518678596586dccb636d8e9b805260e75a7..42f566c9155b70e04d457eb05934d678
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1482,7 +1483,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1474,7 +1475,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getFunctions().tick();
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
this.profiler.popPush("levels");
@ -27,7 +27,7 @@ index d8747518678596586dccb636d8e9b805260e75a7..42f566c9155b70e04d457eb05934d678
// CraftBukkit start
// Run tasks that are waiting on processing
@@ -1514,6 +1515,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1506,6 +1507,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@ -36,7 +36,7 @@ index d8747518678596586dccb636d8e9b805260e75a7..42f566c9155b70e04d457eb05934d678
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
@@ -1560,6 +1563,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1552,6 +1555,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
@ -45,10 +45,10 @@ index d8747518678596586dccb636d8e9b805260e75a7..42f566c9155b70e04d457eb05934d678
this.profiler.popPush("connection");
MinecraftTimings.connectionTimer.startTiming(); // Spigot
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3468fb9e062a3ff0c2229cb75da45955a3d8761c..0a980eb63e6116f91322fd8bf94db7c5dae7b79a 100644
index 6e5d942ec82a5b34c5047c978ecbff176cb8c849..17eaf05dbf0542f7867e92421148cf4edf47bd80 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -874,6 +874,11 @@ public final class CraftServer implements Server {
@@ -877,6 +877,11 @@ public final class CraftServer implements Server {
return new ArrayList<World>(this.worlds.values());
}
@ -60,7 +60,7 @@ index 3468fb9e062a3ff0c2229cb75da45955a3d8761c..0a980eb63e6116f91322fd8bf94db7c5
public DedicatedPlayerList getHandle() {
return this.playerList;
}
@@ -1133,6 +1138,7 @@ public final class CraftServer implements Server {
@@ -1136,6 +1141,7 @@ public final class CraftServer implements Server {
@Override
public World createWorld(WorldCreator creator) {
Preconditions.checkState(this.console.getAllLevels().iterator().hasNext(), "Cannot create additional worlds on STARTUP");
@ -68,7 +68,7 @@ index 3468fb9e062a3ff0c2229cb75da45955a3d8761c..0a980eb63e6116f91322fd8bf94db7c5
Preconditions.checkArgument(creator != null, "WorldCreator cannot be null");
String name = creator.name();
@@ -1272,6 +1278,7 @@ public final class CraftServer implements Server {
@@ -1275,6 +1281,7 @@ public final class CraftServer implements Server {
@Override
public boolean unloadWorld(World world, boolean save) {

Datei anzeigen

@ -2008,10 +2008,10 @@ index 0000000000000000000000000000000000000000..33cd90c30c22200a4e1ae64f40a0bf78
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 67e096207b08d2ba13ebc1b92ac94ed2e170f896..653c9c41ab7c5cd332565436564396d18f26c17c 100644
index fddb0f386614cb6802295861088c1f223ba9b417..0a57c11f1b9811e4fb980268bc561df4290494cf 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -222,6 +222,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public final UUID uuid;
public boolean hasPhysicsEvent = true; // Paper
public boolean hasEntityMoveEvent = false; // Paper
@ -2019,7 +2019,7 @@ index 67e096207b08d2ba13ebc1b92ac94ed2e170f896..653c9c41ab7c5cd332565436564396d1
public static Throwable getAddToWorldStackTrace(Entity entity) {
final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date());
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr);
@@ -2636,6 +2637,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2263,6 +2264,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
return this.randomSequences;
}
@ -2034,13 +2034,13 @@ index 67e096207b08d2ba13ebc1b92ac94ed2e170f896..653c9c41ab7c5cd332565436564396d1
EntityCallbacks() {}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index fb2e1d6954d244a82c70730241046efad927fc14..af7ffeb70ea696e03d3b8188ed167aa4755e308d 100644
index 6486ea4efcedb1008dd9aac87c2541e5997561f2..7d39cdfec62884a8ee98af3ca71aa3c9908cc3d8 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1541,4 +1541,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return ret;
@@ -1453,4 +1453,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private ExplosionInteraction() {}
}
// Paper end
+
+ // Paper start - optimize redstone (Alternate Current)
+ public alternate.current.wire.WireHandler getWireHandler() {
@ -2054,7 +2054,7 @@ index fb2e1d6954d244a82c70730241046efad927fc14..af7ffeb70ea696e03d3b8188ed167aa4
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
index 1926daed1749e3481861f85f57612fe74450191b..70544dac18381ab3fa8ddfa7d276a4ef03f9b191 100644
index a0ae3635ae8c3fd3ac17dd9fa614ec84c7b1b0ca..2b054439b7a763d5a3fbb5dbfe197cb9a9a3525c 100644
--- a/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/RedStoneWireBlock.java
@@ -252,7 +252,7 @@ public class RedStoneWireBlock extends Block {

Datei anzeigen

@ -18,10 +18,10 @@ index 02abc5f387d781094bd2f39233444add3a470be1..ece82743df21f0b776382821ad75dee9
if (bl) {
int j = this.angerByUuid.removeInt(entity.getUUID());
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 64d3467322e6db1fc223ded9d4d1b26bc628b4e1..97b763431bc5015448ee7a26a340635a932c950b 100644
index 2d9ceee41f7b0bd57e1bad26169c506b274019b9..b2bc3a832c310448046ccde37a04918aa6d63197 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -486,6 +486,15 @@ public class Warden extends Monster implements VibrationSystem {
@@ -487,6 +487,15 @@ public class Warden extends Monster implements VibrationSystem {
@VisibleForTesting
public void increaseAngerAt(@Nullable Entity entity, int amount, boolean listening) {
if (!this.isNoAi() && this.canTargetEntity(entity)) {

Datei anzeigen

@ -11,23 +11,23 @@ distance trigger. This adds a config option to ignore that
and use the exact dimension key of the worlds involved.
diff --git a/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java b/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java
index 97b6f2ae67edd37483a27a7e8678d9d78508d990..13078ac512fddc8009114c1c3bec8f67213c4e74 100644
index d4a673a9fb604876c554f955ed13ad31a2adb217..e75b3df4db9cb618aef4837acb8cde92ed5a4b01 100644
--- a/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java
+++ b/src/main/java/net/minecraft/advancements/critereon/LocationPredicate.java
@@ -72,7 +72,7 @@ public class LocationPredicate {
@@ -30,7 +30,7 @@ public record LocationPredicate(Optional<LocationPredicate.PositionPredicate> po
public boolean matches(ServerLevel world, double x, double y, double z) {
if (this.position.isPresent() && !this.position.get().matches(x, y, z)) {
return false;
} else if (!this.z.matches(z)) {
return false;
- } else if (this.dimension != null && this.dimension != world.dimension()) {
+ } else if (this.dimension != null && this.dimension != (io.papermc.paper.configuration.GlobalConfiguration.get().misc.strictAdvancementDimensionCheck ? world.dimension() : org.bukkit.craftbukkit.util.CraftDimensionUtil.getMainDimensionKey(world))) { // Paper
- } else if (this.dimension.isPresent() && this.dimension.get() != world.dimension()) {
+ } else if (this.dimension.isPresent() && this.dimension.get() != (io.papermc.paper.configuration.GlobalConfiguration.get().misc.strictAdvancementDimensionCheck ? world.dimension() : org.bukkit.craftbukkit.util.CraftDimensionUtil.getMainDimensionKey(world))) { // Paper
return false;
} else {
BlockPos blockPos = BlockPos.containing(x, y, z);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a8732fe53dc0d6d5961c5e92e3ce5b500a75bcd7..02eacfb09ce437d5bbb38c5f0e71d7b78793dedc 100644
index 68658d9c204c5e720e81b58d0ee68003ab1030c2..545e5ef99560291210310d69e2572b40f25c605b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1315,6 +1315,12 @@ public class ServerPlayer extends Player {
@@ -1273,6 +1273,12 @@ public class ServerPlayer extends Player {
ResourceKey<Level> maindimensionkey = CraftDimensionUtil.getMainDimensionKey(origin);
ResourceKey<Level> maindimensionkey1 = CraftDimensionUtil.getMainDimensionKey(this.level());

Datei anzeigen

@ -53,14 +53,15 @@ index 6fbf1eab2ea818a0dd0adde0c9247a2d95aac2e0..311808903b42a03b28bad8c75223f95a
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index d5861dfa771c4eb217e082e3c832c3a6c603710d..80026dcdb66cc88a080b33ef290a6a7fb7bcbbaa 100644
index 629178347039893fb9de710810fe8112499bb91c..0bb9cbdceaca055860e7a2a887426c6ba3194b3e 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -273,5 +273,17 @@ public class DummyGeneratorAccess implements WorldGenLevel {
@Override
public <T> void getEntitiesByClass(Class<? extends T> clazz, Entity except, AABB box, List<? super T> into, Predicate<? super T> predicate) {}
@@ -258,4 +258,18 @@ public class DummyGeneratorAccess implements WorldGenLevel {
public boolean destroyBlock(BlockPos pos, boolean drop, Entity breakingEntity, int maxUpdateDepth) {
return false; // SPIGOT-6515
}
+
+ // Paper start
+ @Override
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay) {
+ }
@ -72,5 +73,5 @@ index d5861dfa771c4eb217e082e3c832c3a6c603710d..80026dcdb66cc88a080b33ef290a6a7f
+ @Override
+ public void scheduleTick(BlockPos pos, Fluid fluid, int delay, net.minecraft.world.ticks.TickPriority priority) {
+ }
// Paper end
+ // Paper end
}