From d0a36db6c2933e01bd177105e083692f6e329ef8 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Thu, 8 Jun 2023 04:08:08 -0400 Subject: [PATCH] YOU get patches --- ...reating-command-sender-which-forwards-feedb.patch | 0 .../server/Add-API-for-item-entity-health.patch | 0 .../{unapplied => }/server/Add-GameEvent-tags.patch | 0 .../server/Add-TameableDeathMessageEvent.patch | 2 +- ...nfig-option-for-worlds-affected-by-time-cmd.patch | 0 .../Add-configurable-height-for-slime-spawn.patch | 0 ...ng-Validate-calls-to-CraftServer-getSpawnLi.patch | 0 .../Add-missing-block-data-mins-and-maxes.patch | 0 .../Add-missing-structure-set-seed-configs.patch | 0 ...new-overload-to-PersistentDataContainer-has.patch | 0 ...ded-getHostname-to-AsyncPlayerPreLoginEvent.patch | 0 patches/{unapplied => }/server/Bucketable-API.patch | 0 .../server/Buffer-OOB-setBlock-calls.patch | 0 ...urable-max-block-light-for-monster-spawning.patch | 0 .../Configurable-sculk-sensor-listener-range.patch | 12 ++++++------ .../{unapplied => }/server/Custom-Potion-Mixes.patch | 0 patches/{unapplied => }/server/Dolphin-API.patch | 0 ...ow-vehicle-movement-from-players-while-tele.patch | 7 +++---- ...ntity-passenger-world-matches-ridden-entity.patch | 0 .../server/Entity-powdered-snow-API.patch | 0 ...hunk-tasks-fairly-for-worlds-while-waiting-.patch | 0 .../server/Expose-furnace-minecart-push-values.patch | 0 ...Fuel-and-canSmelt-methods-to-FurnaceInvento.patch | 0 ...Expose-vanilla-BiomeProvider-from-WorldInfo.patch | 0 .../server/Fix-Entity-Position-Desync.patch | 0 .../{unapplied => }/server/Fix-NotePlayEvent.patch | 4 ++-- .../server/Fix-bees-aging-inside-hives.patch | 0 ...ix-cancelled-powdered-snow-bucket-placement.patch | 0 ...lling-ProjectileHitEvent-for-piercing-arrow.patch | 2 +- ...x-entity-type-tags-suggestions-in-selectors.patch | 0 .../server/Fix-falling-block-spawn-methods.patch | 0 ...x-new-block-data-for-EntityChangeBlockEvent.patch | 4 ++-- .../server/Fix-saving-in-unloadWorld.patch | 0 ...-sticky-pistons-and-BlockPistonRetractEvent.patch | 10 +++++----- .../Fix-swamp-hut-cat-generation-deadlock.patch | 0 .../server/Fix-xp-reward-for-baby-zombies.patch | 0 .../server/Force-close-world-loading-screen.patch | 0 .../server/Freeze-Tick-Lock-API.patch | 10 +++++----- .../server/Furnace-RecipesUsed-API.patch | 0 .../Guard-against-invalid-entity-positions.patch | 0 ...timise-single-and-multi-AABB-VoxelShapes-an.patch | 9 --------- .../server/Implement-enchantWithLevels-API.patch | 0 .../server/Implement-getComputedBiome-API.patch | 0 .../server/Implement-regenerateChunk.patch | 0 .../server/Kick-on-main-for-illegal-chat.patch | 0 ...ffect-amplifiers-greater-than-127-correctly.patch | 0 .../server/Make-some-itemstacks-nonnull.patch | 0 ...Make-water-animal-spawn-height-configurable.patch | 0 .../server/More-PotionEffectType-API.patch | 0 .../{unapplied => }/server/More-Projectile-API.patch | 2 +- .../Multi-Block-Change-API-Implementation.patch | 2 +- .../server/Multiple-Entries-with-Scoreboards.patch | 0 ...-have-default-CustomSpawners-in-custom-worl.patch | 4 ++-- ...rld-into-worldlist-before-initing-the-world.patch | 0 .../server/Reset-placed-block-on-exception.patch | 0 ...e-a-CHM-for-StructureTemplate.Pallete-cache.patch | 0 .../{unapplied => }/server/Validate-usernames.patch | 0 ...r-loottables-running-when-mob-loot-gamerule.patch | 0 58 files changed, 29 insertions(+), 39 deletions(-) rename patches/{unapplied => }/server/API-for-creating-command-sender-which-forwards-feedb.patch (100%) rename patches/{unapplied => }/server/Add-API-for-item-entity-health.patch (100%) rename patches/{unapplied => }/server/Add-GameEvent-tags.patch (100%) rename patches/{unapplied => }/server/Add-TameableDeathMessageEvent.patch (90%) rename patches/{unapplied => }/server/Add-config-option-for-worlds-affected-by-time-cmd.patch (100%) rename patches/{unapplied => }/server/Add-configurable-height-for-slime-spawn.patch (100%) rename patches/{unapplied => }/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch (100%) rename patches/{unapplied => }/server/Add-missing-block-data-mins-and-maxes.patch (100%) rename patches/{unapplied => }/server/Add-missing-structure-set-seed-configs.patch (100%) rename patches/{unapplied => }/server/Add-new-overload-to-PersistentDataContainer-has.patch (100%) rename patches/{unapplied => }/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch (100%) rename patches/{unapplied => }/server/Bucketable-API.patch (100%) rename patches/{unapplied => }/server/Buffer-OOB-setBlock-calls.patch (100%) rename patches/{unapplied => }/server/Configurable-max-block-light-for-monster-spawning.patch (100%) rename patches/{unapplied => }/server/Configurable-sculk-sensor-listener-range.patch (86%) rename patches/{unapplied => }/server/Custom-Potion-Mixes.patch (100%) rename patches/{unapplied => }/server/Dolphin-API.patch (100%) rename patches/{unapplied => }/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch (82%) rename patches/{unapplied => }/server/Ensure-entity-passenger-world-matches-ridden-entity.patch (100%) rename patches/{unapplied => }/server/Entity-powdered-snow-API.patch (100%) rename patches/{unapplied => }/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch (100%) rename patches/{unapplied => }/server/Expose-furnace-minecart-push-values.patch (100%) rename patches/{unapplied => }/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch (100%) rename patches/{unapplied => }/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch (100%) rename patches/{unapplied => }/server/Fix-Entity-Position-Desync.patch (100%) rename patches/{unapplied => }/server/Fix-NotePlayEvent.patch (93%) rename patches/{unapplied => }/server/Fix-bees-aging-inside-hives.patch (100%) rename patches/{unapplied => }/server/Fix-cancelled-powdered-snow-bucket-placement.patch (100%) rename patches/{unapplied => }/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch (93%) rename patches/{unapplied => }/server/Fix-entity-type-tags-suggestions-in-selectors.patch (100%) rename patches/{unapplied => }/server/Fix-falling-block-spawn-methods.patch (100%) rename patches/{unapplied => }/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch (97%) rename patches/{unapplied => }/server/Fix-saving-in-unloadWorld.patch (100%) rename patches/{unapplied => }/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch (89%) rename patches/{unapplied => }/server/Fix-swamp-hut-cat-generation-deadlock.patch (100%) rename patches/{unapplied => }/server/Fix-xp-reward-for-baby-zombies.patch (100%) rename patches/{unapplied => }/server/Force-close-world-loading-screen.patch (100%) rename patches/{unapplied => }/server/Freeze-Tick-Lock-API.patch (90%) rename patches/{unapplied => }/server/Furnace-RecipesUsed-API.patch (100%) rename patches/{unapplied => }/server/Guard-against-invalid-entity-positions.patch (100%) rename patches/{unapplied => }/server/Implement-enchantWithLevels-API.patch (100%) rename patches/{unapplied => }/server/Implement-getComputedBiome-API.patch (100%) rename patches/{unapplied => }/server/Implement-regenerateChunk.patch (100%) rename patches/{unapplied => }/server/Kick-on-main-for-illegal-chat.patch (100%) rename patches/{unapplied => }/server/Load-effect-amplifiers-greater-than-127-correctly.patch (100%) rename patches/{unapplied => }/server/Make-some-itemstacks-nonnull.patch (100%) rename patches/{unapplied => }/server/Make-water-animal-spawn-height-configurable.patch (100%) rename patches/{unapplied => }/server/More-PotionEffectType-API.patch (100%) rename patches/{unapplied => }/server/More-Projectile-API.patch (99%) rename patches/{unapplied => }/server/Multi-Block-Change-API-Implementation.patch (97%) rename patches/{unapplied => }/server/Multiple-Entries-with-Scoreboards.patch (100%) rename patches/{unapplied => }/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch (88%) rename patches/{unapplied => }/server/Put-world-into-worldlist-before-initing-the-world.patch (100%) rename patches/{unapplied => }/server/Reset-placed-block-on-exception.patch (100%) rename patches/{unapplied => }/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch (100%) rename patches/{unapplied => }/server/Validate-usernames.patch (100%) rename patches/{unapplied => }/server/fix-player-loottables-running-when-mob-loot-gamerule.patch (100%) diff --git a/patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/API-for-creating-command-sender-which-forwards-feedb.patch similarity index 100% rename from patches/unapplied/server/API-for-creating-command-sender-which-forwards-feedb.patch rename to patches/server/API-for-creating-command-sender-which-forwards-feedb.patch diff --git a/patches/unapplied/server/Add-API-for-item-entity-health.patch b/patches/server/Add-API-for-item-entity-health.patch similarity index 100% rename from patches/unapplied/server/Add-API-for-item-entity-health.patch rename to patches/server/Add-API-for-item-entity-health.patch diff --git a/patches/unapplied/server/Add-GameEvent-tags.patch b/patches/server/Add-GameEvent-tags.patch similarity index 100% rename from patches/unapplied/server/Add-GameEvent-tags.patch rename to patches/server/Add-GameEvent-tags.patch diff --git a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch b/patches/server/Add-TameableDeathMessageEvent.patch similarity index 90% rename from patches/unapplied/server/Add-TameableDeathMessageEvent.patch rename to patches/server/Add-TameableDeathMessageEvent.patch index d351c6fe1e..ee69842511 100644 --- a/patches/unapplied/server/Add-TameableDeathMessageEvent.patch +++ b/patches/server/Add-TameableDeathMessageEvent.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @Override public void die(DamageSource damageSource) { - if (!this.level.isClientSide && this.level.getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { + if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { - this.getOwner().sendSystemMessage(this.getCombatTracker().getDeathMessage()); + // Paper start - TameableDeathMessageEvent + io.papermc.paper.event.entity.TameableDeathMessageEvent event = new io.papermc.paper.event.entity.TameableDeathMessageEvent((org.bukkit.entity.Tameable) getBukkitEntity(), io.papermc.paper.adventure.PaperAdventure.asAdventure(this.getCombatTracker().getDeathMessage())); diff --git a/patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch similarity index 100% rename from patches/unapplied/server/Add-config-option-for-worlds-affected-by-time-cmd.patch rename to patches/server/Add-config-option-for-worlds-affected-by-time-cmd.patch diff --git a/patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch b/patches/server/Add-configurable-height-for-slime-spawn.patch similarity index 100% rename from patches/unapplied/server/Add-configurable-height-for-slime-spawn.patch rename to patches/server/Add-configurable-height-for-slime-spawn.patch diff --git a/patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch similarity index 100% rename from patches/unapplied/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch rename to patches/server/Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch diff --git a/patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch b/patches/server/Add-missing-block-data-mins-and-maxes.patch similarity index 100% rename from patches/unapplied/server/Add-missing-block-data-mins-and-maxes.patch rename to patches/server/Add-missing-block-data-mins-and-maxes.patch diff --git a/patches/unapplied/server/Add-missing-structure-set-seed-configs.patch b/patches/server/Add-missing-structure-set-seed-configs.patch similarity index 100% rename from patches/unapplied/server/Add-missing-structure-set-seed-configs.patch rename to patches/server/Add-missing-structure-set-seed-configs.patch diff --git a/patches/unapplied/server/Add-new-overload-to-PersistentDataContainer-has.patch b/patches/server/Add-new-overload-to-PersistentDataContainer-has.patch similarity index 100% rename from patches/unapplied/server/Add-new-overload-to-PersistentDataContainer-has.patch rename to patches/server/Add-new-overload-to-PersistentDataContainer-has.patch diff --git a/patches/unapplied/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/unapplied/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/Added-getHostname-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/unapplied/server/Bucketable-API.patch b/patches/server/Bucketable-API.patch similarity index 100% rename from patches/unapplied/server/Bucketable-API.patch rename to patches/server/Bucketable-API.patch diff --git a/patches/unapplied/server/Buffer-OOB-setBlock-calls.patch b/patches/server/Buffer-OOB-setBlock-calls.patch similarity index 100% rename from patches/unapplied/server/Buffer-OOB-setBlock-calls.patch rename to patches/server/Buffer-OOB-setBlock-calls.patch diff --git a/patches/unapplied/server/Configurable-max-block-light-for-monster-spawning.patch b/patches/server/Configurable-max-block-light-for-monster-spawning.patch similarity index 100% rename from patches/unapplied/server/Configurable-max-block-light-for-monster-spawning.patch rename to patches/server/Configurable-max-block-light-for-monster-spawning.patch diff --git a/patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch b/patches/server/Configurable-sculk-sensor-listener-range.patch similarity index 86% rename from patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch rename to patches/server/Configurable-sculk-sensor-listener-range.patch index 5dd194f65a..1200d845b1 100644 --- a/patches/unapplied/server/Configurable-sculk-sensor-listener-range.patch +++ b/patches/server/Configurable-sculk-sensor-listener-range.patch @@ -10,8 +10,8 @@ diff --git a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlo index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SculkSensorBlockEntity.java -@@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList - this.listener = listener; +@@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList + this.vibrationData = listener; }); } + if (nbt.contains(PAPER_LISTENER_RANGE_NBT_KEY)) this.listener.listenerRange = nbt.getInt(PAPER_LISTENER_RANGE_NBT_KEY); // Paper @@ -22,19 +22,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override protected void saveAdditional(CompoundTag nbt) { super.saveAdditional(nbt); -@@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements VibrationList - VibrationListener.codec(this).encodeStart(NbtOps.INSTANCE, this.listener).resultOrPartial(LOGGER::error).ifPresent((listenerNbt) -> { +@@ -0,0 +0,0 @@ public class SculkSensorBlockEntity extends BlockEntity implements GameEventList + VibrationSystem.Data.CODEC.encodeStart(NbtOps.INSTANCE, this.vibrationData).resultOrPartial(LOGGER::error).ifPresent((listenerNbt) -> { nbt.put("listener", listenerNbt); }); + if (this.listener.listenerRange != ((SculkSensorBlock) net.minecraft.world.level.block.Blocks.SCULK_SENSOR).getListenerRange()) nbt.putInt(PAPER_LISTENER_RANGE_NBT_KEY, this.listener.listenerRange); // Paper - only save if it's different from the default } - public VibrationListener getListener() { + @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSculkSensor.java -@@ -0,0 +0,0 @@ public class CraftSculkSensor extends CraftBlockEntityState extends CraftBlo Preconditions.checkArgument(0 <= lastVibrationFrequency && lastVibrationFrequency <= 15, "Vibration frequency must be between 0-15"); getSnapshot().lastVibrationFrequency = lastVibrationFrequency; } diff --git a/patches/unapplied/server/Custom-Potion-Mixes.patch b/patches/server/Custom-Potion-Mixes.patch similarity index 100% rename from patches/unapplied/server/Custom-Potion-Mixes.patch rename to patches/server/Custom-Potion-Mixes.patch diff --git a/patches/unapplied/server/Dolphin-API.patch b/patches/server/Dolphin-API.patch similarity index 100% rename from patches/unapplied/server/Dolphin-API.patch rename to patches/server/Dolphin-API.patch diff --git a/patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch similarity index 82% rename from patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch rename to patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch index 74a60492e1..4ccdc38a10 100644 --- a/patches/unapplied/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -11,15 +11,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause } else { Entity entity = this.player.getRootVehicle(); - + // Paper start + if (this.awaitingPositionFromClient != null || this.player.isImmobile() || entity.isRemoved()) { + return; + } + // Paper end -+ + if (entity != this.player && entity.getControllingPassenger() == this.player && entity == this.lastVehicle) { - ServerLevel worldserver = this.player.getLevel(); - double d0 = entity.getX();final double fromX = d0; // Paper - OBFHELPER + ServerLevel worldserver = this.player.serverLevel(); diff --git a/patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch similarity index 100% rename from patches/unapplied/server/Ensure-entity-passenger-world-matches-ridden-entity.patch rename to patches/server/Ensure-entity-passenger-world-matches-ridden-entity.patch diff --git a/patches/unapplied/server/Entity-powdered-snow-API.patch b/patches/server/Entity-powdered-snow-API.patch similarity index 100% rename from patches/unapplied/server/Entity-powdered-snow-API.patch rename to patches/server/Entity-powdered-snow-API.patch diff --git a/patches/unapplied/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch similarity index 100% rename from patches/unapplied/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch rename to patches/server/Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch diff --git a/patches/unapplied/server/Expose-furnace-minecart-push-values.patch b/patches/server/Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/unapplied/server/Expose-furnace-minecart-push-values.patch rename to patches/server/Expose-furnace-minecart-push-values.patch diff --git a/patches/unapplied/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch similarity index 100% rename from patches/unapplied/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch rename to patches/server/Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch diff --git a/patches/unapplied/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch similarity index 100% rename from patches/unapplied/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch rename to patches/server/Expose-vanilla-BiomeProvider-from-WorldInfo.patch diff --git a/patches/unapplied/server/Fix-Entity-Position-Desync.patch b/patches/server/Fix-Entity-Position-Desync.patch similarity index 100% rename from patches/unapplied/server/Fix-Entity-Position-Desync.patch rename to patches/server/Fix-Entity-Position-Desync.patch diff --git a/patches/unapplied/server/Fix-NotePlayEvent.patch b/patches/server/Fix-NotePlayEvent.patch similarity index 93% rename from patches/unapplied/server/Fix-NotePlayEvent.patch rename to patches/server/Fix-NotePlayEvent.patch index dc93a9774a..709afab40e 100644 --- a/patches/unapplied/server/Fix-NotePlayEvent.patch +++ b/patches/server/Fix-NotePlayEvent.patch @@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java @@ -0,0 +0,0 @@ public class NoteBlock extends Block { private void playNote(@Nullable Entity entity, BlockState state, Level world, BlockPos pos) { - if (!((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).requiresAirAbove() || world.getBlockState(pos.above()).isAir()) { + if (((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).worksAboveNoteBlock() || world.getBlockState(pos.above()).isAir()) { // CraftBukkit start - org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(NoteBlock.INSTRUMENT), state.getValue(NoteBlock.NOTE)); - if (event.isCancelled()) { @@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - int k = (Integer) state.getValue(NoteBlock.NOTE); + int k = event.getNote().getId(); // Paper - f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D); + f = NoteBlock.getPitchFromNote(k); world.addParticle(ParticleTypes.NOTE, (double) pos.getX() + 0.5D, (double) pos.getY() + 1.2D, (double) pos.getZ() + 0.5D, (double) k / 24.0D, 0.0D, 0.0D); @@ -0,0 +0,0 @@ public class NoteBlock extends Block { diff --git a/patches/unapplied/server/Fix-bees-aging-inside-hives.patch b/patches/server/Fix-bees-aging-inside-hives.patch similarity index 100% rename from patches/unapplied/server/Fix-bees-aging-inside-hives.patch rename to patches/server/Fix-bees-aging-inside-hives.patch diff --git a/patches/unapplied/server/Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/Fix-cancelled-powdered-snow-bucket-placement.patch similarity index 100% rename from patches/unapplied/server/Fix-cancelled-powdered-snow-bucket-placement.patch rename to patches/server/Fix-cancelled-powdered-snow-bucket-placement.patch diff --git a/patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch similarity index 93% rename from patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch rename to patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch index 9da51bd837..97c56d6b5e 100644 --- a/patches/unapplied/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch +++ b/patches/server/Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch @@ -36,5 +36,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + private boolean shouldFall() { - return this.inGround && this.level.noCollision((new AABB(this.position(), this.position())).inflate(0.06D)); + return this.inGround && this.level().noCollision((new AABB(this.position(), this.position())).inflate(0.06D)); } diff --git a/patches/unapplied/server/Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 100% rename from patches/unapplied/server/Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/Fix-entity-type-tags-suggestions-in-selectors.patch diff --git a/patches/unapplied/server/Fix-falling-block-spawn-methods.patch b/patches/server/Fix-falling-block-spawn-methods.patch similarity index 100% rename from patches/unapplied/server/Fix-falling-block-spawn-methods.patch rename to patches/server/Fix-falling-block-spawn-methods.patch diff --git a/patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch similarity index 97% rename from patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch rename to patches/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch index 0695e9eff7..71b7e2ed92 100644 --- a/patches/unapplied/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/Fix-new-block-data-for-EntityChangeBlockEvent.patch @@ -36,12 +36,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java @@ -0,0 +0,0 @@ public class Ravager extends Raider { - BlockState iblockdata = this.level.getBlockState(blockposition); + BlockState iblockdata = this.level().getBlockState(blockposition); Block block = iblockdata.getBlock(); - if (block instanceof LeavesBlock && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, net.minecraft.world.level.block.Blocks.AIR.defaultBlockState()).isCancelled()) { // CraftBukkit + if (block instanceof LeavesBlock && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock()).isCancelled()) { // CraftBukkit // Paper - flag = this.level.destroyBlock(blockposition, true, this) || flag; + flag = this.level().destroyBlock(blockposition, true, this) || flag; } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java diff --git a/patches/unapplied/server/Fix-saving-in-unloadWorld.patch b/patches/server/Fix-saving-in-unloadWorld.patch similarity index 100% rename from patches/unapplied/server/Fix-saving-in-unloadWorld.patch rename to patches/server/Fix-saving-in-unloadWorld.patch diff --git a/patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch similarity index 89% rename from patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch rename to patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch index d652cddf9d..ad84fdebf3 100644 --- a/patches/unapplied/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch +++ b/patches/server/Fix-sticky-pistons-and-BlockPistonRetractEvent.patch @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 world.blockEvent(pos, this, b0, enumdirection.get3DDataValue()); @@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock { - BlockState iblockdata1 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); + BlockState iblockdata2 = (BlockState) ((BlockState) Blocks.MOVING_PISTON.defaultBlockState().setValue(MovingPistonBlock.FACING, enumdirection)).setValue(MovingPistonBlock.TYPE, this.isSticky ? PistonType.STICKY : PistonType.DEFAULT); + // Paper start - Move empty piston retract call to fix multiple event fires + if (!this.isSticky) { @@ -66,11 +66,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + // Paper end - world.setBlock(pos, iblockdata1, 20); - world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata1, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true)); // Paper - diff on change - world.blockUpdated(pos, iblockdata1.getBlock()); + world.setBlock(pos, iblockdata2, 20); + world.setBlockEntity(MovingPistonBlock.newMovingBlockEntity(pos, iblockdata2, (BlockState) this.defaultBlockState().setValue(PistonBaseBlock.FACING, Direction.from3DDataValue(data & 7)), enumdirection, false, true)); // Paper - diff on change + world.blockUpdated(pos, iblockdata2.getBlock()); @@ -0,0 +0,0 @@ public class PistonBaseBlock extends DirectionalBlock { - if (type == 1 && !iblockdata2.isAir() && PistonBaseBlock.isPushable(iblockdata2, world, blockposition1, enumdirection.getOpposite(), false, enumdirection) && (iblockdata2.getPistonPushReaction() == PushReaction.NORMAL || iblockdata2.is(Blocks.PISTON) || iblockdata2.is(Blocks.STICKY_PISTON))) { + if (type == 1 && !iblockdata3.isAir() && PistonBaseBlock.isPushable(iblockdata3, world, blockposition1, enumdirection.getOpposite(), false, enumdirection) && (iblockdata3.getPistonPushReaction() == PushReaction.NORMAL || iblockdata3.is(Blocks.PISTON) || iblockdata3.is(Blocks.STICKY_PISTON))) { this.moveBlocks(world, pos, enumdirection, false); } else { + // Paper start - fire BlockPistonRetractEvent for sticky pistons retracting nothing (air) diff --git a/patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/Fix-swamp-hut-cat-generation-deadlock.patch similarity index 100% rename from patches/unapplied/server/Fix-swamp-hut-cat-generation-deadlock.patch rename to patches/server/Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch b/patches/server/Fix-xp-reward-for-baby-zombies.patch similarity index 100% rename from patches/unapplied/server/Fix-xp-reward-for-baby-zombies.patch rename to patches/server/Fix-xp-reward-for-baby-zombies.patch diff --git a/patches/unapplied/server/Force-close-world-loading-screen.patch b/patches/server/Force-close-world-loading-screen.patch similarity index 100% rename from patches/unapplied/server/Force-close-world-loading-screen.patch rename to patches/server/Force-close-world-loading-screen.patch diff --git a/patches/unapplied/server/Freeze-Tick-Lock-API.patch b/patches/server/Freeze-Tick-Lock-API.patch similarity index 90% rename from patches/unapplied/server/Freeze-Tick-Lock-API.patch rename to patches/server/Freeze-Tick-Lock-API.patch index 14f188cb3d..1e2b46cfef 100644 --- a/patches/unapplied/server/Freeze-Tick-Lock-API.patch +++ b/patches/server/Freeze-Tick-Lock-API.patch @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - if (this.getTicksFrozen() > 0) { + if (this.getTicksFrozen() > 0 && !freezeLocked) { // Paper - Freeze Tick Lock API this.setTicksFrozen(0); - this.level.levelEvent((Player) null, 1009, this.blockPosition, 1); + this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); } @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (fromNetherPortal) { @@ -51,10 +51,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { - this.level.getProfiler().pop(); - this.level.getProfiler().push("freezing"); -- if (!this.level.isClientSide && !this.isDeadOrDying()) { -+ if (!this.level.isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API + this.level().getProfiler().pop(); + this.level().getProfiler().push("freezing"); +- if (!this.level().isClientSide && !this.isDeadOrDying()) { ++ if (!this.level().isClientSide && !this.isDeadOrDying() && !freezeLocked) { // Paper - Freeze Tick Lock API int i = this.getTicksFrozen(); if (this.isInPowderSnow && this.canFreeze()) { diff --git a/patches/unapplied/server/Furnace-RecipesUsed-API.patch b/patches/server/Furnace-RecipesUsed-API.patch similarity index 100% rename from patches/unapplied/server/Furnace-RecipesUsed-API.patch rename to patches/server/Furnace-RecipesUsed-API.patch diff --git a/patches/unapplied/server/Guard-against-invalid-entity-positions.patch b/patches/server/Guard-against-invalid-entity-positions.patch similarity index 100% rename from patches/unapplied/server/Guard-against-invalid-entity-positions.patch rename to patches/server/Guard-against-invalid-entity-positions.patch diff --git a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index 053ec6a0ba..8a18c4b10c 100644 --- a/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/server/Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch @@ -1268,15 +1268,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.remainingFireTicks <= 0) { this.setRemainingFireTicks(-this.getFireImmuneTicks()); } -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - this.setRemainingFireTicks(-this.getFireImmuneTicks()); - } - -- this.level().getProfiler().pop(); -+ this.level.getProfiler().pop(); - } - } - // Paper start - detailed watchdog information @@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } diff --git a/patches/unapplied/server/Implement-enchantWithLevels-API.patch b/patches/server/Implement-enchantWithLevels-API.patch similarity index 100% rename from patches/unapplied/server/Implement-enchantWithLevels-API.patch rename to patches/server/Implement-enchantWithLevels-API.patch diff --git a/patches/unapplied/server/Implement-getComputedBiome-API.patch b/patches/server/Implement-getComputedBiome-API.patch similarity index 100% rename from patches/unapplied/server/Implement-getComputedBiome-API.patch rename to patches/server/Implement-getComputedBiome-API.patch diff --git a/patches/unapplied/server/Implement-regenerateChunk.patch b/patches/server/Implement-regenerateChunk.patch similarity index 100% rename from patches/unapplied/server/Implement-regenerateChunk.patch rename to patches/server/Implement-regenerateChunk.patch diff --git a/patches/unapplied/server/Kick-on-main-for-illegal-chat.patch b/patches/server/Kick-on-main-for-illegal-chat.patch similarity index 100% rename from patches/unapplied/server/Kick-on-main-for-illegal-chat.patch rename to patches/server/Kick-on-main-for-illegal-chat.patch diff --git a/patches/unapplied/server/Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch similarity index 100% rename from patches/unapplied/server/Load-effect-amplifiers-greater-than-127-correctly.patch rename to patches/server/Load-effect-amplifiers-greater-than-127-correctly.patch diff --git a/patches/unapplied/server/Make-some-itemstacks-nonnull.patch b/patches/server/Make-some-itemstacks-nonnull.patch similarity index 100% rename from patches/unapplied/server/Make-some-itemstacks-nonnull.patch rename to patches/server/Make-some-itemstacks-nonnull.patch diff --git a/patches/unapplied/server/Make-water-animal-spawn-height-configurable.patch b/patches/server/Make-water-animal-spawn-height-configurable.patch similarity index 100% rename from patches/unapplied/server/Make-water-animal-spawn-height-configurable.patch rename to patches/server/Make-water-animal-spawn-height-configurable.patch diff --git a/patches/unapplied/server/More-PotionEffectType-API.patch b/patches/server/More-PotionEffectType-API.patch similarity index 100% rename from patches/unapplied/server/More-PotionEffectType-API.patch rename to patches/server/More-PotionEffectType-API.patch diff --git a/patches/unapplied/server/More-Projectile-API.patch b/patches/server/More-Projectile-API.patch similarity index 99% rename from patches/unapplied/server/More-Projectile-API.patch rename to patches/server/More-Projectile-API.patch index 46ff806de7..796d3edbe7 100644 --- a/patches/unapplied/server/More-Projectile-API.patch +++ b/patches/server/More-Projectile-API.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + public void splash(@org.jetbrains.annotations.Nullable HitResult hitResult) { + // Paper end - More projectile API - if (!this.level.isClientSide) { + if (!this.level().isClientSide) { ItemStack itemstack = this.getItem(); Potion potionregistry = PotionUtils.getPotion(itemstack); @@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie diff --git a/patches/unapplied/server/Multi-Block-Change-API-Implementation.patch b/patches/server/Multi-Block-Change-API-Implementation.patch similarity index 97% rename from patches/unapplied/server/Multi-Block-Change-API-Implementation.patch rename to patches/server/Multi-Block-Change-API-Implementation.patch index a0f028b8e7..bf7b3e249d 100644 --- a/patches/unapplied/server/Multi-Block-Change-API-Implementation.patch +++ b/patches/server/Multi-Block-Change-API-Implementation.patch @@ -59,5 +59,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Override - public void sendBlockChanges(Collection blocks, boolean suppressLightUpdates) { + public void sendBlockChanges(Collection blocks) { Preconditions.checkArgument(blocks != null, "blocks must not be null"); diff --git a/patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch b/patches/server/Multiple-Entries-with-Scoreboards.patch similarity index 100% rename from patches/unapplied/server/Multiple-Entries-with-Scoreboards.patch rename to patches/server/Multiple-Entries-with-Scoreboards.patch diff --git a/patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch b/patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch similarity index 88% rename from patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch rename to patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch index bbec48085e..07e18234e4 100644 --- a/patches/unapplied/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch +++ b/patches/server/Option-to-have-default-CustomSpawners-in-custom-worl.patch @@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.commandStorage = new CommandStorage(worldpersistentdata); } else { ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11); -- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, ImmutableList.of(), true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider); +- world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, ImmutableList.of(), true, this.overworld().getRandomSequences(), org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider); + // Paper start - option to use the dimension_type to check if spawners should be added. I imagine mojang will add some datapack-y way of managing this in the future. + final List spawners; + if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.useDimensionTypeForCustomSpawners && this.registryAccess().registryOrThrow(Registries.DIMENSION_TYPE).getResourceKey(worlddimension.type().value()).orElseThrow() == net.minecraft.world.level.dimension.BuiltinDimensionTypes.OVERWORLD) { @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } else { + spawners = Collections.emptyList(); + } -+ world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, spawners, true, org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider); ++ world = new ServerLevel(this, this.executor, worldSession, iworlddataserver, worldKey, worlddimension, worldloadlistener, flag, j, spawners, true, this.overworld().getRandomSequences(), org.bukkit.World.Environment.getEnvironment(dimension), gen, biomeProvider); + // Paper end } diff --git a/patches/unapplied/server/Put-world-into-worldlist-before-initing-the-world.patch b/patches/server/Put-world-into-worldlist-before-initing-the-world.patch similarity index 100% rename from patches/unapplied/server/Put-world-into-worldlist-before-initing-the-world.patch rename to patches/server/Put-world-into-worldlist-before-initing-the-world.patch diff --git a/patches/unapplied/server/Reset-placed-block-on-exception.patch b/patches/server/Reset-placed-block-on-exception.patch similarity index 100% rename from patches/unapplied/server/Reset-placed-block-on-exception.patch rename to patches/server/Reset-placed-block-on-exception.patch diff --git a/patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch similarity index 100% rename from patches/unapplied/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch rename to patches/server/Use-a-CHM-for-StructureTemplate.Pallete-cache.patch diff --git a/patches/unapplied/server/Validate-usernames.patch b/patches/server/Validate-usernames.patch similarity index 100% rename from patches/unapplied/server/Validate-usernames.patch rename to patches/server/Validate-usernames.patch diff --git a/patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch similarity index 100% rename from patches/unapplied/server/fix-player-loottables-running-when-mob-loot-gamerule.patch rename to patches/server/fix-player-loottables-running-when-mob-loot-gamerule.patch