More patchidy patched patches

This commit is contained in:
Nassim Jahnke 2022-12-07 22:35:34 +01:00
parent 5b6d903302
commit 4710881e40
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B
96 changed files with 362 additions and 378 deletions

View file

@ -8,10 +8,10 @@ Chunks not marked as lit will always go through the light engine,
so they should always have their block sources parsed.
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
index 6e39c2c1556f41140b92064a6fa3a38427504aee..577eefd0990b0d6ae237dd685976975d3532d7fa 100644
index 313a3319c630a4f26f9c53255a0ac67f3c15e410..d4c4d37bcef14e392739d9aae9e20b7d69b05c12 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkSerializer.java
@@ -325,16 +325,33 @@ public class ChunkSerializer {
@@ -327,16 +327,33 @@ public class ChunkSerializer {
BelowZeroRetrogen belowzeroretrogen = protochunk.getBelowZeroRetrogen();
boolean flag5 = chunkstatus.isOrAfter(ChunkStatus.LIGHT) || belowzeroretrogen != null && belowzeroretrogen.targetStatus().isOrAfter(ChunkStatus.LIGHT);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent sending oversized item data in equipment and metadata
diff --git a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
index dc6773ac18bc36ac69e7debf15315776033702ee..adaac498f3277e645d615775d8ca8d055d6d6652 100644
index 6c8505d5d989a2f528a1311a562cd59f4f16fc6d..c5e82ec453a431486a9aed1d6c2637e8b335d0d6 100644
--- a/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
+++ b/src/main/java/net/minecraft/network/syncher/EntityDataSerializers.java
@@ -38,7 +38,7 @@ public class EntityDataSerializers {
@@ -39,7 +39,7 @@ public class EntityDataSerializers {
public static final EntityDataSerializer<ItemStack> ITEM_STACK = new EntityDataSerializer<ItemStack>() {
@Override
public void write(FriendlyByteBuf buf, ItemStack value) {
@ -18,10 +18,10 @@ index dc6773ac18bc36ac69e7debf15315776033702ee..adaac498f3277e645d615775d8ca8d05
@Override
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 523a4963b644cec57c7338cdda72b5e17247f49a..715b49e5e00231e7bd4270534039d520b6549c72 100644
index 64683e218c9c43cfd30514800cfa8da42e37563e..d2fed123ed56eaf550ac2c7a3fcc1678a127bba3 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -310,7 +310,10 @@ public class ServerEntity {
@@ -314,7 +314,10 @@ public class ServerEntity {
ItemStack itemstack = ((LivingEntity) this.entity).getItemBySlot(enumitemslot);
if (!itemstack.isEmpty()) {
@ -34,10 +34,10 @@ index 523a4963b644cec57c7338cdda72b5e17247f49a..715b49e5e00231e7bd4270534039d520
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2aefacac58212d9ba76cf449455241d9c1fd36db..1074ce38a92231bf6c08b1b8e4332dec7b1e04e9 100644
index bd392ff909a217d069a81b2026ab3ce4c38662f3..4842442f4fd97ed72d1cc67334f976ea771ebb0c 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3137,7 +3137,10 @@ public abstract class LivingEntity extends Entity {
@@ -3158,7 +3158,10 @@ public abstract class LivingEntity extends Entity {
equipmentChanges.forEach((enumitemslot, itemstack) -> {
ItemStack itemstack1 = itemstack.copy();
@ -49,7 +49,7 @@ index 2aefacac58212d9ba76cf449455241d9c1fd36db..1074ce38a92231bf6c08b1b8e4332dec
switch (enumitemslot.getType()) {
case HAND:
this.setLastHandItem(enumitemslot, itemstack1);
@@ -3150,6 +3153,34 @@ public abstract class LivingEntity extends Entity {
@@ -3171,6 +3174,34 @@ public abstract class LivingEntity extends Entity {
((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Hide unnecessary itemmeta from clients
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 715b49e5e00231e7bd4270534039d520b6549c72..036d7478c477ce1e794b8311d94f47c42fe9aee9 100644
index d2fed123ed56eaf550ac2c7a3fcc1678a127bba3..77443525e68fab0211ff48af12020ff0399ba6d0 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -312,7 +312,7 @@ public class ServerEntity {
@@ -316,7 +316,7 @@ public class ServerEntity {
if (!itemstack.isEmpty()) {
// Paper start - prevent oversized data
final ItemStack sanitized = LivingEntity.sanitizeItemStack(itemstack.copy(), false);
@ -18,25 +18,25 @@ index 715b49e5e00231e7bd4270534039d520b6549c72..036d7478c477ce1e794b8311d94f47c4
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index eab752600a2711a73516fa029b8eca17d52fde3c..3ba1af93aabbaa635aae60977abe1ed3f1474044 100644
index 045f1b81e568d9adca8e5f9374b5a3ce1267d118..ff7298b9ecd11349dfe57aec4ed0ed0b458faa23 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2817,8 +2817,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2716,8 +2716,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Refresh the current entity metadata
entity.getEntityData().refresh(player);
// SPIGOT-7136 - Allays
- if (entity instanceof Allay) {
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList())));
+ if (entity instanceof Allay allay) { // Paper
+ ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta
player.containerMenu.sendAllDataToRemote();
}
}
// Paper end
// SPIGOT-7136 - Allays
- if (entity instanceof Allay) {
- ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList())));
+ if (entity instanceof Allay allay) { // Paper
+ ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta
player.containerMenu.sendAllDataToRemote();
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 1074ce38a92231bf6c08b1b8e4332dec7b1e04e9..6b01f56aadda10a89796f2b017d0fca3e10dfd98 100644
index 4842442f4fd97ed72d1cc67334f976ea771ebb0c..3d221fd0cec95799763c687222d5d5a917c2171d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3139,7 +3139,7 @@ public abstract class LivingEntity extends Entity {
@@ -3160,7 +3160,7 @@ public abstract class LivingEntity extends Entity {
// Paper start - prevent oversized data
ItemStack toSend = sanitizeItemStack(itemstack1, true);
@ -45,7 +45,7 @@ index 1074ce38a92231bf6c08b1b8e4332dec7b1e04e9..6b01f56aadda10a89796f2b017d0fca3
// Paper end
switch (enumitemslot.getType()) {
case HAND:
@@ -3153,6 +3153,70 @@ public abstract class LivingEntity extends Entity {
@@ -3174,6 +3174,70 @@ public abstract class LivingEntity extends Entity {
((ServerLevel) this.level).getChunkSource().broadcast(this, new ClientboundSetEquipmentPacket(this.getId(), list));
}

View file

@ -11,10 +11,10 @@ Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
index 7d9056f9d841fbbdeaf1e323d818f2f1267b47e8..4940e101250874111e9c55aeb5b87b28602246f0 100644
index fd03fe8d596e7ec05f2a35df0b6587dd2534d5a7..fc76cd43655e0f4b8a8d87f90f0a48a8678ef16c 100644
--- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java
@@ -47,9 +47,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
@@ -48,9 +48,17 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl
@Override
protected BlockState getGrowIntoState(BlockState state, RandomSource random) {
@ -34,7 +34,7 @@ index 7d9056f9d841fbbdeaf1e323d818f2f1267b47e8..4940e101250874111e9c55aeb5b87b28
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
return new ItemStack(Items.GLOW_BERRIES);
diff --git a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
index 4e30917fbc5c539fefc8dc391b902241f7c5ad35..b7517d1e8a5d5eb719de5eda424b7dd2449f1182 100644
index 53b91cf8092b46dbf45afea9ccf439d565d1914a..3a1aa4e2405090ccebefb7f5944f36462929e221 100644
--- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java
@@ -56,12 +56,18 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerItemFrameChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
index ac0fe310b01506b3b2a767d47f65cefb57f58c7d..d2a77b4ca343d19e1c70afe3f3906a9bd53d0eec 100644
index 880ca7cb3ebccc16949e24a0230b1f83887b653f..db60d29b051bad8d115b333e6c72287860a73123 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -3,6 +3,7 @@ package net.minecraft.world.entity.decoration;
@ -16,7 +16,7 @@ index ac0fe310b01506b3b2a767d47f65cefb57f58c7d..d2a77b4ca343d19e1c70afe3f3906a9b
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
@@ -187,6 +188,13 @@ public class ItemFrame extends HangingEntity {
@@ -188,6 +189,13 @@ public class ItemFrame extends HangingEntity {
return true;
}
// CraftBukkit end
@ -30,7 +30,7 @@ index ac0fe310b01506b3b2a767d47f65cefb57f58c7d..d2a77b4ca343d19e1c70afe3f3906a9b
this.dropItem(source.getEntity(), false);
this.playSound(this.getRemoveItemSound(), 1.0F, 1.0F);
}
@@ -451,13 +459,22 @@ public class ItemFrame extends HangingEntity {
@@ -452,13 +460,22 @@ public class ItemFrame extends HangingEntity {
return InteractionResult.FAIL;
}
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add player health update API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 44d2473625420490e35e79f0388a9890bff18fa8..5fc912dcb196b10f33a738951bdad124df449ec5 100644
index ea2316ffa7b494f3f5f102b44fc8d3ec6d9a4131..10ff3f8aba814d73af931e6c91ea9a2c421592bf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2225,9 +2225,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2227,9 +2227,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().maxHealthCache = getMaxHealth();
}
@ -22,7 +22,7 @@ index 44d2473625420490e35e79f0388a9890bff18fa8..5fc912dcb196b10f33a738951bdad124
if (this.getHandle().queueHealthUpdatePacket) {
this.getHandle().queuedHealthUpdatePacket = packet;
} else {
@@ -2235,7 +2237,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2237,7 +2239,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
}

View file

@ -5,11 +5,11 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c648acdd0066f6c480d08927a3c72524cde32ec7..6a264ba85ca10f34ccda5287f8c2c4d492413ae9 100644
index 3af2e5d3bdbf82c142f5ea2629456329bda7666f..9e0f99cdc544bdf1ca7ddd1fe7893592bafca2fd 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2329,6 +2329,90 @@ public final class CraftServer implements Server {
return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(net.minecraft.core.Registry.BIOME_REGISTRY), world); // Paper - Anti-Xray - Add parameters
@@ -2353,6 +2353,90 @@ public final class CraftServer implements Server {
return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters
}
+ // Paper start

View file

@ -1180,10 +1180,10 @@ index 0000000000000000000000000000000000000000..d67a40e7be030142443680c89e1763fc
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 1463d210656c801f8da89d8a2060680684e9c46e..dbd0f0be3c0aaa55fa52f84e557d6a1e29c1146b 100644
index cbe4bf568d5bc97b316f3a9af7a1ad9d88f7f3b5..1b97987788a7180e2ab2c9edf4646925fa691fd6 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -408,7 +408,7 @@ public class ServerPlayer extends Player {
@@ -413,7 +413,7 @@ public class ServerPlayer extends Player {
if (blockposition1 != null) {
this.moveTo(blockposition1, 0.0F, 0.0F);
@ -1192,7 +1192,7 @@ index 1463d210656c801f8da89d8a2060680684e9c46e..dbd0f0be3c0aaa55fa52f84e557d6a1e
break;
}
}
@@ -416,7 +416,7 @@ public class ServerPlayer extends Player {
@@ -421,7 +421,7 @@ public class ServerPlayer extends Player {
} else {
this.moveTo(blockposition, 0.0F, 0.0F);
@ -1202,10 +1202,10 @@ index 1463d210656c801f8da89d8a2060680684e9c46e..dbd0f0be3c0aaa55fa52f84e557d6a1e
}
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 279b7953638d1400072bd153dc3d0c63efdf9035..870a48360dd35c190171f1302393f325f0db6692 100644
index c4e5e2b6283bd3163711a09d6a647c516ed8a1c3..0d9a50fd3e0d97f49c35e2fd743f9e54eaa3b6f0 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -943,7 +943,7 @@ public abstract class PlayerList {
@@ -951,7 +951,7 @@ public abstract class PlayerList {
// CraftBukkit end
worldserver1.getChunkSource().addRegionTicket(net.minecraft.server.level.TicketType.POST_TELEPORT, new net.minecraft.world.level.ChunkPos(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper
@ -1213,9 +1213,9 @@ index 279b7953638d1400072bd153dc3d0c63efdf9035..870a48360dd35c190171f1302393f325
+ while (avoidSuffocation && !worldserver1.noCollision(entityplayer1, entityplayer1.getBoundingBox(), true) && entityplayer1.getY() < (double) worldserver1.getMaxBuildHeight()) { // Paper - make sure this loads chunks, we default to NOT loading now
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
}
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 3f71b0f328842b3659bc01af8502cdc9561c7e5d..97e308353f6e634887a9d5bc9559f84e46f4a507 100644
index 9d7304e97ecc56b78e1a890762346d192c792f4c..9c2d5619f22a8be2d22c6ae926630132c2fffb30 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1160,9 +1160,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -1266,7 +1266,7 @@ index 3f71b0f328842b3659bc01af8502cdc9561c7e5d..97e308353f6e634887a9d5bc9559f84e
if (this.remainingFireTicks <= 0) {
this.setRemainingFireTicks(-this.getFireImmuneTicks());
}
@@ -1306,32 +1341,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -1314,32 +1349,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
private Vec3 collide(Vec3 movement) {
@ -1366,7 +1366,7 @@ index 3f71b0f328842b3659bc01af8502cdc9561c7e5d..97e308353f6e634887a9d5bc9559f84e
}
public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) {
@@ -2454,11 +2535,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2469,11 +2550,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
float f = this.dimensions.width * 0.8F;
AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f);
@ -1471,7 +1471,7 @@ index 56d94c94fb0d4dc468bb5d69be655ddd5c6b5360..d7d396ad73866a97cd9f63b34ad8c587
List<VoxelShape> getEntityCollisions(@Nullable Entity entity, AABB box);
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
index e994db4f81bb94b2e5e8e142e01c05e90a09fa26..87beea39636b641dc5b46c2755a00285b7671ac5 100644
index 66a5783e2a83c75ca46d1fd6f97d9de733c01a09..d860ddae508f53d06f74d8ae0efdfc500c1ddf07 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
@@ -49,7 +49,7 @@ public interface EntityGetter {
@ -1493,14 +1493,13 @@ index e994db4f81bb94b2e5e8e142e01c05e90a09fa26..87beea39636b641dc5b46c2755a00285
return List.of();
} else {
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index bfcd61e09a307e99d6f2e7edae33a0a069abcb51..b86c17b5572f8f74bfefd0f3c6f9d25187574392 100644
index efbcd2b78d75481793e0f29a7431d3eb76489abc..9ebc53d434737c8cd39073470b2b5fcbad167812 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -734,6 +734,13 @@ public abstract class BlockBehaviour {
protected boolean isTicking;
protected FluidState fluid;
// Paper end
+ // Paper start
@@ -762,6 +762,12 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.conditionallyFullOpaque;
}
// Paper end - starlight
+ private long blockCollisionBehavior = io.papermc.paper.util.CollisionUtil.KNOWN_SPECIAL_BLOCK;
+
+ public final long getBlockCollisionBehavior() {
@ -1509,8 +1508,8 @@ index bfcd61e09a307e99d6f2e7edae33a0a069abcb51..b86c17b5572f8f74bfefd0f3c6f9d251
+ // Paper end
public void initCache() {
this.fluid = this.getBlock().getFluidState(this.asState()); // Paper - moved from getFluid()
@@ -744,6 +751,35 @@ public abstract class BlockBehaviour {
this.fluidState = ((Block) this.owner).getFluidState(this.asState());
@@ -772,6 +778,35 @@ public abstract class BlockBehaviour implements FeatureElement {
this.shapeExceedsCube = this.cache == null || this.cache.largeCollisionShape; // Paper - moved from actual method to here
this.opacityIfCached = this.cache == null || this.isConditionallyFullOpaque() ? -1 : this.cache.lightBlock; // Paper - starlight - cache opacity for light

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Optimise collision checking in player move packet handling
Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c36977f3eae7 100644
index ff7298b9ecd11349dfe57aec4ed0ed0b458faa23..41461d9a10abe49b823b92b3817693dbec70eb9e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -655,7 +655,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -647,7 +647,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return;
}
@ -18,7 +18,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above
d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above
@@ -663,6 +663,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -655,6 +655,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag1 = entity.verticalCollisionBelow;
entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8));
@ -26,7 +26,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
double d11 = d7;
d6 = d3 - entity.getX();
@@ -676,16 +677,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -668,16 +669,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag2 = false;
if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
@ -54,7 +54,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
entity.absMoveTo(d0, d1, d2, f, f1);
this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit
this.connection.send(new ClientboundMoveVehiclePacket(entity));
@@ -771,7 +780,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -763,7 +772,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
private boolean noBlocksAround(Entity entity) {
@ -88,7 +88,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
}
@Override
@@ -1351,7 +1385,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1343,7 +1377,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
if (this.awaitingPositionFromClient != null) {
@ -97,7 +97,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
this.awaitingTeleportTime = this.tickCount;
this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
}
@@ -1445,7 +1479,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1437,7 +1471,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
}
@ -106,7 +106,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above
d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above
@@ -1486,6 +1520,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1478,6 +1512,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag1 = this.player.verticalCollisionBelow;
this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9));
@ -114,7 +114,7 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move
// Paper start - prevent position desync
if (this.awaitingPositionFromClient != null) {
@@ -1505,12 +1540,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1497,12 +1532,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
boolean flag2 = false;
if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
@ -138,9 +138,9 @@ index 3ba1af93aabbaa635aae60977abe1ed3f1474044..d4a9c03c557c14069a0227363c61c369
+ }
+ if (!this.player.noPhysics && !this.player.isSleeping() && teleportBack) { // Paper end - optimise out extra getCubes
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
this.player.doCheckFallDamage(this.player.getY() - d6, packet.isOnGround());
} else {
// CraftBukkit start - fire PlayerMoveEvent
@@ -1596,6 +1642,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -1589,6 +1635,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
}

View file

@ -6,13 +6,13 @@ Subject: [PATCH] Fix ChunkSnapshot#isSectionEmpty(int) and optimize
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index 7f23c69e7d6232190a2c75cbc79e1ea56971e8fb..75c6b0aa2cb4ae8637460006ff24d7f6028396be 100644
index 1ac0778fba70ba9f09487c76e086b5a873c6c12a..f7e19bb7d2ff8f8aaf061cec16462913d77c10d5 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -283,13 +283,17 @@ public class CraftChunk implements Chunk {
@@ -284,13 +284,17 @@ public class CraftChunk implements Chunk {
PalettedContainerRO<Holder<Biome>>[] biome = (includeBiome || includeBiomeTempRain) ? new PalettedContainer[cs.length] : null;
Registry<Biome> iregistry = this.worldServer.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
Registry<Biome> iregistry = this.worldServer.registryAccess().registryOrThrow(Registries.BIOME);
- Codec<PalettedContainerRO<Holder<Biome>>> biomeCodec = PalettedContainer.codecRO(iregistry.asHolderIdMap(), iregistry.holderByNameCodec(), PalettedContainer.Strategy.SECTION_BIOMES, iregistry.getHolderOrThrow(Biomes.PLAINS));
for (int i = 0; i < cs.length; i++) {
@ -31,7 +31,7 @@ index 7f23c69e7d6232190a2c75cbc79e1ea56971e8fb..75c6b0aa2cb4ae8637460006ff24d7f6
LevelLightEngine lightengine = chunk.level.getLightEngine();
DataLayer skyLightArray = lightengine.getLayerListener(LightLayer.SKY).getDataLayerData(SectionPos.of(x, i, z));
@@ -308,8 +312,7 @@ public class CraftChunk implements Chunk {
@@ -309,8 +313,7 @@ public class CraftChunk implements Chunk {
}
if (biome != null) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add more Campfire API
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
index 18b22efe9f5335bb49aa0e899727d1911dc20718..8e198941b4ad7845d73ab1cfea5ac07b0014fe22 100644
index 06df710f58ca7d55b19c0db9d393a73ca6e5aa79..830326496e2f961682daadc7a7859247042b4cdd 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java
@@ -39,6 +39,7 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
@ -34,7 +34,7 @@ index 18b22efe9f5335bb49aa0e899727d1911dc20718..8e198941b4ad7845d73ab1cfea5ac07b
if (campfire.cookingProgress[i] >= campfire.cookingTime[i]) {
SimpleContainer inventorysubcontainer = new SimpleContainer(new ItemStack[]{itemstack});
@@ -163,6 +167,16 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
@@ -165,6 +169,16 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
System.arraycopy(aint, 0, this.cookingTime, 0, Math.min(this.cookingTime.length, aint.length));
}
@ -51,7 +51,7 @@ index 18b22efe9f5335bb49aa0e899727d1911dc20718..8e198941b4ad7845d73ab1cfea5ac07b
}
@Override
@@ -171,6 +185,13 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
@@ -173,6 +187,13 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable {
ContainerHelper.saveAllItems(nbt, this.items, true);
nbt.putIntArray("CookingTimes", this.cookingProgress);
nbt.putIntArray("CookingTotalTimes", this.cookingTime);

View file

@ -47,7 +47,7 @@ index 9bae47f99336c377beb72c4b50b7f01cb4db15da..dcfe090c269d4cbcc2eb1b6f85392848
ByteBuffer bytebuffer = ByteBuffer.wrap(this.buf, 0, this.count);
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index e71a451a6b385716cc46db7350b58b4192304547..8db3bcc63aeb23e5b50864ebea675acc75d184ff 100644
index d5b501bcb33a785ef0301bf6bb8d396b9d4fbb6a..bd502ca721de0cab438d995efa00ad0554c0d2fe 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -302,10 +302,17 @@ public class RegionFileStorage implements AutoCloseable {

View file

@ -7,10 +7,10 @@ Leaves fluid if the block broken was fluid-logged which is what
happens if a player breaks a fluid-logged block
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 2881bcb570dc86a7602309e1f540ecd1c7f00284..0030ac394d44acddcd2fc716277ae2b509a378af 100644
index 016f58f452e19a00d72a277d41bcbbb107e4232b..2f5b9083a3d11834fca74d11d6ba10d325a7f7c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -515,6 +515,7 @@ public class CraftBlock implements Block {
@@ -517,6 +517,7 @@ public class CraftBlock implements Block {
net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS();
net.minecraft.world.level.block.Block block = iblockdata.getBlock();
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
@ -18,7 +18,7 @@ index 2881bcb570dc86a7602309e1f540ecd1c7f00284..0030ac394d44acddcd2fc716277ae2b5
boolean result = false;
// Modelled off EntityHuman#hasBlock
@@ -525,7 +526,7 @@ public class CraftBlock implements Block {
@@ -527,7 +528,7 @@ public class CraftBlock implements Block {
}
// SPIGOT-6778: Directly call setBlock instead of setTypeAndData, so that the tile entiy is not removed and custom remove logic is run.

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 97e308353f6e634887a9d5bc9559f84e46f4a507..305a70f4b4646fa6cb8f36af367222a2b7fa39d4 100644
index 9c2d5619f22a8be2d22c6ae926630132c2fffb30..12a032f265a4a5aaac248599cc263896279b54bb 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3276,6 +3276,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3302,6 +3302,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
public void restoreFrom(Entity original) {
@ -22,7 +22,7 @@ index 97e308353f6e634887a9d5bc9559f84e46f4a507..305a70f4b4646fa6cb8f36af367222a2
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
nbttagcompound.remove("Dimension");
@@ -3357,10 +3364,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -3383,10 +3390,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit
ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit
}

View file

@ -7,10 +7,10 @@ Subject: [PATCH] Entity powdered snow API
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 99a9ddbeee75611c5bab8d0e8952a9291bf73a16..446e6e97c4468d3cd60576c8d37e075f5a5b4dba 100644
index 726a4ae7ab928eda3ae1c1e98f3421575af2e065..03b20cec361a2eff27c1187b2a4c5a65d2b4f9b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1340,5 +1340,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1342,5 +1342,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
entity.setRot(location.getYaw(), location.getPitch());
return !entity.valid && entity.level.addFreshEntity(entity, reason);
}

View file

@ -10,10 +10,10 @@ when if this was fixed on the client, that wouldn't be needed.
Mojira Issue: https://bugs.mojang.com/browse/MC-235045
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index 2ff021966426dd6c7c1081fbcfacf4677b404264..81f4e3c869623b6dd2d80886652fa41791fe7032 100644
index c2af60bdb755034e46b85143826a29c4482d58f5..ae5dd08de75a7ed231295f306fd0974da3988249 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -413,4 +413,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
@@ -416,4 +416,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
return this.source.getBukkitSender(this);
}
// CraftBukkit end
@ -35,10 +35,10 @@ index 2ff021966426dd6c7c1081fbcfacf4677b404264..81f4e3c869623b6dd2d80886652fa417
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 27093aed1f4112a5414671fd5d9c4e683011506d..67ab16743b36dbf8b4336e33988d8e78433f566d 100644
index 9cf69ef59ef4330a69753cab7aa8ec7716587d32..6a82d83bca27b3b023d9d6771d194b4db9c97dc2 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -433,6 +433,7 @@ public class Commands {
@@ -441,6 +441,7 @@ public class Commands {
private void fillUsableCommands(CommandNode<CommandSourceStack> tree, CommandNode<SharedSuggestionProvider> result, CommandSourceStack source, Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> resultNodes) {
Iterator iterator = tree.getChildren().iterator();
@ -46,7 +46,7 @@ index 27093aed1f4112a5414671fd5d9c4e683011506d..67ab16743b36dbf8b4336e33988d8e78
while (iterator.hasNext()) {
CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next();
// Paper start
@@ -459,6 +460,12 @@ public class Commands {
@@ -467,6 +468,12 @@ public class Commands {
if (requiredargumentbuilder.getSuggestionsProvider() != null) {
requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider()));
@ -73,10 +73,10 @@ index 850db283bf12345e9e7d7e8e590dbe8135c6dce1..a2ea64b7ec5f47224312a1e08dd64347
try {
argumentparserselector.parse();
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
index ad99d67af92cda03beb1142b02082ee1bfc8a64a..a57ae219d57ed47baedfb73b3d815f39d4f87035 100644
index cdc1319a7cb45a7c5ea30885958b8c3c54f0a241..4cc2ee22369aef22c9bf9d2b244c7278d6db39bb 100644
--- a/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
+++ b/src/main/java/net/minecraft/commands/arguments/selector/EntitySelectorParser.java
@@ -115,12 +115,19 @@ public class EntitySelectorParser {
@@ -113,12 +113,19 @@ public class EntitySelectorParser {
private boolean hasScores;
private boolean hasAdvancements;
private boolean usesSelectors;
@ -97,10 +97,10 @@ index ad99d67af92cda03beb1142b02082ee1bfc8a64a..a57ae219d57ed47baedfb73b3d815f39
this.level = MinMaxBounds.Ints.ANY;
this.rotX = WrappedMinMaxBounds.ANY;
diff --git a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..f2376374c4c6efdfd5cfcea4d30c4b8b4dbbb0d5 100644
index d34d70029ef30ea8c4f1598f676ad65557c066e1..b6abbf5775b8aa73d32494e6ac0e9afbeb534ae2 100644
--- a/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
+++ b/src/main/java/net/minecraft/commands/arguments/selector/options/EntitySelectorOptions.java
@@ -67,6 +67,19 @@ public class EntitySelectorOptions {
@@ -66,6 +66,19 @@ public class EntitySelectorOptions {
public static final DynamicCommandExceptionType ERROR_ENTITY_TYPE_INVALID = new DynamicCommandExceptionType((entity) -> {
return Component.translatable("argument.entity.options.type.invalid", entity);
});
@ -120,12 +120,12 @@ index c2b26a089c423e5df9a5cbfd1c70efbd1acb0e7a..f2376374c4c6efdfd5cfcea4d30c4b8b
private static void register(String id, EntitySelectorOptions.Modifier handler, Predicate<EntitySelectorParser> condition, Component description) {
OPTIONS.put(id, new EntitySelectorOptions.Option(handler, condition, description));
@@ -314,6 +327,12 @@ public class EntitySelectorOptions {
@@ -313,6 +326,12 @@ public class EntitySelectorOptions {
if (reader.isTag()) {
TagKey<EntityType<?>> tagKey = TagKey.create(Registry.ENTITY_TYPE_REGISTRY, ResourceLocation.read(reader.getReader()));
TagKey<EntityType<?>> tagKey = TagKey.create(Registries.ENTITY_TYPE, ResourceLocation.read(reader.getReader()));
+ // Paper start - throw error if invalid entity tag (only on suggestions to keep cmd success behavior)
+ if (reader.parsingEntityArgumentSuggestions && io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && !Registry.ENTITY_TYPE.isKnownTagName(tagKey)) {
+ if (reader.parsingEntityArgumentSuggestions && io.papermc.paper.configuration.GlobalConfiguration.get().commands.fixTargetSelectorTagCompletion && net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getTag(tagKey).isEmpty()) {
+ reader.getReader().setCursor(i);
+ throw ERROR_ENTITY_TAG_INVALID.createWithContext(reader.getReader(), tagKey);
+ }

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Load effect amplifiers greater than 127 correctly
MOJIRA: MC-118857
diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
index 3232ecbf96761528be1bc88f223b51771386ad37..f5c9be3fde2654bd5a6b3ee737afe96a9393e836 100644
index 5ac1aad619a71684a48a2cbd73a8cefc66c587b7..038ba61e4845a4a71bb78ba388ed249d19529b78 100644
--- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
+++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java
@@ -265,7 +265,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
@@ -264,7 +264,7 @@ public class MobEffectInstance implements Comparable<MobEffectInstance> {
}
private static MobEffectInstance loadSpecifiedEffect(MobEffect type, CompoundTag nbt) {

View file

@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..c4eee682f5b8cd82f71f92f0549f39b7
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
index cd751a13a29c34be1d084253f19bf2dce8399d01..cdaf860ec1b84c4ad9f2345968786d878f483f74 100644
index 2947298fe69aa8330d4fe399bf2441c367e8bd80..a82acbbe62bf6aa497e627587e2f3b9be2fbf487 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAxolotl.java
@@ -5,7 +5,7 @@ import org.bukkit.craftbukkit.CraftServer;

View file

@ -5,19 +5,19 @@ Subject: [PATCH] Validate usernames
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index e8d3f455a1a08606568079a3811e2b3ed9d666c7..d6fa1fb3e06a3712b1910990d5b706187c12b51a 100644
index 1a88f9f49aea58321d1c1d4d720944c565c00968..b1648a1cfcc64b77c7bbec19f77d2c968b063fa3 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -65,6 +65,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
private ServerPlayer delayedAcceptPlayer;
@@ -60,6 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
private final String serverId;
@Nullable
private ProfilePublicKey.Data profilePublicKeyData;
private ServerPlayer delayedAcceptPlayer;
+ public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
this.state = ServerLoginPacketListenerImpl.State.HELLO;
@@ -244,10 +245,38 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
}
@@ -212,10 +213,38 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// Paper end
}
+ // Paper start - validate usernames
@ -52,14 +52,14 @@ index e8d3f455a1a08606568079a3811e2b3ed9d666c7..d6fa1fb3e06a3712b1910990d5b70618
+ }
+ }
+ // Paper end - validate usernames
this.profilePublicKeyData = (ProfilePublicKey.Data) packet.publicKey().orElse(null); // CraftBukkit - decompile error
GameProfile gameprofile = this.server.getSingleplayerProfile();
if (gameprofile != null && packet.name().equalsIgnoreCase(gameprofile.getName())) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 870a48360dd35c190171f1302393f325f0db6692..10a4b9b2a954fc5d86ebf3f643cdc940911e7693 100644
index 0d9a50fd3e0d97f49c35e2fd743f9e54eaa3b6f0..a12c3c5c9f7733f3e84a676cd4e58b95e9ad49bf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -714,7 +714,7 @@ public abstract class PlayerList {
@@ -722,7 +722,7 @@ public abstract class PlayerList {
for (int i = 0; i < this.players.size(); ++i) {
entityplayer = (ServerPlayer) this.players.get(i);

View file

@ -5,36 +5,36 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 75651db840072806bb4ef15c4de370fdf6b46c05..2699381f72ff00bb0a9711e3b286e820f1b8dc32 100644
index 0868805c78d991c602d8f1d1b5aeb5c790c13384..6986d5475b090bca60b5ae892512fd5e55ae9b07 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -562,7 +562,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end
@@ -561,7 +561,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver));
LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey);
- org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), worlddimension.typeHolder().value());
+ org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), worlddimension.typeHolder().value(), worlddimension.generator(), this.registryAccess()); // Paper
- org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), worlddimension.type().value());
+ org.bukkit.generator.WorldInfo worldInfo = new org.bukkit.craftbukkit.generator.CraftWorldInfo(iworlddataserver, worldSession, org.bukkit.World.Environment.getEnvironment(dimension), worlddimension.type().value(), worlddimension.generator(), this.registryAccess()); // Paper
if (biomeProvider == null && gen != null) {
biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6a264ba85ca10f34ccda5287f8c2c4d492413ae9..74440a86dd163d5d624b483a5a8b2b993d53e2fb 100644
index 9e0f99cdc544bdf1ca7ddd1fe7893592bafca2fd..1fa90e90b1989aa9ce72beea6c15cd8fb1e24d06 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1212,7 +1212,7 @@ public final class CraftServer implements Server {
net.minecraft.core.Registry<LevelStem> iregistry = worlddata.worldGenSettings().dimensions();
@@ -1236,7 +1236,7 @@ public final class CraftServer implements Server {
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
LevelStem worlddimension = (LevelStem) iregistry.get(actualDimension);
- WorldInfo worldInfo = new CraftWorldInfo(worlddata, worldSession, creator.environment(), worlddimension.typeHolder().value());
+ WorldInfo worldInfo = new CraftWorldInfo(worlddata, worldSession, creator.environment(), worlddimension.typeHolder().value(), worlddimension.generator(), this.getHandle().getServer().registryAccess()); // Paper
- WorldInfo worldInfo = new CraftWorldInfo(worlddata, worldSession, creator.environment(), worlddimension.type().value());
+ WorldInfo worldInfo = new CraftWorldInfo(worlddata, worldSession, creator.environment(), worlddimension.type().value(), worlddimension.generator(), this.getHandle().getServer().registryAccess()); // Paper
if (biomeProvider == null && generator != null) {
biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 80abef83b4b2533fdc50773d4d76c3c6af662df1..579fd470e6198a5caefaaf815510ca1f78325f68 100644
index 7a3aaeb5191f03b8288dde7567bed686150e70a0..c9ec47de502adfc63f5d3ef4ec479208635f3967 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -200,6 +200,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public int getPlayerCount() {
return world.players().size();
}
@ -66,7 +66,7 @@ index 80abef83b4b2533fdc50773d4d76c3c6af662df1..579fd470e6198a5caefaaf815510ca1f
private static final Random rand = new Random();
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java
index 3795dc9b12d62113146e803554283acd8d0e5db9..b9af0c68bfa877314de0d45741a54795b581d9b8 100644
index 5d655d6cd3e23e0287069f8bdf77601487e862fd..e17366910813a6149d3cd403a54de2daf9008cf8 100644
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftWorldInfo.java
@@ -17,8 +17,14 @@ public class CraftWorldInfo implements WorldInfo {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Reset placed block on exception
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index 78cac63e5bd7c84f59b8e00ee40899be78e8cdb1..00d31df5ba7e147b4b969a89cfc2b5088a988169 100644
index e68b7a1b03783e4f9de24c5ae8773fc359bd2d37..e581dc10f3c805f7f8b6e4c842092609e7e1a0f8 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -78,6 +78,7 @@ public class BlockItem extends Item {
@@ -80,6 +80,7 @@ public class BlockItem extends Item {
if (this instanceof PlaceOnWaterBlockItem || this instanceof SolidBucketItem) {
blockstate = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(blockactioncontext1.getLevel(), blockactioncontext1.getClickedPos());
}
@ -16,7 +16,7 @@ index 78cac63e5bd7c84f59b8e00ee40899be78e8cdb1..00d31df5ba7e147b4b969a89cfc2b508
// CraftBukkit end
if (iblockdata == null) {
@@ -93,7 +94,19 @@ public class BlockItem extends Item {
@@ -95,7 +96,19 @@ public class BlockItem extends Item {
if (iblockdata1.is(iblockdata.getBlock())) {
iblockdata1 = this.updateBlockStateFromTag(blockposition, world, itemstack, iblockdata1);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add configurable height for slime spawn
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 15d5a8290be35c2caebf8e296300e8f32cb597c7..fa79316adb11ab39cf921475e12a50058fd82a87 100644
index 7b05640465a47ea8680b4a0b6648a77ea7a1b404..3da612821708f10f7f53b1c9e70adc649689529e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -320,7 +320,11 @@ public class Slime extends Mob implements Enemy {
@@ -322,7 +322,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) {
@ -21,7 +21,7 @@ index 15d5a8290be35c2caebf8e296300e8f32cb597c7..fa79316adb11ab39cf921475e12a5005
return checkMobSpawnRules(type, world, spawnReason, pos, random);
}
@@ -331,7 +335,10 @@ public class Slime extends Mob implements Enemy {
@@ -333,7 +337,10 @@ public class Slime extends Mob implements Enemy {
ChunkPos chunkcoordintpair = new ChunkPos(pos);
boolean flag = world.getMinecraftWorld().paperConfig().entities.spawning.allChunksAreSlimeChunks || WorldgenRandom.seedSlimeChunk(chunkcoordintpair.x, chunkcoordintpair.z, ((WorldGenLevel) world).getSeed(), world.getMinecraftWorld().spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index d6fa1fb3e06a3712b1910990d5b706187c12b51a..96e33103773ae2b8807a6c0a6daac95c35c18bda 100644
index b1648a1cfcc64b77c7bbec19f77d2c968b063fa3..d2cba3fb9eb0d344b71c79387d1d160596b1dc62 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -410,7 +410,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
@@ -371,7 +371,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// Paper start
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);

View file

@ -9,10 +9,10 @@ so this resets it after each call to
Zombie#getExperienceReward
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
index bbaf3e5d29814ce49de68be63411517de3fd320f..e0e16d3b4ba0afc3cfc66b93ecf5f889599f48dd 100644
index 185f0c0d709f374cf6df2654dd9708fca90b1349..9976205537cfe228735687f1e9c52c74ac025690 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
@@ -173,11 +173,16 @@ public class Zombie extends Monster {
@@ -174,11 +174,16 @@ public class Zombie extends Monster {
@Override
public int getExperienceReward() {

View file

@ -7,10 +7,10 @@ Makes the PlayerKickEvent fire on the main thread for
illegal characters or chat out-of-order errors.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d4a9c03c557c14069a0227363c61c36977f3eae7..913ef8c087aea0dbb1e9cd7bcbfd4c2397cb301f 100644
index 41461d9a10abe49b823b92b3817693dbec70eb9e..e94c307a56a0fc3040b8c1d992e078aefa3bdf85 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2175,7 +2175,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2172,7 +2172,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// CraftBukkit end
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) {
@ -18,9 +18,9 @@ index d4a9c03c557c14069a0227363c61c36977f3eae7..913ef8c087aea0dbb1e9cd7bcbfd4c23
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add cause
+ }); // Paper - push to main for event firing
} else {
if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) {
// this.server.submit(() -> { // CraftBukkit - async chat
@@ -2203,7 +2205,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2206,7 +2208,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleChatCommand(ServerboundChatCommandPacket packet) {
if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) {
@ -28,15 +28,15 @@ index d4a9c03c557c14069a0227363c61c36977f3eae7..913ef8c087aea0dbb1e9cd7bcbfd4c23
this.disconnect(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper
+ }); // Paper - push to main for event firing
} else {
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) {
this.server.submit(() -> {
@@ -2289,7 +2293,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
Optional<LastSeenMessages> optional = this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages());
@@ -2286,7 +2290,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
+ this.server.scheduleOnMain(() -> { // Paper - push to main
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca
+ }); // Paper - push to main
return false;
return Optional.empty();
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Multi Block Change API Implementation
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
index 285da70a15f6e4c868747af9d40ac30bd4e42ef4..a0aeac9c29300a0cf6bad55133019e8c29f6cc1c 100644
index 0d851e197e65ec79386ad1f981f6d1d38b65124a..24c677e80af652952263253409c050641e72e3b5 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
@@ -63,6 +63,15 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
@ -25,10 +25,10 @@ index 285da70a15f6e4c868747af9d40ac30bd4e42ef4..a0aeac9c29300a0cf6bad55133019e8c
public void write(FriendlyByteBuf buf) {
buf.writeLong(this.sectionPos.asLong());
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5fc912dcb196b10f33a738951bdad124df449ec5..e88fc016d8f928e378747ce26b808192f22597a7 100644
index 10ff3f8aba814d73af931e6c91ea9a2c421592bf..9385f6727e5215f75b2a437049fb1120d18ce432 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -927,6 +927,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -929,6 +929,35 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.getHandle().connection.send(packet);
}

View file

@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kieran Wallbanks <kieran.wallbanks@gmail.com>
Date: Mon, 21 Jun 2021 14:23:50 +0100
Subject: [PATCH] Fix NotePlayEvent
== AT ==
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
index 52a174884f416c9e61591e18aba3b4cd0073ea02..df7965c86b9c9e89b07b76c75b638d391ea6cc34 100644
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
@@ -88,11 +88,12 @@ public class NoteBlock extends Block {
private void playNote(@Nullable Entity entity, BlockState state, Level world, BlockPos pos) {
if (!((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).requiresAirAbove() || world.getBlockState(pos.above()).isAir()) {
// CraftBukkit start
- org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(NoteBlock.INSTRUMENT), state.getValue(NoteBlock.NOTE));
- if (event.isCancelled()) {
- return;
- }
+ // org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(NoteBlock.INSTRUMENT), state.getValue(NoteBlock.NOTE));
+ // if (event.isCancelled()) {
+ // return;
+ // }
// CraftBukkit end
+ // Paper - TODO any way to cancel the game event?
world.blockEvent(pos, this, 0, 0);
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos);
}
@@ -122,11 +123,15 @@ public class NoteBlock extends Block {
@Override
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
+ // Paper start - move NotePlayEvent call to fix instrument/note changes
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(INSTRUMENT), state.getValue(NOTE));
+ if (event.isCancelled()) return false;
+ // Paper end
NoteBlockInstrument blockpropertyinstrument = (NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT);
float f;
if (blockpropertyinstrument.isTunable()) {
- int k = (Integer) state.getValue(NoteBlock.NOTE);
+ int k = event.getNote().getId(); // Paper
f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D);
world.addParticle(ParticleTypes.NOTE, (double) pos.getX() + 0.5D, (double) pos.getY() + 1.2D, (double) pos.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D);
@@ -148,7 +153,7 @@ public class NoteBlock extends Block {
holder = blockpropertyinstrument.getSoundEvent();
}
- world.playSeededSound((Player) null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, holder, SoundSource.RECORDS, 3.0F, f, world.random.nextLong());
+ world.playSeededSound((Player) null, (double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, org.bukkit.craftbukkit.block.data.CraftBlockData.toNMS(event.getInstrument(), NoteBlockInstrument.class).getSoundEvent(), SoundSource.RECORDS, 3.0F, f, world.random.nextLong()); // Paper
return true;
}

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Freeze Tick Lock API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 305a70f4b4646fa6cb8f36af367222a2b7fa39d4..476668fe955841f61cf12d032b0d3bd1e400cd93 100644
index 12a032f265a4a5aaac248599cc263896279b54bb..9c9251f9f8ac83dddef87561af1d3ea2ab37009c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -396,6 +396,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -25,7 +25,7 @@ index 305a70f4b4646fa6cb8f36af367222a2b7fa39d4..476668fe955841f61cf12d032b0d3bd1
this.setTicksFrozen(0);
this.level.levelEvent((Player) null, 1009, this.blockPosition, 1);
}
@@ -2261,6 +2262,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2276,6 +2277,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (fromNetherPortal) {
nbt.putBoolean("Paper.FromNetherPortal", true);
}
@ -35,7 +35,7 @@ index 305a70f4b4646fa6cb8f36af367222a2b7fa39d4..476668fe955841f61cf12d032b0d3bd1
// Paper end
return nbt;
} catch (Throwable throwable) {
@@ -2425,6 +2429,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2440,6 +2444,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
if (spawnReason == null) {
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
}
@ -46,10 +46,10 @@ index 305a70f4b4646fa6cb8f36af367222a2b7fa39d4..476668fe955841f61cf12d032b0d3bd1
} catch (Throwable throwable) {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 6b01f56aadda10a89796f2b017d0fca3e10dfd98..655253c267925a704e55abe23f1142c15ecb8d2e 100644
index 3d221fd0cec95799763c687222d5d5a917c2171d..2ee07665521804157e4c0a3f6f09455b14b2867f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3390,7 +3390,7 @@ public abstract class LivingEntity extends Entity {
@@ -3411,7 +3411,7 @@ public abstract class LivingEntity extends Entity {
boolean flag1 = this.getType().is(EntityTypeTags.FREEZE_HURTS_EXTRA_TYPES);
int i;
@ -59,10 +59,10 @@ index 6b01f56aadda10a89796f2b017d0fca3e10dfd98..655253c267925a704e55abe23f1142c1
if (this.isInPowderSnow && this.canFreeze()) {
this.setTicksFrozen(Math.min(this.getTicksRequiredToFreeze(), i + 1));
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 446e6e97c4468d3cd60576c8d37e075f5a5b4dba..ea9622e80c8799b33e0edfc2a4a94ba35d1a3b12 100644
index 03b20cec361a2eff27c1187b2a4c5a65d2b4f9b4..32b9816283c8c1de929d5664733553277cf6bf3c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -650,6 +650,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -652,6 +652,17 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.getHandle().isFullyFrozen();
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
index a220102c6e981e4c7d03039340423f05b8c2aeb9..29830a30a886f88254a6d0e7c5245fa14f44bd09 100644
index 5a8c29cc117ce9478cc205f6fdbe63d227268775..c9a2cf4b7476f7b5d7de38ac70e2fc69a486d2a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
@@ -104,4 +104,46 @@ public class CraftPotionEffectType extends PotionEffectType {
@@ -105,4 +105,46 @@ public class CraftPotionEffectType extends PotionEffectType {
public Color getColor() {
return Color.fromRGB(this.handle.getColor());
}

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads
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 9c45e49f480ccd72f6d6c94e5dec41c4becc76cf..4aac9be67a073e60272a68b52c2cda026d4ee28f 100644
index 76666318690368bab672c2302c90dd3abb050299..d1bfb95114b733dde9537c4de6bd1bccb696cd18 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
@@ -832,7 +832,7 @@ public class StructureTemplate {
@@ -833,7 +833,7 @@ public class StructureTemplate {
public static final class Palette {
private final List<StructureTemplate.StructureBlockInfo> blocks;

View file

@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 74440a86dd163d5d624b483a5a8b2b993d53e2fb..9ff71bff0d67a46a4e1317daa918809136885a66 100644
index 1fa90e90b1989aa9ce72beea6c15cd8fb1e24d06..82d3869afe0f4e9fd453d2e1cb179c4aabce9f14 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1990,6 +1990,13 @@ public final class CraftServer implements Server {
@@ -2014,6 +2014,13 @@ public final class CraftServer implements Server {
return console.console;
}

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Implement regenerateChunk
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 579fd470e6198a5caefaaf815510ca1f78325f68..439a360c351f0d82245ee7703f7d0bf48a29c2fa 100644
index c9ec47de502adfc63f5d3ef4ec479208635f3967..2ce47f709f0e7dbfbfe9f7e4e25266b1ed5ed53d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -139,6 +139,7 @@ import org.bukkit.util.Vector;
@@ -138,6 +138,7 @@ import org.bukkit.util.Vector;
public class CraftWorld extends CraftRegionAccessor implements World {
public static final int CUSTOM_DIMENSION_OFFSET = 10;
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
@ -17,7 +17,7 @@ index 579fd470e6198a5caefaaf815510ca1f78325f68..439a360c351f0d82245ee7703f7d0bf4
private final ServerLevel world;
private WorldBorder worldBorder;
@@ -419,27 +420,62 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -418,27 +419,62 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@Override
public boolean regenerateChunk(int x, int z) {
org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot

View file

@ -8,10 +8,10 @@ snow bucket didn't revert grass that became snowy because of the
placement.
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index 00d31df5ba7e147b4b969a89cfc2b5088a988169..62d6c5b7590ff4faef5d8c7a8be03155b7338480 100644
index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd946ad148d5 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -115,6 +115,7 @@ public class BlockItem extends Item {
@@ -117,6 +117,7 @@ public class BlockItem extends Item {
blockstate.update(true, false);
if (this instanceof SolidBucketItem) {
@ -20,10 +20,10 @@ index 00d31df5ba7e147b4b969a89cfc2b5088a988169..62d6c5b7590ff4faef5d8c7a8be03155
}
return InteractionResult.FAIL;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 8ed905d4ef43e2314c64758d0ed075cb969a075c..0611db371b013738a88e5a6c61623a77ea15652e 100644
index a2d92e0ed4348e632b8a55a4fae71ecc3777edcb..64738fffa5ab0cb9ea22fa7198856ea69d8e9cfd 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -337,7 +337,7 @@ public final class ItemStack {
@@ -345,7 +345,7 @@ public final class ItemStack {
int oldCount = this.getCount();
ServerLevel world = (ServerLevel) itemactioncontext.getLevel();
@ -32,7 +32,7 @@ index 8ed905d4ef43e2314c64758d0ed075cb969a075c..0611db371b013738a88e5a6c61623a77
world.captureBlockStates = true;
// special case bonemeal
if (this.getItem() == Items.BONE_MEAL) {
@@ -391,7 +391,7 @@ public final class ItemStack {
@@ -399,7 +399,7 @@ public final class ItemStack {
world.capturedBlockStates.clear();
if (blocks.size() > 1) {
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit
Copies appropriate checks from CraftWorld#getSpawnLimit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9ff71bff0d67a46a4e1317daa918809136885a66..1c2c848edcd95f1d187d9036852b08887fdbf311 100644
index 82d3869afe0f4e9fd453d2e1cb179c4aabce9f14..278bbd6b1bfc3abc434d982a77f18e7b5fe1a70f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2164,6 +2164,8 @@ public final class CraftServer implements Server {
@@ -2188,6 +2188,8 @@ public final class CraftServer implements Server {
@Override
public int getSpawnLimit(SpawnCategory spawnCategory) {
// Paper start

View file

@ -45,11 +45,11 @@ index 0000000000000000000000000000000000000000..cb78a3d4e21376ea24347187478525d5
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1c2c848edcd95f1d187d9036852b08887fdbf311..049ce463c8da4f0730edf5a03439685eb547433e 100644
index 278bbd6b1bfc3abc434d982a77f18e7b5fe1a70f..462b1732205d4d36ff5f6d8f2ce56fe851080bf0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2575,6 +2575,15 @@ public final class CraftServer implements Server {
return (org.bukkit.Tag<T>) new CraftEntityTag(net.minecraft.core.Registry.ENTITY_TYPE, entityTagKey);
@@ -2599,6 +2599,15 @@ public final class CraftServer implements Server {
return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey);
}
}
+ // Paper start
@ -64,8 +64,8 @@ index 1c2c848edcd95f1d187d9036852b08887fdbf311..049ce463c8da4f0730edf5a03439685e
default -> throw new IllegalArgumentException();
}
@@ -2607,6 +2616,13 @@ public final class CraftServer implements Server {
net.minecraft.core.Registry<EntityType<?>> entityTags = net.minecraft.core.Registry.ENTITY_TYPE;
@@ -2631,6 +2640,13 @@ public final class CraftServer implements Server {
net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE;
return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList());
}
+ // Paper start

View file

@ -9,7 +9,7 @@ This might result in chunks loading far slower in the nether,
for example.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2699381f72ff00bb0a9711e3b286e820f1b8dc32..3cd3beb7625a9cf18951f4311d80dbdf00e1334f 100644
index 6986d5475b090bca60b5ae892512fd5e55ae9b07..fa28023738fc50ac6c28e12bb7bbe249ddfc9a4a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1308,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

View file

@ -7,7 +7,7 @@ Subject: [PATCH] Configurable sculk sensor listener range
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
index b7b70a77615dde3f22a9153e17ec2d8edbdcdc7a..579a96d2d6c99d6587ea182f52b6df918f595f17 100644
index 87aed83bd73451268417b8cf8eeb641757a55cce..a73d23d4235354c6232471d9839254f4bd791d0a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java
@@ -36,9 +36,11 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList

View file

@ -10,10 +10,10 @@ just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3cd3beb7625a9cf18951f4311d80dbdf00e1334f..8ac653bbf61015a38343d54f1009c1d935833546 100644
index fa28023738fc50ac6c28e12bb7bbe249ddfc9a4a..b029b04d53b1a9253942de0b2252707f779dde4e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -589,7 +589,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -588,7 +588,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.commandStorage = new CommandStorage(worldpersistentdata);
} else {
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);

View file

@ -7,15 +7,15 @@ Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8ac653bbf61015a38343d54f1009c1d935833546..b3e272bf7329a17094850e2fac9ee0c69d5e045d 100644
index b029b04d53b1a9253942de0b2252707f779dde4e..b79486847e1568a65673ef944a1eeabfa3bdd1a1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -601,9 +601,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -600,9 +600,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
+ this.addLevel(world); // Paper - move up
this.initWorld(world, worlddata, worldData, worlddata.worldGenSettings());
this.initWorld(world, worlddata, worldData, worldoptions);
- this.addLevel(world);
+ // Paper - move up
@ -23,15 +23,15 @@ index 8ac653bbf61015a38343d54f1009c1d935833546..b3e272bf7329a17094850e2fac9ee0c6
if (worlddata.getCustomBossEvents() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 049ce463c8da4f0730edf5a03439685eb547433e..793eae3ab4d144b90ad01099a2c0e90afc53a641 100644
index 462b1732205d4d36ff5f6d8f2ce56fe851080bf0..5b3c274d055c6a123078fe8e819eabb2e1b2c33b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1241,10 +1241,11 @@ public final class CraftServer implements Server {
@@ -1265,10 +1265,11 @@ public final class CraftServer implements Server {
return null;
}
+ this.console.addLevel(internal); // Paper - move up
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenSettings());
this.console.initWorld(internal, worlddata, worlddata, worlddata.worldGenOptions());
internal.setSpawnSettings(true, true);
- this.console.addLevel(internal);

View file

@ -9,10 +9,10 @@ This excludes hanging entities, as this fix caused problematic behavior due to t
position field.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 036d7478c477ce1e794b8311d94f47c42fe9aee9..2358bb1788cfb902bac9b3b7588954af2d2cd823 100644
index 77443525e68fab0211ff48af12020ff0399ba6d0..190e9761087baec5827d722a8281f0ffb6798341 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -159,7 +159,7 @@ public class ServerEntity {
@@ -163,7 +163,7 @@ public class ServerEntity {
boolean flag2 = flag1 || this.tickCount % 60 == 0;
boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1;

View file

@ -24,11 +24,11 @@ index 0000000000000000000000000000000000000000..6b0bed550763f34e18c9e92f9a47ec0c
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b3e272bf7329a17094850e2fac9ee0c69d5e045d..300f6af9e01ce966ca03110c444139f1ae7e691c 100644
index b79486847e1568a65673ef944a1eeabfa3bdd1a1..cbdf2753fca41663185cbfc3b375516b40d238c1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2043,6 +2043,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataPackConfig(MinecraftServer.getSelectedPacks(this.packRepository));
@@ -2032,6 +2032,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess());
io.papermc.paper.registry.PaperRegistry.clearCaches(); // Paper
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper
@ -36,7 +36,7 @@ index b3e272bf7329a17094850e2fac9ee0c69d5e045d..300f6af9e01ce966ca03110c444139f1
// Paper start
if (Thread.currentThread() != this.serverThread) {
diff --git a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
index a809e8a903f98fcbcea3184fac6dfd04adc735f9..13720c2df8ac37d020d4a785e48c45877edf74b9 100644
index cd4ac0eb723b3befba3f03bfffbd16c09b2991b0..e149d3d6637a321903866d22f77cdd9e459ccf5c 100644
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
@@ -168,7 +168,7 @@ public class BrewingStandMenu extends AbstractContainerMenu {
@ -49,7 +49,7 @@ index a809e8a903f98fcbcea3184fac6dfd04adc735f9..13720c2df8ac37d020d4a785e48c4587
}
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
index eee96f87f68d9146b1d19d5923d073fb5c39d507..5d86895f93cadcf0b123263c2a6f718fedcb24ac 100644
index 421c2131fec0b7266c773c3f1983308f6921df6b..12d9556a11ac4ef2e7a62fcd2686d868904bc010 100644
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
+++ b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
@@ -14,6 +14,7 @@ public class PotionBrewing {
@ -164,10 +164,10 @@ index 3d688e334c7287f41460bd866bfd1155e8bb55d2..55006724ccec9f3de828ec18693728e9
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 793eae3ab4d144b90ad01099a2c0e90afc53a641..f26ef8db95292a73e99b0cbb2c25128087ff9346 100644
index 5b3c274d055c6a123078fe8e819eabb2e1b2c33b..03961e7c61170b912e118d93a0c996e0b7070424 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -285,6 +285,7 @@ public final class CraftServer implements Server {
@@ -298,6 +298,7 @@ public final class CraftServer implements Server {
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
public static Exception excessiveVelEx; // Paper - Velocity warnings
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
@ -175,7 +175,7 @@ index 793eae3ab4d144b90ad01099a2c0e90afc53a641..f26ef8db95292a73e99b0cbb2c251280
static {
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
@@ -311,7 +312,7 @@ public final class CraftServer implements Server {
@@ -324,7 +325,7 @@ public final class CraftServer implements Server {
Enchantments.SHARPNESS.getClass();
org.bukkit.enchantments.Enchantment.stopAcceptingRegistrations();
@ -184,7 +184,7 @@ index 793eae3ab4d144b90ad01099a2c0e90afc53a641..f26ef8db95292a73e99b0cbb2c251280
MobEffects.BLINDNESS.getClass();
PotionEffectType.stopAcceptingRegistrations();
// Ugly hack :(
@@ -2896,5 +2897,10 @@ public final class CraftServer implements Server {
@@ -2920,5 +2921,10 @@ public final class CraftServer implements Server {
return datapackManager;
}
@ -196,10 +196,10 @@ index 793eae3ab4d144b90ad01099a2c0e90afc53a641..f26ef8db95292a73e99b0cbb2c251280
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
index 10ace7bb17c36bfefc584a6322841ab6ea4c866f..71486c08db28caf89f2366e082f6f6fab5609b71 100644
index 4d17fa834c0bb602fa104e660a8e7fbe5a02f0a4..8563fcf77eef0e1e354857b9a4256d78a523a8d0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java
@@ -13,6 +13,11 @@ public interface CraftRecipe extends Recipe {
@@ -15,6 +15,11 @@ public interface CraftRecipe extends Recipe {
void addToCraftingManager();
default Ingredient toNMS(RecipeChoice bukkit, boolean requireNotEmpty) {

View file

@ -18,10 +18,10 @@ index 89cb1ec575c0f58e9934d98b056621348dbbe27a..cdd474e9b0363641839a66d3e61fec46
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 2f71e549c5c3f7e8ebfd10a7b0c8601fcc1d9c49..f833213ce3aceffa7771e55659987e126e28cf50 100644
index ca0b9b6f2b9bbbc53ab0001d5eabad341bfb3b0d..7afa387ab07da199ba719fa08a1faba66c3025fa 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -206,7 +206,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -205,7 +205,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftMagicNumbers.MATERIAL_BLOCK.get(material);
}

View file

@ -10,10 +10,10 @@ so we do not need that. The client only needs the chunk it is currently in to
be loaded to close the loading screen, so we just send an empty one.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 10a4b9b2a954fc5d86ebf3f643cdc940911e7693..4fe2184223568a6d8b800e83faa9ade1bba7d31f 100644
index a12c3c5c9f7733f3e84a676cd4e58b95e9ad49bf..d9c1445fee611ebd3dbb19e1e60da3a8bb752d42 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -429,6 +429,16 @@ public abstract class PlayerList {
@@ -437,6 +437,16 @@ public abstract class PlayerList {
// Paper start - move vehicle into method so it can be called above - short circuit around that code
onPlayerJoinFinish(player, worldserver1, s1);

View file

@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 11ee6a2b264b570b61facec5625f6257259432bd..4f7fa1d7b7f90c8326011f58825b4cca0da152bc 100644
index bb486249d409743b0fc9891ac5ae76a38034800b..e365081bf532488f2b41b22deb2fb2346d4f2322 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -566,7 +566,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
@@ -570,7 +570,7 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
// Paper end
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
BlockPos pos = new BlockPos(x, y, z);
@ -24,10 +24,10 @@ index 11ee6a2b264b570b61facec5625f6257259432bd..4f7fa1d7b7f90c8326011f58825b4cca
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 439a360c351f0d82245ee7703f7d0bf48a29c2fa..1aa28195d2d2ef466764a162891c232f99b678e7 100644
index 2ce47f709f0e7dbfbfe9f7e4e25266b1ed5ed53d..70fc51e5689dd1012afac8df40c2d1200baffd0e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1395,7 +1395,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1394,7 +1394,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Validate.notNull(material, "Material cannot be null");
Validate.isTrue(material.isBlock(), "Material must be a block");
@ -41,7 +41,7 @@ index 439a360c351f0d82245ee7703f7d0bf48a29c2fa..1aa28195d2d2ef466764a162891c232f
return (FallingBlock) entity.getBukkitEntity();
}
@@ -1404,7 +1409,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1403,7 +1408,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
Validate.notNull(location, "Location cannot be null");
Validate.notNull(data, "BlockData cannot be null");

View file

@ -15,10 +15,10 @@ 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 39136b9707221e4e4934ee0ef18fc2cb92723aa2..def3b3f8dac4b28eaaafdd9bc2e7f4b9ec9d6855 100644
index dcd3c5b4d3982f02214f8e0306eab37ebbf15299..e7ef36dac559d03d127cf45373a7e0dc935b80a8 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
@@ -300,6 +300,19 @@ public abstract class AbstractArrow extends Projectile {
@@ -301,6 +301,19 @@ public abstract class AbstractArrow extends Projectile {
}
}

View file

@ -18,10 +18,10 @@ public net.minecraft.world.entity.projectile.Projectile leftOwner
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 fee09e6ff72cf1da389d5811dd005642cd50a5b4..4f276b2a86735a2c664738450ae0fbdd82031d4e 100644
index 87c148922d693b5a5bfde89b0dcbc44438df592b..488bf8a197f06a9024bae97ca005f112e4afbb51 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
@@ -98,6 +98,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);
@ -33,7 +33,7 @@ index fee09e6ff72cf1da389d5811dd005642cd50a5b4..4f276b2a86735a2c664738450ae0fbdd
if (!this.level.isClientSide) {
ItemStack itemstack = this.getItem();
Potion potionregistry = PotionUtils.getPotion(itemstack);
@@ -110,7 +115,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
@@ -112,7 +117,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
if (this.isLingering()) {
this.makeAreaOfEffectCloud(itemstack, potionregistry);
} else {
@ -340,7 +340,7 @@ index 832981b07ef5c633ef00a382f56798ee87eec0df..faf071201b7c1414225a33fe9641eac9
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index f3abcd5949011eaef3d1ba68f4cc0751042d2834..bfb1ad0b6e20e10fee53f94a3e6c4f8aad7aae7d 100644
index 05dc7159f178b971a8bd5aa06b0b6551ef27ec7d..2d0e828687e9f4e860348eb10b1a40e12a654f2a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -278,12 +278,20 @@ public final class CraftItemStack extends ItemStack {

View file

@ -10,23 +10,23 @@ 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 5ad968a2f1add27da0d6a858e683d5d771128092..e44352857272a2a4027c67bd25a28a9498b7bb49 100644
index ad4392c3ec8f9f5f910f3be40f6b7dbfed223ca7..366f32b11f39a79210532c614fdbb2230b87d88f 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -361,7 +361,7 @@ public class Cat extends TamableAnimal {
@@ -366,7 +366,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
});
ServerLevel worldserver = world.getLevel();
- if (worldserver.structureManager().getStructureWithPieceAt(this.blockPosition(), StructureTags.CATS_SPAWN_AS_BLACK).isValid()) {
+ if (worldserver.structureManager().getStructureWithPieceAt(this.blockPosition(), StructureTags.CATS_SPAWN_AS_BLACK, world).isValid()) { // Paper - fix deadlock
this.setCatVariant(CatVariant.ALL_BLACK);
this.setVariant((CatVariant) BuiltInRegistries.CAT_VARIANT.getOrThrow(CatVariant.ALL_BLACK));
this.setPersistenceRequired();
}
diff --git a/src/main/java/net/minecraft/world/level/StructureManager.java b/src/main/java/net/minecraft/world/level/StructureManager.java
index e7445c1ff0d1e3e989fcd8d3630dd5269a64598d..64ca546a905d69a795bbdafb4f9860b31cd863d1 100644
index 924c7a67abe334494c571f9b4c5c8a7d5dfef5b4..bad7031426ae6c750ae4376beb238186e7d65270 100644
--- a/src/main/java/net/minecraft/world/level/StructureManager.java
+++ b/src/main/java/net/minecraft/world/level/StructureManager.java
@@ -43,7 +43,12 @@ public class StructureManager {
@@ -44,7 +44,12 @@ public class StructureManager {
}
public List<StructureStart> startsForStructure(ChunkPos pos, Predicate<Structure> predicate) {
@ -40,7 +40,7 @@ index e7445c1ff0d1e3e989fcd8d3630dd5269a64598d..64ca546a905d69a795bbdafb4f9860b3
ImmutableList.Builder<StructureStart> builder = ImmutableList.builder();
for(Map.Entry<Structure, LongSet> entry : map.entrySet()) {
@@ -107,13 +112,18 @@ public class StructureManager {
@@ -108,13 +113,18 @@ public class StructureManager {
}
public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> structureTag) {
@ -49,11 +49,11 @@ index e7445c1ff0d1e3e989fcd8d3630dd5269a64598d..64ca546a905d69a795bbdafb4f9860b3
+ }
+ public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> structureTag, @Nullable ServerLevelAccessor levelAccessor) {
+ // Paper end
Registry<Structure> registry = this.registryAccess().registryOrThrow(Registry.STRUCTURE_REGISTRY);
Registry<Structure> registry = this.registryAccess().registryOrThrow(Registries.STRUCTURE);
for(StructureStart structureStart : this.startsForStructure(new ChunkPos(pos), (structure) -> {
return registry.getHolder(registry.getId(structure)).map((holder) -> {
return holder.is(structureTag);
return registry.getHolder(registry.getId(structure)).map((reference) -> {
return reference.is(structureTag);
}).orElse(false);
- })) {
+ }, levelAccessor)) { // Paper

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 913ef8c087aea0dbb1e9cd7bcbfd4c2397cb301f..cf5ef052a262a910ed5348ba83ccf9274450a030 100644
index e94c307a56a0fc3040b8c1d992e078aefa3bdf85..b51e0dfad64cf9844bd511689786a456f7c8e48e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -585,6 +585,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -577,6 +577,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else {
Entity entity = this.player.getRootVehicle();

View file

@ -5,11 +5,11 @@ 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 4f7fa1d7b7f90c8326011f58825b4cca0da152bc..d5cc47eb1fd1ea9a0638827483b03165f6a7e10c 100644
index e365081bf532488f2b41b22deb2fb2346d4f2322..3209d13a12a033e157621920a0cefdad5727463f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -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));
@@ -214,6 +214,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
return CraftBlock.biomeBaseToBiome(this.getHandle().registryAccess().registryOrThrow(Registries.BIOME), this.getHandle().getNoiseBiome(x >> 2, y >> 2, z >> 2));
}
+ // Paper start
@ -23,10 +23,10 @@ index 4f7fa1d7b7f90c8326011f58825b4cca0da152bc..d5cc47eb1fd1ea9a0638827483b03165
public void setBiome(Location location, Biome biome) {
this.setBiome(location.getBlockX(), location.getBlockY(), location.getBlockZ(), biome);
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 0030ac394d44acddcd2fc716277ae2b509a378af..22356c2380741dd811810420127e247e46b0b8e2 100644
index 2f5b9083a3d11834fca74d11d6ba10d325a7f7c3..38408e37cd3d8742a5cbf6711d48b9c7a35159a1 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -341,6 +341,13 @@ public class CraftBlock implements Block {
@@ -343,6 +343,13 @@ public class CraftBlock implements Block {
return this.getWorld().getBiome(this.getX(), this.getY(), this.getZ());
}

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 c5d5d90d10b30f30d1262367b3d75df43fbdb231..e017020b7630f54c506d93ab0504c6f3299fc80b 100644
index 91fb6678214d5f23b33d5d3b65a29fdfbb003c58..e4d4dec63260c7b3ec3ed841a1e509eb67e66fb2 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
@@ -114,13 +114,28 @@ public class SkullBlockEntity extends BlockEntity {
@@ -131,13 +131,28 @@ public class SkullBlockEntity extends BlockEntity {
updateGameprofile(this.owner, (owner) -> {
this.owner = owner;
this.setChanged();
@ -40,7 +40,7 @@ index c5d5d90d10b30f30d1262367b3d75df43fbdb231..e017020b7630f54c506d93ab0504c6f3
Util.ifElse(profile, (profilex) -> {
Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
if (property == null) {
@@ -137,6 +152,20 @@ public class SkullBlockEntity extends BlockEntity {
@@ -154,6 +169,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 30bff345b33a1b4f7909efbe4b3622d7780e7bbf..8e5bc2bf5fed1f70a9fdcdeb4b23468aa0c7fb8e 100644
index 2d25b7fb8e0c8984a6d3bad94b177713e3114533..4214420d6670b394758f14dbf6de628420c56e3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -376,6 +376,21 @@ public final class CraftItemFactory implements ItemFactory {
@@ -401,6 +401,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 f26ef8db95292a73e99b0cbb2c25128087ff9346..acb82138d7b375dc7ef1e02e63a60c8d420995eb 100644
index 03961e7c61170b912e118d93a0c996e0b7070424..8c0ad5680e20b2a5109a3c5d2c8d46854438cc1c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1289,7 +1289,7 @@ public final class CraftServer implements Server {
@@ -1313,7 +1313,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 51d3150e732f95be13f5f54d994dab1fa89ed3f2..80c1e0e47818486a68e0114b063395290365346b 100644
index 73b96f804079288e9c5fcc11da54e61e89a6782a..52fd12c474c01f3b53d0f6596b7a6fafee52bd0d 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -274,6 +274,7 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel {
}
}
@ -24,7 +24,7 @@ index 51d3150e732f95be13f5f54d994dab1fa89ed3f2..80c1e0e47818486a68e0114b06339529
@Override
public boolean ensureCanWrite(BlockPos pos) {
int i = SectionPos.blockToSectionCoord(pos.getX());
@@ -293,7 +294,15 @@ public class WorldGenRegion implements WorldGenLevel {
@@ -294,7 +295,15 @@ public class WorldGenRegion implements WorldGenLevel {
return true;
} else {

View file

@ -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 dbd0f0be3c0aaa55fa52f84e557d6a1e29c1146b..58d17cc0c5ba5093fe306c8a1514c27f355f49ae 100644
index 1b97987788a7180e2ab2c9edf4646925fa691fd6..2741a218ce45377479ad47ec0141fa70e2b0acca 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -846,12 +846,14 @@ public class ServerPlayer extends Player {
@@ -868,12 +868,14 @@ public class ServerPlayer extends Player {
}
}
}

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 476668fe955841f61cf12d032b0d3bd1e400cd93..dd53f6a00ba4a5714fe6314b527195c3c84fdb90 100644
index 9c9251f9f8ac83dddef87561af1d3ea2ab37009c..4728b08a363dfc9e33f6858a88faba404d79af6f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2684,6 +2684,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -2703,6 +2703,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 dd53f6a00ba4a5714fe6314b527195c3c84fdb90..d81ee5367205ba96eb23f885ec648a27f2cf62f8 100644
index 4728b08a363dfc9e33f6858a88faba404d79af6f..8770c02b6ba1d1dcb7b5fa3ac7f006a7097234f5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4197,11 +4197,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@@ -4247,11 +4247,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] cache resource keys
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 22356c2380741dd811810420127e247e46b0b8e2..bfe9dc935c87e01fb435d8b46ce413b84ca74856 100644
index 38408e37cd3d8742a5cbf6711d48b9c7a35159a1..47ee348a7042a8e0705bc7d2c4077c0f270a8239 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -366,12 +366,13 @@ public class CraftBlock implements Block {
@@ -368,12 +368,13 @@ public class CraftBlock implements Block {
return (biome == null) ? Biome.CUSTOM : biome;
}
@ -18,24 +18,24 @@ index 22356c2380741dd811810420127e247e46b0b8e2..bfe9dc935c87e01fb435d8b46ce413b8
return null;
}
- return registry.getHolderOrThrow(ResourceKey.create(net.minecraft.core.Registry.BIOME_REGISTRY, CraftNamespacedKey.toMinecraft(bio.getKey())));
+ return registry.getHolderOrThrow(BIOME_KEY_CACHE.computeIfAbsent(bio, b -> ResourceKey.create(net.minecraft.core.Registry.BIOME_REGISTRY, CraftNamespacedKey.toMinecraft(b.getKey())))); // Paper - cache key
- return registry.getHolderOrThrow(ResourceKey.create(Registries.BIOME, CraftNamespacedKey.toMinecraft(bio.getKey())));
+ return registry.getHolderOrThrow(BIOME_KEY_CACHE.computeIfAbsent(bio, b -> ResourceKey.create(Registries.BIOME, CraftNamespacedKey.toMinecraft(b.getKey())))); // Paper - cache key
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java
index 393bb27648501c6f25cf846e929f4c95b1a0b11f..979f82d589e378b9e52417d20b48d66f077f5dfd 100644
index e0bf615fb1b99abbab2be55a4ee345204b36e218..7b3b12b4b2f5dbd37e23a7f5a0ad2abd04d259e2 100644
--- a/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java
+++ b/src/main/java/org/bukkit/craftbukkit/tag/CraftEntityTag.java
@@ -16,9 +16,10 @@ public class CraftEntityTag extends CraftTag<net.minecraft.world.entity.EntityTy
super(registry, tag);
}
+ private static final java.util.Map<org.bukkit.entity.EntityType, net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>>> KEY_CACHE = Collections.synchronizedMap(new java.util.EnumMap<>(EntityType.class)); // Paper
+ private static final java.util.Map<org.bukkit.entity.EntityType, net.minecraft.resources.ResourceKey<net.minecraft.world.entity.EntityType<?>>> KEY_CACHE = java.util.Collections.synchronizedMap(new java.util.EnumMap<>(EntityType.class)); // Paper
@Override
public boolean isTagged(EntityType entity) {
- return registry.getHolderOrThrow(ResourceKey.create(net.minecraft.core.Registry.ENTITY_TYPE_REGISTRY, CraftNamespacedKey.toMinecraft(entity.getKey()))).is(tag);
+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(entity, type -> ResourceKey.create(net.minecraft.core.Registry.ENTITY_TYPE_REGISTRY, CraftNamespacedKey.toMinecraft(type.getKey())))).is(tag); // Paper - cache key
- return registry.getHolderOrThrow(ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(entity.getKey()))).is(tag);
+ return registry.getHolderOrThrow(KEY_CACHE.computeIfAbsent(entity, type -> ResourceKey.create(Registries.ENTITY_TYPE, CraftNamespacedKey.toMinecraft(type.getKey())))).is(tag); // Paper - cache key
}
@Override

View file

@ -5,7 +5,7 @@ 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 3f854bea2e6be82c7ad12b4d13064de8baec55c7..b786bd5178a605a5dfb7682b7cb809646895aea3 100644
index d8c9beab9163820df949f6002bbb9224a044c6f3..84ee7c1d3c2923090445422f38880e5b59668288 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
@@ -99,6 +99,10 @@ public class EnderDragon extends Mob implements Enemy {
@ -71,10 +71,10 @@ index a64ee433e34538ce2b52207b6183999ae611e5dd..0f78e1ab090bb1df7b863c90b3c7465a
}
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonHoldingPatternPhase.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonHoldingPatternPhase.java
index e58f608e424e384606289d9ff27bf8f9c63aeeb2..4c338d7f3d5274a36db768e4a1cdedca130127d4 100644
index adec9aec93d545941a3d592b54c5fe064cdb1437..77206aba171d063691b8f32afcebd570784d7da2 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonHoldingPatternPhase.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/phases/DragonHoldingPatternPhase.java
@@ -55,7 +55,7 @@ public class DragonHoldingPatternPhase extends AbstractDragonPhaseInstance {
@@ -54,7 +54,7 @@ public class DragonHoldingPatternPhase extends AbstractDragonPhaseInstance {
private void findNewTarget() {
if (this.currentPath != null && this.currentPath.isDone()) {

View file

@ -9,10 +9,10 @@ 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 4aac9be67a073e60272a68b52c2cda026d4ee28f..30c44b39f9b7a434bb77d6307d2514f2ce9d2857 100644
index d1bfb95114b733dde9537c4de6bd1bccb696cd18..1d809de3db6c6de64f938f66d81356c5b58967f8 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
@@ -266,7 +266,11 @@ public class StructureTemplate {
@@ -267,7 +267,11 @@ public class StructureTemplate {
if (definedstructure_blockinfo.nbt != null) {
tileentity = world.getBlockEntity(blockposition2);
@ -25,7 +25,7 @@ index 4aac9be67a073e60272a68b52c2cda026d4ee28f..30c44b39f9b7a434bb77d6307d2514f2
world.setBlock(blockposition2, Blocks.BARRIER.defaultBlockState(), 20);
}
@@ -381,7 +385,11 @@ public class StructureTemplate {
@@ -382,7 +386,11 @@ public class StructureTemplate {
if (pair1.getSecond() != null) {
tileentity = world.getBlockEntity(blockposition6);
if (tileentity != null) {

View file

@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Tue, 12 Apr 2022 16:36:15 -0700
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
--- 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 {
return false;
} else {
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
if (((ConfiguredFeature) ((Holder) optional.get()).value()).place(world, world.getChunkSource().getGenerator(), random, pos)) {
return true;
} else {

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 cf5ef052a262a910ed5348ba83ccf9274450a030..e783dbe494b85928d67a0490a664e4b7dbef832c 100644
index b51e0dfad64cf9844bd511689786a456f7c8e48e..93603aabe8b96c8d85a355dcf8c2d5ca45036f89 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3412,7 +3412,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3319,7 +3319,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
if (this.player.level.isLoaded(blockposition)) {

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 4fe2184223568a6d8b800e83faa9ade1bba7d31f..3be9352ae9b0b84acf07064b45562ceffd30391b 100644
index d9c1445fee611ebd3dbb19e1e60da3a8bb752d42..cb0d6f2eba67b0f45ce0ce0f6c6b76167a87de10 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1483,7 +1483,7 @@ public abstract class PlayerList {
@@ -1474,7 +1474,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

View file

@ -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 fa79316adb11ab39cf921475e12a50058fd82a87..7e85ad7ba31bbb32ea1e1dff5d1c83e7ce68b4b3 100644
index 3da612821708f10f7f53b1c9e70adc649689529e..87c2e50c6f817d1a77e0cfd64366765b265f9ba0 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Slime.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java
@@ -320,6 +320,11 @@ public class Slime extends Mob implements Enemy {
@@ -322,6 +322,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) {

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 c399aaeee89e12a7da4e054acd877fe033676dfd..ff3eced0e20c39b825586897ee2fed01dd471d88 100644
index 5b46cabf4f2e2a1f7feaad378dd98d64aeef8671..51b3db0b6c2cede95b584268e035c0fb36d38094 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -309,7 +309,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -304,7 +304,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 c399aaeee89e12a7da4e054acd877fe033676dfd..ff3eced0e20c39b825586897ee2fed01
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 e783dbe494b85928d67a0490a664e4b7dbef832c..7ef7a9203f6376cd13e6a9803dd01522d217f700 100644
index 93603aabe8b96c8d85a355dcf8c2d5ca45036f89..b5a8bea33fbaf0cf793808a1bba364a2d87431be 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3008,7 +3008,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2910,7 +2910,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
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 e783dbe494b85928d67a0490a664e4b7dbef832c..7ef7a9203f6376cd13e6a9803dd01522
}
break;
diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java
index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9537722e3 100644
index fa8cd4438c19a262272da47985a57f7e84654f1b..663c1d8c1611af915a1bae733920dd75ad73feb1 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 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
while (iterator.hasNext()) {
ServerPlayer entityplayer = (ServerPlayer) iterator.next();
@@ -157,13 +157,13 @@ public class GameRules {
@@ -164,13 +164,13 @@ public class GameRules {
((GameRules.Type<T>) type).callVisitor(consumer, (GameRules.Key<T>) key); // CraftBukkit - decompile error
}
@ -68,7 +68,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
T t0 = rules.getRule(key);
this.getRule(key).setFrom(t0, server);
@@ -231,10 +231,10 @@ public class GameRules {
@@ -238,10 +238,10 @@ public class GameRules {
private final Supplier<ArgumentType<?>> argument;
private final Function<GameRules.Type<T>, T> constructor;
@ -81,7 +81,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
this.argument = argumentType;
this.constructor = ruleFactory;
this.callback = changeCallback;
@@ -266,10 +266,10 @@ public class GameRules {
@@ -273,10 +273,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 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
if (server != null) {
this.type.callback.accept(server, this.getSelf());
}
@@ -290,7 +290,7 @@ public class GameRules {
@@ -297,7 +297,7 @@ public class GameRules {
protected abstract T copy();
@ -103,7 +103,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
}
public interface GameRuleTypeVisitor {
@@ -306,7 +306,7 @@ public class GameRules {
@@ -313,7 +313,7 @@ public class GameRules {
private boolean value;
@ -112,7 +112,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
return new GameRules.Type<>(BoolArgumentType::bool, (gamerules_gameruledefinition) -> {
return new GameRules.BooleanValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitBoolean);
@@ -334,7 +334,7 @@ public class GameRules {
@@ -341,7 +341,7 @@ public class GameRules {
return this.value;
}
@ -121,7 +121,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
this.value = value;
this.onChanged(server);
}
@@ -364,7 +364,7 @@ public class GameRules {
@@ -371,7 +371,7 @@ public class GameRules {
return new GameRules.BooleanValue(this.type, this.value);
}
@ -130,7 +130,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
this.value = rule.value;
this.onChanged(server);
}
@@ -374,7 +374,7 @@ public class GameRules {
@@ -381,7 +381,7 @@ public class GameRules {
private int value;
@ -139,7 +139,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
return new GameRules.Type<>(IntegerArgumentType::integer, (gamerules_gameruledefinition) -> {
return new GameRules.IntegerValue(gamerules_gameruledefinition, initialValue);
}, changeCallback, GameRules.GameRuleTypeVisitor::visitInteger);
@@ -402,7 +402,7 @@ public class GameRules {
@@ -409,7 +409,7 @@ public class GameRules {
return this.value;
}
@ -148,7 +148,7 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
this.value = value;
this.onChanged(server);
}
@@ -453,7 +453,7 @@ public class GameRules {
@@ -460,7 +460,7 @@ public class GameRules {
return new GameRules.IntegerValue(this.type, this.value);
}
@ -158,10 +158,10 @@ index 392ab42d3c4fa6ef1815279a02b1fce236f725fa..2c500cfdd594e24b039d698bced1f9f9
this.onChanged(server);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 1aa28195d2d2ef466764a162891c232f99b678e7..5fcea8546b574a6fc91502c0674ab8f9389c7cf3 100644
index 70fc51e5689dd1012afac8df40c2d1200baffd0e..2976b3469a7870611862c28ef555be974309ee34 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1899,7 +1899,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1898,7 +1898,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 1aa28195d2d2ef466764a162891c232f99b678e7..5fcea8546b574a6fc91502c0674ab8f9
return true;
}
@@ -1939,7 +1939,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1938,7 +1938,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

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 0611db371b013738a88e5a6c61623a77ea15652e..6eda115b5cd3312123784e758b59973e0a55773c 100644
index 64738fffa5ab0cb9ea22fa7198856ea69d8e9cfd..8450a22b0fc6e8dc5cad0f61ac52a82b3cd3791e 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -563,10 +563,11 @@ public final class ItemStack {
@@ -571,10 +571,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 acb82138d7b375dc7ef1e02e63a60c8d420995eb..0f3156c2dd1884bc5952708636ec559307bb61ba 100644
index 8c0ad5680e20b2a5109a3c5d2c8d46854438cc1c..85413bb569a3b60cb06fa80fabfaa279529c0071 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1248,6 +1248,7 @@ public final class CraftServer implements Server {
@@ -1272,6 +1272,7 @@ public final class CraftServer implements Server {
internal.setSpawnSettings(true, true);
// Paper - move up

View file

@ -5,7 +5,7 @@ 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 1ad1f958a9b6e1bc21f1c505aa7ea54950de6cad..9378e83a67a70dbb1fb4f05b33f1e553d008e62b 100644
index 17c313b9cb45c8158cab751ffc4e0dc3b7e1fa3c..796d17f51496974cfdfed2593753b8c09b5c81c1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -419,12 +419,16 @@ public class ServerPlayerGameMode {
@ -40,7 +40,7 @@ index 1ad1f958a9b6e1bc21f1c505aa7ea54950de6cad..9378e83a67a70dbb1fb4f05b33f1e553
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 dd51ea83935028a083c9cf368e6826fa32c00462..c2715a576d2b36188da2e2e472b22a3ea2f9d7d3 100644
index 81048c54c45b77894ee1e2045870446dff7c71d4..fe7daa57119af137eeb76ca2c0e54bf7903ebbca 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 e44352857272a2a4027c67bd25a28a9498b7bb49..ab86bfdaebe9b8791f0cfa6e0c61f80c8f891a93 100644
index 366f32b11f39a79210532c614fdbb2230b87d88f..a0dd4a58937a4e49e430d8c1470fe84b709e8044 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -399,6 +399,13 @@ public class Cat extends TamableAnimal {
@@ -404,6 +404,13 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
DyeColor enumcolor = ((DyeItem) item).getDyeColor();
if (enumcolor != this.getCollarColor()) {
@ -23,7 +23,7 @@ index e44352857272a2a4027c67bd25a28a9498b7bb49..ab86bfdaebe9b8791f0cfa6e0c61f80c
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 34dadacb8238896b799716875ea5d0e924c323e8..45c3cec839a7c23903dedf6e3e004305da2adceb 100644
index c44bbdea03856ac3a7652674263d1ec78ed02473..a6a50eb4f4ac85751071571876ac804d44ee1ee6 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -392,6 +392,13 @@ public class Wolf extends TamableAnimal implements NeutralMob {

View file

@ -1,24 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darbyjack <admin@glaremasters.me>
Date: Thu, 9 Dec 2021 19:17:02 -0600
Subject: [PATCH] Update Log4j
diff --git a/build.gradle.kts b/build.gradle.kts
index 88000dae363f55044f86e72e9f6fb0214cd320bc..ea1faaf4820059b4a67dbd229a90bc6b78b861bc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -18,10 +18,11 @@ dependencies {
all its classes to check if they are plugins.
Scanning takes about 1-2 seconds so adding this speeds up the server start.
*/
- implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
- annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
+ implementation("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - implementation
+ annotationProcessor("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - Needed to generate meta for our Log4j plugins
// Paper end
implementation("org.apache.logging.log4j:log4j-iostreams:2.17.1") // Paper
+ implementation("org.apache.logging.log4j:log4j-slf4j18-impl:2.17.1") // Paper
implementation("org.ow2.asm:asm:9.3")
implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files

View file

@ -1,46 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kieran Wallbanks <kieran.wallbanks@gmail.com>
Date: Mon, 21 Jun 2021 14:23:50 +0100
Subject: [PATCH] Fix NotePlayEvent
== AT ==
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
index 293affa9821bcf7c6f4c2d57818958ae2765c5de..c14eb4f7decdbcd6176d3bff95d595a947d4ec95 100644
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
@@ -63,11 +63,12 @@ public class NoteBlock extends Block {
private void playNote(@Nullable Entity entity, Level world, BlockPos blockposition, BlockState data) { // CraftBukkit
if (world.getBlockState(blockposition.above()).isAir()) {
// CraftBukkit start
- org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.NOTE));
- if (event.isCancelled()) {
- return;
- }
+ // org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.NOTE)); // Paper - move event into block event handler
+ // if (event.isCancelled()) {
+ // return;
+ // }
// CraftBukkit end
+ // Paper - TODO any way to cancel the game event?
world.blockEvent(blockposition, this, 0, 0);
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, blockposition);
}
@@ -97,10 +98,14 @@ public class NoteBlock extends Block {
@Override
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
- int k = (Integer) state.getValue(NoteBlock.NOTE);
+ // Paper start - move NotePlayEvent call to fix instrument/note changes
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(INSTRUMENT), state.getValue(NOTE));
+ if (event.isCancelled()) return false;
+ int k = event.getNote().getId();
float f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D);
- world.playSound((Player) null, pos, ((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).getSoundEvent(), SoundSource.RECORDS, 3.0F, f);
+ world.playSound(null, pos, org.bukkit.craftbukkit.block.data.CraftBlockData.toNMS(event.getInstrument(), NoteBlockInstrument.class).getSoundEvent(), SoundSource.RECORDS, 3.0F, f);
+ // Paper end
world.addParticle(ParticleTypes.NOTE, (double) pos.getX() + 0.5D, (double) pos.getY() + 1.2D, (double) pos.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D);
return true;
}

View file

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Tue, 12 Apr 2022 16:36:15 -0700
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 30dac710f355de75e620b807f88c6a209615b05f..88a7b38f33500a618f42aed427e7e15db9e837b3 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, 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
if (((ConfiguredFeature) ((Holder) this.featureSupplier.get()).value()).place(world, world.getChunkSource().getGenerator(), random, pos)) {
return true;
} else {