Patches, patches, patches

This commit is contained in:
Bjarne Koll 2024-10-24 10:42:29 +02:00
parent 5d19e2b332
commit 457d03534d
No known key found for this signature in database
GPG Key ID: 27F6CCCF55D2EE62
40 changed files with 211 additions and 209 deletions

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only tick item frames if players can see it
In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index f3f93710846ce0f6d53845e0b49331646a4e8332..f010be9605d7458add7e5693ff473fabf679c938 100644
index bc0f1aa61e68d2a8638d89c10bc5c71922d057f9..3cdcc4f44608d24550f2a8c6f3f5ce675d7777c5 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -112,7 +112,7 @@ public class ServerEntity {
@@ -116,7 +116,7 @@ public class ServerEntity {
Entity entity = this.entity;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix cmd permission levels for command blocks
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index f3c83bb20a73b489f1fb6bacb69388902b1b6fe7..3c0d2332207ba638faaaa4280bce18c334a01271 100644
index f31c5d665678c3163ed4469f8e9d395b890c1bbe..fc0c60b22844ed010aede2fa125b9fa440d3de80 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -204,10 +204,29 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
@@ -206,10 +206,29 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
return this.permissionLevel >= level;
}
@ -41,10 +41,10 @@ index f3c83bb20a73b489f1fb6bacb69388902b1b6fe7..3c0d2332207ba638faaaa4280bce18c3
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 96ca1af97c1f63776b88bc428874742a5114564f..7b86e064564d3a285e3971fd08ea6168bac0720e 100644
index fd12046fab797fd845ad8521f94147480dfba5da..fe9f638db3525893beed565ef9b7ac2fc76318bd 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -295,16 +295,7 @@ public class Commands {
@@ -300,16 +300,7 @@ public class Commands {
String[] args = command.split(" ");
if (args.length == 0) return; // Paper - empty commands shall not be dispatched
@ -63,10 +63,10 @@ index 96ca1af97c1f63776b88bc428874742a5114564f..7b86e064564d3a285e3971fd08ea6168
// Handle vanilla commands;
if (sender.getLevel().getCraftServer().getCommandBlockOverride(args[0])) {
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
index c671b26d7dc70bac1f4bf9a68a264b25865cf7da..83ef2c3e7b06152b9e68f90002c35e77f148347d 100644
index d7321275cf963ba4fd838226c7f705ea0f2e1ac6..56bae8ea1e7b115e85a701209f3badbd29912b28 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java
@@ -136,7 +136,7 @@ public class MinecartCommandBlock extends AbstractMinecart {
@@ -133,7 +133,7 @@ public class MinecartCommandBlock extends AbstractMinecart {
@Override
public CommandSourceStack createCommandSourceStack() {
@ -76,7 +76,7 @@ index c671b26d7dc70bac1f4bf9a68a264b25865cf7da..83ef2c3e7b06152b9e68f90002c35e77
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
index 4c7d142dc653f3aca82e0563b6ba2e020721eb9b..6c484f3f8f37a19992ebbfe30aba399cac21acfe 100644
index faa0a3248217fb27dae5b918099f8a63eee6f586..a02c5feb8f2ffe6bb6070650a45762476e1ff9ac 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/CommandBlockEntity.java
@@ -58,7 +58,7 @@ public class CommandBlockEntity extends BlockEntity {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add option to disable block updates
diff --git a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
index 06f0e5afdab6274154213d82ab3278e08c4ba1b7..8569ad43985fa60d5196ae4bc21646406d8b2adc 100644
index bf2790fae091ab9d7f4ec4b2ab0f103190c31984..5d3ca961b325a39efcd6b398a27f9a4d300b35e5 100644
--- a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
@@ -38,6 +38,7 @@ public class ChorusPlantBlock extends PipeBlock {
@ -16,15 +16,15 @@ index 06f0e5afdab6274154213d82ab3278e08c4ba1b7..8569ad43985fa60d5196ae4bc2164640
return getStateWithConnections(ctx.getLevel(), ctx.getClickedPos(), this.defaultBlockState());
}
@@ -59,6 +60,7 @@ public class ChorusPlantBlock extends PipeBlock {
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
@@ -68,6 +69,7 @@ public class ChorusPlantBlock extends PipeBlock {
BlockState neighborState,
RandomSource random
) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableChorusPlantUpdates) return state; // Paper - add option to disable block updates
if (!state.canSurvive(world, pos)) {
world.scheduleTick(pos, this, 1);
return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
@@ -70,6 +72,7 @@ public class ChorusPlantBlock extends PipeBlock {
tickView.scheduleTick(pos, this, 1);
return super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
@@ -79,6 +81,7 @@ public class ChorusPlantBlock extends PipeBlock {
@Override
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
@ -32,7 +32,7 @@ index 06f0e5afdab6274154213d82ab3278e08c4ba1b7..8569ad43985fa60d5196ae4bc2164640
if (!state.canSurvive(world, pos)) {
world.destroyBlock(pos, true);
}
@@ -77,6 +80,7 @@ public class ChorusPlantBlock extends PipeBlock {
@@ -86,6 +89,7 @@ public class ChorusPlantBlock extends PipeBlock {
@Override
protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
@ -41,10 +41,10 @@ index 06f0e5afdab6274154213d82ab3278e08c4ba1b7..8569ad43985fa60d5196ae4bc2164640
boolean bl = !world.getBlockState(pos.above()).isAir() && !blockState.isAir();
diff --git a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
index 3f45058eee0c78f50c119da5da4c7d2af0251a27..d16aad72c90bbde158b845759eef227546d12e24 100644
index 0e0441646bd21a14a8bea576e5400ce937ebea01..437ad7051bad2d7dccc1a9ae764bdc5dcbe88612 100644
--- a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
@@ -43,6 +43,7 @@ public class HugeMushroomBlock extends Block {
@@ -45,6 +45,7 @@ public class HugeMushroomBlock extends Block {
@Override
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
@ -52,15 +52,15 @@ index 3f45058eee0c78f50c119da5da4c7d2af0251a27..d16aad72c90bbde158b845759eef2275
BlockGetter blockGetter = ctx.getLevel();
BlockPos blockPos = ctx.getClickedPos();
return this.defaultBlockState()
@@ -56,6 +57,7 @@ public class HugeMushroomBlock extends Block {
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
@@ -67,6 +68,7 @@ public class HugeMushroomBlock extends Block {
BlockState neighborState,
RandomSource random
) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableMushroomBlockUpdates) return state; // Paper - add option to disable block updates
return neighborState.is(this)
? state.setValue(PROPERTY_BY_DIRECTION.get(direction), Boolean.valueOf(false))
: super.updateShape(state, direction, neighborState, world, pos, neighborPos);
@@ -63,6 +65,7 @@ public class HugeMushroomBlock extends Block {
: super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
@@ -74,6 +76,7 @@ public class HugeMushroomBlock extends Block {
@Override
protected BlockState rotate(BlockState state, Rotation rotation) {
@ -68,7 +68,7 @@ index 3f45058eee0c78f50c119da5da4c7d2af0251a27..d16aad72c90bbde158b845759eef2275
return state.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.NORTH)), state.getValue(NORTH))
.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.SOUTH)), state.getValue(SOUTH))
.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.EAST)), state.getValue(EAST))
@@ -73,6 +76,7 @@ public class HugeMushroomBlock extends Block {
@@ -84,6 +87,7 @@ public class HugeMushroomBlock extends Block {
@Override
protected BlockState mirror(BlockState state, Mirror mirror) {
@ -77,10 +77,10 @@ index 3f45058eee0c78f50c119da5da4c7d2af0251a27..d16aad72c90bbde158b845759eef2275
.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.SOUTH)), state.getValue(SOUTH))
.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.EAST)), state.getValue(EAST))
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
index f77d51d10e01fc4eaf5516c05c8be0ef7a425893..1d82cfe7af0dc42f88901fb0c44896771fdf8a93 100644
index 71fd7a467a4cb89cad8d2541366fd4add9115e04..6582db84c5307257f16c321453491cf24e40c9c7 100644
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
@@ -66,11 +66,13 @@ public class NoteBlock extends Block {
@@ -68,11 +68,13 @@ public class NoteBlock extends Block {
@Override
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
@ -89,33 +89,33 @@ index f77d51d10e01fc4eaf5516c05c8be0ef7a425893..1d82cfe7af0dc42f88901fb0c4489677
}
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
boolean flag = direction.getAxis() == Direction.Axis.Y;
return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
@@ -78,6 +80,7 @@ public class NoteBlock extends Block {
return flag ? this.setInstrument(world, pos, state) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
@@ -80,6 +82,7 @@ public class NoteBlock extends Block {
@Override
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
boolean flag1 = world.hasNeighborSignal(pos);
if (flag1 != (Boolean) state.getValue(NoteBlock.POWERED)) {
@@ -116,7 +119,7 @@ public class NoteBlock extends Block {
if (world.isClientSide) {
return InteractionResult.SUCCESS;
} else {
@Override
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
if (!world.isClientSide) {
- state = (BlockState) state.cycle(NoteBlock.NOTE);
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
world.setBlock(pos, state, 3);
this.playNote(player, state, world, pos);
player.awardStat(Stats.TUNE_NOTEBLOCK);
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b66845b979 100644
index f079e5a9aa098225acf09ed9b4aa7ddbc2381270..74cce7874809dcbce2718ec3840bb6bb3127e871 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
@@ -67,6 +67,7 @@ public class TripWireBlock extends Block {
@@ -68,6 +68,7 @@ public class TripWireBlock extends Block {
@Override
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
@ -123,12 +123,12 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
Level world = ctx.getLevel();
BlockPos blockposition = ctx.getClickedPos();
@@ -75,11 +76,13 @@ public class TripWireBlock extends Block {
@@ -76,11 +77,13 @@ public class TripWireBlock extends Block {
@Override
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
}
@Override
@ -137,7 +137,7 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
if (!oldState.is(state.getBlock())) {
this.updateSource(world, pos, state);
}
@@ -87,6 +90,7 @@ public class TripWireBlock extends Block {
@@ -88,6 +91,7 @@ public class TripWireBlock extends Block {
@Override
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
@ -145,7 +145,7 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
if (!moved && !state.is(newState.getBlock())) {
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
}
@@ -94,6 +98,7 @@ public class TripWireBlock extends Block {
@@ -95,6 +99,7 @@ public class TripWireBlock extends Block {
@Override
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
@ -153,7 +153,7 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
world.gameEvent((Entity) player, (Holder) GameEvent.SHEAR, pos);
@@ -103,6 +108,7 @@ public class TripWireBlock extends Block {
@@ -104,6 +109,7 @@ public class TripWireBlock extends Block {
}
private void updateSource(Level world, BlockPos pos, BlockState state) {
@ -161,7 +161,7 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
int i = aenumdirection.length;
int j = 0;
@@ -135,6 +141,7 @@ public class TripWireBlock extends Block {
@@ -141,6 +147,7 @@ public class TripWireBlock extends Block {
@Override
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
@ -169,7 +169,7 @@ index e032d8907045c653c3dd449f65e93e40fd0bb6be..6fe5be785423a35b6ff4e6206ca281b6
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) {
if (!(Boolean) state.getValue(TripWireBlock.POWERED)) {
@@ -145,6 +152,7 @@ public class TripWireBlock extends Block {
@@ -151,6 +158,7 @@ public class TripWireBlock extends Block {
@Override
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Call missing BlockDispenseEvent
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f2760ffe3 100644
index 5793569ae8a088f21b0d8d6771a5099b1e88be09..f8f570a97789ab16e57774f233506a289277d5d9 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -867,6 +867,13 @@ public interface DispenseItemBehavior {
@@ -768,6 +768,13 @@ public interface DispenseItemBehavior {
this.setSuccess(true);
if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) {
if ((Integer) iblockdata.getValue(RespawnAnchorBlock.CHARGE) != 4) {
@ -22,7 +22,7 @@ index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f
RespawnAnchorBlock.charge((Entity) null, worldserver, blockposition, iblockdata);
stack.shrink(1);
} else {
@@ -944,6 +951,13 @@ public interface DispenseItemBehavior {
@@ -845,6 +852,13 @@ public interface DispenseItemBehavior {
Optional<BlockState> optional = HoneycombItem.getWaxed(iblockdata);
if (optional.isPresent()) {
@ -36,7 +36,7 @@ index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f
worldserver.setBlockAndUpdate(blockposition, (BlockState) optional.get());
worldserver.levelEvent(3003, blockposition, 0);
stack.shrink(1);
@@ -971,6 +985,12 @@ public interface DispenseItemBehavior {
@@ -872,6 +886,12 @@ public interface DispenseItemBehavior {
if (!worldserver.getBlockState(blockposition1).is(BlockTags.CONVERTABLE_TO_MUD)) {
return this.defaultDispenseItemBehavior.dispense(pointer, stack);
} else {
@ -50,10 +50,10 @@ index 96db0b1041a4c0f054d4f3f2bdced960b119664e..78951f50188528718cdb3dbbaabe3f9f
for (int k = 0; k < 5; ++k) {
worldserver.sendParticles(ParticleTypes.SPLASH, (double) blockposition.getX() + worldserver.random.nextDouble(), (double) (blockposition.getY() + 1), (double) blockposition.getZ() + worldserver.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 9586837f25464396c0695e87fa278c91ca90183a..9b3023fdda9d08c0f5489542f644e2ea311af191 100644
index ac25a5c933b8748ca44ca02100058992b1aad358..22244f38bfee746f14c969de05bc028c934c6d6b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2198,6 +2198,32 @@ public class CraftEventFactory {
@@ -2196,6 +2196,32 @@ populateFields(victim, event); // Paper - make cancellable
}
// Paper end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cd362a91ad31dbae94fdb5a8c71839576f397ea1..8e252b930247293e0fbcf350111403ee716cfffa 100644
index 8cdef637f6343119fc77f87e7478ee23e9b8efab..3ef1352030bf1d6f4d2053158caea852552e91a7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1185,7 +1185,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1228,7 +1228,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
protected BlockPos getOnPos(float offset) {

View File

@ -7,7 +7,7 @@ For larger ranges, it's better to iterate over the player list
than the entity slices.
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 b6633ca1ee73ef0f8a220992a2e0424e67dd9758..814e70f558d7a6186233da0ff86c94c95d390e09 100644
index 2a7d896dd9a02acf6e3596e2e2e7ed50f4b88377..0e0d178f2793ab014358f534c8dc53218b89f083 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -333,7 +333,22 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name

View File

@ -6,10 +6,10 @@ Subject: [PATCH] More Sign Block API
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index bfe8029852385875af4ebe73c63e688f61042021..3070cd2b588f5a69fd8c0d3551e16251680d8c27 100644
index a34c2fc6ac1418a89d789b8945ca3dad57f64151..8ac19e1e052e73ff3fd09089bb8e3fd687390ee4 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -68,12 +68,17 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@@ -68,12 +68,17 @@ public class SignBlockEntity extends BlockEntity {
}
public boolean isFacingFrontText(net.minecraft.world.entity.player.Player player) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] fix item meta for tadpole buckets
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java
index c9fbc01be0b0e7fd1cafb091d06496f4ba1e7c2c..a4c4ba0d02f9a072236ce86c1e98e2c60b059cb8 100644
index 4f5568707d725195ee19b65274454fec8bf99d64..d29f4dd9808e2001c79535d663ca77d6840f6092 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemMetas.java
@@ -263,7 +263,7 @@ public final class CraftItemMetas {
@@ -265,7 +265,7 @@ public final class CraftItemMetas {
if (itemType == ItemType.SUSPICIOUS_STEW) {
return CraftItemMetas.asType(CraftItemMetas.SUSPICIOUS_STEW_META_DATA);
}

View File

@ -208,10 +208,10 @@ index 172202accf4448a933fcf1ff820316c7910dd7f7..50ee7656580d386db473c054f5c5ec57
return null;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3945a6ab723deee3ec3ebb5fbc726ce16bbca411..62914bde6f6b045e6b3682581899d756d1b272f1 100644
index cdc53abb5572fa57b4ec98a694c5583ad0982a05..79e35265978357eeb27c43205433d6b24335f401 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1747,23 +1747,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1760,23 +1760,23 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
@ -240,7 +240,7 @@ index 3945a6ab723deee3ec3ebb5fbc726ce16bbca411..62914bde6f6b045e6b3682581899d756
if (kickPlayer) {
this.kickPlayer(reason);
}
@@ -1771,12 +1771,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1784,12 +1784,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override

View File

@ -9,10 +9,10 @@ When selecting which explosion resistance to use for lava and water, vanilla sel
Problems emerge when we want to reduce the explosion resistance of water or lava, since the fluid explosion resistance is hardcoded to return 100.0F and can't be changed by a plugin. This simply makes the fluid explosion resistance the same as the block explosion resistance, which allows plugin to change the value. Since both are the same in vanilla, this has no side effects on servers that do not need to do this.
diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
index 72f8b72c6436ca3b8eaeb39c7d3efe2c1462ae1d..3bb4a9a1a6249e8ba2de237f801210e7f4fd5825 100644
index a27ceed2cac6c16eb4e5f2959db9e482e67e9de6..884db3e64cb22ed765beec8f11ea309fcf810207 100644
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
@@ -232,7 +232,7 @@ public abstract class LavaFluid extends FlowingFluid {
@@ -233,7 +233,7 @@ public abstract class LavaFluid extends FlowingFluid {
@Override
protected float getExplosionResistance() {
@ -22,10 +22,10 @@ index 72f8b72c6436ca3b8eaeb39c7d3efe2c1462ae1d..3bb4a9a1a6249e8ba2de237f801210e7
@Override
diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
index 21b4afd053e01073eb514264d4960f0f3b1ee3d8..109f71401c65f476ccf6813137386fc9fef10254 100644
index 0a7c05c08bf8c6c331b91e399dc4103a91dc20fe..552925ba47c7475e2e1ec2ded0966f28ed3e50a5 100644
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
@@ -125,7 +125,7 @@ public abstract class WaterFluid extends FlowingFluid {
@@ -126,7 +126,7 @@ public abstract class WaterFluid extends FlowingFluid {
@Override
protected float getExplosionResistance() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix possible NPE on painting creation
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
index 46a4f31e2b6eee6f8dc5f8fccd7de4c48a698b61..577ed3656480271a491bcd3d346c63854fd840e4 100644
index 39ea25d2145acaa7c7b458800adc674a3e73e7c1..8715d8e790b6735610e2f880f8c1f88a89967f21 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
@@ -326,8 +326,13 @@ public final class CraftEntityTypes {
@@ -361,8 +361,13 @@ public final class CraftEntityTypes {
// Hanging
register(new EntityTypeData<>(EntityType.PAINTING, Painting.class, CraftPainting::new, createHanging(Painting.class, (spawnData, hangingData) -> {
if (spawnData.normalWorld && hangingData.randomize()) {
@ -24,7 +24,7 @@ index 46a4f31e2b6eee6f8dc5f8fccd7de4c48a698b61..577ed3656480271a491bcd3d346c6385
net.minecraft.world.entity.decoration.Painting entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, spawnData.minecraftWorld());
entity.absMoveTo(spawnData.x(), spawnData.y(), spawnData.z(), spawnData.yaw(), spawnData.pitch());
entity.setDirection(hangingData.direction());
@@ -466,6 +471,7 @@ public final class CraftEntityTypes {
@@ -523,6 +528,7 @@ public final class CraftEntityTypes {
AABB bb = (ItemFrame.class.isAssignableFrom(clazz))
? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBoxStatic(pos, CraftBlock.blockFaceToNotch(dir).getOpposite())
: net.minecraft.world.entity.decoration.Painting.calculateBoundingBoxStatic(pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height);

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only set despawnTimer for Wandering Traders spawned by
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
index 856a93324f5ac411713851ccfb38dba52fb0af5e..0af34e0f9c9696fbcb11b12fb27472ef17ad532a 100644
index a65fba5621c067c453858efb7fee64cbee1e7916..1e77cce428d9e53142aaa2cf780b7f862d536eca 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java
@@ -68,7 +68,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
@@ -69,7 +69,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
public WanderingTrader(EntityType<? extends WanderingTrader> type, Level world) {
super(type, world);
@ -19,15 +19,15 @@ index 856a93324f5ac411713851ccfb38dba52fb0af5e..0af34e0f9c9696fbcb11b12fb27472ef
@Override
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index d5d27b0d352ca3fd57a26605cb35c499e88b57fc..c72b6ea5530e54fc373c701028e1c147cea34b59 100644
index 08a3c7140867f339dd99a95094ed0fd8ff344fca..9d206bed5b982603f39bc1f70ae23ea38e4d9bc9 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -120,7 +120,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
return false;
}
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, MobSpawnType.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
+ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, trader -> trader.setDespawnDelay(48000), blockposition2, MobSpawnType.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit // Paper - set despawnTimer before spawn events called
- WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, blockposition2, EntitySpawnReason.EVENT, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit
+ WanderingTrader entityvillagertrader = (WanderingTrader) EntityType.WANDERING_TRADER.spawn(world, trader -> trader.setDespawnDelay(48000), blockposition2, EntitySpawnReason.EVENT, false, false, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBu // Paper - set despawnTimer before spawn events calledkkit
if (entityvillagertrader != null) {
for (int i = 0; i < 2; ++i) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 9b3023fdda9d08c0f5489542f644e2ea311af191..907ea60b647d529f133986632d00416269bc311e 100644
index 22244f38bfee746f14c969de05bc028c934c6d6b..03afabc3ab4b264f84698627b79e58f502a8cea9 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -746,7 +746,8 @@ public class CraftEventFactory {
@@ -744,7 +744,8 @@ public class CraftEventFactory {
// Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above)
if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
double radius = world.spigotConfig.expMerge;

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerFailMoveEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index db9c04d74475e00983cc9df74d615e4b68f83688..adcfa6a783222482ce7ec5c7805fe44dd24bf7d0 100644
index 5d261106b0cd12e9ed737833b1f6d2572d15ab4e..618c620b4bca535c454691f9a87c9b36a36021e2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1260,8 +1260,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1263,8 +1263,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
double d0 = ServerGamePacketListenerImpl.clampHorizontal(packet.getX(this.player.getX())); final double toX = d0; // Paper - OBFHELPER
double d1 = ServerGamePacketListenerImpl.clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER
double d2 = ServerGamePacketListenerImpl.clampHorizontal(packet.getZ(this.player.getZ())); final double toZ = d2; // Paper - OBFHELPER
@ -19,26 +19,26 @@ index db9c04d74475e00983cc9df74d615e4b68f83688..adcfa6a783222482ce7ec5c7805fe44d
if (this.player.isPassenger()) {
this.player.absMoveTo(this.player.getX(), this.player.getY(), this.player.getZ(), f, f1);
@@ -1328,8 +1328,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1331,8 +1331,14 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper start - Prevent moving into unloaded chunks
if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
- this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
- this.internalTeleport(PositionMoveRotation.of(this.player), Collections.emptySet());
- return;
+ // Paper start - Add fail move event
+ io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_INTO_UNLOADED_CHUNK,
+ toX, toY, toZ, toYaw, toPitch, false);
+ if (!event.isAllowed()) {
+ this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
+ this.internalTeleport(PositionMoveRotation.of(this.player), Collections.emptySet());
+ return;
+ }
+ // Paper end - Add fail move event
}
// Paper end - Prevent moving into unloaded chunks
@@ -1338,9 +1344,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1341,9 +1347,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2))) {
// CraftBukkit end
- ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
- this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
@ -56,7 +56,7 @@ index db9c04d74475e00983cc9df74d615e4b68f83688..adcfa6a783222482ce7ec5c7805fe44d
}
}
}
@@ -1402,14 +1415,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1405,14 +1418,31 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d8 = d2 - this.player.getZ();
d10 = d6 * d6 + d7 * d7 + d8 * d8;
@ -88,10 +88,10 @@ index db9c04d74475e00983cc9df74d615e4b68f83688..adcfa6a783222482ce7ec5c7805fe44d
+ }
+ if (teleportBack) {
+ // Paper end - Add fail move event
this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet()); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
this.internalTeleport(d3, d4, d5, f, f1); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet.
this.player.doCheckFallDamage(this.player.getX() - d3, this.player.getY() - d4, this.player.getZ() - d5, packet.isOnGround());
} else {
@@ -3465,4 +3495,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3529,4 +3559,17 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
InteractionResult run(ServerPlayer player, Entity entity, InteractionHand hand);
}

View File

@ -1148,12 +1148,12 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2cc22a9a5483c62cdf64870f5ce62b33018bef06..3ee0e2adf576e312c18da90adc46160ad85179fb 100644
index 53c9be615a0f2939cd989e24e304e81e6e27f39d..f1b1be0caff83720d77454d333abae4613c66e72 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1576,6 +1576,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1654,6 +1654,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper
+ // Paper start - Folia scheduler API
+ ((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
@ -1170,25 +1170,25 @@ index 2cc22a9a5483c62cdf64870f5ce62b33018bef06..3ee0e2adf576e312c18da90adc46160a
+ });
+ // Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
this.profiler.push("commandFunctions");
gameprofilerfiller.push("commandFunctions");
MinecraftTimings.commandFunctionsTimer.startTiming(); // Spigot // Paper
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index bd67245393f512264db774e0b855db0ce925a3f4..e85b91036c2470b2f164a4641d1c07d27553a078 100644
index 4fe3024e26b56c2d796acf703a1bc200ff309f09..7356a027ae3bca3a9f2056ef6849d5fab38a0df3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -640,6 +640,7 @@ public abstract class PlayerList {
@@ -598,6 +598,7 @@ public abstract class PlayerList {
}
entityplayer.unRide();
worldserver.removePlayerImmediately(entityplayer, Entity.RemovalReason.UNLOADED_WITH_PLAYER);
+ entityplayer.retireScheduler(); // Paper - Folia schedulers
entityplayer.getAdvancements().stopListening();
this.players.remove(entityplayer);
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 37f37df8b4185c92c13e43eb89d19514e360059e..33ac5c816c98c2dfa99898279ed74d42a92646cf 100644
index 3ef1352030bf1d6f4d2053158caea852552e91a7..aeeb90481a9ac0a8ec9e3c5af08a32ca3e32bfb6 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -254,11 +254,23 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -262,10 +262,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public CraftEntity getBukkitEntity() {
if (this.bukkitEntity == null) {
@ -1203,17 +1203,15 @@ index 37f37df8b4185c92c13e43eb89d19514e360059e..33ac5c816c98c2dfa99898279ed74d42
}
return this.bukkitEntity;
}
+ // Paper start
+ public CraftEntity getBukkitEntityRaw() {
+ return this.bukkitEntity;
+ }
+ // Paper end
+
@Override
public CommandSender getBukkitSender(CommandSourceStack wrapper) {
return this.getBukkitEntity();
@@ -4486,6 +4498,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
public int getDefaultMaxAirSupply() {
@@ -4674,6 +4685,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public final void setRemoved(Entity.RemovalReason entity_removalreason, EntityRemoveEvent.Cause cause) {
CraftEventFactory.callEntityRemoveEvent(this, cause);
// CraftBukkit end
@ -1221,10 +1219,10 @@ index 37f37df8b4185c92c13e43eb89d19514e360059e..33ac5c816c98c2dfa99898279ed74d42
if (this.removalReason == null) {
this.removalReason = entity_removalreason;
}
@@ -4496,12 +4509,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -4685,12 +4697,28 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.getPassengers().forEach(Entity::stopRiding);
this.levelCallback.onRemove(entity_removalreason);
this.onRemoval(entity_removalreason);
+ // Paper start - Folia schedulers
+ if (!(this instanceof ServerPlayer) && entity_removalreason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) {
+ // Players need to be special cased, because they are regularly removed from the world
@ -1251,10 +1249,10 @@ index 37f37df8b4185c92c13e43eb89d19514e360059e..33ac5c816c98c2dfa99898279ed74d42
public void setLevelCallback(EntityInLevelCallback changeListener) {
this.levelCallback = changeListener;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 622fe949819ec80737da21305e1a1e0c46480a63..2dd20823769f1a3a2d028cd64d3af5989429d1ac 100644
index f85e8ec660bf588f694aa96e6e2ade478a9696b7..b5da166e147bff2ded9d295b1bf84cf71a3e7b8d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -310,6 +310,76 @@ public final class CraftServer implements Server {
@@ -313,6 +313,76 @@ public final class CraftServer implements Server {
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
private final io.papermc.paper.potion.PaperPotionBrewer potionBrewer; // Paper - Custom Potion Mixes
@ -1332,10 +1330,10 @@ index 622fe949819ec80737da21305e1a1e0c46480a63..2dd20823769f1a3a2d028cd64d3af598
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
ConfigurationSerialization.registerClass(CraftPlayerProfile.class);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 7c7501b4b21530d0641774f64e87d7d1ca71a33c..d3ff8015b2f713451b0aeb50e1b4cf81f2bcb7bc 100644
index f473df7a5aea6a89fb1eed28c9071b7eb3269cf8..d57798d6a53334eacf8235c0fd0f28d7719593fe 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -70,6 +70,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -71,6 +71,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
private EntityDamageEvent lastDamageEvent;
private final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftEntity.DATA_TYPE_REGISTRY);
protected net.kyori.adventure.pointer.Pointers adventure$pointers; // Paper - implement pointers
@ -1351,7 +1349,7 @@ index 7c7501b4b21530d0641774f64e87d7d1ca71a33c..d3ff8015b2f713451b0aeb50e1b4cf81
public CraftEntity(final CraftServer server, final Entity entity) {
this.server = server;
@@ -486,6 +495,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -487,6 +496,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return this.entity;
}

View File

@ -13,7 +13,7 @@ This commit fixes the faulty behaviour by instance performing a check
against the CraftItem type.
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/GoToWantedItem.java b/src/main/java/net/minecraft/world/entity/ai/behavior/GoToWantedItem.java
index bd9aa4a5443da862be3403c1941113373741a87c..2f92eb39cde7b30a894db347ca85a506d880411e 100644
index 07db92870f9efd515751453569f0dd7b6fada8fc..7d814e5b4b634674995d55ab97155f949f14ef3b 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/GoToWantedItem.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/GoToWantedItem.java
@@ -35,8 +35,9 @@ public class GoToWantedItem {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Fix rotation when spawning display entities
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
index 577ed3656480271a491bcd3d346c63854fd840e4..39aa116193f313f53540b0135d2ab26acb7f1469 100644
index 8715d8e790b6735610e2f880f8c1f88a89967f21..6cf57640b3bd2bb0417129256ed77d9d67fcf04a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
@@ -221,6 +221,7 @@ public final class CraftEntityTypes {
@@ -254,6 +254,7 @@ public final class CraftEntityTypes {
Vector direction = spawnData.location().getDirection();
entity.assignDirectionalMovement(new Vec3(direction.getX(), direction.getY(), direction.getZ()), 1.0);
};
@ -16,7 +16,7 @@ index 577ed3656480271a491bcd3d346c63854fd840e4..39aa116193f313f53540b0135d2ab26a
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
@@ -361,10 +362,10 @@ public final class CraftEntityTypes {
@@ -415,10 +416,10 @@ public final class CraftEntityTypes {
// Set pos
register(new EntityTypeData<>(EntityType.MARKER, Marker.class, CraftMarker::new, createAndSetPos(net.minecraft.world.entity.EntityType.MARKER)));

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Only capture actual tree growth
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index 78951f50188528718cdb3dbbaabe3f9f2760ffe3..7826e2a52da47914aca39fef958b8f398a2ff937 100644
index f8f570a97789ab16e57774f233506a289277d5d9..18304349c9ab24657c4152aff800dba969174665 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -634,6 +634,7 @@ public interface DispenseItemBehavior {
@@ -550,6 +550,7 @@ public interface DispenseItemBehavior {
if (!fertilizeEvent.isCancelled()) {
for (org.bukkit.block.BlockState blockstate : blocks) {
blockstate.update(true);
@ -16,28 +16,16 @@ index 78951f50188528718cdb3dbbaabe3f9f2760ffe3..7826e2a52da47914aca39fef958b8f39
}
}
}
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 10b3e41d589d480046e15a957902c2751b731cec..87cae96faf33fa0491b13add79e02fc225bd2f70 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -466,6 +466,7 @@ public final class ItemStack implements DataComponentHolder {
for (CraftBlockState blockstate : blocks) {
// SPIGOT-7572 - Move fix for SPIGOT-7248 to CapturedBlockState, to allow bees in bee nest
CapturedBlockState.setBlockState(blockstate);
+ world.checkCapturedTreeStateForObserverNotify(blockposition, blockstate); // Paper - notify observers even if grow failed
}
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index bd909b08b5e604778d35ba6514cf8c353d489228..c8a3e49f08fd0d110ffc3be763cfda4e62f55916 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1395,4 +1395,14 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 509a67aff07bcdcad47eb77e923d442349a4f20c..1cb5e107a391ab56942cdb2d1cae7d5646a85ec6 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2228,6 +2228,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
return range <= 0 ? 64.0 * 64.0 : range * range; // 64 is taken from default in ServerLevel#levelEvent
}
// Paper end - respect global sound events gamerule
+ // Paper start - notify observers even if grow failed
+ public void checkCapturedTreeStateForObserverNotify(final BlockPos pos, final CraftBlockState craftBlockState) {
+ public void checkCapturedTreeStateForObserverNotify(final BlockPos pos, final org.bukkit.craftbukkit.block.CraftBlockState craftBlockState) {
+ // notify observers if the block state is the same and the Y level equals the original y level (for mega trees)
+ // blocks at the same Y level with the same state can be assumed to be saplings which trigger observers regardless of if the
+ // tree grew or not
@ -46,6 +34,20 @@ index bd909b08b5e604778d35ba6514cf8c353d489228..c8a3e49f08fd0d110ffc3be763cfda4e
+ }
+ }
+ // Paper end - notify observers even if grow failed
@Override
public CrashReportCategory fillReportDetails(CrashReport report) {
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 612eb27b471a9ebfdea29a58e5a32931f869bfb6..db971851a9e219ead89d71bb97d65ff73d9fd285 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -469,6 +469,7 @@ public final class ItemStack implements DataComponentHolder {
for (CraftBlockState blockstate : blocks) {
// SPIGOT-7572 - Move fix for SPIGOT-7248 to CapturedBlockState, to allow bees in bee nest
CapturedBlockState.setBlockState(blockstate);
+ world.checkCapturedTreeStateForObserverNotify(blockposition, blockstate); // Paper - notify observers even if grow failed
}
entityhuman.awardStat(Stats.ITEM_USED.get(item)); // SPIGOT-7236 - award stat
}
diff --git a/src/main/java/net/minecraft/world/level/block/SaplingBlock.java b/src/main/java/net/minecraft/world/level/block/SaplingBlock.java
index 2d7290ace5fc8890325a8ec623075ad32f9b1d44..d262a5a6da57ef9ba9a6fe0dfbc88f577105e74f 100644
@ -60,7 +62,7 @@ index 2d7290ace5fc8890325a8ec623075ad32f9b1d44..d262a5a6da57ef9ba9a6fe0dfbc88f57
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index af219df5267589300f0ad1d30fa5c81a1f50234f..461a66c323a74db5a70981fafc5fa20f54f0f40d 100644
index 490a4f023491aaabd3966cb67901335c2b02bb52..a34e888f63ead250c41b6bbe6850a5e5b4254c3d 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -572,6 +572,7 @@ public class CraftBlock implements Block {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Use correct source for mushroom block spread event
diff --git a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
index f549cac99a665f20f1cd1d8c807ed3649fed7531..1172d85c5c26ab2142343d91149766e5993cb36a 100644
index 61fb134686c7cd538ae2f8fefe78fd9618a9990b..7900856c9e86afe907c00c9ac31bec93ece50abe 100644
--- a/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/MushroomBlock.java
@@ -68,6 +68,7 @@ public class MushroomBlock extends BushBlock implements BonemealableBlock {

View File

@ -9,10 +9,10 @@ Subject: [PATCH] Respect randomizeData on more entities when spawning
* ExperienceOrb
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
index 39aa116193f313f53540b0135d2ab26acb7f1469..afc75ef3fb0fac40673fdfb684bd1f0d0edeb6ce 100644
index 6cf57640b3bd2bb0417129256ed77d9d67fcf04a..3b5277f90b5bba30d40d79ba67903a8d04d2c0df 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
@@ -222,6 +222,13 @@ public final class CraftEntityTypes {
@@ -255,6 +255,13 @@ public final class CraftEntityTypes {
entity.assignDirectionalMovement(new Vec3(direction.getX(), direction.getY(), direction.getZ()), 1.0);
};
private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper
@ -26,7 +26,7 @@ index 39aa116193f313f53540b0135d2ab26acb7f1469..afc75ef3fb0fac40673fdfb684bd1f0d
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
@@ -374,11 +381,12 @@ public final class CraftEntityTypes {
@@ -428,11 +435,12 @@ public final class CraftEntityTypes {
net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE);
ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), itemStack);
item.setPickUpDelay(10);
@ -39,9 +39,9 @@ index 39aa116193f313f53540b0135d2ab26acb7f1469..afc75ef3fb0fac40673fdfb684bd1f0d
+ combine(combine(spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null), CLEAR_MOVE_IF_NOT_RANDOMIZED), (spawnData, experienceOrb) -> { if (!spawnData.randomizeData()) { experienceOrb.setYRot(0); } }) // Paper - respect randomizeData
));
register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
@@ -390,12 +398,23 @@ public final class CraftEntityTypes {
entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1)));
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), new net.minecraft.world.item.ItemStack(Items.EGG))));
@@ -443,12 +451,23 @@ public final class CraftEntityTypes {
net.minecraft.world.entity.projectile.ThrownPotion entity = new net.minecraft.world.entity.projectile.ThrownPotion(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), new net.minecraft.world.item.ItemStack(Items.SPLASH_POTION));
return entity;
}));
- register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
@ -64,5 +64,5 @@ index 39aa116193f313f53540b0135d2ab26acb7f1469..afc75ef3fb0fac40673fdfb684bd1f0d
+ }));
+ // Paper end - respect randomizeData
register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null)));
register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
register(new EntityTypeData<>(EntityType.COMMAND_BLOCK_MINECART, CommandMinecart.class, CraftMinecartCommand::new, createMinecart(net.minecraft.world.entity.EntityType.COMMAND_BLOCK_MINECART)));
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, createMinecart(net.minecraft.world.entity.EntityType.MINECART)));

View File

@ -5,15 +5,15 @@ Subject: [PATCH] Use correct seed on api world load
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 75c222e592d676e98b293767d00de54a61411ae7..69df0cf285a5af1011cc769a433683489ff3dded 100644
index b5da166e147bff2ded9d295b1bf84cf71a3e7b8d..6bafb10ddbb1a4a73370b8cefac79e61d0c35ffc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1398,7 +1398,7 @@ public final class CraftServer implements Server {
@@ -1389,7 +1389,7 @@ public final class CraftServer implements Server {
net.minecraft.server.Main.forceUpgrade(worldSession, DataFixers.getDataFixer(), this.console.options.has("eraseCache"), () -> true, iregistrycustom_dimension, this.console.options.has("recreateRegionFiles"));
}
- long j = BiomeManager.obfuscateSeed(creator.seed());
+ long j = BiomeManager.obfuscateSeed(worlddata.worldGenOptions().seed()); // Paper - use world seed
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata));
LevelStem worlddimension = iregistry.get(actualDimension);
LevelStem worlddimension = iregistry.getValue(actualDimension);

View File

@ -7,10 +7,10 @@ The lists are only supposed to contain ticks for the 1 radius
neighbours of the chunk.
diff --git a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
index bfb73e016f107fb8da12903bf233a824d062ed73..22b6d0851a51da180cd8fbbe6554c5370f5ac5bd 100644
index 5c7c8fb3c67047ddc1b92f03e889839b5a303ff4..ce3d79ebc7f933d0b34b3f8f71bbec872076847a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
+++ b/src/main/java/net/minecraft/world/level/chunk/UpgradeData.java
@@ -100,6 +100,25 @@ public class UpgradeData {
@@ -113,6 +113,25 @@ public class UpgradeData {
}
}
@ -36,7 +36,7 @@ index bfb73e016f107fb8da12903bf233a824d062ed73..22b6d0851a51da180cd8fbbe6554c537
public void upgrade(LevelChunk chunk) {
this.upgradeInside(chunk);
@@ -107,6 +126,11 @@ public class UpgradeData {
@@ -120,6 +139,11 @@ public class UpgradeData {
upgradeSides(chunk, direction8);
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Cache map ids on item frames
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index f010be9605d7458add7e5693ff473fabf679c938..a2fbbbd7a66d4e7b1063638f8467e8887a417282 100644
index 3cdcc4f44608d24550f2a8c6f3f5ce675d7777c5..7118e1f806af98159ec292f9340d7e4004e2b486 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -117,7 +117,7 @@ public class ServerEntity {
@@ -121,7 +121,7 @@ public class ServerEntity {
ItemStack itemstack = entityitemframe.getItem();
if (this.level.paperConfig().maps.itemFrameCursorUpdateInterval > 0 && this.tickCount % this.level.paperConfig().maps.itemFrameCursorUpdateInterval == 0 && itemstack.getItem() instanceof MapItem) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks // Paper - Make item frame map cursor update interval configurable
@ -18,10 +18,10 @@ index f010be9605d7458add7e5693ff473fabf679c938..a2fbbbd7a66d4e7b1063638f8467e888
if (worldmap != null) {
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 ba4e0ad7c7c2731d61ec7f60f19d7e9ec31a28ba..5b7245cd99593ee90e17c97e0104f3aba9ae05ea 100644
index 07c143c3eac263848fc5daf6f958d16a1a163e92..f046a866215fea7df10963af1a235ba9d04d4242 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
@@ -50,6 +50,7 @@ public class ItemFrame extends HangingEntity {
@@ -51,6 +51,7 @@ public class ItemFrame extends HangingEntity {
private static final float HEIGHT = 0.75F;
public float dropChance;
public boolean fixed;
@ -29,7 +29,7 @@ index ba4e0ad7c7c2731d61ec7f60f19d7e9ec31a28ba..5b7245cd99593ee90e17c97e0104f3ab
public ItemFrame(EntityType<? extends ItemFrame> type, Level world) {
super(type, world);
@@ -322,6 +323,7 @@ public class ItemFrame extends HangingEntity {
@@ -334,6 +335,7 @@ public class ItemFrame extends HangingEntity {
}
private void onItemChanged(ItemStack stack) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Fix custom statistic criteria creation
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 72c2f70d22c5ac920f13b11badac404dbb15c055..23ed0a130525a0b3a1b41330685476463c81f183 100644
index a5a3a0f0460252415c243dfe3019d103b9589c5b..a4998c2df341a1b9a337afb24284428cd98e59d8 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -599,6 +599,14 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -68,10 +68,10 @@ index 71733f918ed84b9879ac1b142ef6205c5e768a9c..c856384019eff2f2d0bb831ebe1ccb0f
break;
case BONE_MEAL_USE:
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 58cd4ecd5582c01b836814f4151df2538b93143c..cb50fca4867688d2572e8ab5b7fef7243c5b8ba9 100644
index 03cef3e33de1cf2a1ad4c7a5ba9a65ee3b69ee52..536ad499e893c5b9898fb02582eeca541c917890 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1372,7 +1372,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
@@ -1382,7 +1382,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
public <T> void playEffect(Location loc, Effect effect, T data, int radius) {
if (data != null) {
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
@ -81,10 +81,10 @@ index 58cd4ecd5582c01b836814f4151df2538b93143c..cb50fca4867688d2572e8ab5b7fef724
// Special case: the axis is optional for ELECTRIC_SPARK
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 62914bde6f6b045e6b3682581899d756d1b272f1..ccd81bc7279a92f78bb882c9443cf9ca90fd9acf 100644
index 79e35265978357eeb27c43205433d6b24335f401..e20e8ba103a0ba094e00ef08ff0fc3b741a9bce5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -917,7 +917,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -930,7 +930,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
Preconditions.checkArgument(effect != null, "Effect cannot be null");
if (data != null) {
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);

View File

@ -7,10 +7,10 @@ Was obtainable through different methods, but you had to use different
methods depending on the implementation of Entity you were working with.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index d3ff8015b2f713451b0aeb50e1b4cf81f2bcb7bc..3626fea17527da69e6fbee26f018f52ef036cf90 100644
index d57798d6a53334eacf8235c0fd0f28d7719593fe..0d2d1b6eab153aea6015bd69f2bad58e67d065c3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1263,4 +1263,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1264,4 +1264,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return !this.getHandle().level().noCollision(this.getHandle(), aabb);
}
// Paper end - Collision API

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Deprecate and replace methods with old StructureType
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 69df0cf285a5af1011cc769a433683489ff3dded..8b871d29d883119cd8ad9ca134f4c1fce9362705 100644
index 6bafb10ddbb1a4a73370b8cefac79e61d0c35ffc..2934e232c84603224470fdaba0103d42fc06e8b4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2003,6 +2003,11 @@ public final class CraftServer implements Server {
@@ -1970,6 +1970,11 @@ public final class CraftServer implements Server {
ServerLevel worldServer = ((CraftWorld) world).getHandle();
Location structureLocation = world.locateNearestStructure(location, structureType, radius, findUnexplored);
@ -20,7 +20,7 @@ index 69df0cf285a5af1011cc769a433683489ff3dded..8b871d29d883119cd8ad9ca134f4c1fc
BlockPos structurePosition = CraftLocation.toBlockPosition(structureLocation);
// Create map with trackPlayer = true, unlimitedTracking = true
@@ -2013,6 +2018,31 @@ public final class CraftServer implements Server {
@@ -1980,6 +1985,31 @@ public final class CraftServer implements Server {
return CraftItemStack.asBukkitCopy(stack);
}

View File

@ -11,10 +11,10 @@ This patch prevents server from sending namespaced commands when player
requests tab-complete only commands.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index adcfa6a783222482ce7ec5c7805fe44dd24bf7d0..7750660defe490bcdc24a3b4ad4f495c8a703fed 100644
index 618c620b4bca535c454691f9a87c9b36a36021e2..f21a5b9de17db9a094b22267b33bbffbf7ef8966 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -820,6 +820,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -824,6 +824,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {

View File

@ -9,10 +9,10 @@ food consumption, turtle egg count decreases, ice to water
conversions and beehive releases
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 717d015dd4637dd9d568b751be1dc1046b0a0560..c680f081ba548f84f07a968a46811090c53e57e3 100644
index 2aee9c2fbe38076317a3de7c3fdbd6988b64b389..3bd4ab8161c29bb8df2ba496a4430393b6593476 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -439,8 +439,8 @@ public class ServerPlayerGameMode {
@@ -437,8 +437,8 @@ public class ServerPlayerGameMode {
isCorrectTool = flag1; // Paper - Trigger bee_nest_destroyed trigger in the correct place
itemstack.mineBlock(this.level, iblockdata1, pos, this.player);
@ -24,10 +24,10 @@ index 717d015dd4637dd9d568b751be1dc1046b0a0560..c680f081ba548f84f07a968a46811090
// return true; // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
index c75227b2ea165dcd65c203e60157ac7cdebd4bc6..4669b1877be5eecf6738eefd81a35bde531759d6 100644
index 90f69a0c4d0707fd2319db71aea7dfdc14636d82..9591870420390fe1a69d44855a8f4de779332b7d 100644
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
@@ -86,8 +86,8 @@ public class BeehiveBlock extends BaseEntityBlock {
@@ -94,8 +94,8 @@ public class BeehiveBlock extends BaseEntityBlock {
}
@Override
@ -39,10 +39,10 @@ index c75227b2ea165dcd65c203e60157ac7cdebd4bc6..4669b1877be5eecf6738eefd81a35bde
if (!EnchantmentHelper.hasTag(tool, EnchantmentTags.PREVENTS_BEE_SPAWNS_WHEN_MINING)) {
tileentitybeehive.emptyAllLivingFromHive(player, state, BeehiveBlockEntity.BeeReleaseStatus.EMERGENCY);
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 232e6216dc36aa698047fc0badf78c347414b3a5..c083dc8b2a69c3747b250d13f1a28ad22b5e6119 100644
index 4d140bd83ca0e1554afad80ec4fc6186188a79d8..6fb3f551f432d7e668c606fb7bd3514408e0478a 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -402,10 +402,18 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -405,10 +405,18 @@ public class Block extends BlockBehaviour implements ItemLike {
return this.defaultBlockState();
}
@ -62,10 +62,10 @@ index 232e6216dc36aa698047fc0badf78c347414b3a5..c083dc8b2a69c3747b250d13f1a28ad2
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {}
diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
index 7fdf744a2be55313cc75c1322f6534f55cf463f5..f446c40c4d90307c568faa2866800f5326634df6 100644
index edb3b6cdb617c48140539728af1373993e78648f..4fe83bd0f355549847b66afb7e61f6f2a6d97016 100644
--- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java
@@ -96,8 +96,8 @@ public class DoublePlantBlock extends BushBlock {
@@ -98,8 +98,8 @@ public class DoublePlantBlock extends BushBlock {
}
@Override
@ -77,10 +77,10 @@ index 7fdf744a2be55313cc75c1322f6534f55cf463f5..f446c40c4d90307c568faa2866800f53
protected static void preventDropFromBottomPart(Level world, BlockPos pos, BlockState state, Player player) {
diff --git a/src/main/java/net/minecraft/world/level/block/IceBlock.java b/src/main/java/net/minecraft/world/level/block/IceBlock.java
index e862814c1e54776f11050623b52476accc2f1f79..ac775afb265430ac202cfa3900a036d11a308b1e 100644
index 067a2d969ca0979ae67b600e303deec93eda0251..a94762e65853ccad38cf90b0049ca256106c0c9f 100644
--- a/src/main/java/net/minecraft/world/level/block/IceBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/IceBlock.java
@@ -33,8 +33,8 @@ public class IceBlock extends HalfTransparentBlock {
@@ -34,8 +34,8 @@ public class IceBlock extends HalfTransparentBlock {
}
@Override
@ -92,10 +92,10 @@ index e862814c1e54776f11050623b52476accc2f1f79..ac775afb265430ac202cfa3900a036d1
this.afterDestroy(world, pos, tool);
}
diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
index bdcb732a31fff0cfc2119132079ce197c7a77c9a..a6f408e56fa6c9de82fd93555fe21e1b11ce1022 100644
index 85d9829e979ef5f22aee9c346800612f479786b7..953ddb2ea6fd48e57712e30a6addf23e188e5312 100644
--- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java
@@ -174,8 +174,8 @@ public class TurtleEggBlock extends Block {
@@ -175,8 +175,8 @@ public class TurtleEggBlock extends Block {
}
@Override

View File

@ -5,13 +5,13 @@ Subject: [PATCH] Fire entity death event for ender dragon
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
index 6306f7925ac4852d8eed7508a11764c636dd7d36..5868d2e9e05a698c77117cf87c79b636b50fe289 100644
index 38456d3901e495e4c401cff0de7ae38544c1b2a7..2df8bf818345246cc1f88b93e4a3b62e61772efb 100644
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
@@ -657,6 +657,15 @@ public class EnderDragon extends Mob implements Enemy {
@@ -627,6 +627,14 @@ public class EnderDragon extends Mob implements Enemy {
@Override
public void kill() {
public void kill(ServerLevel world) {
+ // Paper start - Fire entity death event
+ this.silentDeath = true;
+ org.bukkit.event.entity.EntityDeathEvent deathEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, this.damageSources().genericKill());
@ -20,7 +20,6 @@ index 6306f7925ac4852d8eed7508a11764c636dd7d36..5868d2e9e05a698c77117cf87c79b636
+ return;
+ }
+ // Paper end - Fire entity death event
+
this.remove(Entity.RemovalReason.KILLED, EntityRemoveEvent.Cause.DEATH); // CraftBukkit - add Bukkit remove cause
this.gameEvent(GameEvent.ENTITY_DIE);
if (this.dragonFight != null) {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable entity tracking range by Y coordinate
Options to configure entity tracking by Y coordinate, also for each entity category.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index dca6087dc4e1c177c3dfdae01f140cf80c179803..57af5d1986021c9a135599c6f55b091aebd3bab7 100644
index ec19eb88705a07db45f1a3541571fb7f43efb5a9..49d926313b0d0f2ed2e93ca824009c8d0a988f67 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1524,7 +1524,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1583,7 +1583,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
double d0 = (double) Math.min(this.getEffectiveRange(), i * 16);
double d1 = vec3d.x * vec3d.x + vec3d.z * vec3d.z;
double d2 = d0 * d0;

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add Listing API for Player
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdcacbe09a92 100644
index 29b465fc1dc50e0e84ddb889c5303e80fe662874..4d67d98257b2cb9045d03c999cfd4ba2caf8453c 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
@@ -37,6 +37,17 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
@ -26,7 +26,7 @@ index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdca
public static ClientboundPlayerInfoUpdatePacket createPlayerInitializing(Collection<ServerPlayer> players) {
EnumSet<ClientboundPlayerInfoUpdatePacket.Action> enumSet = EnumSet.of(
@@ -50,6 +61,28 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
@@ -51,6 +62,28 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
return new ClientboundPlayerInfoUpdatePacket(enumSet, players);
}
@ -55,7 +55,7 @@ index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdca
private ClientboundPlayerInfoUpdatePacket(RegistryFriendlyByteBuf buf) {
this.actions = buf.readEnumSet(ClientboundPlayerInfoUpdatePacket.Action.class);
this.entries = buf.readList(buf2 -> {
@@ -158,16 +191,24 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
@@ -161,10 +194,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
@Nullable RemoteChatSession.Data chatSession
) {
Entry(ServerPlayer player) {
@ -64,28 +64,31 @@ index 6247a21c9c391abf1f6db3482c659593e4f29355..9ccca41bf23efadba5329cc584bbcdca
+ }
+ Entry(ServerPlayer player, boolean listed) {
this(
+ // Paper end - Add Listing API for Player
player.getUUID(),
player.getGameProfile(),
- true,
+ listed,
+ listed, // Paper - Add Listing API for Player
player.connection.latency(),
player.gameMode.getGameModeForPlayer(),
player.getTabListDisplayName(),
@@ -172,6 +210,11 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
Optionull.map(player.getChatSession(), RemoteChatSession::asData)
);
}
+ // Paper start - Add Listing API for Player
+ Entry(UUID profileId, boolean listed) {
+ this(profileId, null, listed, 0, GameType.DEFAULT_MODE, null, null);
+ this(profileId, null, listed, 0, GameType.DEFAULT_MODE, null, 0, null);
+ }
+ // Paper end - Add Listing API for Player
}
static class EntryBuilder {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 387470d6cfd34dc6f9c895a962ddcdf92583ab8c..c9d72ab365dcfc2482764463b116451187684b3c 100644
index 7356a027ae3bca3a9f2056ef6849d5fab38a0df3..a4937d11b79cef41f3fbf79282c0c435e794dbfe 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -359,14 +359,22 @@ public abstract class PlayerList {
@@ -363,14 +363,22 @@ public abstract class PlayerList {
// CraftBukkit end
// CraftBukkit start - sendAll above replaced with this loop
@ -109,7 +112,7 @@ index 387470d6cfd34dc6f9c895a962ddcdf92583ab8c..c9d72ab365dcfc2482764463b1164511
}
if (entityplayer1 == player || !bukkitPlayer.canSee(entityplayer1.getBukkitEntity())) { // Paper - Use single player info update packet on join; Don't include joining player
@@ -377,7 +385,7 @@ public abstract class PlayerList {
@@ -381,7 +389,7 @@ public abstract class PlayerList {
}
// Paper start - Use single player info update packet on join
if (!onlinePlayers.isEmpty()) {
@ -119,10 +122,10 @@ index 387470d6cfd34dc6f9c895a962ddcdf92583ab8c..c9d72ab365dcfc2482764463b1164511
// Paper end - Use single player info update packet on join
player.sentListPacket = true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ccd81bc7279a92f78bb882c9443cf9ca90fd9acf..a3912d4de96a6bb2b9b3977705fa3facb891f73d 100644
index e20e8ba103a0ba094e00ef08ff0fc3b741a9bce5..b6093a1bbd8176cde85ef034373ae71f9dd8f1c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -201,6 +201,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -202,6 +202,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
private final ConversationTracker conversationTracker = new ConversationTracker();
private final Set<String> channels = new HashSet<String>();
private final Map<UUID, Set<WeakReference<Plugin>>> invertedVisibilityEntities = new HashMap<>();
@ -130,7 +133,7 @@ index ccd81bc7279a92f78bb882c9443cf9ca90fd9acf..a3912d4de96a6bb2b9b3977705fa3fac
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
private int hash = 0;
private double health = 20;
@@ -2092,7 +2093,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2105,7 +2106,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
otherPlayer.setUUID(uuidOverride);
}
// Paper end
@ -139,7 +142,7 @@ index ccd81bc7279a92f78bb882c9443cf9ca90fd9acf..a3912d4de96a6bb2b9b3977705fa3fac
if (original != null) otherPlayer.setUUID(original); // Paper - uuid override
}
@@ -2196,6 +2197,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -2209,6 +2210,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return (entity != null) ? this.canSee(entity) : false; // If we can't find it, we can't see it
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add BlockFace to BlockDamageEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index c680f081ba548f84f07a968a46811090c53e57e3..d839f8df658c894f144ba4637d290ffbed77e132 100644
index 3bd4ab8161c29bb8df2ba496a4430393b6593476..0da6496c18341c01fc4551ead7e740a6037dcf31 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -261,7 +261,7 @@ public class ServerPlayerGameMode {
@@ -259,7 +259,7 @@ public class ServerPlayerGameMode {
}
return;
}
@ -18,10 +18,10 @@ index c680f081ba548f84f07a968a46811090c53e57e3..d839f8df658c894f144ba4637d290ffb
if (blockEvent.isCancelled()) {
// Let the client know the block still exists
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 907ea60b647d529f133986632d00416269bc311e..6b241ec85f360ec79f18b911175d7092861024a4 100644
index 03afabc3ab4b264f84698627b79e58f502a8cea9..0bf830b51f078d1a642e1bbec6cd8b6e83501135 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -661,13 +661,13 @@ public class CraftEventFactory {
@@ -660,13 +660,13 @@ public class CraftEventFactory {
/**
* BlockDamageEvent
*/

View File

@ -9,10 +9,10 @@ Boat status is null until the entity is added to the world and the tick() method
public net.minecraft.world.entity.vehicle.Boat getStatus()Lnet/minecraft/world/entity/vehicle/Boat$Status;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index d161cbf9c83cd78593864850b98f688da2c85aa5..e33b1b6fd50a4eea57500cc00dba20d6edcab75d 100644
index 5de1ada561d11c247a597effab1e0aa363b7c90f..412fd9e87ec81cf50cb8bc82fe2dad5dd0029039 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -88,6 +88,17 @@ public class CraftBoat extends CraftVehicle implements Boat {
@@ -87,6 +87,17 @@ public abstract class CraftBoat extends CraftVehicle implements Boat {
@Override
public Status getStatus() {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f81a576084ccceb2b02e8d8cd57442efc7ff1e9f..84d283cd637b5c84a8682acec503b0e3831d1684 100644
index aeeb90481a9ac0a8ec9e3c5af08a32ca3e32bfb6..a8a5b28d95f7c3ce944f51993dd0c0eb98e3c550 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -425,6 +425,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -427,6 +427,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@javax.annotation.Nullable
private UUID originWorld;
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
@ -16,8 +16,8 @@ index f81a576084ccceb2b02e8d8cd57442efc7ff1e9f..84d283cd637b5c84a8682acec503b0e3
public void setOrigin(@javax.annotation.Nonnull Location location) {
this.origin = location.toVector();
@@ -618,6 +619,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void onClientRemoval() {}
@@ -625,6 +626,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void onRemoval(Entity.RemovalReason reason) {}
public void setPose(net.minecraft.world.entity.Pose pose) {
+ if (this.fixedPose) return; // Paper - Expand Pose API
@ -25,10 +25,10 @@ index f81a576084ccceb2b02e8d8cd57442efc7ff1e9f..84d283cd637b5c84a8682acec503b0e3
if (pose == this.getPose()) {
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 3626fea17527da69e6fbee26f018f52ef036cf90..580427bf1521ac9fef37f7464e12a7bfe4fbfb10 100644
index 0d2d1b6eab153aea6015bd69f2bad58e67d065c3..9c8e2731ca37a16cb538da27190c085bbc9791e3 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -899,6 +899,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -900,6 +900,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isSneaking() {
return this.getHandle().isShiftKeyDown();
}