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-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
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-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-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
2024-08-31 21:01:29 +02:00
https://bugs.mojang.com/browse/MC-99075
Fix inventory desync within spawn protected area
2024-09-15 22:20:38 +02:00
https://bugs.mojang.com/browse/MC-273635
Fix TrialSpawner forgets assigned mob when placed by player
2023-09-17 00:16:44 +02:00
== AT ==
public net/minecraft/world/entity/Mob leashInfoTag
2024-10-29 16:54:40 +01:00
public net/minecraft/server/level/ChunkMap anyPlayerCloseEnoughForSpawning(Lnet/minecraft/world/level/ChunkPos;)Z
2023-09-17 00:16:44 +02:00
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-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-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
Rework async chunk api implementation
Firstly, the old methods all routed to the CompletableFuture method.
However, the CF method could not guarantee that if the caller
was off-main that the future would be "completed" on-main. Since
the callback methods used the CF one, this meant that the callback
methods did not guarantee that the callbacks were to be called on
the main thread.
Now, all methods route to getChunkAtAsync(x, z, gen, urgent, cb)
so that the methods with the callback are guaranteed to invoke
the callback on the main thread. The CF behavior remains unchanged;
it may still appear to complete on main if invoked off-main.
Secondly, remove the scheduleOnMain invocation in the async
chunk completion. This unnecessarily delays the callback
by 1 tick.
Thirdly, add getChunksAtAsync(minX, minZ, maxX, maxZ, ...) which
will load chunks within an area. This method is provided as a helper
as keeping all chunks loaded within an area can be complicated to
implement for plugins (due to the lacking ticket API), and is
already implemented internally anyways.
Fourthly, remove the ticket addition that occured with getChunkAt
and getChunkAtAsync. The ticket addition may delay the unloading
of the chunk unnecessarily. It also fixes a very rare timing bug
where the future/callback would be completed after the chunk
unloads.
2024-11-19 07:34:32 +01:00
index d090b46a6c6d7e99ec07623adc3fc77a9918b1da..88e3408244f57e9138d7ca7f9b2b90d4f8b66f7e 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
Rework async chunk api implementation
Firstly, the old methods all routed to the CompletableFuture method.
However, the CF method could not guarantee that if the caller
was off-main that the future would be "completed" on-main. Since
the callback methods used the CF one, this meant that the callback
methods did not guarantee that the callbacks were to be called on
the main thread.
Now, all methods route to getChunkAtAsync(x, z, gen, urgent, cb)
so that the methods with the callback are guaranteed to invoke
the callback on the main thread. The CF behavior remains unchanged;
it may still appear to complete on main if invoked off-main.
Secondly, remove the scheduleOnMain invocation in the async
chunk completion. This unnecessarily delays the callback
by 1 tick.
Thirdly, add getChunksAtAsync(minX, minZ, maxX, maxZ, ...) which
will load chunks within an area. This method is provided as a helper
as keeping all chunks loaded within an area can be complicated to
implement for plugins (due to the lacking ticket API), and is
already implemented internally anyways.
Fourthly, remove the ticket addition that occured with getChunkAt
and getChunkAtAsync. The ticket addition may delay the unloading
of the chunk unnecessarily. It also fixes a very rare timing bug
where the future/callback would be completed after the chunk
unloads.
2024-11-19 07:34:32 +01:00
@@ -753,7 +753,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
2023-05-08 16:17:00 +02:00
} else {
2024-10-23 23:35:21 +02:00
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, blockposition1.atY(this.getMaxY() + 1)).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-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-10-23 23:35:21 +02:00
index 064a7a3e1c4d192010e072a5e985a54135748d87..a706f0855fdf88cc9aece3ba00ef574b9cd8bd11 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
2024-10-23 23:35:21 +02:00
@@ -91,7 +91,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-08-31 21:01:29 +02:00
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-10-31 17:25:52 +01:00
index 51ee01dfe5e144cb881c9376e586b95790a9ab98..f5e05a34afee8f5750b3a7871083968c5d75d2e7 100644
2024-08-31 21:01:29 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
2024-10-31 17:25:52 +01:00
@@ -1832,7 +1832,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
2024-10-23 23:35:21 +02:00
this.player.swing(enumhand, true);
}
2024-08-31 21:01:29 +02:00
}
- }
+ } else { this.player.containerMenu.sendAllDataToRemote(); } // Paper - Fix inventory desync; MC-99075
} else {
2024-10-23 23:35:21 +02:00
MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i).withStyle(ChatFormatting.RED);
2024-08-31 21:01:29 +02:00
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
Rework async chunk api implementation
Firstly, the old methods all routed to the CompletableFuture method.
However, the CF method could not guarantee that if the caller
was off-main that the future would be "completed" on-main. Since
the callback methods used the CF one, this meant that the callback
methods did not guarantee that the callbacks were to be called on
the main thread.
Now, all methods route to getChunkAtAsync(x, z, gen, urgent, cb)
so that the methods with the callback are guaranteed to invoke
the callback on the main thread. The CF behavior remains unchanged;
it may still appear to complete on main if invoked off-main.
Secondly, remove the scheduleOnMain invocation in the async
chunk completion. This unnecessarily delays the callback
by 1 tick.
Thirdly, add getChunksAtAsync(minX, minZ, maxX, maxZ, ...) which
will load chunks within an area. This method is provided as a helper
as keeping all chunks loaded within an area can be complicated to
implement for plugins (due to the lacking ticket API), and is
already implemented internally anyways.
Fourthly, remove the ticket addition that occured with getChunkAt
and getChunkAtAsync. The ticket addition may delay the unloading
of the chunk unnecessarily. It also fixes a very rare timing bug
where the future/callback would be completed after the chunk
unloads.
2024-11-19 07:34:32 +01:00
index 1456945e8d6e82c59bf09150bfe24bd1ae14a8c3..4b8636c2107e6a16c26f259e0dbdbc40a1268e06 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
2024-10-27 18:11:15 +01:00
@@ -260,7 +260,7 @@ public abstract class PlayerList {
2024-06-14 03:30:23 +02:00
}
if (optional.isEmpty() || invalidPlayerWorld[0]) {
// Paper end - reset to main world spawn if first spawn or invalid world
- player.moveTo(player.adjustSpawnLocation(worldserver1, worldserver1.getSharedSpawnPos()).getBottomCenter(), 0.0F, 0.0F);
+ player.moveTo(player.adjustSpawnLocation(worldserver1, worldserver1.getSharedSpawnPos()).getBottomCenter(), worldserver1.getSharedSpawnAngle(), 0.0F); // Paper - MC-200092 - fix first spawn pos yaw being ignored
}
// Paper end - Entity#getEntitySpawnReason
player.setServerLevel(worldserver1);
2024-10-27 18:11:15 +01:00
@@ -660,8 +660,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) {
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
2024-10-23 23:35:21 +02:00
index 6827426e6e9706909265f84bf97b5fa7105a7fea..7324da6b7dd2623ce394e3827ff77ef684a3b98b 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
2024-10-23 23:35:21 +02:00
@@ -78,9 +78,10 @@ public class BreakDoorGoal extends DoorInteractGoal {
2023-07-13 21:11:27 +02:00
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
2024-10-23 23:35:21 +02:00
index 9e6f946e6d2878aa3fa8abe0f6fa4770d18676d3..32bb591371fe78ba10a2bc52389ef33978cbc0eb 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 {
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-10-25 13:52:04 +02:00
index 14b47d6fa189f2a666b12ef7e7708d204c2b0452..4c6dc427b90012b0945e073dd905dc7e8d1bec82 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
2024-10-23 23:35:21 +02:00
@@ -247,9 +247,10 @@ public class Goat extends Animal {
2022-10-01 19:39:42 +02:00
player.setItemInHand(hand, itemstack1);
2024-10-23 23:35:21 +02:00
return InteractionResult.SUCCESS;
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
2024-10-23 23:35:21 +02:00
this.playEatingSound();
2022-10-01 19:39:42 +02:00
}
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-10-29 16:54:40 +01:00
index 30af4cbb17148c247a46c0346419d6c838dbc9d2..d431ee93cd7e87a24ff4079288facd089053d725 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
2024-10-23 23:35:21 +02:00
@@ -272,6 +272,14 @@ public class ItemFrame extends HangingEntity {
2024-04-24 23:23:56 +02:00
return (ItemStack) this.getEntityData().get(ItemFrame.DATA_ITEM);
2023-07-15 22:28:28 +02:00
}
+ // Paper start - Fix MC-123848 (spawn item frame drops above block)
+ @Nullable
+ @Override
2024-10-25 13:34:01 +02:00
+ public net.minecraft.world.entity.item.ItemEntity spawnAtLocation(ServerLevel serverLevel, ItemStack stack) {
2024-10-29 16:54:40 +01:00
+ return this.spawnAtLocation(serverLevel, stack, this.getDirection() == Direction.DOWN ? -0.6F : 0.0F);
2023-07-15 22:28:28 +02:00
+ }
+ // Paper end
+
2024-04-24 23:23:56 +02:00
@Nullable
2024-10-23 23:35:21 +02:00
public MapId getFramedMapId(ItemStack stack) {
return (MapId) stack.get(DataComponents.MAP_ID);
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-10-23 23:35:21 +02:00
index 15a1ea01917ce57c2457094186dde937c21ffb22..b0236c7bf9441aa84d3795ffed05dd6099f29636 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-24 23:23:56 +02:00
@@ -82,8 +82,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-10-23 23:35:21 +02:00
cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), EntitySpawnReason.NATURAL, null);
2022-10-28 02:53:16 +02:00
- cat.moveTo(pos, 0.0F, 0.0F);
world.addFreshEntityWithPassengers(cat);
return 1;
}
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-10-23 23:35:21 +02:00
index cad0b581c992edc5cd312a727695a443e26e96d8..9db647cfbd3f9c884465cf3d3a1b911d46a3da58 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-10-23 23:35:21 +02:00
@@ -164,6 +164,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
2024-04-24 23:23:56 +02:00
public void updateEffects(Optional<Holder<MobEffect>> primary, Optional<Holder<MobEffect>> secondary) {
2023-09-17 02:36:10 +02:00
+ // Paper start - fix MC-174630 - validate secondary power
2024-05-08 03:18:57 +02:00
+ if (secondary.isPresent() && secondary.get() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) {
2023-09-17 02:36:10 +02:00
+ 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());
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-10-23 23:35:21 +02:00
index 7dd6b7c0ea472cfbc7ece55bc64bc5d85be4a6c0..6dcb571e9f35fbae724be69dc113b0c33eca63b3 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
2024-10-23 23:35:21 +02:00
@@ -72,7 +72,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock {
if (entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) {
// CraftBukkit start - moved down
// entity.clearFire();
- if (entity.mayInteract(worldserver, pos)) {
+ if ((entity instanceof net.minecraft.world.entity.player.Player || worldserver.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(worldserver, pos)) { // Paper - Fixes MC-248588
if (this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities
entity.clearFire();
}
2022-10-01 19:39:42 +02:00
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-10-25 17:08:48 +02:00
index 9c1267df7057caa3500c7a9e6c705ea58c2b5e11..4d36aa195332c2ff6fa7bc5fff61ff7dc80a3fd5 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-10-23 23:35:21 +02:00
@@ -531,13 +531,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
2022-10-01 19:39:42 +02:00
@Override
2024-10-23 23:35:21 +02:00
public void fillStackedContents(StackedItemContents finder) {
2022-10-01 19:39:42 +02:00
- 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-10-23 23:35:21 +02:00
index 8aab6f68f576fb022eb59798585e264f5aafbc69..edd6017937a7f20a1b43fa15204ec130b524b52b 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
2024-04-24 23:23:56 +02:00
@@ -295,7 +295,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();
}
2024-09-15 22:20:38 +02:00
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
2024-10-29 16:54:40 +01:00
index e64a30577e9000e5c4d22fd3d9cf8a9381c5c459..a49f83784f85f5420091692aae588ef067aa5fcd 100644
2024-09-15 22:20:38 +02:00
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
2024-10-29 16:54:40 +01:00
@@ -101,9 +101,9 @@ public class TrialSpawnerData {
2024-09-15 22:20:38 +02:00
this.ejectingLootTable = rewardLootTable;
}
- public void reset() {
+ public void reset(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
2024-10-23 23:35:21 +02:00
this.currentMobs.clear();
2024-10-29 16:54:40 +01:00
- this.nextSpawnData = Optional.empty();
2024-09-15 22:20:38 +02:00
+ if (!logic.getConfig().spawnPotentialsDefinition().isEmpty()) this.nextSpawnData = Optional.empty(); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
2024-10-29 16:54:40 +01:00
this.resetStatistics();
2024-09-15 22:20:38 +02:00
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
2024-10-29 16:54:40 +01:00
index 83cdeee5e2ce115ff696a5afc5465dc4301779b9..192ee216b617d3533f592e62719b6d75d20b5a96 100644
2024-09-15 22:20:38 +02:00
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
@@ -145,7 +145,7 @@ public enum TrialSpawnerState implements StringRepresentable {
yield ACTIVE;
} else if (trialSpawnerData.isCooldownFinished(world)) {
logic.removeOminous(world, pos);
- trialSpawnerData.reset();
+ trialSpawnerData.reset(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635
yield WAITING_FOR_PLAYERS;
} else {
yield this;
2024-10-29 16:54:40 +01:00
diff --git a/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java b/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
index cf27b0d6a9fe53b9f91090db4740776b335a2e9b..7d5909431f98f7e8b84d740bba9c044fec6d8e96 100644
--- a/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
+++ b/src/main/java/net/minecraft/world/level/portal/TeleportTransition.java
@@ -53,7 +53,7 @@ public record TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 delta
}
public TeleportTransition(ServerLevel worldserver, Entity entity, TeleportTransition.PostTeleportTransition teleporttransition_a, PlayerTeleportEvent.TeleportCause cause) {
- this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, 0.0F, 0.0F, false, false, Set.of(), teleporttransition_a, cause);
+ this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, worldserver.getSharedSpawnAngle(), 0.0F, false, false, Set.of(), teleporttransition_a, cause); // Paper - MC-200092 - fix first spawn pos yaw being ignored
// CraftBukkit end
}
@@ -69,7 +69,7 @@ public record TeleportTransition(ServerLevel newLevel, Vec3 position, Vec3 delta
}
public static TeleportTransition missingRespawnBlock(ServerLevel world, Entity entity, TeleportTransition.PostTeleportTransition postDimensionTransition) {
- return new TeleportTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, 0.0F, 0.0F, true, false, Set.of(), postDimensionTransition);
+ return new TeleportTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, world.getSharedSpawnAngle(), 0.0F, true, false, Set.of(), postDimensionTransition); // Paper - MC-200092 - fix spawn pos yaw being ignored
}
private static Vec3 findAdjustedSharedSpawnPos(ServerLevel world, Entity entity) {