mirror of
https://github.com/PaperMC/Paper.git
synced 2025-04-05 14:01:02 +02:00
Add back Fix NotePlayEvent patch
This commit is contained in:
parent
af4b5ee4f0
commit
d5216d8588
67 changed files with 13 additions and 9 deletions
patches/server
0834-Fix-NotePlayEvent.patch0835-Freeze-Tick-Lock-API.patch0836-Dolphin-API.patch0837-More-PotionEffectType-API.patch0838-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch0839-API-for-creating-command-sender-which-forwards-feedb.patch0840-Add-config-for-stronghold-seed.patch0841-Implement-regenerateChunk.patch0842-Log-exceptions-thrown-during-chat-processing.patch0843-Fix-cancelled-powdered-snow-bucket-placement.patch0844-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch0845-Add-GameEvent-tags.patch0846-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch0847-Replace-ticket-level-propagator.patch0848-Furnace-RecipesUsed-API.patch0849-Configurable-sculk-sensor-listener-range.patch0850-Add-missing-block-data-mins-and-maxes.patch0851-Option-to-have-default-CustomSpawners-in-custom-worl.patch0852-Put-world-into-worldlist-before-initing-the-world.patch0853-Fix-Entity-Position-Desync.patch0854-Custom-Potion-Mixes.patch0855-Fix-Fluid-tags-isTagged-method.patch0856-Force-close-world-loading-screen.patch0857-Fix-falling-block-spawn-methods.patch0858-Expose-furnace-minecart-push-values.patch0859-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch0860-Fix-save-problems-on-shutdown.patch0861-More-Projectile-API.patch0862-Don-t-allow-vehicle-movement-from-players-while-tele.patch0863-Implement-getComputedBiome-API.patch0864-Make-some-itemstacks-nonnull.patch0865-Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch0866-Implement-enchantWithLevels-API.patch0867-Fix-saving-in-unloadWorld.patch0868-Buffer-OOB-setBlock-calls.patch0869-Add-TameableDeathMessageEvent.patch0870-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch0871-fix-player-loottables-running-when-mob-loot-gamerule.patch0872-Ensure-entity-passenger-world-matches-ridden-entity.patch0873-Guard-against-invalid-entity-positions.patch0874-cache-resource-keys.patch0875-Allow-to-change-the-podium-for-the-EnderDragon.patch0876-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch0877-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch0878-Prevent-tile-entity-copies-loading-chunks.patch0879-Use-username-instead-of-display-name-in-PlayerList-g.patch0880-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch0881-Pass-ServerLevel-for-gamerule-callbacks.patch0882-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch0883-WorldCreator-keepSpawnLoaded.patch0884-Fix-NPE-for-BlockDataMeta-getBlockData.patch0885-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch0886-Add-EntityDyeEvent-and-CollarColorable-interface.patch0887-Fire-CauldronLevelChange-on-initial-fill.patch0888-fix-powder-snow-cauldrons-not-turning-to-water.patch0889-Sign-cleanup-filtering.patch0890-Add-PlayerStopUsingItemEvent.patch0891-FallingBlock-auto-expire-setting.patch0892-Don-t-tick-markers.patch0893-Do-not-accept-invalid-client-settings.patch0894-Add-support-for-Proxy-Protocol.patch0895-Fix-OfflinePlayer-getBedSpawnLocation.patch0896-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch0897-Sanitize-Sent-BlockEntity-NBT.patch0898-Prevent-entity-loading-causing-async-lookups.patch0899-Disable-component-selector-resolving-in-books-by-def.patch0900-Throw-exception-on-world-create-while-being-ticked.patch
|
@ -5,23 +5,27 @@ Subject: [PATCH] Fix NotePlayEvent
|
|||
|
||||
|
||||
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 16e11e31077f160198e0b04abdfeabb97ed20c6f..0e106bcc1f882877a5e444a2621466c6e4696d42 100644
|
||||
index 293affa9821bcf7c6f4c2d57818958ae2765c5de..c14eb4f7decdbcd6176d3bff95d595a947d4ec95 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -60,10 +60,9 @@ public class NoteBlock extends Block {
|
||||
private void playNote(Level world, BlockPos blockposition, BlockState data) { // CraftBukkit
|
||||
@@ -63,11 +63,12 @@ public class NoteBlock extends Block {
|
||||
private void playNote(@Nullable Entity entity, Level world, BlockPos blockposition, BlockState data) { // CraftBukkit
|
||||
if (world.getBlockState(blockposition.above()).isAir()) {
|
||||
// CraftBukkit start
|
||||
- org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.NOTE));
|
||||
- if (!event.isCancelled()) {
|
||||
+ // Paper start - move NotePlayEvent call to fix instrument/note changes
|
||||
world.blockEvent(blockposition, this, 0, 0);
|
||||
- if (event.isCancelled()) {
|
||||
- return;
|
||||
- }
|
||||
+ // Paper end
|
||||
+ // org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(NoteBlock.INSTRUMENT), data.getValue(NoteBlock.NOTE)); // Paper - move event into block event handler
|
||||
+ // if (event.isCancelled()) {
|
||||
+ // return;
|
||||
+ // }
|
||||
// CraftBukkit end
|
||||
+ // Paper - TODO any way to cancel the game event?
|
||||
world.blockEvent(blockposition, this, 0, 0);
|
||||
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, blockposition);
|
||||
}
|
||||
|
||||
@@ -92,10 +91,14 @@ public class NoteBlock extends Block {
|
||||
@@ -97,10 +98,14 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) {
|
Loading…
Add table
Reference in a new issue