Archiviert
13
0

more more work (806)

Dieser Commit ist enthalten in:
Noah van der Aa 2024-04-24 23:23:56 +02:00
Ursprung 22227ccf26
Commit 4d9e824a44
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 547D90BC6FF753CF
51 geänderte Dateien mit 315 neuen und 381 gelöschten Zeilen

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods
Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com>
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index be82e1d52d7026facb20bf07f4b3a394e77ab708..0d49d7b92305977fe66f13c1e66739c1430dc7fd 100644 index 8191fedcdc7d96de9574f567a8e95ce121a15df4..b2755299789dea3bcc49e66d3647a6e8a5080b4d 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -625,6 +625,19 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -622,6 +622,19 @@ public final class CraftMagicNumbers implements UnsafeValues {
Preconditions.checkArgument(material.isBlock(), material + " is not a block"); Preconditions.checkArgument(material.isBlock(), material + " is not a block");
return getBlock(material).hasCollision; return getBlock(material).hasCollision;
} }

Datei anzeigen

@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2a96d128dd42b937b16e25274b39fb66c3d9a097..ad2583c581e78e9cf352567b7dbde193319d4301 100644 index 00457548d43e1d2143d1f6027593a1178f02564a..9416daa3edef2d9bb780fe3b2aa210d92a300cf1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1223,6 +1223,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1235,6 +1235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (Exception ignored) { } catch (Exception ignored) {
} }
// CraftBukkit end // CraftBukkit end
@ -49,7 +49,7 @@ index 2a96d128dd42b937b16e25274b39fb66c3d9a097..ad2583c581e78e9cf352567b7dbde193
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 44f49cc8b7800eebda426a1a04a311979e4516b9..b131a84865d9160d1b5d411515b69e967dbda66c 100644 index 90911cd3ba86e02baf8684099f0762fab563581c..3b8a2de79c79302626f43f320b15bae52416cc37 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -18,6 +18,12 @@ public class Main { @@ -18,6 +18,12 @@ public class Main {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Stop large look changes from crashing the server
Co-authored-by: Jaren Knodel <Jaren@Knodel.com> Co-authored-by: Jaren Knodel <Jaren@Knodel.com>
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2b7325d3bcea2175ec22a45101f5bbaf29c2231a..09a26622db4bb4b504f735454e2b031f4840b092 100644 index f3ca6f6c7a8f2dc51e263ee879412bf2806b0946..4bda4252889cc42bb5a38c45d87f5ec0f2c281b3 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3076,37 +3076,15 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3136,37 +3136,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.level().getProfiler().pop(); this.level().getProfiler().pop();
this.level().getProfiler().push("rangeChecks"); this.level().getProfiler().push("rangeChecks");
@ -54,10 +54,10 @@ index 2b7325d3bcea2175ec22a45101f5bbaf29c2231a..09a26622db4bb4b504f735454e2b031f
this.level().getProfiler().pop(); this.level().getProfiler().pop();
this.animStep += f2; this.animStep += f2;
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
index 20842ed5b730dda88efd0cda9292a37f879a4017..0a207f3f2e4c0790e784fb4b0c3c2dfa49c39724 100644 index 40348e45b02be9a0b397a883940a476fb6738ef4..734e00caf72a694654319f69f793dcbf616f1784 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
@@ -259,13 +259,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { @@ -298,13 +298,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
} }
protected static float lerpRotation(float prevRot, float newRot) { protected static float lerpRotation(float prevRot, float newRot) {

Datei anzeigen

@ -7,10 +7,10 @@ Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com>
Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java
index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56e24aa4a7 100644 index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b58a3f1abc 100644
--- a/src/main/java/net/minecraft/world/entity/LightningBolt.java --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java
+++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java
@@ -98,7 +98,7 @@ public class LightningBolt extends Entity { @@ -99,7 +99,7 @@ public class LightningBolt extends Entity {
} }
this.powerLightningRod(); this.powerLightningRod();
@ -19,7 +19,7 @@ index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56
this.gameEvent(GameEvent.LIGHTNING_STRIKE); this.gameEvent(GameEvent.LIGHTNING_STRIKE);
} }
} }
@@ -192,7 +192,7 @@ public class LightningBolt extends Entity { @@ -193,7 +193,7 @@ public class LightningBolt extends Entity {
} }
} }
@ -28,7 +28,7 @@ index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56
BlockState iblockdata = world.getBlockState(pos); BlockState iblockdata = world.getBlockState(pos);
BlockPos blockposition1; BlockPos blockposition1;
BlockState iblockdata1; BlockState iblockdata1;
@@ -206,24 +206,29 @@ public class LightningBolt extends Entity { @@ -207,24 +207,29 @@ public class LightningBolt extends Entity {
} }
if (iblockdata1.getBlock() instanceof WeatheringCopper) { if (iblockdata1.getBlock() instanceof WeatheringCopper) {
@ -62,7 +62,7 @@ index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56
if (optional.isEmpty()) { if (optional.isEmpty()) {
break; break;
@@ -234,7 +239,7 @@ public class LightningBolt extends Entity { @@ -235,7 +240,7 @@ public class LightningBolt extends Entity {
} }
@ -71,7 +71,7 @@ index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56
Iterator iterator = BlockPos.randomInCube(world.random, 10, pos, 1).iterator(); Iterator iterator = BlockPos.randomInCube(world.random, 10, pos, 1).iterator();
BlockPos blockposition1; BlockPos blockposition1;
@@ -251,6 +256,7 @@ public class LightningBolt extends Entity { @@ -252,6 +257,7 @@ public class LightningBolt extends Entity {
BlockPos blockposition1Final = blockposition1; // CraftBukkit - decompile error BlockPos blockposition1Final = blockposition1; // CraftBukkit - decompile error
WeatheringCopper.getPrevious(iblockdata).ifPresent((iblockdata1) -> { WeatheringCopper.getPrevious(iblockdata).ifPresent((iblockdata1) -> {
@ -80,10 +80,10 @@ index a298f511c8a7eb208a0dd63b24ec050848a31476..41a3ca4edf4fa662f2af13efd7b78b56
}); });
world.levelEvent(3002, blockposition1, -1); world.levelEvent(3002, blockposition1, -1);
diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java
index 596f4c6b69e5a9bd9eeebee60cf49128264727ae..4f8689e8cbc8b6b9f44168126b95cc864a383c9e 100644 index bc689df6b43d42566aed875de6aa0081341c5c44..9fd2d97ff0e05578a3e6a0b86dc1974691845c5d 100644
--- a/src/main/java/net/minecraft/world/item/AxeItem.java --- a/src/main/java/net/minecraft/world/item/AxeItem.java
+++ b/src/main/java/net/minecraft/world/item/AxeItem.java +++ b/src/main/java/net/minecraft/world/item/AxeItem.java
@@ -60,6 +60,11 @@ public class AxeItem extends DiggerItem { @@ -61,6 +61,11 @@ public class AxeItem extends DiggerItem {
return InteractionResult.PASS; return InteractionResult.PASS;
} else { } else {
ItemStack itemStack = context.getItemInHand(); ItemStack itemStack = context.getItemInHand();
@ -96,10 +96,10 @@ index 596f4c6b69e5a9bd9eeebee60cf49128264727ae..4f8689e8cbc8b6b9f44168126b95cc86
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack);
} }
diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java
index 1977e702f6af39ebf100c1f2f2edc2d1c4d003b0..cfcd1778b5ae66395400221879dde3575591b23d 100644 index 37cfb9694dc06f693b7b54f20bc31dfd9f95c76c..4d8c98db89ae32baa407830d9380ece3b34c642a 100644
--- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java --- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java
+++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java +++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java
@@ -43,6 +43,11 @@ public class EnderEyeItem extends Item { @@ -44,6 +44,11 @@ public class EnderEyeItem extends Item {
return InteractionResult.SUCCESS; return InteractionResult.SUCCESS;
} else { } else {
BlockState iblockdata1 = (BlockState) iblockdata.setValue(EndPortalFrameBlock.HAS_EYE, true); BlockState iblockdata1 = (BlockState) iblockdata.setValue(EndPortalFrameBlock.HAS_EYE, true);
@ -131,13 +131,13 @@ index decabf6fccaca3d1bfeba679ac71677d33315f5e..14d37bf64af719eae3ea154ea7f952cc
CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack);
} }
diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java
index 5c62741e3a3854a7f674bfec49758f837f3bb9a0..b93ed2896ebeb8ec75eb3cfb717a740c97dd9622 100644 index 042a9cf9c15fd30bc30e03d0e0311c70e40e6950..db038cb423c3b951890c81d833aa77ebcea3304f 100644
--- a/src/main/java/net/minecraft/world/item/PotionItem.java --- a/src/main/java/net/minecraft/world/item/PotionItem.java
+++ b/src/main/java/net/minecraft/world/item/PotionItem.java +++ b/src/main/java/net/minecraft/world/item/PotionItem.java
@@ -107,6 +107,12 @@ public class PotionItem extends Item { @@ -109,6 +109,12 @@ public class PotionItem extends Item {
BlockState iblockdata = world.getBlockState(blockposition); BlockState iblockdata = world.getBlockState(blockposition);
if (context.getClickedFace() != Direction.DOWN && iblockdata.is(BlockTags.CONVERTABLE_TO_MUD) && PotionUtils.getPotion(itemstack) == Potions.WATER) { if (context.getClickedFace() != Direction.DOWN && iblockdata.is(BlockTags.CONVERTABLE_TO_MUD) && potioncontents.is(Potions.WATER)) {
+ // Paper start + // Paper start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityhuman, blockposition, Blocks.MUD.defaultBlockState())) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityhuman, blockposition, Blocks.MUD.defaultBlockState())) {
+ entityhuman.containerMenu.sendAllDataToRemote(); + entityhuman.containerMenu.sendAllDataToRemote();
@ -148,10 +148,10 @@ index 5c62741e3a3854a7f674bfec49758f837f3bb9a0..b93ed2896ebeb8ec75eb3cfb717a740c
entityhuman.setItemInHand(context.getHand(), ItemUtils.createFilledResult(itemstack, entityhuman, new ItemStack(Items.GLASS_BOTTLE))); entityhuman.setItemInHand(context.getHand(), ItemUtils.createFilledResult(itemstack, entityhuman, new ItemStack(Items.GLASS_BOTTLE)));
entityhuman.awardStat(Stats.ITEM_USED.get(itemstack.getItem())); entityhuman.awardStat(Stats.ITEM_USED.get(itemstack.getItem()));
diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java
index 6118bee65c1fe65482db2cd8d1e0e3c2dad4c8f3..9aba0211f37501bbd19b583d22fa83eae32390d9 100644 index c0e96284bb470353c0e54ad4e0c2205017913e61..24f6a158e4759aac3be8da4cf5e0d40bd295355b 100644
--- a/src/main/java/net/minecraft/world/item/ShovelItem.java --- a/src/main/java/net/minecraft/world/item/ShovelItem.java
+++ b/src/main/java/net/minecraft/world/item/ShovelItem.java +++ b/src/main/java/net/minecraft/world/item/ShovelItem.java
@@ -45,20 +45,29 @@ public class ShovelItem extends DiggerItem { @@ -46,20 +46,29 @@ public class ShovelItem extends DiggerItem {
Player player = context.getPlayer(); Player player = context.getPlayer();
BlockState blockState2 = FLATTENABLES.get(blockState.getBlock()); BlockState blockState2 = FLATTENABLES.get(blockState.getBlock());
BlockState blockState3 = null; BlockState blockState3 = null;
@ -183,23 +183,24 @@ index 6118bee65c1fe65482db2cd8d1e0e3c2dad4c8f3..9aba0211f37501bbd19b583d22fa83ea
level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, blockState3)); level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, blockState3));
if (player != null) { if (player != null) {
diff --git a/src/main/java/net/minecraft/world/level/block/CakeBlock.java b/src/main/java/net/minecraft/world/level/block/CakeBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/CakeBlock.java b/src/main/java/net/minecraft/world/level/block/CakeBlock.java
index 49fe91a8eaeb2580c8ad0166e72540168af605f6..ca1ccedb5a551328ebfad907f39594b220efaefe 100644 index 430312f4e67a253465c54e3fe5e5cfad365cfa22..e1d853e5cb97046dd481cd14b4199be27c593d3b 100644
--- a/src/main/java/net/minecraft/world/level/block/CakeBlock.java --- a/src/main/java/net/minecraft/world/level/block/CakeBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CakeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CakeBlock.java
@@ -62,6 +62,12 @@ public class CakeBlock extends Block { @@ -64,7 +64,12 @@ public class CakeBlock extends Block {
Block block = Block.byItem(item);
if (block instanceof CandleBlock) { if (block instanceof CandleBlock) {
CandleBlock candleblock = (CandleBlock) block;
-
+ // Paper start - call change block event + // Paper start - call change block event
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, CandleCakeBlock.byCandle(block))) { + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, CandleCakeBlock.byCandle(block))) {
+ player.containerMenu.sendAllDataToRemote(); // update inv because candle could decrease + player.containerMenu.sendAllDataToRemote(); // update inv because candle could decrease
+ return InteractionResult.PASS; + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
+ } + }
+ // Paper end - call change block event + // Paper end - call change block event
if (!player.isCreative()) { if (!player.isCreative()) {
itemstack.shrink(1); stack.shrink(1);
} }
@@ -91,6 +97,14 @@ public class CakeBlock extends Block { @@ -99,6 +104,14 @@ public class CakeBlock extends Block {
if (!player.canEat(false)) { if (!player.canEat(false)) {
return InteractionResult.PASS; return InteractionResult.PASS;
} else { } else {
@ -214,23 +215,23 @@ index 49fe91a8eaeb2580c8ad0166e72540168af605f6..ca1ccedb5a551328ebfad907f39594b2
player.awardStat(Stats.EAT_CAKE_SLICE); player.awardStat(Stats.EAT_CAKE_SLICE);
// CraftBukkit start // CraftBukkit start
// entityhuman.getFoodData().eat(2, 0.1F); // entityhuman.getFoodData().eat(2, 0.1F);
@@ -104,7 +118,7 @@ public class CakeBlock extends Block { @@ -112,7 +125,7 @@ public class CakeBlock extends Block {
((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().sendHealthUpdate(); ((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().sendHealthUpdate();
// CraftBukkit end // CraftBukkit end
- int i = (Integer) state.getValue(CakeBlock.BITES); - int i = (Integer) state.getValue(CakeBlock.BITES);
+ // Paper - move up + // Paper - move up
world.gameEvent((Entity) player, GameEvent.EAT, pos); world.gameEvent((Entity) player, (Holder) GameEvent.EAT, pos);
if (i < 6) { if (i < 6) {
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index 6cccdd1d19488275ff3fe90838cf1c31e844d517..413b307acaad5823b9e06f49fa2faf561f5f7b9a 100644 index 804adb5ed92dfcf4c29c756dd95d7164150a9666..fcd8a977eaa52cd478507c3b44fa72b194df9540 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -238,6 +238,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @@ -239,6 +239,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) { if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) {
if (i < 7 && !world.isClientSide) { if (i < 7 && !world.isClientSide) {
BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack); BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, stack);
+ // Paper start - handle cancelled events + // Paper start - handle cancelled events
+ if (iblockdata1 == null) { + if (iblockdata1 == null) {
+ return InteractionResult.PASS; + return InteractionResult.PASS;
@ -238,8 +239,8 @@ index 6cccdd1d19488275ff3fe90838cf1c31e844d517..413b307acaad5823b9e06f49fa2faf56
+ // Paper end + // Paper end
world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0); world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0);
player.awardStat(Stats.ITEM_USED.get(itemstack.getItem())); player.awardStat(Stats.ITEM_USED.get(stack.getItem()));
@@ -261,11 +266,16 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @@ -269,11 +274,16 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) { if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) {
// CraftBukkit start // CraftBukkit start
double rand = world.getRandom().nextDouble(); double rand = world.getRandom().nextDouble();
@ -258,7 +259,7 @@ index 6cccdd1d19488275ff3fe90838cf1c31e844d517..413b307acaad5823b9e06f49fa2faf56
// CraftBukkit end // CraftBukkit end
stack.shrink(1); stack.shrink(1);
@@ -306,11 +316,13 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @@ -314,11 +324,13 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
return iblockdata1; return iblockdata1;
} }
@ -272,7 +273,7 @@ index 6cccdd1d19488275ff3fe90838cf1c31e844d517..413b307acaad5823b9e06f49fa2faf56
static BlockState addItem(@Nullable Entity entity, BlockState iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand) { static BlockState addItem(@Nullable Entity entity, BlockState iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand) {
// CraftBukkit end // CraftBukkit end
int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL);
@@ -321,6 +333,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { @@ -329,6 +341,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
} else { } else {
int j = i + 1; int j = i + 1;
BlockState iblockdata1 = (BlockState) iblockdata.setValue(ComposterBlock.LEVEL, j); BlockState iblockdata1 = (BlockState) iblockdata.setValue(ComposterBlock.LEVEL, j);
@ -283,12 +284,12 @@ index 6cccdd1d19488275ff3fe90838cf1c31e844d517..413b307acaad5823b9e06f49fa2faf56
+ // Paper end + // Paper end
generatoraccess.setBlock(blockposition, iblockdata1, 3); generatoraccess.setBlock(blockposition, iblockdata1, 3);
generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1)); generatoraccess.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1));
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
index 55b0e2bf98a285cdcd30e40d94192b7a1802efd8..d445ed0895293dd45c36226051f5809be8587ebe 100644 index b18494d2a83473e9bc4197f86ff599de59043217..6fb7ec36f6f7a3021fac4b9e31fd333dfd5ea5e5 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
@@ -264,7 +264,13 @@ public class BeehiveBlockEntity extends BlockEntity { @@ -259,7 +259,13 @@ public class BeehiveBlockEntity extends BlockEntity {
--j; --j;
} }
@ -304,13 +305,13 @@ index 55b0e2bf98a285cdcd30e40d94192b7a1802efd8..d445ed0895293dd45c36226051f5809b
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index 67c9009b735429e887e706baf50a6023d572a46c..7956002e2d4d583c27e277562312d27ea6871557 100644 index daf3c26fce7569761951bfd5594c6726d854a9ff..e8a73d34dbb372581b03018aade170a31c266099 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -120,7 +120,7 @@ public class DummyGeneratorAccess implements WorldGenLevel { @@ -120,7 +120,7 @@ public class DummyGeneratorAccess implements WorldGenLevel {
@Override @Override
public void gameEvent(GameEvent event, Vec3 emitterPos, GameEvent.Context emitter) { public void gameEvent(Holder<GameEvent> event, Vec3 emitterPos, GameEvent.Context emitter) {
- // Used by BlockComposter - // Used by BlockComposter
+ // Used by ComposterBlock + // Used by ComposterBlock
} }

Datei anzeigen

@ -5,23 +5,23 @@ Subject: [PATCH] Missing eating regain reason
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java 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 1d0c424be2b67cad0f8bca85070a9c46a6b283da..f760ce7d9df79ef58f8963de3e901cba3e12fcaa 100644 index 57c22ca91e9f3a161f5277914e379ea9dc8eeeef..827c5800b9e898418ff7a641c97ffb86935a914c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -387,7 +387,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> { @@ -408,7 +408,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
if (!(item instanceof DyeItem)) {
if (item.isEdible() && this.isFood(itemstack) && this.getHealth() < this.getMaxHealth()) {
this.usePlayerItem(player, hand, itemstack); this.usePlayerItem(player, hand, itemstack);
- this.heal((float) item.getFoodProperties().getNutrition()); FoodProperties foodinfo = (FoodProperties) itemstack.get(DataComponents.FOOD);
+ this.heal((float) item.getFoodProperties().getNutrition(), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
return InteractionResult.CONSUME; - this.heal(foodinfo != null ? (float) foodinfo.nutrition() : 1.0F);
+ this.heal(foodinfo != null ? (float) foodinfo.nutrition() : 1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
} }
return InteractionResult.sidedSuccess(this.level().isClientSide());
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 87c8460324ff2d2a14e1404fcfa3adb2d336a089..090d36d73b12fec59782142e2e85f17ba35dc6be 100644 index 09aa76ec6f89163c1221721008ccb541eaf420ca..f3fcfd3b358f496d26748099e1d5a95721a6a0d8 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -392,7 +392,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -383,7 +383,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
boolean flag = this.getHealth() < this.getMaxHealth(); boolean flag = this.getHealth() < this.getMaxHealth();
if (flag) { if (flag) {
@ -31,10 +31,10 @@ index 87c8460324ff2d2a14e1404fcfa3adb2d336a089..090d36d73b12fec59782142e2e85f17b
boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove(); boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove();
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
index 91fb62807b3c5600c83d4dc8d3fadf36e94e2133..9b5b894d43f25566ab9c3698705e978ab823a0d2 100644 index 4fa1a12e7e5c23e1d902b59f2a315eac64134aa8..d4eceb535561e11f5f7ab891e81aac285f3cd828 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
@@ -196,7 +196,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V @@ -188,7 +188,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
} }
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) { if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Missing effect cause
diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
index af5db5da4e5b2fd90a5cf0ca3c92e87ba82d4779..b21e180641d17438997a80e5bcb0ec7998d24a2e 100644 index 0a6ebd5c5fcad420659f3ade3280beaf6ac115f2..a8cc6ddbf45370fe632e5c5fb7ceef3d299e62a4 100644
--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java --- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -419,7 +419,7 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder<Axolo @@ -407,7 +407,7 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder<Axolo
player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, j, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // CraftBukkit player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, j, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // CraftBukkit
} }
@ -18,7 +18,7 @@ index af5db5da4e5b2fd90a5cf0ca3c92e87ba82d4779..b21e180641d17438997a80e5bcb0ec79
@Override @Override
diff --git a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java diff --git a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
index 5d27598d62c1ddfc84bac64228275749ec01cba5..f0061dab24ee5ee94c151483a553db2590108581 100644 index d6715103e264eb7b345e19ea486d83f2ce289ca4..55c21d394734230e10e32e0e10de6ff7b20decc9 100644
--- a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java --- a/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
+++ b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java +++ b/src/main/java/net/minecraft/world/item/HoneyBottleItem.java
@@ -28,7 +28,7 @@ public class HoneyBottleItem extends Item { @@ -28,7 +28,7 @@ public class HoneyBottleItem extends Item {
@ -31,15 +31,15 @@ index 5d27598d62c1ddfc84bac64228275749ec01cba5..f0061dab24ee5ee94c151483a553db25
if (stack.isEmpty()) { if (stack.isEmpty()) {
diff --git a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java diff --git a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java
index 6322eddcf097572f24216eefdb9b6b5dedf5edbe..4cc05188a4408e076b6babc91dd24f772f0c7d70 100644 index c980abc27fb14b207d35d08a0c4557b1e525f1b9..3019122ad653ed8a5da64f3ab7b81169c4d9e9c6 100644
--- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java --- a/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java
+++ b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java +++ b/src/main/java/net/minecraft/world/item/SuspiciousStewItem.java
@@ -58,7 +58,7 @@ public class SuspiciousStewItem extends Item { @@ -37,7 +37,7 @@ public class SuspiciousStewItem extends Item {
@Override SuspiciousStewEffects suspiciousStewEffects = stack.getOrDefault(DataComponents.SUSPICIOUS_STEW_EFFECTS, SuspiciousStewEffects.EMPTY);
public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity user) {
ItemStack itemStack = super.finishUsingItem(stack, world, user); for (SuspiciousStewEffects.Entry entry : suspiciousStewEffects.effects()) {
- listPotionEffects(itemStack, effect -> user.addEffect(effect.createEffectInstance())); - user.addEffect(entry.createEffectInstance());
+ listPotionEffects(itemStack, effect -> user.addEffect(effect.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD)); // Paper - Add missing effect cause + user.addEffect(entry.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause
return user instanceof Player && ((Player)user).getAbilities().instabuild ? itemStack : new ItemStack(Items.BOWL);
}
} }
super.finishUsingItem(stack, world, user);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 5a760234a4604cec289705f1439f03c821bb0aab..9ae20d759965bc9b88b52c15372155ad10bcc199 100644 index 6344ab27c113dd42c729e0b05b957670c4930722..bf58fb8acd09723cbc55f6ac41c24cccda97bac8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -562,8 +562,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -561,8 +561,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
} }
@Override @Override
@ -25,7 +25,7 @@ index 5a760234a4604cec289705f1439f03c821bb0aab..9ae20d759965bc9b88b52c15372155ad
Preconditions.checkState(!this.getHandle().generation, "Cannot launch projectile during world generation"); Preconditions.checkState(!this.getHandle().generation, "Cannot launch projectile during world generation");
net.minecraft.world.level.Level world = ((CraftWorld) this.getWorld()).getHandle(); net.minecraft.world.level.Level world = ((CraftWorld) this.getWorld()).getHandle();
@@ -650,6 +657,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -649,6 +656,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
if (velocity != null) { if (velocity != null) {
((T) launch.getBukkitEntity()).setVelocity(velocity); ((T) launch.getBukkitEntity()).setVelocity(velocity);
} }

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Call BlockPhysicsEvent more often
diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
index 457a963ee6ebd3cf5c3831f6660e3850335af49f..106af2b2c7ff72c7549975aef75cdcff8d9a7d97 100644 index 61744d8fde3ba98585cf261fc09f0acc042b67b8..c0adfa72a6b43b72825797572c5c2557042e2a42 100644
--- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java --- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
+++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java +++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java
@@ -119,7 +119,20 @@ public class CollectingNeighborUpdater implements NeighborUpdater { @@ -119,7 +119,20 @@ public class CollectingNeighborUpdater implements NeighborUpdater {

Datei anzeigen

@ -7,11 +7,11 @@ Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type
TODO: Remove in 1.21? TODO: Remove in 1.21?
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
index 010014c06fcea7d603160928f124f54d6e5e63d8..bc008773f8cf0d416182152ecfc5a64b70744009 100644 index b08de24fbc5addefe61d5b1919898775260d4a54..c46bb5ab1a9f365099a5e86ec6411e504fac372f 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
@@ -394,6 +394,12 @@ public class Commodore { @@ -373,6 +373,12 @@ public class Commodore {
super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE_PREFIX + "advancement/CraftAdvancement", "getDisplay0", desc, false);
return; return;
} }
+ if (owner.equals("org/bukkit/WorldCreator") && name.equals("keepSpawnLoaded") && desc.equals("(Lnet/kyori/adventure/util/TriState;)V")) { + if (owner.equals("org/bukkit/WorldCreator") && name.equals("keepSpawnLoaded") && desc.equals("(Lnet/kyori/adventure/util/TriState;)V")) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] fix Jigsaw block kicking user
diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
index f39a35f7c6ee61d5d7375e9792957f27e507cf0c..447b0359922011fe12b1bb9628d23a47c9d7dc89 100644 index 3a80b0e9c0e12a84034aadebd0ff6f6b51d0d2ea..922592f2073eaea8ca361a3a1efcda8b18bea21c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java
@@ -136,7 +136,12 @@ public class JigsawBlockEntity extends BlockEntity { @@ -137,7 +137,12 @@ public class JigsawBlockEntity extends BlockEntity {
public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) { public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) {
BlockPos blockPos = this.getBlockPos().relative(this.getBlockState().getValue(JigsawBlock.ORIENTATION).front()); BlockPos blockPos = this.getBlockPos().relative(this.getBlockState().getValue(JigsawBlock.ORIENTATION).front());
Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL); Registry<StructureTemplatePool> registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL);
@ -23,10 +23,10 @@ index f39a35f7c6ee61d5d7375e9792957f27e507cf0c..447b0359922011fe12b1bb9628d23a47
} }
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
index c8e41cd51bddfafb3675352ea9ec39188ee91a80..488ddcc22dfb08baedc080326b1531151826a702 100644 index 23ac340661cf0f5940c0d6333c74a9c7b36dca26..7ba11f734bd73dde165d155a633b47dac979a8e9 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java --- a/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/pools/StructureTemplatePool.java
@@ -98,7 +98,13 @@ public class StructureTemplatePool { @@ -97,7 +97,13 @@ public class StructureTemplatePool {
} }
public StructurePoolElement getRandomTemplate(RandomSource random) { public StructurePoolElement getRandomTemplate(RandomSource random) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] use BlockFormEvent for mud converting into clay
diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
index d0e679745a794228bf62a9aa59422776760f3867..5835872df922b859a31b44e3723c67097f21a641 100644 index 95cb7492ac691a8e8aa9894f701b802a7eda5446..a2bd54dae4b0460d200f6d5300194a7ef5a28830 100644
--- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java --- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
@@ -214,10 +214,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate @@ -215,10 +215,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
if (((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState.is(Blocks.MUD) && fluidtype == Fluids.WATER) { if (((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState.is(Blocks.MUD) && fluidtype == Fluids.WATER) {
BlockState iblockdata1 = Blocks.CLAY.defaultBlockState(); BlockState iblockdata1 = Blocks.CLAY.defaultBlockState();
@ -16,7 +16,7 @@ index d0e679745a794228bf62a9aa59422776760f3867..5835872df922b859a31b44e3723c6709
+ // Paper start - Call BlockFormEvent + // Paper start - Call BlockFormEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, iblockdata1)) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, iblockdata1)) {
Block.pushEntitiesUp(((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState, iblockdata1, world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos); Block.pushEntitiesUp(((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState, iblockdata1, world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos);
world.gameEvent(GameEvent.BLOCK_CHANGE, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, GameEvent.Context.of(iblockdata1)); world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, GameEvent.Context.of(iblockdata1));
world.levelEvent(1504, blockposition1, 0); world.levelEvent(1504, blockposition1, 0);
+ } + }
+ // Paper end - Call BlockFormEvent + // Paper end - Call BlockFormEvent

Datei anzeigen

@ -7,10 +7,10 @@ Originally added isPreferredTool to BlockData but
upstream added that. upstream added that.
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
index 08716e757b2e100f7bc47a046f02db664d882aba..2cfaa59a0bb6b5253b5a8dcc38ae65e0f085fd3f 100644 index e96023b71845526383288917e8d7c5759a4c0e9b..fa63a6cfcfcc4eee4503a82d85333c139c8c8b2b 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
@@ -337,5 +337,24 @@ public class CraftBlockState implements BlockState { @@ -347,5 +347,24 @@ public class CraftBlockState implements BlockState {
public boolean isCollidable() { public boolean isCollidable() {
return this.data.getBlock().hasCollision; return this.data.getBlock().hasCollision;
} }

Datei anzeigen

@ -3,9 +3,6 @@ From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Mon, 11 Jul 2022 11:56:41 -0700 Date: Mon, 11 Jul 2022 11:56:41 -0700
Subject: [PATCH] Fix a bunch of vanilla bugs Subject: [PATCH] Fix a bunch of vanilla bugs
https://bugs.mojang.com/browse/MC-253884
show raid entity event to all tracking players
https://bugs.mojang.com/browse/MC-253721 https://bugs.mojang.com/browse/MC-253721
wrong msg for opping multiple players wrong msg for opping multiple players
@ -49,12 +46,6 @@ https://bugs.mojang.com/browse/MC-123848
https://bugs.mojang.com/browse/MC-84789 https://bugs.mojang.com/browse/MC-84789
Fix wild wolves not considering bones interesting Fix wild wolves not considering bones interesting
https://bugs.mojang.com/browse/MC-225381
Fix overfilled bundles duplicating items / being filled with air
https://bugs.mojang.com/browse/MC-173303
Fix leashed pets teleporting to owner when loaded
https://bugs.mojang.com/browse/MC-174630 https://bugs.mojang.com/browse/MC-174630
Fix secondary beacon effect remaining after switching effect Fix secondary beacon effect remaining after switching effect
@ -74,10 +65,10 @@ Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 829c72333664da0c06ce04af93ea39bb90ce0b67..b4f7e3ae855cbf48925f0db916501adf513ae08c 100644 index f880f9faa1e5660853f28c0e2daf4ab6bc6a55fd..2bb3d1f0b89ef5b9b1f9f8da1070d21168830645 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java --- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -351,7 +351,7 @@ public interface DispenseItemBehavior { @@ -241,7 +241,7 @@ public interface DispenseItemBehavior {
} }
} }
// CraftBukkit end // CraftBukkit end
@ -113,10 +104,10 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520
} }
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index f2d3dc066b00b685715eb5104234945c41a15f92..43c8f6a0615f392cc560b2259b116cc9d5fba4e7 100644 index 3532febc8e34c8436a69a4c4b472b1776f21ee48..de19a5ea96fa38621513e970e04d153576f4f6ae 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1233,7 +1233,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1252,7 +1252,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end // CraftBukkit end
} }
@ -126,10 +117,10 @@ index f2d3dc066b00b685715eb5104234945c41a15f92..43c8f6a0615f392cc560b2259b116cc9
return this.anyPlayerCloseEnoughForSpawning(pos, false); return this.anyPlayerCloseEnoughForSpawning(pos, false);
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 57f54e3399f9d2d7fecdae62858d20e50caf7afd..b804941c76582871813ba813b9eef2422e7e71f0 100644 index 90500b6a5b3612c85a06660fe67e89351d4c0fd1..78fc8689438d90eb792f7836f6b2ec03be0b407c 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -770,7 +770,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -776,7 +776,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} else { } else {
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D); AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D);
List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> { List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> {
@ -139,10 +130,10 @@ index 57f54e3399f9d2d7fecdae62858d20e50caf7afd..b804941c76582871813ba813b9eef242
if (!list.isEmpty()) { if (!list.isEmpty()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index c99a672dd2d2e4972e9d4025e10e8863d0af1e6a..d831fb1f66dc38b6c9d3592944f94cc5eeaac864 100644 index 22e9009e2943a70f21da6fa1ceefb5cfc9d20dab..9a56a019b604e95f9ce536333223fa058d2a6550 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -419,14 +419,14 @@ public class ServerPlayer extends Player { @@ -435,14 +435,14 @@ public class ServerPlayer extends Player {
BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i); BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i);
if (blockposition1 != null) { if (blockposition1 != null) {
@ -160,10 +151,10 @@ index c99a672dd2d2e4972e9d4025e10e8863d0af1e6a..d831fb1f66dc38b6c9d3592944f94cc5
while (!world.noCollision((Entity) this) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) { while (!world.noCollision((Entity) this) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) {
this.setPos(this.getX(), this.getY() + 1.0D, this.getZ()); this.setPos(this.getX(), this.getY() + 1.0D, this.getZ());
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index f3389dc345d8b6e5389ae37848d9b268d4bbad83..5d1b8bae981dc538ee1fe4fb993e44f227168233 100644 index 77e78808171daac78502ef3fcc70f03579eaa9e3..0cfdd01778fb4f2150a4dea2d9dc6b3b830af987 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -92,7 +92,7 @@ public class ServerPlayerGameMode { @@ -91,7 +91,7 @@ public class ServerPlayerGameMode {
return event; // Paper - Expand PlayerGameModeChangeEvent return event; // Paper - Expand PlayerGameModeChangeEvent
} }
// CraftBukkit end // CraftBukkit end
@ -173,10 +164,10 @@ index f3389dc345d8b6e5389ae37848d9b268d4bbad83..5d1b8bae981dc538ee1fe4fb993e44f2
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList(); this.level.updateSleepingPlayerList();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 6fbcea8fd32a425cab936330d5d9545782e03346..1478def0ba4bc02c1c466d80cc2b90919612c18a 100644 index 42d609cc3bd13e957b6f2194552da34393849790..b2634bdedfe8359da602cf600a2bdddbd762e7c2 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -710,8 +710,10 @@ public abstract class PlayerList { @@ -709,8 +709,10 @@ public abstract class PlayerList {
Player player = entity.getBukkitEntity(); Player player = entity.getBukkitEntity();
PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress()); PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress());
@ -250,19 +241,6 @@ index d802985f1431be4332c07f0dab88feebedea4ce2..4e2c23ccdf4e4a4d65b291dbe20952ba
if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) { if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) {
return false; return false;
} else { } else {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
index 11cc26954b4e97114b59df35a4f9b75a09132e20..0a3f7dcc0e205a85dbaa6dee1fc9ae2c7fa9e02d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
@@ -74,7 +74,7 @@ public class FollowOwnerGoal extends Goal {
}
private boolean unableToMove() {
- return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed();
+ return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed() || this.tamable.leashInfoTag != null; // Paper - Fix MC-173303
}
@Override
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java
index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c9af362b9 100644 index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c9af362b9 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java
@ -282,10 +260,10 @@ index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c
public void start() { public void start() {
this.creeper.getNavigation().stop(); this.creeper.getNavigation().stop();
diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
index 110dd5418b0512a2f27f0c4d5a5f1812356a6a12..5d247ac38fe8a61603b3d934f3000bcda773142b 100644 index 923806900ef6248576e71260d40e9caf2c8943e8..02e49c7ae5e120302b6479cf3e3934b9217eebf0 100644
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
@@ -239,9 +239,10 @@ public class Goat extends Animal { @@ -243,9 +243,10 @@ public class Goat extends Animal {
player.setItemInHand(hand, itemstack1); player.setItemInHand(hand, itemstack1);
return InteractionResult.sidedSuccess(this.level().isClientSide); return InteractionResult.sidedSuccess(this.level().isClientSide);
} else { } else {
@ -298,10 +276,10 @@ index 110dd5418b0512a2f27f0c4d5a5f1812356a6a12..5d247ac38fe8a61603b3d934f3000bcd
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
index 56cc6ecf7f95687db7c7c062b4ee979bfe49844b..94dd97662ba07689fbfa16ef5c7d99fe12ce83de 100644 index 57952ad65c905265799ba2d8f99cc4cf4aa69f94..8cae4e154ca07493aba9acadd4ff7150d7ae4f67 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java --- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
@@ -252,7 +252,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener, @@ -321,7 +321,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
@Override @Override
public void equipSaddle(@Nullable SoundSource sound) { public void equipSaddle(@Nullable SoundSource sound) {
@ -315,13 +293,13 @@ index 56cc6ecf7f95687db7c7c062b4ee979bfe49844b..94dd97662ba07689fbfa16ef5c7d99fe
+ // Paper end + // Paper end
} }
public void equipArmor(Player player, ItemStack stack) { public void equipBodyArmor(Player player, ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java 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 ab85050a64d4897aff11d0780d8cb26660918ac7..bfb9694087821de206fafe867f207e07a4a6a988 100644 index bb22b84c32848869967a47a60f9d8a0629a59e2a..cb3de05dba7daa925b6fa7e0c7bbb8e3c53b51f4 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -282,6 +282,14 @@ public class ItemFrame extends HangingEntity { @@ -295,6 +295,14 @@ public class ItemFrame extends HangingEntity {
} return (ItemStack) this.getEntityData().get(ItemFrame.DATA_ITEM);
} }
+ // Paper start - Fix MC-123848 (spawn item frame drops above block) + // Paper start - Fix MC-123848 (spawn item frame drops above block)
@ -332,83 +310,39 @@ index ab85050a64d4897aff11d0780d8cb26660918ac7..bfb9694087821de206fafe867f207e07
+ } + }
+ // Paper end + // Paper end
+ +
private void removeFramedMap(ItemStack itemstack) { @Nullable
this.getFramedMapId().ifPresent((i) -> { public MapId getFramedMapId() {
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level()); return (MapId) this.getItem().get(DataComponents.MAP_ID);
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
index c718cee92522a0d3c0e30eafd09fa8178c7e6e4a..5d1610eddcaf0cf65c726a5438b42e53bab85332 100644 index 08dcc94c9eca9a5fd61055f05b7737ba5840b5bf..e0e5046c84941a8d17e18c177f3daea9cb631940 100644
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
@@ -83,8 +83,8 @@ public class CatSpawner implements CustomSpawner { @@ -82,8 +82,8 @@ public class CatSpawner implements CustomSpawner {
if (cat == null) { if (cat == null) {
return 0; return 0;
} else { } else {
+ cat.moveTo(pos, 0.0F, 0.0F); // Paper - move up - Fix MC-147659 + cat.moveTo(pos, 0.0F, 0.0F); // Paper - move up - Fix MC-147659
cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null, null); cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null);
- cat.moveTo(pos, 0.0F, 0.0F); - cat.moveTo(pos, 0.0F, 0.0F);
world.addFreshEntityWithPassengers(cat); world.addFreshEntityWithPassengers(cat);
return 1; return 1;
} }
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raids.java b/src/main/java/net/minecraft/world/entity/raid/Raids.java
index 4a0f4c83228187a2082ad029680056b1801f77bd..31831811ce16265e9828fa34d9e67d8ac195d723 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raids.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raids.java
@@ -134,7 +134,7 @@ public class Raids extends SavedData {
// CraftBukkit end
} else {
player.removeEffect(MobEffects.BAD_OMEN);
- player.connection.send(new ClientboundEntityEventPacket(player, (byte) 43));
+ this.level.broadcastEntityEvent(player, net.minecraft.world.entity.EntityEvent.BAD_OMEN_TRIGGERED /* (byte) 43 */); // Paper - Fix MC-253884
}
if (flag) {
@@ -149,7 +149,7 @@ public class Raids extends SavedData {
}
// CraftBukkit end
raid.absorbBadOmen(player);
- player.connection.send(new ClientboundEntityEventPacket(player, (byte) 43));
+ this.level.broadcastEntityEvent(player, net.minecraft.world.entity.EntityEvent.BAD_OMEN_TRIGGERED /* (byte) 43 */); // Paper - Fix MC-253884
if (!raid.hasFirstWaveSpawned()) {
player.awardStat(Stats.RAID_TRIGGER);
CriteriaTriggers.BAD_OMEN.trigger(player);
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
index b670c0cb3886c99d38a91b5c13aa2cefaae702cf..9599a5f96601030bf7f7cbd3392861d626959f9d 100644 index 866dd476829bd59501021a8c24bde6d8e8778963..580e5714c62aef5a5fdd16606712b96f3d41c938 100644
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
@@ -177,6 +177,11 @@ public class BeaconMenu extends AbstractContainerMenu { @@ -178,6 +178,11 @@ public class BeaconMenu extends AbstractContainerMenu {
// Paper end - Add PlayerChangeBeaconEffectEvent // Paper end - Add PlayerChangeBeaconEffectEvent
public void updateEffects(Optional<MobEffect> primary, Optional<MobEffect> secondary) { public void updateEffects(Optional<Holder<MobEffect>> primary, Optional<Holder<MobEffect>> secondary) {
+ // Paper start - fix MC-174630 - validate secondary power + // Paper start - fix MC-174630 - validate secondary power
+ if (secondary.isPresent() && secondary.get() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) { + if (secondary.isPresent() && secondary.get().value() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) {
+ secondary = Optional.empty(); + secondary = Optional.empty();
+ } + }
+ // Paper end + // Paper end
if (this.paymentSlot.hasItem()) { if (this.paymentSlot.hasItem()) {
// Paper start - Add PlayerChangeBeaconEffectEvent // Paper start - Add PlayerChangeBeaconEffectEvent
io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock()); io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock());
diff --git a/src/main/java/net/minecraft/world/item/BundleItem.java b/src/main/java/net/minecraft/world/item/BundleItem.java
index 1e538c691d867a96a57fec9350b4f663d01f8e93..c4c966c555407b7146053187e2ed16cfb99a2dc9 100644
--- a/src/main/java/net/minecraft/world/item/BundleItem.java
+++ b/src/main/java/net/minecraft/world/item/BundleItem.java
@@ -49,7 +49,7 @@ public class BundleItem extends Item {
removeOne(stack).ifPresent(removedStack -> add(stack, slot.safeInsert(removedStack)));
} else if (itemStack.getItem().canFitInsideContainerItems()) {
int i = (64 - getContentWeight(stack)) / getWeight(itemStack);
- int j = add(stack, slot.safeTake(itemStack.getCount(), i, player));
+ int j = add(stack, slot.safeTake(itemStack.getCount(), Math.max(0, i), player)); // Paper - prevent item addition on overfilled bundles - safeTake will yield EMPTY for amount == 0.
if (j > 0) {
this.playInsertSound(player);
}
@@ -120,7 +120,7 @@ public class BundleItem extends Item {
int i = getContentWeight(bundle);
int j = getWeight(stack);
int k = Math.min(stack.getCount(), (64 - i) / j);
- if (k == 0) {
+ if (k <= 0) { // Paper - prevent item addition on overfilled bundles
return 0;
} else {
ListTag listTag = compoundTag.getList("Items", 10);
diff --git a/src/main/java/net/minecraft/world/item/SaddleItem.java b/src/main/java/net/minecraft/world/item/SaddleItem.java diff --git a/src/main/java/net/minecraft/world/item/SaddleItem.java b/src/main/java/net/minecraft/world/item/SaddleItem.java
index a569b404ece21fa9571e73947334f5aa57a8080c..51d350add4ca1756cb9e364e066bbee7949ffb8c 100644 index a569b404ece21fa9571e73947334f5aa57a8080c..51d350add4ca1756cb9e364e066bbee7949ffb8c 100644
--- a/src/main/java/net/minecraft/world/item/SaddleItem.java --- a/src/main/java/net/minecraft/world/item/SaddleItem.java
@ -423,7 +357,7 @@ index a569b404ece21fa9571e73947334f5aa57a8080c..51d350add4ca1756cb9e364e066bbee7
stack.shrink(1); stack.shrink(1);
} }
diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
index 655956f3c50d6a78b0cbfaa23d6a62cd776c1e52..85484d061090d989de8246df81f8e9e5f8906072 100644 index cd90129be2cf8095abd80528e5de3bbe05022a9d..65dfad03a9f82d2ce65d0ec7d5bd22bd6fed15a2 100644
--- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java --- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
@@ -51,4 +51,11 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock { @@ -51,4 +51,11 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock {
@ -439,10 +373,10 @@ index 655956f3c50d6a78b0cbfaa23d6a62cd776c1e52..85484d061090d989de8246df81f8e9e5
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
index 42c1e3dfec23d6a7d832bf73d47ecae1212ec2c9..a4857675772d4fe849ba85fc21a369decca42fc0 100644 index fa5366961861370c2366e6f0ff026a6d65128316..a5c7c2d24498c66159316a4f92677625975ce5ca 100644
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java --- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
@@ -68,7 +68,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock { @@ -69,7 +69,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) { if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start // CraftBukkit start
@ -452,10 +386,10 @@ index 42c1e3dfec23d6a7d832bf73d47ecae1212ec2c9..a4857675772d4fe849ba85fc21a369de
return; return;
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4..d7beeac4a8e4a16221809663a5aa03389a759742 100644 index 614ddebb92aba91694951fc22900fed362b3426d..d19e799491f790ca967a0731ef95a06993a7ab9a 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -675,13 +675,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @@ -645,13 +645,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@Override @Override
public void fillStackedContents(StackedContents finder) { public void fillStackedContents(StackedContents finder) {
@ -474,10 +408,10 @@ index c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4..d7beeac4a8e4a16221809663a5aa0338
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 61a618f09af475407a78343eecb4352052b1df1e..247f24c7fadc203ee0f6a6f85122c91ab4c82f80 100644 index 7cec5aeee93e4fb14d403559293ec3c9be7955a6..35c7d05b1898adf6b193d0b0b53f3c3be186d4ce 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -291,7 +291,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -295,7 +295,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition); org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent(); new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent();
// Paper end - beacon activation/deactivation events // Paper end - beacon activation/deactivation events

Datei anzeigen

@ -5,22 +5,22 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b804941c76582871813ba813b9eef2422e7e71f0..b5eda9931a82a667c25ca1a49980b01b042dc0cc 100644 index 78fc8689438d90eb792f7836f6b2ec03be0b407c..79d91a4e54a20c0b3681eaeb7245acda0ab5bbc3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2263,7 +2263,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2216,7 +2216,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) { }
Mob entityinsentient = (Mob) entity;
if (entity instanceof Mob entityinsentient) {
- if (ServerLevel.this.isUpdatingNavigations) { - if (ServerLevel.this.isUpdatingNavigations) {
+ if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning + if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning
String s = "onTrackingStart called during navigation iteration"; String s = "onTrackingStart called during navigation iteration";
Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")); Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration"));
@@ -2348,7 +2348,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2296,7 +2296,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (entity instanceof Mob) { }
Mob entityinsentient = (Mob) entity;
if (entity instanceof Mob entityinsentient) {
- if (ServerLevel.this.isUpdatingNavigations) { - if (ServerLevel.this.isUpdatingNavigations) {
+ if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning + if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning
String s = "onTrackingStart called during navigation iteration"; String s = "onTrackingStart called during navigation iteration";

Datei anzeigen

@ -7,7 +7,7 @@ Upstream didn't modify the isLovedItem check in wantsToPickup
so piglins never actually tried to pickup interestItems so piglins never actually tried to pickup interestItems
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index 9d905ba5c306409ff846f93e3569d1e4c3c6bbf7..2a3bdf7cd8207732983d033c1301fa051df5b126 100644 index 96d8f0fea969fa14bae77afc60c6a64032ca4957..d69b92849733f5228ac65e3feefd6838bb5b9a74 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -403,7 +403,7 @@ public class PiglinAi { @@ -403,7 +403,7 @@ public class PiglinAi {

Datei anzeigen

@ -12,10 +12,10 @@ Fires the event when a Raider tries to pick up a raid banner
to become raid leader. to become raid leader.
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
index ea0902b4ba68a89b1f51281b10c1dfd1bfb42833..a9813da7f2b248f98f22e0ad2e7842915025ec12 100644 index 20d9690127aed9c8ae2632bcf497ba0e473b7bea..a8ab486c7e11ec137da48174af6f1030dfd48056 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
@@ -424,7 +424,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento @@ -413,7 +413,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override @Override
protected void pickUpItem(ItemEntity item) { protected void pickUpItem(ItemEntity item) {
@ -25,7 +25,7 @@ index ea0902b4ba68a89b1f51281b10c1dfd1bfb42833..a9813da7f2b248f98f22e0ad2e784291
} }
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index 2a3bdf7cd8207732983d033c1301fa051df5b126..4f4f557b7f4232ec3b90dda43c6bed30521318ba 100644 index d69b92849733f5228ac65e3feefd6838bb5b9a74..e25af9af8f87e6762716749c367658bf6bda9e34 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -242,11 +242,16 @@ public class PiglinAi { @@ -242,11 +242,16 @@ public class PiglinAi {
@ -47,13 +47,13 @@ index 2a3bdf7cd8207732983d033c1301fa051df5b126..4f4f557b7f4232ec3b90dda43c6bed30
itemstack = PiglinAi.removeOneItemFromItemEntity(drop); itemstack = PiglinAi.removeOneItemFromItemEntity(drop);
} else { } else {
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
index d783b4d561e252af8928e4b1ea13c4e61598f8bf..93bbf7556f9599e9dd90761085a57d78bd521867 100644 index d3fef00a351a6c6ae6af1f1dcf793c5954fd3485..98e558338b5d9fb03869d2cc21b3e90eb45b95f6 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java --- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
@@ -248,6 +248,11 @@ public abstract class Raider extends PatrollingMonster { @@ -267,6 +267,11 @@ public abstract class Raider extends PatrollingMonster {
boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null; boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null;
if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance())) { if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) {
+ // Paper start - EntityPickupItemEvent fixes + // Paper start - EntityPickupItemEvent fixes
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) {
+ return; + return;

Datei anzeigen

@ -5,18 +5,18 @@ Subject: [PATCH] Correctly handle interactions with items on cooldown
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 5d1b8bae981dc538ee1fe4fb993e44f227168233..3621770701c6fb1da75c69a41297684493380e37 100644 index 0cfdd01778fb4f2150a4dea2d9dc6b3b830af987..ee7f36700863b9f504a70a56c5f28c8e39b45c91 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -514,6 +514,7 @@ public class ServerPlayerGameMode { @@ -509,6 +509,7 @@ public class ServerPlayerGameMode {
BlockPos blockposition = hitResult.getBlockPos();
BlockState iblockdata = world.getBlockState(blockposition); BlockState iblockdata = world.getBlockState(blockposition);
InteractionResult enuminteractionresult = InteractionResult.PASS;
boolean cancelledBlock = false; boolean cancelledBlock = false;
+ boolean cancelledItem = false; // Paper - correctly handle items on cooldown + boolean cancelledItem = false; // Paper - correctly handle items on cooldown
if (!iblockdata.getBlock().isEnabled(world.enabledFeatures())) { if (!iblockdata.getBlock().isEnabled(world.enabledFeatures())) {
return InteractionResult.FAIL; return InteractionResult.FAIL;
@@ -523,10 +524,10 @@ public class ServerPlayerGameMode { @@ -518,10 +519,10 @@ public class ServerPlayerGameMode {
} }
if (player.getCooldowns().isOnCooldown(stack.getItem())) { if (player.getCooldowns().isOnCooldown(stack.getItem())) {
@ -30,10 +30,10 @@ index 5d1b8bae981dc538ee1fe4fb993e44f227168233..3621770701c6fb1da75c69a412976844
this.interactResult = event.useItemInHand() == Event.Result.DENY; this.interactResult = event.useItemInHand() == Event.Result.DENY;
this.interactPosition = blockposition.immutable(); this.interactPosition = blockposition.immutable();
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 13366b67b20b812a037a199b8a1e6609a4a54444..6b226ab2b6365788362683e629c8cece12118233 100644 index 70489085763475d29ddddc0bd3279974d0eb73cf..c52cb55cd1da988ec646e4e1484ec1a72513291d 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -546,6 +546,12 @@ public class CraftEventFactory { @@ -545,6 +545,12 @@ public class CraftEventFactory {
} }
public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 targetPos) { public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 targetPos) {
@ -46,7 +46,7 @@ index 13366b67b20b812a037a199b8a1e6609a4a54444..6b226ab2b6365788362683e629c8cece
Player player = (who == null) ? null : (Player) who.getBukkitEntity(); Player player = (who == null) ? null : (Player) who.getBukkitEntity();
CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack);
@@ -580,6 +586,11 @@ public class CraftEventFactory { @@ -579,6 +585,11 @@ public class CraftEventFactory {
if (cancelledBlock) { if (cancelledBlock) {
event.setUseInteractedBlock(Event.Result.DENY); event.setUseInteractedBlock(Event.Result.DENY);
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerInventorySlotChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index d831fb1f66dc38b6c9d3592944f94cc5eeaac864..2a1722db668b141705ce47389cd24d0a247e373d 100644 index 9a56a019b604e95f9ce536333223fa058d2a6550..15a00f156036ed364e05216cb34ad6556b0ba714 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -330,6 +330,25 @@ public class ServerPlayer extends Player { @@ -346,6 +346,25 @@ public class ServerPlayer extends Player {
} }
} }
@ -35,7 +35,7 @@ index d831fb1f66dc38b6c9d3592944f94cc5eeaac864..2a1722db668b141705ce47389cd24d0a
@Override @Override
public void dataChanged(AbstractContainerMenu handler, int property, int value) {} public void dataChanged(AbstractContainerMenu handler, int property, int value) {}
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index 94fe6bd403222049e4e7a407bb6ca99bcaab6acb..399b2f4ddb7e9ef26fbc5e83f3b77c46d3868814 100644 index 00031a013d8e1e9f40bc1ef9491da6df3b061d5f..ea84d4549815ddfd2829cb2fd3885ddd1114bfa8 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -302,7 +302,7 @@ public abstract class AbstractContainerMenu { @@ -302,7 +302,7 @@ public abstract class AbstractContainerMenu {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ccc706733689f07f9b4e1635db4a0259817f71aa..4acbd7359d8528916e4b74466697401bde8559a4 100644 index 7d0cf5cba735b3726d8d9594ce0ac88360149680..175c49c6b8fa4e00e8a6205f27ee06467f069960 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3217,6 +3217,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3282,6 +3282,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
// Paper end // Paper end

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 9ae20d759965bc9b88b52c15372155ad10bcc199..8be0e064f1f7e98e6bfd5915cd4eaf814b5f1d26 100644 index bf58fb8acd09723cbc55f6ac41c24cccda97bac8..a188aefec543352b4e0d9ce03103ac842db61fc8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1121,4 +1121,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -1106,4 +1106,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category"); throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
} }
// Paper end - more enchant API // Paper end - more enchant API

Datei anzeigen

@ -27,10 +27,10 @@ index 6bd0afddbcc461149dfe9a5c7a86fff6ea13a5f1..148d233f4f5278ff39eacdaa0f4f0e7d
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index d3b1fa89c1ae96abebfc0a792f2bc592de05443f..953e228afc6f706b819bb26655b91761436cc68d 100644 index 467b8ca8007c5d3a7b72b88e3a979bdf09f1a283..13e1a914d4523f1c192db2a9a1ee6522e0ee27da 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -164,6 +164,18 @@ public class Main { @@ -167,6 +167,18 @@ public class Main {
return; return;
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] fix entity vehicle collision event not called
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
index 9a6b6120c248a57d9dc86ca215146f6de980bd0d..d514ec1e4cbdc579c3a61533998437903afdc8b6 100644 index 2f73ca283f2d6e6bc5265c95ef767b3f606a3d69..4d7454e5a64fc18e63793a221daa94617f17c666 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
@@ -168,7 +168,15 @@ public abstract class AbstractMinecart extends VehicleEntity { @@ -165,7 +165,15 @@ public abstract class AbstractMinecart extends VehicleEntity {
@Override @Override
public boolean canCollideWith(Entity other) { public boolean canCollideWith(Entity other) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityToggleSitEvent
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
index 01b91388577b6013d7bd5c9112a03f818fee1f9c..cf5cd0e49c4966e7b636a8ad4dec7a12806c6a4d 100644 index ed2514de46d0939259ca4e45a6dc96d7c1dac20d..45284bb0f081377bc5913876c6877a424285c0bb 100644
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java --- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
@@ -69,7 +69,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @@ -68,7 +68,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
} }
this.orderedToSit = nbt.getBoolean("Sitting"); this.orderedToSit = nbt.getBoolean("Sitting");
@ -17,7 +17,7 @@ index 01b91388577b6013d7bd5c9112a03f818fee1f9c..cf5cd0e49c4966e7b636a8ad4dec7a12
} }
@Override @Override
@@ -125,6 +125,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @@ -126,6 +126,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
} }
public void setInSittingPose(boolean inSittingPose) { public void setInSittingPose(boolean inSittingPose) {
@ -31,10 +31,10 @@ index 01b91388577b6013d7bd5c9112a03f818fee1f9c..cf5cd0e49c4966e7b636a8ad4dec7a12
if (inSittingPose) { if (inSittingPose) {
this.entityData.set(DATA_FLAGS_ID, (byte)(b | 1)); this.entityData.set(DATA_FLAGS_ID, (byte)(b | 1));
diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java
index 4c2e090a72dbd5bfb928e6ccbcedb1a25231d5b1..f7a7810fdc2f74b79fa14470493485e4b74539ab 100644 index 1aa5485f2608000e4ac07350d1c537bc9bd92de4..e705449496b1a06270ecbc13f4dce5357479845b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Fox.java --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
@@ -437,7 +437,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> { @@ -432,7 +432,7 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
this.setSleeping(nbt.getBoolean("Sleeping")); this.setSleeping(nbt.getBoolean("Sleeping"));
this.setVariant(Fox.Type.byName(nbt.getString("Type"))); this.setVariant(Fox.Type.byName(nbt.getString("Type")));
@ -43,7 +43,7 @@ index 4c2e090a72dbd5bfb928e6ccbcedb1a25231d5b1..f7a7810fdc2f74b79fa14470493485e4
this.setIsCrouching(nbt.getBoolean("Crouching")); this.setIsCrouching(nbt.getBoolean("Crouching"));
if (this.level() instanceof ServerLevel) { if (this.level() instanceof ServerLevel) {
this.setTargetGoals(); this.setTargetGoals();
@@ -450,6 +450,12 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> { @@ -445,6 +445,12 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
} }
public void setSitting(boolean sitting) { public void setSitting(boolean sitting) {
@ -57,10 +57,10 @@ index 4c2e090a72dbd5bfb928e6ccbcedb1a25231d5b1..f7a7810fdc2f74b79fa14470493485e4
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java
index 4abd26c7baf8f198f13dd41a3146f9ece13a4164..0297e234f17c6157cfff79420b9eeaf4e0e2c3ab 100644 index 83d8a09980c4ab3c7c97b07c3dcdb3d7dab9e1aa..0440fd2d1bb3f87641ad88de6d5ae64617536a6d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
@@ -139,6 +139,7 @@ public class Panda extends Animal { @@ -144,6 +144,7 @@ public class Panda extends Animal {
} }
public void sit(boolean sitting) { public void sit(boolean sitting) {
@ -69,28 +69,28 @@ index 4abd26c7baf8f198f13dd41a3146f9ece13a4164..0297e234f17c6157cfff79420b9eeaf4
} }
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 090d36d73b12fec59782142e2e85f17ba35dc6be..7860331b640fe48d1f2357d9f8e2e40c682b3620 100644 index f3fcfd3b358f496d26748099e1d5a95721a6a0d8..33531cbdd9b2a5607092d2364ce5655a63c2361c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -580,7 +580,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -560,7 +560,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
} }
public void sitDown() { public void sitDown() {
- if (!this.isCamelSitting()) { - if (!this.isCamelSitting()) {
+ if (!this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), true).callEvent()) { // Paper - Add EntityToggleSitEvent + if (!this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), true).callEvent()) { // Paper - Add EntityToggleSitEvent
this.playSound(SoundEvents.CAMEL_SIT, 1.0F, this.getVoicePitch()); this.makeSound(SoundEvents.CAMEL_SIT);
this.setPose(Pose.SITTING); this.setPose(Pose.SITTING);
this.gameEvent(GameEvent.ENTITY_ACTION); this.gameEvent(GameEvent.ENTITY_ACTION);
@@ -589,7 +589,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -569,7 +569,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
} }
public void standUp() { public void standUp() {
- if (this.isCamelSitting()) { - if (this.isCamelSitting()) {
+ if (this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), false).callEvent()) { // Paper - Add EntityToggleSitEvent + if (this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), false).callEvent()) { // Paper - Add EntityToggleSitEvent
this.playSound(SoundEvents.CAMEL_STAND, 1.0F, this.getVoicePitch()); this.makeSound(SoundEvents.CAMEL_STAND);
this.setPose(Pose.STANDING); this.setPose(Pose.STANDING);
this.gameEvent(GameEvent.ENTITY_ACTION); this.gameEvent(GameEvent.ENTITY_ACTION);
@@ -598,6 +598,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -578,6 +578,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
} }
public void standUpInstantly() { public void standUpInstantly() {

Datei anzeigen

@ -5,24 +5,24 @@ Subject: [PATCH] Add fire-tick-delay option
diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java
index c5116d12f3c073f0a8695a8cd00545e6d947644d..7f05e58358024d303eab9ab4fbc1bb299760ad1e 100644 index 5dad1aa26a8908cba6a08398a4bad27f31d4c2c0..4d467ecf0dd8006b9fa4fb8fb5aadc0622a1e512 100644
--- a/src/main/java/net/minecraft/world/level/block/FireBlock.java --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java
@@ -171,7 +171,7 @@ public class FireBlock extends BaseFireBlock { @@ -171,7 +171,7 @@ public class FireBlock extends BaseFireBlock {
@Override @Override
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
- world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random)); - world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
+ world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option + world.scheduleTick(pos, this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option
if (world.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) { if (world.getGameRules().getBoolean(GameRules.RULE_DOFIRETICK)) {
if (!state.canSurvive(world, pos)) { if (!state.canSurvive(world, pos)) {
this.fireExtinguished(world, pos); // CraftBukkit - invalid place location this.fireExtinguished(world, pos); // CraftBukkit - invalid place location
@@ -372,11 +372,11 @@ public class FireBlock extends BaseFireBlock { @@ -372,11 +372,11 @@ public class FireBlock extends BaseFireBlock {
public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) { protected void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify, net.minecraft.world.item.context.UseOnContext context) {
super.onPlace(state, world, pos, oldState, notify, context); super.onPlace(state, world, pos, oldState, notify, context);
// Paper end - UseOnContext param // Paper end - UseOnContext param
- world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random)); - world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world.random));
+ world.scheduleTick(pos, (Block) this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option + world.scheduleTick(pos, this, FireBlock.getFireTickDelay(world)); // Paper - Add fire-tick-delay option
} }
- private static int getFireTickDelay(RandomSource random) { - private static int getFireTickDelay(RandomSource random) {

Datei anzeigen

@ -5,11 +5,11 @@ Subject: [PATCH] Add Moving Piston API
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java b/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java b/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java
index c685846a539756ca7f0857e27f2b60d25cc13959..93ad5fed9a4d92169af0546c7e1cd8a62d19d1d7 100644 index 25b759dee5ae2b311965f26ba311591199894be4..293ac0b658224fc0b3c2acdfc86eff3c8a9fdc04 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java --- a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java
@@ -3,7 +3,7 @@ package org.bukkit.craftbukkit.block; @@ -4,7 +4,7 @@ import net.minecraft.world.level.block.piston.PistonMovingBlockEntity;
import net.minecraft.world.level.block.piston.PistonMovingBlockEntity; import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
-public class CraftMovingPiston extends CraftBlockEntityState<PistonMovingBlockEntity> { -public class CraftMovingPiston extends CraftBlockEntityState<PistonMovingBlockEntity> {
@ -17,9 +17,9 @@ index c685846a539756ca7f0857e27f2b60d25cc13959..93ad5fed9a4d92169af0546c7e1cd8a6
public CraftMovingPiston(World world, PistonMovingBlockEntity tileEntity) { public CraftMovingPiston(World world, PistonMovingBlockEntity tileEntity) {
super(world, tileEntity); super(world, tileEntity);
@@ -17,4 +17,26 @@ public class CraftMovingPiston extends CraftBlockEntityState<PistonMovingBlockEn @@ -23,4 +23,26 @@ public class CraftMovingPiston extends CraftBlockEntityState<PistonMovingBlockEn
public CraftMovingPiston copy() { public CraftMovingPiston copy(Location location) {
return new CraftMovingPiston(this); return new CraftMovingPiston(this, location);
} }
+ +
+ // Paper start - Add Moving Piston API + // Paper start - Add Moving Piston API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Ignore impossible spawn tick
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 41d2793e69bd664456b5e3c5891b03bdcb31d103..65c3e91ac4541c0150057dc9f012eb1ee566516e 100644 index 8efc06d29c62fa2be8515ed3359d52a6d4b807d2..f57e1b78204dff661ad5d3ee93a88a00330af2dc 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -82,6 +82,7 @@ public abstract class BaseSpawner { @@ -84,6 +84,7 @@ public abstract class BaseSpawner {
} }
public void serverTick(ServerLevel world, BlockPos pos) { public void serverTick(ServerLevel world, BlockPos pos) {

Datei anzeigen

@ -9,10 +9,10 @@ suggestions, which especially matters when we force suggestions to
the server for this type the server for this type
diff --git a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java diff --git a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
index 850db283bf12345e9e7d7e8e590dbe8135c6dce1..8e008e752c5b11781088e2b4b5ba180bacb59326 100644 index 78eca3243a276260ff26c3587fb60e17e0439af0..2043001c16b3530c2d3f52efda10bcad424881c0 100644
--- a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java --- a/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
+++ b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java +++ b/src/main/java/net/minecraft/commands/arguments/EntityArgument.java
@@ -128,7 +128,12 @@ public class EntityArgument implements ArgumentType<EntitySelector> { @@ -127,7 +127,12 @@ public class EntityArgument implements ArgumentType<EntitySelector> {
StringReader stringreader = new StringReader(suggestionsbuilder.getInput()); StringReader stringreader = new StringReader(suggestionsbuilder.getInput());
stringreader.setCursor(suggestionsbuilder.getStart()); stringreader.setCursor(suggestionsbuilder.getStart());

Datei anzeigen

@ -6,13 +6,13 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8b44dc6cfddf77bdfe3684d1cdb15bb9125c4137..640d7f248e3696b73ef8d7668358a78037081320 100644 index 4b54b3e121508fb1590654123e86c6c5de54a755..0a4069e6c544deb0ad576350ec371fe1ec5de8f4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3111,6 +3111,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3127,6 +3127,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
pluginManager.callEvent(entityCombustEvent); pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) { if (!entityCombustEvent.isCancelled()) {
this.setSecondsOnFire(entityCombustEvent.getDuration(), false); this.igniteForSeconds(entityCombustEvent.getDuration(), false);
+ // Paper start - fix EntityCombustEvent cancellation + // Paper start - fix EntityCombustEvent cancellation
+ } else { + } else {
+ this.setRemainingFireTicks(this.remainingFireTicks - 1); + this.setRemainingFireTicks(this.remainingFireTicks - 1);
@ -21,13 +21,13 @@ index 8b44dc6cfddf77bdfe3684d1cdb15bb9125c4137..640d7f248e3696b73ef8d7668358a780
// CraftBukkit end // CraftBukkit end
} }
diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
index ceb5f9867f714b3b6a4602c787574dfa83c006f6..bd7cb2ddcac5cdc1d61899d12fc3383fd00598b1 100644 index b18c1ca558e4005354ff42cde3056df9408f7fdc..139d65d2dfb48857415dc2a350204862031f83c9 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java --- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -134,6 +134,10 @@ public abstract class BaseFireBlock extends Block { @@ -134,6 +134,10 @@ public abstract class BaseFireBlock extends Block {
if (!event.isCancelled()) { if (!event.isCancelled()) {
entity.setSecondsOnFire(event.getDuration(), false); entity.igniteForSeconds(event.getDuration(), false);
+ // Paper start - fix EntityCombustEvent cancellation + // Paper start - fix EntityCombustEvent cancellation
+ } else { + } else {
+ entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1); + entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1);

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add PrePlayerAttackEntityEvent
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 7c0db708575ef26a1dd73709bf22653f21e0c863..262cefa51856cf6a58ae3b80b1ae93a5dd7bfaa7 100644 index 4003dfeae8b2486045a3dbe4c1adc65a882e70ba..761e8a0c4e1db465c18892999e86885f27ca8075 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java --- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1234,8 +1234,17 @@ public abstract class Player extends LivingEntity { @@ -1246,8 +1246,17 @@ public abstract class Player extends LivingEntity {
} }
public void attack(Entity target) { public void attack(Entity target) {
@ -26,5 +26,5 @@ index 7c0db708575ef26a1dd73709bf22653f21e0c863..262cefa51856cf6a58ae3b80b1ae93a5
+ { + {
+ // Paper end - PlayerAttackEntityEvent + // Paper end - PlayerAttackEntityEvent
float f = (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); float f = (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE);
float f1; float f1 = EnchantmentHelper.getDamageBonus(this.getMainHandItem(), target.getType());
float f2 = this.getAttackStrengthScale(0.5F);

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] ensure reset EnderDragon boss event name
Fix MC-257487 Fix MC-257487
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index 50071bec6825ec2b34662de14128070510d16afb..8737501e14792de13adf95da24fa6177bfb77946 100644 index b8bba857aa390e5435b8a199a25065a940d6a972..f6f5fad52e41d5ccc37dc28c40904fce014907fb 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -73,6 +73,7 @@ public class EndDragonFight { @@ -73,6 +73,7 @@ public class EndDragonFight {

Datei anzeigen

@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: braindead <totsuka.sama@gmail.com>
Date: Sat, 5 Nov 2022 17:47:26 -0400
Subject: [PATCH] fix MC-252817 (green map markers do not disappear).
this bug is caused by the fact that the itemframe's item is set to empty before the green marker is requested to be removed. this is fixed by getting the mapid from this method's parameter, rather than the air block now stored by the item frame.
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 cb3de05dba7daa925b6fa7e0c7bbb8e3c53b51f4..ef6d63cdc823280c9db491c744af598b94b6922e 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -277,8 +277,7 @@ public class ItemFrame extends HangingEntity {
}
private void removeFramedMap(ItemStack stack) {
- MapId mapid = this.getFramedMapId();
-
+ MapId mapid = this.getFramedMapIdForItem(stack); // Paper - fix MC-252817 (green map markers do not disappear)
if (mapid != null) {
MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level());
@@ -305,9 +304,16 @@ public class ItemFrame extends HangingEntity {
@Nullable
public MapId getFramedMapId() {
- return (MapId) this.getItem().get(DataComponents.MAP_ID);
+ // Paper start
+ return this.getFramedMapIdForItem(this.getItem());
}
+ @Nullable
+ public MapId getFramedMapIdForItem(ItemStack item) {
+ return (MapId) item.get(DataComponents.MAP_ID);
+ }
+ // Paper end
+
public boolean hasFramedMap() {
return this.getItem().has(DataComponents.MAP_ID);
}

Datei anzeigen

@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 4acbd7359d8528916e4b74466697401bde8559a4..35213408270522d08e0f8a10989db232ea24c0f7 100644 index 175c49c6b8fa4e00e8a6205f27ee06467f069960..0262e0cd3ad5f4ab3a264aa110b946f81e9e92c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -3222,6 +3222,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3287,6 +3287,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void showElderGuardian(boolean silent) { public void showElderGuardian(boolean silent) {
if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F));
} }

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] More vanilla friendly methods to update trades
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index a01e089ed7689485a7ac33ab29bc27c4b68bc1df..fa2569fecefb3e3af3264928a3c7a347710deedf 100644 index 4d3a04e1d7910c4e71ac9a1cebb58e482958671a..1e8579c994098fb18d9725e3f1604a582be4162f 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -927,6 +927,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -919,6 +919,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@Override @Override
protected void updateTrades() { protected void updateTrades() {
@ -21,7 +21,7 @@ index a01e089ed7689485a7ac33ab29bc27c4b68bc1df..fa2569fecefb3e3af3264928a3c7a347
VillagerData villagerdata = this.getVillagerData(); VillagerData villagerdata = this.getVillagerData();
Int2ObjectMap int2objectmap; Int2ObjectMap int2objectmap;
@@ -944,9 +950,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -936,9 +942,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
if (avillagertrades_imerchantrecipeoption != null) { if (avillagertrades_imerchantrecipeoption != null) {
MerchantOffers merchantrecipelist = this.getOffers(); MerchantOffers merchantrecipelist = this.getOffers();

Datei anzeigen

@ -7,10 +7,10 @@ Makes certain entities check all players when searching for a player
instead of just checking players in their world. instead of just checking players in their world.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b5eda9931a82a667c25ca1a49980b01b042dc0cc..5f1a4a35d2179b7ff5a95390f82d65cacf4fd457 100644 index 79d91a4e54a20c0b3681eaeb7245acda0ab5bbc3..2eda55a09632a6c5668600251a8c491c501fbe2b 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2385,4 +2385,12 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -2332,4 +2332,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.updateDynamicGameEventListener(DynamicGameEventListener::move); entity.updateDynamicGameEventListener(DynamicGameEventListener::move);
} }
} }
@ -24,10 +24,10 @@ index b5eda9931a82a667c25ca1a49980b01b042dc0cc..5f1a4a35d2179b7ff5a95390f82d65ca
+ // Paper end - check global player list where appropriate + // Paper end - check global player list where appropriate
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 09a26622db4bb4b504f735454e2b031f4840b092..b19b5b8678ce2fb912b703382ae79f5755e025e7 100644 index 4bda4252889cc42bb5a38c45d87f5ec0f2c281b3..fdd0cf40b4e0df7d1987889c635fd90cd63727b6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3698,7 +3698,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -3682,7 +3682,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public void onItemPickup(ItemEntity item) { public void onItemPickup(ItemEntity item) {
@ -37,11 +37,11 @@ index 09a26622db4bb4b504f735454e2b031f4840b092..b19b5b8678ce2fb912b703382ae79f57
if (entity instanceof ServerPlayer) { if (entity instanceof ServerPlayer) {
CriteriaTriggers.THROWN_ITEM_PICKED_UP_BY_ENTITY.trigger((ServerPlayer) entity, item.getItem(), this); CriteriaTriggers.THROWN_ITEM_PICKED_UP_BY_ENTITY.trigger((ServerPlayer) entity, item.getItem(), this);
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index d4ac3e566b47cfc8688bcc2ab08385b6de4693f8..7de9d012e7416eaa0189b513a0972c846e93c4b6 100644 index deedc707971be0bd1b7757f4e9b6d2729cc669d0..f38acc96f71298e40ce9433e7759fd223ca55e48 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -272,7 +272,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { @@ -273,7 +273,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null); entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null);
entityvillager.refreshBrain(world); entityvillager.refreshBrain(world);
if (this.conversionStarter != null) { if (this.conversionStarter != null) {
- Player entityhuman = world.getPlayerByUUID(this.conversionStarter); - Player entityhuman = world.getPlayerByUUID(this.conversionStarter);
@ -66,10 +66,10 @@ index d465fb01af4c8610f83ecb9c68b83127cf7e95ae..bd20bea7f76a7307f1698fb2dfef3712
+ // Paper end - check global player list where appropriate + // Paper end - check global player list where appropriate
} }
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
index d71a9fb54269f7c7e251e0e3bdd8b5a072af5201..a2ab5291605a3a3c4fda067c23da7d9aafe1cc38 100644 index baa876db3a58a3c756a72ef1ad081964b358f58e..974d195d147dacb79f29dbfe2c6f4a0e0ebf28be 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java --- a/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkShriekerBlockEntity.java
@@ -97,6 +97,13 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi @@ -99,6 +99,13 @@ public class SculkShriekerBlockEntity extends BlockEntity implements GameEventLi
@Nullable @Nullable
public static ServerPlayer tryGetPlayer(@Nullable Entity entity) { public static ServerPlayer tryGetPlayer(@Nullable Entity entity) {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Fix async entity add due to fungus trees
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
index ff94af5be8de374f5cde2607eebbb23e65705581..209596e89307b9e1d0ff4c465876d29fef4fc290 100644 index a343bb1b1ee2cd2ecd75be00aa91d5418dcdec76..713509e08c6325816fef7c09477d36aacb0008ef 100644
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
@@ -228,6 +228,7 @@ public class WorldGenRegion implements WorldGenLevel { @@ -236,6 +236,7 @@ public class WorldGenRegion implements WorldGenLevel {
if (iblockdata.isAir()) { if (iblockdata.isAir()) {
return false; return false;
} else { } else {
@ -17,7 +17,7 @@ index ff94af5be8de374f5cde2607eebbb23e65705581..209596e89307b9e1d0ff4c465876d29f
BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null; BlockEntity tileentity = iblockdata.hasBlockEntity() ? this.getBlockEntity(pos) : null;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
index 5680e9772a2d90e997d2d0aacdda9eddb7edef56..7c7dbd030ada8d2fab494b6a125664ddc3955639 100644 index 72c275d7da798ee10a224bbd3f4c92abd82601e1..0e307c2bb788c1ec856613b0203f5fc7aca7e85d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
@@ -257,10 +257,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor { @@ -257,10 +257,10 @@ public abstract class CraftRegionAccessor implements RegionAccessor {

Datei anzeigen

@ -11,10 +11,10 @@ the logic associated with damaging them
public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B public net.minecraft.world.entity.LivingEntity entityEventForEquipmentBreak(Lnet/minecraft/world/entity/EquipmentSlot;)B
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 8be0e064f1f7e98e6bfd5915cd4eaf814b5f1d26..711eb84fee6c46341928a765970defa47e1fe0c3 100644 index a188aefec543352b4e0d9ce03103ac842db61fc8..48505c6df9d5fdbd426127e306926fae9824d0a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1129,4 +1129,52 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -1114,4 +1114,52 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().knockback(strength, directionX, directionZ); this.getHandle().knockback(strength, directionX, directionZ);
}; };
// Paper end - knockback API // Paper end - knockback API

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Friction API
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b19b5b8678ce2fb912b703382ae79f5755e025e7..084d988ec3dcdae54a10309d34d335ca4f37b7b0 100644 index fdd0cf40b4e0df7d1987889c635fd90cd63727b6..6ac6848fe27336a96a813c84d7d797cc9bc4c297 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -262,6 +262,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -273,6 +273,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
public boolean bukkitPickUpLoot; public boolean bukkitPickUpLoot;
public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper public org.bukkit.craftbukkit.entity.CraftLivingEntity getBukkitLivingEntity() { return (org.bukkit.craftbukkit.entity.CraftLivingEntity) super.getBukkitEntity(); } // Paper
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
@ -16,7 +16,7 @@ index b19b5b8678ce2fb912b703382ae79f5755e025e7..084d988ec3dcdae54a10309d34d335ca
@Override @Override
public float getBukkitYaw() { public float getBukkitYaw() {
@@ -717,7 +718,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -738,7 +739,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
public boolean shouldDiscardFriction() { public boolean shouldDiscardFriction() {
@ -25,7 +25,7 @@ index b19b5b8678ce2fb912b703382ae79f5755e025e7..084d988ec3dcdae54a10309d34d335ca
} }
public void setDiscardFriction(boolean noDrag) { public void setDiscardFriction(boolean noDrag) {
@@ -768,6 +769,11 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -799,6 +800,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
@Override @Override
public void addAdditionalSaveData(CompoundTag nbt) { public void addAdditionalSaveData(CompoundTag nbt) {
@ -37,7 +37,7 @@ index b19b5b8678ce2fb912b703382ae79f5755e025e7..084d988ec3dcdae54a10309d34d335ca
nbt.putFloat("Health", this.getHealth()); nbt.putFloat("Health", this.getHealth());
nbt.putShort("HurtTime", (short) this.hurtTime); nbt.putShort("HurtTime", (short) this.hurtTime);
nbt.putInt("HurtByTimestamp", this.lastHurtByMobTimestamp); nbt.putInt("HurtByTimestamp", this.lastHurtByMobTimestamp);
@@ -811,6 +817,16 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -842,6 +848,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
} }
this.internalSetAbsorptionAmount(absorptionAmount); this.internalSetAbsorptionAmount(absorptionAmount);
// Paper end - Check for NaN // Paper end - Check for NaN
@ -55,10 +55,10 @@ index b19b5b8678ce2fb912b703382ae79f5755e025e7..084d988ec3dcdae54a10309d34d335ca
this.getAttributes().load(nbt.getList("Attributes", 10)); this.getAttributes().load(nbt.getList("Attributes", 10));
} }
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..29ce703a79f7893ac990ad80e0f1c1cf63546e6c 100644 index b392fda26982517cbc2c04156897184275ce69e5..8fd3845c4965843be9c37498760d93f1ebdff541 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -58,6 +58,7 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -62,6 +62,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
public boolean canMobPickup = true; // Paper - Item#canEntityPickup public boolean canMobPickup = true; // Paper - Item#canEntityPickup
private int despawnRate = -1; // Paper - Alternative item-despawn-rate private int despawnRate = -1; // Paper - Alternative item-despawn-rate
@ -66,25 +66,20 @@ index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..29ce703a79f7893ac990ad80e0f1c1cf
public ItemEntity(EntityType<? extends ItemEntity> type, Level world) { public ItemEntity(EntityType<? extends ItemEntity> type, Level world) {
super(type, world); super(type, world);
@@ -179,11 +180,15 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -185,7 +186,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.move(MoverType.SELF, this.getDeltaMovement()); this.move(MoverType.SELF, this.getDeltaMovement());
float f1 = 0.98F; float f = 0.98F;
- if (this.onGround()) { - if (this.onGround()) {
+ // Paper start - Friction API + // Paper start - Friction API
+ if (frictionState == net.kyori.adventure.util.TriState.FALSE) { + if (frictionState == net.kyori.adventure.util.TriState.FALSE) {
+ f1 = 1F; + f = 1F;
+ } else if (this.onGround()) { + } else if (this.onGround()) {
+ // Paper end - Friction API + // Paper end - Friction API
f1 = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F; f = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F;
} }
- this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, 0.98D, (double) f1)); @@ -394,6 +399,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
+ this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, frictionState == net.kyori.adventure.util.TriState.FALSE ? 1D : 0.98D, (double) f1)); // Paper - Friction API
if (this.onGround()) {
Vec3 vec3d1 = this.getDeltaMovement();
@@ -388,6 +393,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
@Override @Override
public void addAdditionalSaveData(CompoundTag nbt) { public void addAdditionalSaveData(CompoundTag nbt) {
@ -96,8 +91,8 @@ index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..29ce703a79f7893ac990ad80e0f1c1cf
nbt.putShort("Health", (short) this.health); nbt.putShort("Health", (short) this.health);
nbt.putShort("Age", (short) this.age); nbt.putShort("Age", (short) this.age);
nbt.putShort("PickupDelay", (short) this.pickupDelay); nbt.putShort("PickupDelay", (short) this.pickupDelay);
@@ -422,6 +432,17 @@ public class ItemEntity extends Entity implements TraceableEntity { @@ -436,6 +446,17 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.cachedThrower = null; this.setItem(ItemStack.EMPTY);
} }
+ // Paper start - Friction API + // Paper start - Friction API
@ -111,9 +106,9 @@ index d0dac3dc89b9bb645a1d8498802fb8c6bff6a78e..29ce703a79f7893ac990ad80e0f1c1cf
+ } + }
+ // Paper end - Friction API + // Paper end - Friction API
+ +
CompoundTag nbttagcompound1 = nbt.getCompound("Item"); if (this.getItem().isEmpty()) {
this.discard(null); // CraftBukkit - add Bukkit remove cause
this.setItem(ItemStack.of(nbttagcompound1)); }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
index 1a291dd8a287db30e71dcb315599fc4b038764c4..30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02 100644 index 1a291dd8a287db30e71dcb315599fc4b038764c4..30d62ee4d5cd2ddacb8783b5bbbf475d592b3e02 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java
@ -138,10 +133,10 @@ index 1a291dd8a287db30e71dcb315599fc4b038764c4..30d62ee4d5cd2ddacb8783b5bbbf475d
public int getHealth() { public int getHealth() {
return this.getHandle().health; return this.getHandle().health;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 711eb84fee6c46341928a765970defa47e1fe0c3..b0c03854ee9936b1dac9cbf89e9977d978712d56 100644 index 48505c6df9d5fdbd426127e306926fae9824d0a9..51e9b9f7460ec4f8b14d570356026d433351806d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -1177,4 +1177,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -1162,4 +1162,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}); });
} }
// Paper end - ItemStack damage API // Paper end - ItemStack damage API

Datei anzeigen

@ -29,10 +29,10 @@ index e382a29b441b656f35bc24cb90f95cb4def433d2..d8cc5614502db7025349e085381b6b32
private EntitySelector() {} private EntitySelector() {}
// Paper start - Affects Spawning API // Paper start - Affects Spawning API
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index 76982e0dbab0ecb6f7d4cd8a748af940492a31e7..ed80960777b18faca2d6a99783e53daf5fa19e09 100644 index f74d41e57570a40cd5ce4da3076f3210b6594a63..1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java --- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -33,13 +33,22 @@ public class PhantomSpawner implements CustomSpawner { @@ -32,13 +32,22 @@ public class PhantomSpawner implements CustomSpawner {
} else if (!world.getGameRules().getBoolean(GameRules.RULE_DOINSOMNIA)) { } else if (!world.getGameRules().getBoolean(GameRules.RULE_DOINSOMNIA)) {
return 0; return 0;
} else { } else {
@ -56,7 +56,7 @@ index 76982e0dbab0ecb6f7d4cd8a748af940492a31e7..ed80960777b18faca2d6a99783e53daf
if (world.getSkyDarken() < 5 && world.dimensionType().hasSkyLight()) { if (world.getSkyDarken() < 5 && world.dimensionType().hasSkyLight()) {
return 0; return 0;
} else { } else {
@@ -60,7 +69,7 @@ public class PhantomSpawner implements CustomSpawner { @@ -59,7 +68,7 @@ public class PhantomSpawner implements CustomSpawner {
int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE); int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE);
boolean flag2 = true; boolean flag2 = true;

Datei anzeigen

@ -35,10 +35,10 @@ index 0000000000000000000000000000000000000000..2c5cd77103c5a33d4349ab6b9ee2d837
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 22a7f17180b76b6c3548d3b54ae8218a469401a8..c399625a342ffd61102bb96a97ac24b0669e8e17 100644 index fd2a5c829899d45641a5b5d30116f4f368953c15..f57679d88cd015caa8996d44b486da694df29521 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -290,6 +290,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -277,6 +277,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
Connection.genericsFtw(packet, packetlistener); Connection.genericsFtw(packet, packetlistener);
} catch (RunningOnDifferentThreadException cancelledpackethandleexception) { } catch (RunningOnDifferentThreadException cancelledpackethandleexception) {
; ;
@ -47,10 +47,10 @@ index 22a7f17180b76b6c3548d3b54ae8218a469401a8..c399625a342ffd61102bb96a97ac24b0
this.disconnect(Component.translatable("multiplayer.disconnect.server_shutdown")); this.disconnect(Component.translatable("multiplayer.disconnect.server_shutdown"));
} catch (ClassCastException classcastexception) { } catch (ClassCastException classcastexception) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ad2583c581e78e9cf352567b7dbde193319d4301..a540c744ca88884207c4520794091c01c1c9f50e 100644 index 9416daa3edef2d9bb780fe3b2aa210d92a300cf1..f12165838f77ae83437f5770faeac1e46b326e98 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2013,7 +2013,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2074,7 +2074,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public void executeIfPossible(Runnable runnable) { public void executeIfPossible(Runnable runnable) {
if (this.isStopped()) { if (this.isStopped()) {

Datei anzeigen

@ -8,10 +8,10 @@ offhand slot isn't sent. This is not correct because you *can* put stuff into th
by pressing the offhand swap item by pressing the offhand swap item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 2a1722db668b141705ce47389cd24d0a247e373d..406794c439900a0d86fd4fe67d05a98bde625aec 100644 index 15a00f156036ed364e05216cb34ad6556b0ba714..c70e1a17d855f2a9d160e8cd15a6a4bcf39b8945 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -299,6 +299,13 @@ public class ServerPlayer extends Player { @@ -315,6 +315,13 @@ public class ServerPlayer extends Player {
} }
@ -26,7 +26,7 @@ index 2a1722db668b141705ce47389cd24d0a247e373d..406794c439900a0d86fd4fe67d05a98b
public void sendSlotChange(AbstractContainerMenu handler, int slot, ItemStack stack) { public void sendSlotChange(AbstractContainerMenu handler, int slot, ItemStack stack) {
ServerPlayer.this.connection.send(new ClientboundContainerSetSlotPacket(handler.containerId, handler.incrementStateId(), slot, stack)); ServerPlayer.this.connection.send(new ClientboundContainerSetSlotPacket(handler.containerId, handler.incrementStateId(), slot, stack));
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
index 399b2f4ddb7e9ef26fbc5e83f3b77c46d3868814..24caa1cf91cd50a5972238119aca1f85ec2b3d2b 100644 index ea84d4549815ddfd2829cb2fd3885ddd1114bfa8..85fb19177690ea7235c10f64789066599db08b05 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -200,6 +200,7 @@ public abstract class AbstractContainerMenu { @@ -200,6 +200,7 @@ public abstract class AbstractContainerMenu {

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Player Entity Tracking Events
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 43c8f6a0615f392cc560b2259b116cc9d5fba4e7..ca24463405f138deb882f319bf84696f52a1f606 100644 index de19a5ea96fa38621513e970e04d153576f4f6ae..bff776f07bcc7841acc5757c1f53bde1812756c8 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1749,7 +1749,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -1762,7 +1762,11 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// CraftBukkit end // CraftBukkit end
if (flag) { if (flag) {
if (this.seenBy.add(player.connection)) { if (this.seenBy.add(player.connection)) {
@ -21,10 +21,10 @@ index 43c8f6a0615f392cc560b2259b116cc9d5fba4e7..ca24463405f138deb882f319bf84696f
} else if (this.seenBy.remove(player.connection)) { } else if (this.seenBy.remove(player.connection)) {
this.serverEntity.removePairing(player); this.serverEntity.removePairing(player);
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 640d7f248e3696b73ef8d7668358a78037081320..96a1f1460daba1507659a8ed34b608ded7084c0f 100644 index 0a4069e6c544deb0ad576350ec371fe1ec5de8f4..63e4fa54c6931a3fc33b081662823f5b736d8496 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3837,7 +3837,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -3853,7 +3853,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void startSeenByPlayer(ServerPlayer player) {} public void startSeenByPlayer(ServerPlayer player) {}

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Limit pet look distance
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
index 0a3f7dcc0e205a85dbaa6dee1fc9ae2c7fa9e02d..8e2f7e2385588224018f7f94ed9686415bc91deb 100644 index 4d2a04158f8e1855b59636b0b67fcb6a795f32e7..8fa9282acd87132516329083f774345df3310cf2 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java --- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java
@@ -93,7 +93,7 @@ public class FollowOwnerGoal extends Goal { @@ -94,7 +94,7 @@ public class FollowOwnerGoal extends Goal {
@Override @Override
public void tick() { public void tick() {

Datei anzeigen

@ -8,10 +8,10 @@ Fixes some wrong reasons, and adds missing spawn reasons for entities.
Co-authored-by: Doc <nachito94@msn.com> Co-authored-by: Doc <nachito94@msn.com>
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 035af9ccf679a562203a4a2c4f2b38098c57b492..557df259ae54defb43e475e10fc4732854e64f77 100644 index fb621b161b0a47fac2c44b369ed01c27278bc4f6..3ac31c869d0e53410558ddeb79c21d3f5a3decb6 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java --- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -353,7 +353,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT @@ -366,7 +366,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
@Nullable @Nullable
public T spawn(ServerLevel world, @Nullable ItemStack stack, @Nullable Player player, BlockPos pos, MobSpawnType spawnReason, boolean alignPosition, boolean invertY) { public T spawn(ServerLevel world, @Nullable ItemStack stack, @Nullable Player player, BlockPos pos, MobSpawnType spawnReason, boolean alignPosition, boolean invertY) {
// CraftBukkit start // CraftBukkit start
@ -21,7 +21,7 @@ index 035af9ccf679a562203a4a2c4f2b38098c57b492..557df259ae54defb43e475e10fc47328
@Nullable @Nullable
diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java diff --git a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
index 58723ea75f7db9bf3889b99139669b14a284a3a1..6bf11d526b82403e9a5443ac77645cf2b4bc1ad8 100644 index cecfae3bee405fb57df28e83b005e100e72b896b..cde9d03286a3cbb80005b59efe7d57de86fe4eda 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java --- a/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java +++ b/src/main/java/net/minecraft/world/entity/projectile/DragonFireball.java
@@ -64,7 +64,7 @@ public class DragonFireball extends AbstractHurtingProjectile { @@ -64,7 +64,7 @@ public class DragonFireball extends AbstractHurtingProjectile {
@ -34,7 +34,7 @@ index 58723ea75f7db9bf3889b99139669b14a284a3a1..6bf11d526b82403e9a5443ac77645cf2
this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
} }
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
index 1a842694c076d71b14733904c2052183d86d1f5d..eb2f6038133be72c32d31bd1a25bc80f5aa4028f 100644 index 2c076a5b23c09f634fa6807c207e5e06e1795e8a..f87614eec0aa4e6f967add78c6758f78e7ad9505 100644
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
@@ -117,7 +117,7 @@ public class FrogspawnBlock extends Block { @@ -117,7 +117,7 @@ public class FrogspawnBlock extends Block {
@ -47,7 +47,7 @@ index 1a842694c076d71b14733904c2052183d86d1f5d..eb2f6038133be72c32d31bd1a25bc80f
} }
} }
diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java diff --git a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
index 1ff0e5c120418c3e5f92326580af7254fb4c699f..9766a919f85abfd52497ecd6d2e2002d3de8051d 100644 index 38288f20306632e6546c95b4cb1a42806be49975..f53808e200bd83ab80954ec5c1e9c14250302be8 100644
--- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java --- a/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SnifferEggBlock.java
@@ -87,7 +87,7 @@ public class SnifferEggBlock extends Block { @@ -87,7 +87,7 @@ public class SnifferEggBlock extends Block {

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] fix Instruments
properly handle Player#playNote properly handle Player#playNote
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 35213408270522d08e0f8a10989db232ea24c0f7..f80a71100d317c8670b728a7c289ffa40dd2038b 100644 index 0262e0cd3ad5f4ab3a264aa110b946f81e9e92c1..af6713dc949cce945f3625092a01f04ad41120e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -690,7 +690,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -765,7 +765,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Sound instrumentSound = instrument.getSound(); Sound instrumentSound = instrument.getSound();
if (instrumentSound == null) return; if (instrumentSound == null) return;

Datei anzeigen

@ -6,10 +6,10 @@ Subject: [PATCH] Improve inlining for some hot BlockBehavior and FluidState
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 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 c7b6377aafd32f67eb8ba4dedd7cce5841b2d58d..e57e3a26b0fb856e1ab693df5783fe8b9bee9719 100644 index 939d116ea940d52b319e08a11f08d1ccc406cb76..f76ce68ed8e08167cf1cbd7bfec67ae01567c38d 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -975,15 +975,15 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -906,15 +906,15 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.shapeExceedsCube; // Paper - moved into shape cache init return this.shapeExceedsCube; // Paper - moved into shape cache init
} }
@ -28,7 +28,7 @@ index c7b6377aafd32f67eb8ba4dedd7cce5841b2d58d..e57e3a26b0fb856e1ab693df5783fe8b
return this.isAir; return this.isAir;
} }
@@ -1067,7 +1067,7 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -998,7 +998,7 @@ public abstract class BlockBehaviour implements FeatureElement {
} }
} }
@ -37,7 +37,7 @@ index c7b6377aafd32f67eb8ba4dedd7cce5841b2d58d..e57e3a26b0fb856e1ab693df5783fe8b
return this.canOcclude; return this.canOcclude;
} }
@@ -1275,11 +1275,11 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -1214,11 +1214,11 @@ public abstract class BlockBehaviour implements FeatureElement {
return this.getBlock().builtInRegistryHolder().is(key); return this.getBlock().builtInRegistryHolder().is(key);
} }
@ -52,7 +52,7 @@ index c7b6377aafd32f67eb8ba4dedd7cce5841b2d58d..e57e3a26b0fb856e1ab693df5783fe8b
} }
diff --git a/src/main/java/net/minecraft/world/level/material/FluidState.java b/src/main/java/net/minecraft/world/level/material/FluidState.java diff --git a/src/main/java/net/minecraft/world/level/material/FluidState.java b/src/main/java/net/minecraft/world/level/material/FluidState.java
index 3e8619f536a5cc4b8c9c10cf8454e38abdb7b721..f20398eab05797d1b23b71cf74076d6382022657 100644 index 42370e5e6628ebf8216c01521af859706b08834b..14bb12d2a0066e8b020f2e0e670a7a5c74633623 100644
--- a/src/main/java/net/minecraft/world/level/material/FluidState.java --- a/src/main/java/net/minecraft/world/level/material/FluidState.java
+++ b/src/main/java/net/minecraft/world/level/material/FluidState.java +++ b/src/main/java/net/minecraft/world/level/material/FluidState.java
@@ -25,9 +25,11 @@ public final class FluidState extends StateHolder<Fluid, FluidState> { @@ -25,9 +25,11 @@ public final class FluidState extends StateHolder<Fluid, FluidState> {
@ -61,8 +61,8 @@ index 3e8619f536a5cc4b8c9c10cf8454e38abdb7b721..f20398eab05797d1b23b71cf74076d63
public static final int AMOUNT_FULL = 8; public static final int AMOUNT_FULL = 8;
+ protected final boolean isEmpty; // Paper - Perf: moved from isEmpty() + protected final boolean isEmpty; // Paper - Perf: moved from isEmpty()
public FluidState(Fluid fluid, ImmutableMap<Property<?>, Comparable<?>> propertiesMap, MapCodec<FluidState> codec) { public FluidState(Fluid fluid, Reference2ObjectArrayMap<Property<?>, Comparable<?>> propertyMap, MapCodec<FluidState> codec) {
super(fluid, propertiesMap, codec); super(fluid, propertyMap, codec);
+ this.isEmpty = fluid.isEmpty(); // Paper - Perf: moved from isEmpty() + this.isEmpty = fluid.isEmpty(); // Paper - Perf: moved from isEmpty()
} }

Datei anzeigen

@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: braindead <totsuka.sama@gmail.com>
Date: Sat, 5 Nov 2022 17:47:26 -0400
Subject: [PATCH] fix MC-252817 (green map markers do not disappear).
this bug is caused by the fact that the itemframe's item is set to empty before the green marker is requested to be removed. this is fixed by getting the mapid from this method's parameter, rather than the air block now stored by the item frame.
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 bfb9694087821de206fafe867f207e07a4a6a988..e875196824ef9618a52ca3f172f202d5584990df 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -291,7 +291,9 @@ public class ItemFrame extends HangingEntity {
// Paper end
private void removeFramedMap(ItemStack itemstack) {
- this.getFramedMapId().ifPresent((i) -> {
+ // Paper start - fix MC-252817 (green map markers do not disappear)
+ this.getFramedMapIdFromItem(itemstack).ifPresent((i) -> {
+ // Paper end - fix MC-252817
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
if (worldmap != null) {
@@ -309,7 +311,12 @@ public class ItemFrame extends HangingEntity {
public OptionalInt getFramedMapId() {
ItemStack itemstack = this.getItem();
+ // Paper start - fix MC-252817 (green map markers do not disappear)
+ return this.getFramedMapIdFromItem(itemstack);
+ }
+ public OptionalInt getFramedMapIdFromItem(ItemStack itemstack) {
+ // Paper end - fix MC-252817
if (itemstack.is(Items.FILLED_MAP)) {
Integer integer = MapItem.getMapId(itemstack);