2022-10-01 19:39:42 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Mon, 11 Jul 2022 11:56:41 -0700
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
wrong msg for opping multiple players
https://bugs.mojang.com/browse/MC-248588
respect mob griefing gamerule for draining water cauldrons
https://bugs.mojang.com/browse/MC-244739
play goat eating sound for last item in stack
https://bugs.mojang.com/browse/MC-243057
ignore furnace fuel slot in recipe book click
2022-10-28 02:53:16 +02:00
https://bugs.mojang.com/browse/MC-147659
Some witch huts spawn the incorrect cat
Note: Marked as Won't Fix, makes 0 sense
2022-11-19 19:23:31 +01:00
https://bugs.mojang.com/browse/MC-179072
Creepers do not defuse when switching from Survival to Creative/Spectator
2022-12-12 00:22:56 +01:00
https://bugs.mojang.com/browse/MC-191591
Fix items equipped on AbstractHorse losing NBT
2023-03-16 17:06:40 +01:00
https://bugs.mojang.com/browse/MC-259571
Fix changeGameModeForPlayer to use gameModeForPlayer
2023-05-08 16:17:00 +02:00
https://bugs.mojang.com/browse/MC-262422
Fix lightning being able to hit spectators
2023-05-15 17:33:15 +02:00
https://bugs.mojang.com/browse/MC-224454
Fix mobs attempting to pathfind through azalea blocks
2023-07-13 21:11:27 +02:00
https://bugs.mojang.com/browse/MC-263999
Fix mobs breaking doors not spawning block break particles
2023-07-15 22:28:28 +02:00
https://bugs.mojang.com/browse/MC-210802
Fixes sheep eating blocks outside of ticking range
https://bugs.mojang.com/browse/MC-123848
Fixes item frames dropping items above when pointing down
2023-08-09 01:15:01 +02:00
https://bugs.mojang.com/browse/MC-84789
Fix wild wolves not considering bones interesting
2023-08-22 11:57:44 +02:00
https://bugs.mojang.com/browse/MC-225381
Fix overfilled bundles duplicating items / being filled with air
2023-09-17 00:16:44 +02:00
https://bugs.mojang.com/browse/MC-173303
Fix leashed pets teleporting to owner when loaded
2023-09-17 02:36:10 +02:00
https://bugs.mojang.com/browse/MC-174630
Fix secondary beacon effect remaining after switching effect
https://bugs.mojang.com/browse/MC-153086
Fix the beacon deactivation sound always playing when broken
2023-11-25 23:09:26 +01:00
https://bugs.mojang.com/browse/MC-200092
Fix yaw being ignored for a player's first spawn pos
2024-01-18 15:56:25 +01:00
https://bugs.mojang.com/browse/MC-158900
Fix error when joining after tempban expired
2023-09-17 00:16:44 +02:00
== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
2022-10-28 02:53:16 +02:00
Co-authored-by: William Blake Galbreath <blake.galbreath@gmail.com>
2024-01-16 19:27:39 +01:00
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2022-10-28 02:53:16 +02:00
2022-12-12 00:22:56 +01:00
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
2024-01-24 15:57:53 +01:00
index 829c72333664da0c06ce04af93ea39bb90ce0b67..b4f7e3ae855cbf48925f0db916501adf513ae08c 100644
2022-12-12 00:22:56 +01:00
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
2023-06-08 10:47:19 +02:00
@@ -351,7 +351,7 @@ public interface DispenseItemBehavior {
2022-12-12 00:22:56 +01:00
}
}
// CraftBukkit end
- ((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS);
+ ((Saddleable) list.get(0)).equipSaddle(SoundSource.BLOCKS, CraftItemStack.asNMSCopy(event.getItem())); // Paper - Fix saddles losing nbt data - MC-191591
// itemstack.shrink(1); // CraftBukkit - handled above
this.setSuccess(true);
return stack;
2022-10-01 19:39:42 +02:00
diff --git a/src/main/java/net/minecraft/server/commands/DeOpCommands.java b/src/main/java/net/minecraft/server/commands/DeOpCommands.java
2024-04-12 21:14:06 +02:00
index 0283f26151488d715dc823a0008c9a37ef6740fb..d98447e58233745665f0833196226077d972cc2a 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/server/commands/DeOpCommands.java
+++ b/src/main/java/net/minecraft/server/commands/DeOpCommands.java
2024-04-12 21:14:06 +02:00
@@ -35,7 +35,7 @@ public class DeOpCommands {
if (playerList.isOp(gameProfile)) {
2022-10-01 19:39:42 +02:00
playerList.deop(gameProfile);
2024-04-12 21:14:06 +02:00
i++;
- source.sendSuccess(() -> Component.translatable("commands.deop.success", targets.iterator().next().getName()), true);
+ source.sendSuccess(() -> Component.translatable("commands.deop.success", gameProfile.getName()), true); // Paper - fixes MC-253721
2022-10-01 19:39:42 +02:00
}
}
2024-04-12 21:14:06 +02:00
2022-10-01 19:39:42 +02:00
diff --git a/src/main/java/net/minecraft/server/commands/OpCommand.java b/src/main/java/net/minecraft/server/commands/OpCommand.java
2024-04-12 21:14:06 +02:00
index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c53465206ea8e0ec 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/server/commands/OpCommand.java
+++ b/src/main/java/net/minecraft/server/commands/OpCommand.java
2024-04-12 21:14:06 +02:00
@@ -46,7 +46,7 @@ public class OpCommand {
if (!playerList.isOp(gameProfile)) {
2022-10-01 19:39:42 +02:00
playerList.op(gameProfile);
2024-04-12 21:14:06 +02:00
i++;
- source.sendSuccess(() -> Component.translatable("commands.op.success", targets.iterator().next().getName()), true);
+ source.sendSuccess(() -> Component.translatable("commands.op.success", gameProfile.getName()), true); // Paper - fixes MC-253721
2022-10-01 19:39:42 +02:00
}
}
2024-04-12 21:14:06 +02:00
2023-07-15 22:28:28 +02:00
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
index f2d3dc066b00b685715eb5104234945c41a15f92..43c8f6a0615f392cc560b2259b116cc9d5fba4e7 100644
2023-07-15 22:28:28 +02:00
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
2024-01-24 22:13:08 +01:00
@@ -1233,7 +1233,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
2024-01-23 15:43:48 +01:00
// CraftBukkit end
2023-07-15 22:28:28 +02:00
}
- boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) {
+ public boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) { // Paper - public
// Spigot start
return this.anyPlayerCloseEnoughForSpawning(pos, false);
}
2023-05-08 16:17:00 +02:00
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
index 57f54e3399f9d2d7fecdae62858d20e50caf7afd..b804941c76582871813ba813b9eef2422e7e71f0 100644
2023-05-08 16:17:00 +02:00
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
2024-01-24 22:13:08 +01:00
@@ -770,7 +770,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
2023-05-08 16:17:00 +02:00
} else {
2023-12-06 17:21:56 +01:00
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D);
2023-05-08 16:17:00 +02:00
List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> {
- return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition());
+ return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()) && !entityliving.isSpectator(); // Paper - Fix lightning being able to hit spectators (MC-262422)
});
if (!list.isEmpty()) {
2023-11-25 23:09:26 +01:00
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2024-04-12 21:14:06 +02:00
index c99a672dd2d2e4972e9d4025e10e8863d0af1e6a..d831fb1f66dc38b6c9d3592944f94cc5eeaac864 100644
2023-11-25 23:09:26 +01:00
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
2024-01-24 22:13:08 +01:00
@@ -419,14 +419,14 @@ public class ServerPlayer extends Player {
2023-11-25 23:09:26 +01:00
BlockPos blockposition1 = PlayerRespawnLogic.getOverworldRespawnPos(world, blockposition.getX() + j2 - i, blockposition.getZ() + k2 - i);
if (blockposition1 != null) {
- this.moveTo(blockposition1, 0.0F, 0.0F);
+ this.moveTo(blockposition1, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored
2024-01-22 21:04:08 +01:00
if (world.noCollision((Entity) this)) {
2023-11-25 23:09:26 +01:00
break;
}
}
}
} else {
- this.moveTo(blockposition, 0.0F, 0.0F);
+ this.moveTo(blockposition, world.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored
2024-01-22 21:04:08 +01:00
while (!world.noCollision((Entity) this) && this.getY() < (double) (world.getMaxBuildHeight() - 1)) {
2023-11-25 23:09:26 +01:00
this.setPos(this.getX(), this.getY() + 1.0D, this.getZ());
2023-03-16 19:47:05 +01:00
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
2024-02-01 10:15:57 +01:00
index f3389dc345d8b6e5389ae37848d9b268d4bbad83..5d1b8bae981dc538ee1fe4fb993e44f227168233 100644
2023-03-16 19:47:05 +01:00
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
2023-06-08 10:47:19 +02:00
@@ -92,7 +92,7 @@ public class ServerPlayerGameMode {
2024-01-19 17:54:05 +01:00
return event; // Paper - Expand PlayerGameModeChangeEvent
2023-03-16 19:47:05 +01:00
}
// CraftBukkit end
- this.setGameModeForPlayer(gameMode, this.previousGameModeForPlayer);
+ this.setGameModeForPlayer(gameMode, this.gameModeForPlayer); // Paper - Fix MC-259571
this.player.onUpdateAbilities();
this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit
this.level.updateSleepingPlayerList();
2024-01-16 19:27:39 +01:00
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
index 6fbcea8fd32a425cab936330d5d9545782e03346..1478def0ba4bc02c1c466d80cc2b90919612c18a 100644
2024-01-16 19:27:39 +01:00
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
@@ -710,8 +710,10 @@ public abstract class PlayerList {
2024-01-16 19:27:39 +01:00
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());
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
- if (this.bans.isBanned(gameprofile)) {
2024-01-16 19:27:39 +01:00
- UserBanListEntry gameprofilebanentry = (UserBanListEntry) this.bans.get(gameprofile);
+ // Paper start - Fix MC-158900
+ UserBanListEntry gameprofilebanentry;
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
+ if (this.bans.isBanned(gameprofile) && (gameprofilebanentry = this.bans.get(gameprofile)) != null) {
2024-01-16 19:27:39 +01:00
+ // Paper end - Fix MC-158900
ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned.reason", gameprofilebanentry.getReason());
if (gameprofilebanentry.getExpires() != null) {
2022-12-12 00:22:56 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/Saddleable.java b/src/main/java/net/minecraft/world/entity/Saddleable.java
2023-09-22 19:59:56 +02:00
index effe4c4fb37fe13aece70cdef4966047d4719af9..7152674d3f3fb98198585cb5ece2bb88877345f9 100644
2022-12-12 00:22:56 +01:00
--- a/src/main/java/net/minecraft/world/entity/Saddleable.java
+++ b/src/main/java/net/minecraft/world/entity/Saddleable.java
@@ -9,6 +9,11 @@ public interface Saddleable {
boolean isSaddleable();
void equipSaddle(@Nullable SoundSource sound);
+ // Paper start - Fix saddles losing nbt data - MC-191591
+ default void equipSaddle(final @Nullable SoundSource sound, final @Nullable net.minecraft.world.item.ItemStack stack) {
+ this.equipSaddle(sound);
+ }
+ // Paper end
default SoundEvent getSaddleSoundEvent() {
return SoundEvents.HORSE_SADDLE;
2023-08-09 01:15:01 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java
2024-04-12 21:14:06 +02:00
index 95ec11bfd4df6c53d6a4828f55c621cd08b0e666..f1b28965f6fe785e6e3a24fdb6db6676701338b9 100644
2023-08-09 01:15:01 +02:00
--- a/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/BegGoal.java
2024-04-12 21:14:06 +02:00
@@ -62,7 +62,7 @@ public class BegGoal extends Goal {
2023-08-09 01:15:01 +02:00
private boolean playerHoldingInteresting(Player player) {
2024-04-12 21:14:06 +02:00
for (InteractionHand interactionHand : InteractionHand.values()) {
2023-08-09 01:15:01 +02:00
ItemStack itemStack = player.getItemInHand(interactionHand);
- if (this.wolf.isTame() && itemStack.is(Items.BONE)) {
+ if (!this.wolf.isTame() && itemStack.is(Items.BONE)) { // Paper - Fix MC-84789
return true;
}
2023-07-13 21:11:27 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
2023-07-15 22:28:28 +02:00
index 784a894688f98f9d0368a36d456c5c94e1ee3695..a85885ee51df585fa11ae9f8fcd67ff2a71c5a18 100644
2023-07-13 21:11:27 +02:00
--- a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java
@@ -77,9 +77,10 @@ public class BreakDoorGoal extends DoorInteractGoal {
return;
}
// CraftBukkit end
+ final net.minecraft.world.level.block.state.BlockState oldState = this.mob.level().getBlockState(this.doorPos); // Paper - fix MC-263999
this.mob.level().removeBlock(this.doorPos, false);
this.mob.level().levelEvent(1021, this.doorPos, 0);
- this.mob.level().levelEvent(2001, this.doorPos, Block.getId(this.mob.level().getBlockState(this.doorPos)));
+ this.mob.level().levelEvent(2001, this.doorPos, Block.getId(oldState)); // Paper - fix MC-263999
}
}
2023-07-15 22:28:28 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
2023-12-06 17:21:56 +01:00
index d802985f1431be4332c07f0dab88feebedea4ce2..4e2c23ccdf4e4a4d65b291dbe20952bae1838bff 100644
2023-07-15 22:28:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java
@@ -31,6 +31,11 @@ public class EatBlockGoal extends Goal {
@Override
public boolean canUse() {
+ // Paper start - Fix MC-210802
+ if (!((net.minecraft.server.level.ServerLevel) this.level).chunkSource.chunkMap.anyPlayerCloseEnoughForSpawning(this.mob.chunkPosition())) {
+ return false;
+ }
+ // Paper end
if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) {
return false;
} else {
2023-09-17 00:16:44 +02:00
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
2022-11-19 19:23:31 +01:00
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
2024-04-12 21:14:06 +02:00
index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c9af362b9 100644
2022-11-19 19:23:31 +01:00
--- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java
@@ -21,6 +21,13 @@ public class SwellGoal extends Goal {
2024-04-12 21:14:06 +02:00
return this.creeper.getSwellDir() > 0 || livingEntity != null && this.creeper.distanceToSqr(livingEntity) < 9.0;
2022-11-19 19:23:31 +01:00
}
+ // Paper start - Fix MC-179072
+ @Override
+ public boolean canContinueToUse() {
+ return !net.minecraft.world.entity.EntitySelector.NO_CREATIVE_OR_SPECTATOR.test(this.creeper.getTarget()) && canUse();
+ }
+ // Paper end
+
@Override
public void start() {
this.creeper.getNavigation().stop();
2022-10-01 19:39:42 +02:00
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
2024-01-19 12:30:04 +01:00
index 110dd5418b0512a2f27f0c4d5a5f1812356a6a12..5d247ac38fe8a61603b3d934f3000bcda773142b 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java
2023-09-22 17:51:48 +02:00
@@ -239,9 +239,10 @@ public class Goat extends Animal {
2022-10-01 19:39:42 +02:00
player.setItemInHand(hand, itemstack1);
2023-06-08 10:47:19 +02:00
return InteractionResult.sidedSuccess(this.level().isClientSide);
2022-10-01 19:39:42 +02:00
} else {
+ boolean isFood = this.isFood(itemstack); // Paper - track before stack is possibly decreased to 0 (Fixes MC-244739)
InteractionResult enuminteractionresult = super.mobInteract(player, hand);
- if (enuminteractionresult.consumesAction() && this.isFood(itemstack)) {
+ if (enuminteractionresult.consumesAction() && isFood) { // Paper
2023-06-08 10:47:19 +02:00
this.level().playSound((Player) null, (Entity) this, this.getEatingSound(itemstack), SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level().random, 0.8F, 1.2F));
2022-10-01 19:39:42 +02:00
}
2022-12-12 00:22:56 +01:00
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
2024-01-21 12:53:04 +01:00
index 56cc6ecf7f95687db7c7c062b4ee979bfe49844b..94dd97662ba07689fbfa16ef5c7d99fe12ce83de 100644
2022-12-12 00:22:56 +01:00
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
2023-09-22 17:51:48 +02:00
@@ -252,7 +252,13 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
2022-12-12 00:22:56 +01:00
@Override
public void equipSaddle(@Nullable SoundSource sound) {
- this.inventory.setItem(0, new ItemStack(Items.SADDLE));
+ // Paper start - Fix saddles losing nbt data - MC-191591
+ this.equipSaddle(sound, null);
+ }
+ @Override
+ public void equipSaddle(@Nullable SoundSource sound, @Nullable ItemStack stack) {
+ this.inventory.setItem(0, stack != null ? stack : new ItemStack(Items.SADDLE));
+ // Paper end
2023-06-08 10:47:19 +02:00
}
2022-12-12 00:22:56 +01:00
public void equipArmor(Player player, ItemStack stack) {
2023-07-15 22:28:28 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
2024-03-23 22:26:17 +01:00
index ab85050a64d4897aff11d0780d8cb26660918ac7..bfb9694087821de206fafe867f207e07a4a6a988 100644
2023-07-15 22:28:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
2023-12-06 17:21:56 +01:00
@@ -282,6 +282,14 @@ public class ItemFrame extends HangingEntity {
2023-07-15 22:28:28 +02:00
}
}
+ // Paper start - Fix MC-123848 (spawn item frame drops above block)
+ @Nullable
+ @Override
+ public net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ItemStack stack) {
+ return this.spawnAtLocation(stack, getDirection().equals(Direction.DOWN) ? -0.6F : 0.0F);
+ }
+ // Paper end
+
private void removeFramedMap(ItemStack itemstack) {
this.getFramedMapId().ifPresent((i) -> {
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
2022-10-28 02:53:16 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
2024-04-12 21:14:06 +02:00
index c718cee92522a0d3c0e30eafd09fa8178c7e6e4a..5d1610eddcaf0cf65c726a5438b42e53bab85332 100644
2022-10-28 02:53:16 +02:00
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
2024-04-12 21:14:06 +02:00
@@ -83,8 +83,8 @@ public class CatSpawner implements CustomSpawner {
2022-10-28 02:53:16 +02:00
if (cat == null) {
return 0;
} else {
+ cat.moveTo(pos, 0.0F, 0.0F); // Paper - move up - Fix MC-147659
2024-04-12 21:14:06 +02:00
cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null, null);
2022-10-28 02:53:16 +02:00
- cat.moveTo(pos, 0.0F, 0.0F);
world.addFreshEntityWithPassengers(cat);
return 1;
}
2022-10-01 19:39:42 +02:00
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raids.java b/src/main/java/net/minecraft/world/entity/raid/Raids.java
2023-09-22 17:51:48 +02:00
index 4a0f4c83228187a2082ad029680056b1801f77bd..31831811ce16265e9828fa34d9e67d8ac195d723 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/world/entity/raid/Raids.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raids.java
2023-09-22 17:51:48 +02:00
@@ -134,7 +134,7 @@ public class Raids extends SavedData {
2022-10-01 19:39:42 +02:00
// 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) {
2023-09-22 17:51:48 +02:00
@@ -149,7 +149,7 @@ public class Raids extends SavedData {
2022-10-01 19:39:42 +02:00
}
// 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);
2023-09-17 02:36:10 +02:00
diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
2024-02-01 10:15:57 +01:00
index b670c0cb3886c99d38a91b5c13aa2cefaae702cf..9599a5f96601030bf7f7cbd3392861d626959f9d 100644
2023-09-17 02:36:10 +02:00
--- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java
2024-02-01 10:15:57 +01:00
@@ -177,6 +177,11 @@ public class BeaconMenu extends AbstractContainerMenu {
2024-01-19 22:13:42 +01:00
// Paper end - Add PlayerChangeBeaconEffectEvent
2023-09-17 02:36:10 +02:00
public void updateEffects(Optional<MobEffect> primary, Optional<MobEffect> secondary) {
+ // 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())) {
+ secondary = Optional.empty();
+ }
+ // Paper end
if (this.paymentSlot.hasItem()) {
2024-01-19 22:13:42 +01:00
// Paper start - Add PlayerChangeBeaconEffectEvent
2023-09-17 02:36:10 +02:00
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());
2023-08-22 11:57:44 +02:00
diff --git a/src/main/java/net/minecraft/world/item/BundleItem.java b/src/main/java/net/minecraft/world/item/BundleItem.java
2024-04-12 21:14:06 +02:00
index 1e538c691d867a96a57fec9350b4f663d01f8e93..c4c966c555407b7146053187e2ed16cfb99a2dc9 100644
2023-08-22 11:57:44 +02:00
--- a/src/main/java/net/minecraft/world/item/BundleItem.java
+++ b/src/main/java/net/minecraft/world/item/BundleItem.java
2024-04-12 21:14:06 +02:00
@@ -49,7 +49,7 @@ public class BundleItem extends Item {
removeOne(stack).ifPresent(removedStack -> add(stack, slot.safeInsert(removedStack)));
2023-08-22 11:57:44 +02:00
} 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);
}
2024-04-12 21:14:06 +02:00
@@ -120,7 +120,7 @@ public class BundleItem extends Item {
2023-08-22 11:57:44 +02:00
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);
2022-12-12 00:22:56 +01:00
diff --git a/src/main/java/net/minecraft/world/item/SaddleItem.java b/src/main/java/net/minecraft/world/item/SaddleItem.java
2024-04-12 21:14:06 +02:00
index a569b404ece21fa9571e73947334f5aa57a8080c..51d350add4ca1756cb9e364e066bbee7949ffb8c 100644
2022-12-12 00:22:56 +01:00
--- a/src/main/java/net/minecraft/world/item/SaddleItem.java
+++ b/src/main/java/net/minecraft/world/item/SaddleItem.java
2024-04-12 21:14:06 +02:00
@@ -17,7 +17,7 @@ public class SaddleItem extends Item {
public InteractionResult interactLivingEntity(ItemStack stack, Player user, LivingEntity entity, InteractionHand hand) {
if (entity instanceof Saddleable saddleable && entity.isAlive() && !saddleable.isSaddled() && saddleable.isSaddleable()) {
if (!user.level().isClientSide) {
- saddleable.equipSaddle(SoundSource.NEUTRAL);
+ saddleable.equipSaddle(SoundSource.NEUTRAL, stack.copyWithCount(1)); // Paper - Fix saddles losing nbt data - MC-191591
entity.level().gameEvent(entity, GameEvent.EQUIP, entity.position());
stack.shrink(1);
}
2023-05-15 17:33:15 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
2024-04-12 21:14:06 +02:00
index 655956f3c50d6a78b0cbfaa23d6a62cd776c1e52..85484d061090d989de8246df81f8e9e5f8906072 100644
2023-05-15 17:33:15 +02:00
--- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
2023-12-06 17:21:56 +01:00
@@ -51,4 +51,11 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock {
2023-05-15 17:33:15 +02:00
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
2023-12-06 17:21:56 +01:00
TreeGrower.AZALEA.growTree(world, world.getChunkSource().getGenerator(), pos, state, random);
2023-05-15 17:33:15 +02:00
}
+
+ // Paper start - Fix MC-224454
+ @Override
+ public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, net.minecraft.world.level.pathfinder.PathComputationType type) {
+ return false;
+ }
+ // Paper end
}
2022-10-01 19:39:42 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
2024-02-01 10:15:57 +01:00
index 42c1e3dfec23d6a7d832bf73d47ecae1212ec2c9..a4857675772d4fe849ba85fc21a369decca42fc0 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java
2023-12-06 17:21:56 +01:00
@@ -68,7 +68,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
2024-01-19 13:22:30 +01:00
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
2022-10-01 19:39:42 +02:00
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start
- if (entity.mayInteract(world, pos)) {
+ if ((entity instanceof net.minecraft.world.entity.player.Player || world.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(world, pos)) { // Paper - Fixes MC-248588
if (!this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
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
2024-01-21 17:39:05 +01:00
index c7ba7ac1a3869e4db1ef6b0350b3cab7f31a94c4..d7beeac4a8e4a16221809663a5aa03389a759742 100644
2022-10-01 19:39:42 +02:00
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
2024-01-14 10:46:04 +01:00
@@ -675,13 +675,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
2022-10-01 19:39:42 +02:00
@Override
public void fillStackedContents(StackedContents finder) {
- Iterator iterator = this.items.iterator();
-
- while (iterator.hasNext()) {
- ItemStack itemstack = (ItemStack) iterator.next();
-
- finder.accountStack(itemstack);
- }
+ // Paper start - don't account fuel stack (fixes MC-243057)
+ finder.accountStack(this.items.get(SLOT_INPUT));
+ finder.accountStack(this.items.get(SLOT_RESULT));
+ // Paper end
}
}
2023-09-17 02:36:10 +02:00
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
2024-02-01 10:15:57 +01:00
index 61a618f09af475407a78343eecb4352052b1df1e..247f24c7fadc203ee0f6a6f85122c91ab4c82f80 100644
2023-09-17 02:36:10 +02:00
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
2023-09-22 17:51:48 +02:00
@@ -291,7 +291,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
2023-09-17 02:36:10 +02:00
org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, worldPosition);
new io.papermc.paper.event.block.BeaconDeactivatedEvent(block).callEvent();
2024-01-19 17:54:05 +01:00
// Paper end - beacon activation/deactivation events
2023-09-17 02:36:10 +02:00
+ // Paper start - fix MC-153086
+ if (this.levels > 0 && !this.beamSections.isEmpty()) {
BeaconBlockEntity.playSound(this.level, this.worldPosition, SoundEvents.BEACON_DEACTIVATE);
+ }
+ // Paper end
super.setRemoved();
}