More more more more more more more more more more more patches

This commit is contained in:
Nassim Jahnke 2022-06-08 15:36:56 +02:00
parent beab8a32c1
commit 55d7f562b8
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
45 changed files with 160 additions and 196 deletions

View File

@ -12,10 +12,10 @@ already-existing field on AbstractArrow for tracking entities hit by
piercing arrows to avoid duplicate damage being applied.
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 3d3dcb47720055f550d17d1f106a2c0e59de2919..53d0024daf6963ac4dab575666b0d6a74a39a958 100644
index 0d1458152b7ef8227b601d287b53989059468dce..3a9ecb0b46d541a1dec551d6159414ad253e96ce 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -299,6 +299,19 @@ public abstract class AbstractArrow extends Projectile {
@@ -300,6 +300,19 @@ public abstract class AbstractArrow extends Projectile {
}
}

View File

@ -12,10 +12,10 @@ Subject: [PATCH] Fix save problems on shutdown
processed so that the main process queue can be drained
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 583d2deffa819c1aa25e1937a7f709d0d6bab294..c8d56947305c981a3268ce4ae3e975db350ceff2 100644
index 33953cc7afc2616577b768a23a7d4ce0230cf480..869e0b6c8588d751a9b38b713119f888778d3387 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -996,6 +996,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -953,6 +953,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@ -29,7 +29,7 @@ index 583d2deffa819c1aa25e1937a7f709d0d6bab294..c8d56947305c981a3268ce4ae3e975db
while (this.levels.values().stream().anyMatch((worldserver1) -> {
return worldserver1.getChunkSource().chunkMap.hasWork();
})) {
@@ -1008,9 +1015,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -965,9 +972,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.getChunkSource().tick(() -> {
return true;
}, false);
@ -42,7 +42,7 @@ index 583d2deffa819c1aa25e1937a7f709d0d6bab294..c8d56947305c981a3268ce4ae3e975db
}
this.saveAllChunks(false, true, false);
@@ -1306,6 +1315,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1264,6 +1273,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private boolean haveTime() {
@ -55,10 +55,10 @@ index 583d2deffa819c1aa25e1937a7f709d0d6bab294..c8d56947305c981a3268ce4ae3e975db
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
return this.forceTicks || this.runningTask() || Util.getMillis() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTime : this.nextTickTime);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 00e6f60e13f50c727530de37ab9692ad3683c11b..50fd3419deb668dda64b1056f03fb66da55e6960 100644
index fb5c42755703ade855ab727c55c8d72456b59141..b4daa19c5bc3c0555c393f17d6f5da7eb7d7bc35 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1258,7 +1258,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1272,7 +1272,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}

View File

@ -164,7 +164,7 @@ index b08739dd1ffd041f0885af6c1f57dca9027763b6..c1594f62c06a49ba2d0c2c6e6befcda7
public net.minecraft.world.entity.projectile.ThrownPotion getHandle() {
return (net.minecraft.world.entity.projectile.ThrownPotion) entity;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 14da2997b5fff4434b1fe8d5a1b3109dde143740..226d9ac01c601fc8954a88bea93a521cdce79eda 100644
index 04aabec62f0c89e70681af3846d73659f4c81360..c7c5f18cde7a4ad4dd821e452de3068c2e2187d1 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -274,12 +274,20 @@ public final class CraftItemStack extends ItemStack {

View File

@ -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 b42d4224d7f5c5de7e9fa8d6278af10f84d81245..3bfd0fc8e2d068657183e4ebd4f632c94c3908b2 100644
index 56208159d46a25de26ab6ce4b65eae27c93297e7..1bdded13ce729f7f9532660ff952677582e08f67 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -517,6 +517,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -543,6 +543,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
} else {
Entity entity = this.player.getRootVehicle();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement getComputedBiome API
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 6e827ed6212915b187e4c610acf6c34037c9c994..81a2a4f9ca0cb94cfd0680f57be4157dfb2fff57 100644
index 5628940cd3c3566c5db2beda506d4f20b6e3cbae..6445c2e4c97860e1c98f5263188d309cf55936f0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -204,6 +204,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -211,6 +211,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
return CraftBlock.biomeBaseToBiome(this.getHandle().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2));
}

View File

@ -8,10 +8,10 @@ also adds 'Paper.debugInvalidSkullProfiles' system property which can be
set to 'true' for extra debug info (trace of updateGameprofile caller).
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
index 118472b83a21a250f398c088c91ac4560c19c749..5840cf6d22029cf1599ae9460b4498d5c8c5ae7d 100644
index c1703a67a615f563dab4fb442a6df7082229af57..4613a343d3ca5f76992f2bd1e55bdc0833abcab6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -142,13 +142,28 @@ public class SkullBlockEntity extends BlockEntity {
@@ -143,13 +143,28 @@ public class SkullBlockEntity extends BlockEntity {
updateGameprofile(this.owner, (owner) -> {
this.owner = owner;
this.setChanged();
@ -40,7 +40,7 @@ index 118472b83a21a250f398c088c91ac4560c19c749..5840cf6d22029cf1599ae9460b4498d5
Util.ifElse(profile, (profilex) -> {
Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
if (property == null) {
@@ -165,6 +180,20 @@ public class SkullBlockEntity extends BlockEntity {
@@ -166,6 +181,20 @@ public class SkullBlockEntity extends BlockEntity {
callback.accept(owner);
});
});

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 697d6d8387d1451ac3158d35bbaa00229dcfcbc6..d5daabdcd5b5f50d1ada52b420517a901aa8fa41 100644
index 4a8ac558d308c4e3bc63cdd8d7071a3f9ff3aa81..4b60a9b78e410695310926e1fd319ce7d9eb5e61 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -370,6 +370,21 @@ public final class CraftItemFactory implements ItemFactory {
@@ -376,6 +376,21 @@ public final class CraftItemFactory implements ItemFactory {
}
// Paper start

View File

@ -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 6333688c49b8c9dd2476634ad3968b468b3d5147..12c1728084d5f1af2a0c242b271939198c7fbea5 100644
index 1b4fcbbbbb9b006814bd4a43f1c0001b59c759ef..678a611feec69125df9be047652fe48c0cb11a4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1303,7 +1303,7 @@ public final class CraftServer implements Server {
@@ -1279,7 +1279,7 @@ public final class CraftServer implements Server {
try {
if (save) {

View File

@ -13,10 +13,10 @@ 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 a24f605bd033f249a374e83ba094880106260eee..1e656438d9ee89b97c660f3b3ec671be6546c6b7 100644
index 05ff7bcc79e617904903cf082f6687d24e587547..f000c822ed4563b5b840936852bc7d8e030763e3 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -266,6 +266,7 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -273,6 +273,7 @@ public class WorldGenRegion implements WorldGenLevel {
}
}
@ -24,7 +24,7 @@ index a24f605bd033f249a374e83ba094880106260eee..1e656438d9ee89b97c660f3b3ec671be
@Override
public boolean ensureCanWrite(BlockPos pos) {
int i = SectionPos.blockToSectionCoord(pos.getX());
@@ -285,7 +286,15 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -292,7 +293,15 @@ public class WorldGenRegion implements WorldGenLevel {
return true;
} else {

View File

@ -5,19 +5,20 @@ Subject: [PATCH] Add TameableDeathMessageEvent
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index 7e67c47434d1f29cc87f3af926f3efc920c87829..de95bfd6e5a97257cb4915ce0a7a704784f110df 100644
index 59878c68d9e25a6f4ece26566d8e2b5108536ae8..acc25fb309568864dd7b53ad6a7a3ee6ff18e82a 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -209,7 +209,11 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@@ -208,7 +208,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
@Override
public void die(DamageSource source) {
public void die(DamageSource damageSource) {
if (!this.level.isClientSide && this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
- this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), Util.NIL_UUID);
- this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage());
+ // Paper start - TameableDeathMessageEvent
+ io.papermc.paper.event.entity.TameableDeathMessageEvent event = new io.papermc.paper.event.entity.TameableDeathMessageEvent((org.bukkit.entity.Tameable) getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getCombatTracker().getDeathMessage()));
+ if (event.callEvent()) {
+ this.getOwner().sendMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()), Util.NIL_UUID);
+ } // Paper end - TameableDeathMessageEvent
+ this.getOwner().sendSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.deathMessage()));
+ }
+ // Paper end - TameableDeathMessageEvent
}
super.die(source);
super.die(damageSource);

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix new block data for EntityChangeBlockEvent when sheep eats
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
index 14ed3f0524773e22a792efb8b41a9217bad50f27..99044ebe2c37ce951566e3463ddbfaeec46d2b3c 100644
index cc44e975aef8e9dabfbc740dd5a0db3a55c5831e..80aa539f7c6a6ee44338de084cdcdf5fb4ef996a 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
@@ -81,7 +81,7 @@ public class EatBlockGoal extends Goal {
@@ -79,7 +79,7 @@ public class EatBlockGoal extends Goal {
if (this.level.getBlockState(blockposition1).is(Blocks.GRASS_BLOCK)) {
// CraftBukkit

View File

@ -5,16 +5,16 @@ 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 5e10a22c19ca1d5208dcfbe93436f5fdc3172c69..a6edf5117d4ae03d8294e7bb74dd2d77048895a5 100644
index 1f8282ab903293a4221bce48b5d4d5f4284fe781..49a2a99bc0aaedb27524c64db5ce3907bf55cc28 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -851,12 +851,14 @@ public class ServerPlayer extends Player {
@@ -859,12 +859,14 @@ public class ServerPlayer extends Player {
}
}
}
+ if (this.shouldDropLoot() && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { // Paper - preserve this check from vanilla
// SPIGOT-5071: manually add player loot tables (SPIGOT-5195 - ignores keepInventory rule)
this.dropFromLootTable(source, this.lastHurtByPlayerTime > 0);
this.dropFromLootTable(damageSource, this.lastHurtByPlayerTime > 0);
for (org.bukkit.inventory.ItemStack item : this.drops) {
loot.add(item);
}

View File

@ -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 ede2f5f00b59893cca354e5626938360347b0a36..2e5cf8575e7a30d2199c77e70d82732b74ae70a7 100644
index fc03e5ddc126a57d4ca9f158b7d0f67401e1ca4b..7deb28159c822b2a05df228028278776e5bea4d5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2584,6 +2584,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2632,6 +2632,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
protected boolean addPassenger(Entity entity) { // CraftBukkit

View File

@ -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 2e5cf8575e7a30d2199c77e70d82732b74ae70a7..86a2eddf344503cbe75a5243a114f6fe1578185f 100644
index 7deb28159c822b2a05df228028278776e5bea4d5..f8652e17a1d9779b6ca39aa251b15f49e3b2f6e1 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4085,11 +4085,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4136,11 +4136,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 2e5cf8575e7a30d2199c77e70d82732b74ae70a7..86a2eddf344503cbe75a5243a114f6fe
+ }
+ // Paper end - block invalid positions
// Paper end
// Paper start - fix MC-4
if (this instanceof ItemEntity) {
if (this.position.x != x || this.position.y != y || this.position.z != z) {
synchronized (this.posLock) { // Paper

View File

@ -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 1eb76c456790b81b657090377dd5ea547898f9a5..8c4db2f0e5158872879da52a96bc592145e52e13 100644
index 21d26be5edbc05ac78c2f4a092594d772d98c982..69c6a0c64ef5371dc57da1fdb60a8ac295bf327a 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
@@ -100,6 +100,10 @@ public class EnderDragon extends Mob implements Enemy {
@@ -99,6 +99,10 @@ public class EnderDragon extends Mob implements Enemy {
private final int[] nodeAdjacency = new int[24];
private final BinaryHeap openSet = new BinaryHeap();
private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
@ -19,7 +19,7 @@ index 1eb76c456790b81b657090377dd5ea547898f9a5..8c4db2f0e5158872879da52a96bc5921
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
super(EntityType.ENDER_DRAGON, world);
@@ -120,6 +124,19 @@ public class EnderDragon extends Mob implements Enemy {
@@ -119,6 +123,19 @@ public class EnderDragon extends Mob implements Enemy {
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D);
}
@ -39,7 +39,7 @@ index 1eb76c456790b81b657090377dd5ea547898f9a5..8c4db2f0e5158872879da52a96bc5921
@Override
public boolean isFlapping() {
float f = Mth.cos(this.flapTime * 6.2831855F);
@@ -947,7 +964,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -944,7 +961,7 @@ public class EnderDragon extends Mob implements Enemy {
d0 = segment2[1] - segment1[1];
}
} else {
@ -48,7 +48,7 @@ index 1eb76c456790b81b657090377dd5ea547898f9a5..8c4db2f0e5158872879da52a96bc5921
double d1 = Math.max(Math.sqrt(blockposition.distToCenterSqr(this.position())) / 4.0D, 1.0D);
d0 = (double) segmentOffset / d1;
@@ -974,7 +991,7 @@ public class EnderDragon extends Mob implements Enemy {
@@ -971,7 +988,7 @@ public class EnderDragon extends Mob implements Enemy {
vec3d = this.getViewVector(tickDelta);
}
} else {
@ -97,7 +97,7 @@ index fdfdd42a30d752b11d18f2cefe84c1e9ddec41a2..5fca7c4e1d1d9da6f29ad70f1b5703c7
int j;
if (player != null) {
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
index c3eb04fa31a8e767c737091c2e1a3f858589e16b..1ee3ba970e33e20e5c72bc2f4153889b60c0e77e 100644
index ed29ba6c5c4f1380847564f07b5523cce77ab865..2948d58f9f90b353b86eb43f932ab0574b3415f7 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonLandingPhase.java
@@ -39,7 +39,7 @@ public class DragonLandingPhase extends AbstractDragonPhaseInstance {

View File

@ -9,7 +9,7 @@ is not a WorldGenRegion, we can bypass the deadlock entirely.
See https://bugs.mojang.com/browse/MC-246262
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
index c5827e4d870a0bba483649d54cae23072eab2b18..332d080ad722a0252d2ae8eb83f7697c1323b4ce 100644
index fcd6b2a438ffc2f039036a45ff88ba46017981f7..b667663ea0dbac0bc59cee9090e9769770934b06 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
@@ -265,7 +265,11 @@ public class StructureTemplate {

View File

@ -5,12 +5,12 @@ 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 dd9446abb8b701b29dbb770c4d8e80f9ba5441cd..8f69073c4aec074a17791bceb91e7df608558c63 100644
index 5333188e45e47c12c8c56939b87603750a45af57..881d899ff551bc2c2c6fc7d58107a2aee7d86f2a 100644
--- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
@@ -85,7 +85,7 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock {
public boolean growMushroom(ServerLevel world, BlockPos pos, BlockState state, Random random) {
public boolean growMushroom(ServerLevel world, BlockPos pos, BlockState state, RandomSource random) {
world.removeBlock(pos, false);
- SaplingBlock.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit
+ SaplingBlock.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.RED_MUSHROOM; // CraftBukkit // Paper

View File

@ -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 3bfd0fc8e2d068657183e4ebd4f632c94c3908b2..4e3ee857b7c328d857aee8ff066758b19ef81da2 100644
index 1bdded13ce729f7f9532660ff952677582e08f67..5b084b1dc4c52dec3ec6fbc98ccc8e36af89e26b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2995,7 +2995,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3173,7 +3173,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
if (!itemstack.isEmpty() && nbttagcompound != null && nbttagcompound.contains("x") && nbttagcompound.contains("y") && nbttagcompound.contains("z") && this.player.getBukkitEntity().hasPermission("minecraft.nbt.copy")) { // Spigot
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);

View File

@ -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 2a8c3082d07244f8f00d644e01e875b81264324d..624946f48f0811c94d05174f28d0b1fc6d5e6a00 100644
index 9110288a30c02e69eb5978f433fd7098ae7a955a..5134af3c96b8df8534db543971c1d574eec31f55 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1414,7 +1414,7 @@ public abstract class PlayerList {
@@ -1446,7 +1446,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

View File

@ -7,12 +7,12 @@ 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 b6e78e8145ea78d532f22707c7525829c5778076..2e819d32915941bd77034ce599eb787610a6d666 100644
index e82bf53e1d31a5dd81713fe858d1e5d7b8f8c60d..012aae6ad413e7520d3ac9fe2a4aa1e0594f5dfd 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -325,6 +325,11 @@ public class Slime extends Mob implements Enemy {
@@ -320,6 +320,11 @@ public class Slime extends Mob implements Enemy {
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) {
public static boolean checkSlimeSpawnRules(EntityType<Slime> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
if (world.getDifficulty() != Difficulty.PEACEFUL) {
+ // Paper start - fix slime spawners; Fixes MC-50647
+ if (spawnReason == MobSpawnType.SPAWNER) {

View File

@ -5,10 +5,10 @@ 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 e28e09aae1d95d9bed50a137e999e6d457e62478..257c94f7c1cb00c9a91ab82e311dfd8eca29c538 100644
index 1236c3ce776ad6bea9a3a5156e89b0e9c0b9afb5..9ad11f56daff4aa575c2079e54d0239dbab22d8d 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -319,7 +319,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -311,7 +311,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
//DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\"", s); // Paper moved to after init
if (dedicatedserverproperties.announcePlayerAchievements != null) {
@ -18,10 +18,10 @@ index e28e09aae1d95d9bed50a137e999e6d457e62478..257c94f7c1cb00c9a91ab82e311dfd8e
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 4e3ee857b7c328d857aee8ff066758b19ef81da2..1169149f0316e683ba5ac3b1e95a8a00a3c2dafa 100644
index 5b084b1dc4c52dec3ec6fbc98ccc8e36af89e26b..68ac242d2012ea04ae53280b401e5254c597f83d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2604,7 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -2782,7 +2782,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) {
this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper
@ -31,7 +31,7 @@ index 4e3ee857b7c328d857aee8ff066758b19ef81da2..1169149f0316e683ba5ac3b1e95a8a00
}
break;
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d0afe0a31 100644
index 3c93bfeb94168f832904a8462ae23b06e81e080d..468c635d31cfa8051666bbefce8df4b448e9ed93 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 {
@ -52,7 +52,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
@@ -156,13 +156,13 @@ public class GameRules {
@@ -157,13 +157,13 @@ public class GameRules {
((GameRules.Type<T>) type).callVisitor(consumer, (GameRules.Key<T>) key); // CraftBukkit - decompile error
}
@ -68,7 +68,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
T t0 = rules.getRule(key);
this.getRule(key).setFrom(t0, server);
@@ -230,10 +230,10 @@ public class GameRules {
@@ -231,10 +231,10 @@ public class GameRules {
private final Supplier<ArgumentType<?>> argument;
private final Function<GameRules.Type<T>, T> constructor;
@ -81,7 +81,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
this.argument = argumentType;
this.constructor = ruleFactory;
this.callback = changeCallback;
@@ -265,10 +265,10 @@ public class GameRules {
@@ -266,10 +266,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 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
if (server != null) {
this.type.callback.accept(server, this.getSelf());
}
@@ -289,7 +289,7 @@ public class GameRules {
@@ -290,7 +290,7 @@ public class GameRules {
protected abstract T copy();
@ -103,7 +103,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
}
public interface GameRuleTypeVisitor {
@@ -305,7 +305,7 @@ public class GameRules {
@@ -306,7 +306,7 @@ public class GameRules {
private boolean value;
@ -112,7 +112,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
return new GameRules.Type<>(BoolArgumentType::bool, (gamerules_gameruledefinition) -> {
return new GameRules.BooleanValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitBoolean);
@@ -333,7 +333,7 @@ public class GameRules {
@@ -334,7 +334,7 @@ public class GameRules {
return this.value;
}
@ -121,7 +121,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
this.value = value;
this.onChanged(server);
}
@@ -363,7 +363,7 @@ public class GameRules {
@@ -364,7 +364,7 @@ public class GameRules {
return new GameRules.BooleanValue(this.type, this.value);
}
@ -130,7 +130,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
this.value = rule.value;
this.onChanged(server);
}
@@ -373,7 +373,7 @@ public class GameRules {
@@ -374,7 +374,7 @@ public class GameRules {
private int value;
@ -139,7 +139,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
return new GameRules.Type<>(IntegerArgumentType::integer, (gamerules_gameruledefinition) -> {
return new GameRules.IntegerValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitInteger);
@@ -401,7 +401,7 @@ public class GameRules {
@@ -402,7 +402,7 @@ public class GameRules {
return this.value;
}
@ -148,7 +148,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
this.value = value;
this.onChanged(server);
}
@@ -452,7 +452,7 @@ public class GameRules {
@@ -453,7 +453,7 @@ public class GameRules {
return new GameRules.IntegerValue(this.type, this.value);
}
@ -158,7 +158,7 @@ index 798afc145c54306fcf0838d8daef2bdf17763da9..22feab6477bad023c2d6cc9ac99d392d
this.onChanged(server);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index f5a6250350a5f0b6236c1fe0f149b1190de34880..43244a479a112786539a905a22cb12e3cf55b2dd 100644
index 105869020cd5b056b984c57f7196e9256e07b83e..7dc99902f8b199a74356c0510397000253c26b6a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1915,7 +1915,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View File

@ -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 dc4639f905fb71435daf29c61f64621a3e2cc533..6837c965592d4584cfc958a1008b98791a0fc780 100644
index acd80da6e249f83ccd96c3bd24c3b75d9084fc91..2772eafc6ad0b7376a4d8b3e0342634c3cdb223e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -551,10 +551,11 @@ public final class ItemStack {
@@ -565,10 +565,11 @@ public final class ItemStack {
}
}

View File

@ -5,10 +5,10 @@ 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 12c1728084d5f1af2a0c242b271939198c7fbea5..c3f15ee7505e82418d9659ba3cee4f807546e0db 100644
index 678a611feec69125df9be047652fe48c0cb11a4d..88eac456dbcd53484109692d9aa898e174bff145 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1262,6 +1262,7 @@ public final class CraftServer implements Server {
@@ -1238,6 +1238,7 @@ public final class CraftServer implements Server {
internal.setSpawnSettings(true, true);
// Paper - move up

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix NPE for BlockDataMeta#getBlockData
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 1fe46049cc33c24db04fbfcde36ab275c03177bf..5607dc10dc1c9d2dbf4e3007890e5e89a175605e 100644
index bf3d6c613d905554d3faa73765a16774f43c6546..d22d1b485e4ac25c1d22c6e299f93503d94e897d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1093,7 +1093,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {

View File

@ -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 891199d02539fa46454cd0aa7c133637e5dc8235..415b6c2bbf11c5a2ac75d18f52b93f80b9e14fe4 100644
index 4d907501dfe7f1a4641542291f4abdd05cb1644c..7572f6d03d315ab4639be211c5ffc7682b326362 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -458,12 +458,16 @@ public class ServerPlayerGameMode {
@@ -419,12 +419,16 @@ public class ServerPlayerGameMode {
block.destroy(this.level, pos, iblockdata);
}
@ -25,7 +25,7 @@ index 891199d02539fa46454cd0aa7c133637e5dc8235..415b6c2bbf11c5a2ac75d18f52b93f80
itemstack.mineBlock(this.level, iblockdata, pos, this.player);
if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
@@ -484,6 +488,13 @@ public class ServerPlayerGameMode {
@@ -445,6 +449,13 @@ public class ServerPlayerGameMode {
if (flag && event != null) {
iblockdata.getBlock().popExperience(this.level, pos, event.getExpToDrop(), this.player); // Paper
}
@ -40,7 +40,7 @@ index 891199d02539fa46454cd0aa7c133637e5dc8235..415b6c2bbf11c5a2ac75d18f52b93f80
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 e9974415e8f016f50a93a5eea117afe25a6b735d..a510ec076ff91bb5e06ebfca0b00e6f82a92e8cd 100644
index 1aaab26c59bb9255955aff34ea1d057b88152768..0e61c47307b9e06eddc43a3aa5f8ae9da24acd08 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 {

View File

@ -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 e4eac546836b73b5e9c8fd68ca0d32c01148313e..9f5180271ca8a790aa52763ac46d31b905c9d477 100644
index 5ad968a2f1add27da0d6a858e683d5d771128092..4e42bcb48c75c816e89e652c898242a9bd8c9d5a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -432,6 +432,13 @@ public class Cat extends TamableAnimal {
@@ -399,6 +399,13 @@ public class Cat extends TamableAnimal {
DyeColor enumcolor = ((DyeItem) item).getDyeColor();
if (enumcolor != this.getCollarColor()) {
@ -23,10 +23,10 @@ index e4eac546836b73b5e9c8fd68ca0d32c01148313e..9f5180271ca8a790aa52763ac46d31b9
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 aaf7096835bab3a42d617553dd83e048e4a83766..249ef89342d2811614507090b79250adf78e33ce 100644
index 34dadacb8238896b799716875ea5d0e924c323e8..45c3cec839a7c23903dedf6e3e004305da2adceb 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -393,6 +393,13 @@ public class Wolf extends TamableAnimal implements NeutralMob {
@@ -392,6 +392,13 @@ public class Wolf extends TamableAnimal implements NeutralMob {
DyeColor enumcolor = ((DyeItem) item).getDyeColor();
if (enumcolor != this.getCollarColor()) {

View File

@ -7,7 +7,7 @@ Also don't fire level events or game events if stalactite
drip is cancelled
diff --git a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
index dbae4f3b56d0290c6d28b9beaaa3b459754d43e3..18f4c422e8277b2f673202a598d81eabf5eea712 100644
index 53089c3a36bf2c0ec1bc9b436884deff0c30f028..46846ac9981e447fc6886aecf82563378a4f5548 100644
--- a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java
@@ -36,10 +36,18 @@ public class CauldronBlock extends AbstractCauldronBlock {
@ -20,7 +20,7 @@ index dbae4f3b56d0290c6d28b9beaaa3b459754d43e3..18f4c422e8277b2f673202a598d81eab
+ return;
+ }
+ // Paper end
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos);
world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos);
} else if (precipitation == Biome.Precipitation.SNOW) {
- world.setBlockAndUpdate(pos, Blocks.POWDER_SNOW_CAULDRON.defaultBlockState());
+ // Paper start - call event for initial fill
@ -28,36 +28,36 @@ index dbae4f3b56d0290c6d28b9beaaa3b459754d43e3..18f4c422e8277b2f673202a598d81eab
+ return;
+ }
+ // Paper end
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos);
world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, pos);
}
@@ -54,11 +62,19 @@ public class CauldronBlock extends AbstractCauldronBlock {
@Override
protected void receiveStalactiteDrip(BlockState state, Level world, BlockPos pos, Fluid fluid) {
@@ -57,11 +65,19 @@ public class CauldronBlock extends AbstractCauldronBlock {
if (fluid == Fluids.WATER) {
- LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState();
- LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
+ // Paper start - don't send level event or game event if cancelled
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit
+ return;
+ }
+ // Paper end
world.levelEvent(1047, pos, 0);
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos);
} else if (fluid == Fluids.LAVA) {
- LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
iblockdata1 = Blocks.LAVA_CAULDRON.defaultBlockState();
- LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
+ // Paper start - don't send level event or game event if cancelled
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit
+ if (!LayeredCauldronBlock.changeLevel(state, world, pos, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) { // CraftBukkit
+ return;
+ }
+ // Paper end
world.levelEvent(1046, pos, 0);
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, pos);
}
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
index e6ea389350cf391a87c4c388ed9a6325bdceb90d..c21b0e7265488f26179810ddb6a8a6992a2a4807 100644
index 24d2da792bc498adf4251555a538df4cafe2e827..1a7cb12fd3f183c00079d679452a01b8df8d2bbb 100644
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -89,7 +89,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -91,7 +91,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
}
// CraftBukkit start

View File

@ -7,10 +7,10 @@ Powder snow cauldrons should turn to water when
extinguishing an entity
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
index c21b0e7265488f26179810ddb6a8a6992a2a4807..95946623bc4673363a008fea7a4b1eeae6e1dfdb 100644
index 1a7cb12fd3f183c00079d679452a01b8df8d2bbb..a223959f766ac41aff7aeff80606f5e7c37ebf49 100644
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -63,7 +63,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -64,7 +64,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start
if (entity.mayInteract(world, pos)) {
@ -19,7 +19,7 @@ index c21b0e7265488f26179810ddb6a8a6992a2a4807..95946623bc4673363a008fea7a4b1eea
return;
}
}
@@ -73,9 +73,15 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
@@ -74,9 +74,15 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
}

View File

@ -8,7 +8,7 @@ noting to ensure to apply the cleanup logic here, and clean up the added
tags
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 6371176fba41218a209ea59b4cafe5b2d4a685fd..d5bcc81a809e3c733c6fc11309bcf0913860edf6 100644
index 517f9c6df4427f21ebac17a298a57e28d53e6fd0..504ee81804f3b55590ee053f50481774524bb9b1 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -72,6 +72,7 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C

View File

@ -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 c17b8c77b1a4d65afaefd9c4b32219d898882410..d6ef140bcc35b10f78f2ec2f10c8a153395fc9df 100644
index f2ac92cdd718d351e0cea7fd1d05008a4b5734b7..32b0603063032677d734a1c173677f544ce7cc5c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3868,6 +3868,7 @@ public abstract class LivingEntity extends Entity {
@@ -3901,6 +3901,7 @@ public abstract class LivingEntity extends Entity {
public void releaseUsingItem() {
if (!this.useItem.isEmpty()) {

View File

@ -22,10 +22,10 @@ index 5f079cf06b0d1505bfb3fda5c326b2d7fd4f0e48..febb35091d32735ae2fe846170bd2c46
}
});
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 50fd3419deb668dda64b1056f03fb66da55e6960..62ec40de8ed8acb293ef21c8d2c624060d51cfe8 100644
index b4daa19c5bc3c0555c393f17d6f5da7eb7d7bc35..31fadaf364bf52018132df5ea721e0303ba5b65a 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2418,6 +2418,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -2483,6 +2483,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void onTickingStart(Entity entity) {

View File

@ -5,10 +5,10 @@ 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 1169149f0316e683ba5ac3b1e95a8a00a3c2dafa..0b7923f67d27549f41c0d398d1b99737f0c8a746 100644
index 68ac242d2012ea04ae53280b401e5254c597f83d..b53876746fcc23e7517da3287fdc58909865eb39 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3170,6 +3170,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@@ -3351,6 +3351,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add support for Proxy Protocol
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 1ac6cf51f2682d5eb14fe19646e79f6617d492dd..fafbebbb5e8c1a381b673f97f1fa210687b52823 100644
index 72e17ac76e5f3ac1283bec2133f76bc197353dd6..d4ff14b9e6028259c27ea9cb2b4be587ebabfb41 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -688,4 +688,9 @@ public class PaperConfig {
@@ -647,4 +647,9 @@ public class PaperConfig {
private static void useDimensionTypeForCustomSpawners() {
useDimensionTypeForCustomSpawners = getBoolean("settings.use-dimension-type-for-custom-spawners", false);
}
@ -19,10 +19,10 @@ index 1ac6cf51f2682d5eb14fe19646e79f6617d492dd..fafbebbb5e8c1a381b673f97f1fa2106
+ }
}
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
index 058fb3696c7ece4a7b6971886b1760b26add733b..98286dd27fc3562ca55ec44cc6e5eb5157269942 100644
index 510a1fc4e315483809035b1e5c28b441f18a7c14..947f7afb1d61ece0b1a51b275b22f21ec2216dde 100644
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
+++ b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
@@ -109,6 +109,12 @@ public class ServerConnectionListener {
@@ -110,6 +110,12 @@ public class ServerConnectionListener {
ServerConnectionListener.LOGGER.info("Paper: Using " + com.velocitypowered.natives.util.Natives.cipher.getLoadedVariant() + " cipher from Velocity.");
// Paper end
@ -35,7 +35,7 @@ index 058fb3696c7ece4a7b6971886b1760b26add733b..98286dd27fc3562ca55ec44cc6e5eb51
this.channels.add(((ServerBootstrap) ((ServerBootstrap) (new ServerBootstrap()).channel(oclass)).childHandler(new ChannelInitializer<Channel>() {
protected void initChannel(Channel channel) {
try {
@@ -122,6 +128,30 @@ public class ServerConnectionListener {
@@ -123,6 +129,30 @@ public class ServerConnectionListener {
int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond();
Object object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Sanitize Sent BlockEntity NBT
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
index 43220caaa331eade5b183f68f09d94542b4bc3db..8c87020e422acfb6b862d9d77e74114770f1b342 100644
index 12d7cb0eb485987d245454fa2d9fef67ea7e9c76..b1e326cf4f7fe447f81b588dcb0eda9a435e59a8 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundBlockEntityDataPacket.java
@@ -17,7 +17,7 @@ public class ClientboundBlockEntityDataPacket implements Packet<ClientGamePacket
@ -18,10 +18,10 @@ index 43220caaa331eade5b183f68f09d94542b4bc3db..8c87020e422acfb6b862d9d77e741147
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 52f68d7611862b0e904305f8a16f04422b2b5b3f..07b64291c3b0390b746433dd42c32534a2b05018 100644
index e902b437ee089907b34ae30c0a6bdf1d42e1e674..88a68a3e176b1cf0b514093b5089a1cba8ad7e06 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData.java
@@ -184,6 +184,7 @@ public class ClientboundLevelChunkPacketData {
@@ -183,6 +183,7 @@ public class ClientboundLevelChunkPacketData {
BlockPos blockPos = blockEntity.getBlockPos();
if (blockEntity instanceof net.minecraft.world.level.block.entity.SkullBlockEntity) { net.minecraft.world.level.block.entity.SkullBlockEntity.sanitizeTileEntityUUID(compoundTag); } // Paper
int i = SectionPos.sectionRelative(blockPos.getX()) << 4 | SectionPos.sectionRelative(blockPos.getZ());

View File

@ -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 86a2eddf344503cbe75a5243a114f6fe1578185f..dfd1f37757af1bd808cc2e2d8bf97123adf638bb 100644
index f8652e17a1d9779b6ca39aa251b15f49e3b2f6e1..e1b7fc9fb342cc03d3447d3638f9376ef89d5543 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -725,6 +725,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -747,6 +747,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void baseTick() {
this.level.getProfiler().push("entityBaseTick");

View File

@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
Date: Thu, 2 Jun 2022 20:35:58 +0200
Subject: [PATCH] Disable component selector resolving in books by default
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index d4ff14b9e6028259c27ea9cb2b4be587ebabfb41..83121be2274a33d4188ff6fe37752432dd4e6b22 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -652,4 +652,9 @@ public class PaperConfig {
private static void useProxyProtocol() {
useProxyProtocol = getBoolean("settings.proxy-protocol", false);
}
+
+ public static boolean resolveSelectorsInBooks;
+ private static void resolveSelectorsInBooks() {
+ resolveSelectorsInBooks = getBoolean("settings.resolve-selectors-in-books", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
index a324df312d9bb87d9e0962f8028d900933e70c07..de72b4abf38782061f5635dd679a20ba66f09cd5 100644
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
@@ -111,7 +111,7 @@ public class WrittenBookItem extends Item {
public static boolean resolveBookComponents(ItemStack book, @Nullable CommandSourceStack commandSource, @Nullable Player player) {
CompoundTag compoundTag = book.getTag();
- if (compoundTag != null && !compoundTag.getBoolean("resolved")) {
+ if (com.destroystokyo.paper.PaperConfig.resolveSelectorsInBooks && compoundTag != null && !compoundTag.getBoolean("resolved")) { // Paper
compoundTag.putBoolean("resolved", true);
if (!makeSureTagIsValid(compoundTag)) {
return false;

View File

@ -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 c8d56947305c981a3268ce4ae3e975db350ceff2..da15a224b8b974e78b9d8d5f514229b3b2a5a63e 100644
index 869e0b6c8588d751a9b38b713119f888778d3387..5a642dc7cd2fed59c3e5b6ff4ac9ea2f11b401da 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -308,6 +308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -294,6 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
@ -18,7 +18,7 @@ index c8d56947305c981a3268ce4ae3e975db350ceff2..da15a224b8b974e78b9d8d5f514229b3
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();
@@ -1567,6 +1568,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1525,6 +1526,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@ -26,7 +26,7 @@ index c8d56947305c981a3268ce4ae3e975db350ceff2..da15a224b8b974e78b9d8d5f514229b3
while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
@@ -1614,6 +1616,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1572,6 +1574,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop();
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
}
@ -35,10 +35,10 @@ index c8d56947305c981a3268ce4ae3e975db350ceff2..da15a224b8b974e78b9d8d5f514229b3
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 c3f15ee7505e82418d9659ba3cee4f807546e0db..8a248e34fce1e04de4460f98b7627df495c66af1 100644
index 88eac456dbcd53484109692d9aa898e174bff145..e161d79ee33a4d1e6bd8182d4e8acefeb4e0ae6d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1135,6 +1135,7 @@ public final class CraftServer implements Server {
@@ -1129,6 +1129,7 @@ public final class CraftServer implements Server {
@Override
public World createWorld(WorldCreator creator) {
Preconditions.checkState(!console.levels.isEmpty(), "Cannot create additional worlds on STARTUP");

View File

@ -1,70 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
Date: Thu, 2 Jun 2022 20:35:58 +0200
Subject: [PATCH] Disable component selector resolving in books by default
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index fafbebbb5e8c1a381b673f97f1fa210687b52823..8379c6313f06ab3eeaf02bad41d8b835d50e093f 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -693,4 +693,9 @@ public class PaperConfig {
private static void useProxyProtocol() {
useProxyProtocol = getBoolean("settings.proxy-protocol", false);
}
+
+ public static boolean resolveSelectorsInBooks;
+ private static void resolveSelectorsInBooks() {
+ resolveSelectorsInBooks = getBoolean("settings.resolve-selectors-in-books", false);
+ }
}
diff --git a/src/main/java/net/minecraft/world/item/WrittenBookItem.java b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
index 0600bfcc3a4f9043324c046b6c0d2b579ab151cb..26a9a15cc630113cd8d2c8287c6b0f1067ce53f0 100644
--- a/src/main/java/net/minecraft/world/item/WrittenBookItem.java
+++ b/src/main/java/net/minecraft/world/item/WrittenBookItem.java
@@ -113,25 +113,42 @@ public class WrittenBookItem extends Item {
public static boolean resolveBookComponents(ItemStack book, @Nullable CommandSourceStack commandSource, @Nullable Player player) {
CompoundTag compoundTag = book.getTag();
- if (compoundTag != null && !compoundTag.getBoolean("resolved")) {
+ if (com.destroystokyo.paper.PaperConfig.resolveSelectorsInBooks && compoundTag != null && !compoundTag.getBoolean("resolved")) { // Paper
compoundTag.putBoolean("resolved", true);
if (!makeSureTagIsValid(compoundTag)) {
return false;
} else {
ListTag listTag = compoundTag.getList("pages", 8);
+ // Paper start - backport length limit
+ ListTag newPages = new ListTag();
for(int i = 0; i < listTag.size(); ++i) {
- listTag.set(i, (Tag)StringTag.valueOf(resolvePage(commandSource, player, listTag.getString(i))));
+ String resolvedPage = resolvePage(commandSource, player, listTag.getString(i));
+ if (resolvedPage.length() > 32767) {
+ return false;
+ }
+
+ newPages.add(i, StringTag.valueOf(resolvedPage));
}
if (compoundTag.contains("filtered_pages", 10)) {
CompoundTag compoundTag2 = compoundTag.getCompound("filtered_pages");
+ CompoundTag newFilteredPages = new CompoundTag();
for(String string : compoundTag2.getAllKeys()) {
- compoundTag2.putString(string, resolvePage(commandSource, player, compoundTag2.getString(string)));
+ String resolvedPage = resolvePage(commandSource, player, compoundTag2.getString(string));
+ if (resolvedPage.length() > 32767) {
+ return false;
+ }
+
+ newFilteredPages.putString(string, resolvedPage);
}
+
+ compoundTag.put("filtered_pages", newFilteredPages);
}
+ compoundTag.put("pages", newPages);
+ // Paper end
return true;
}
} else {