diff options
author | Jake Potrebic <[email protected]> | 2022-02-28 19:25:13 -0800 |
---|---|---|
committer | Jason Penilla <[email protected]> | 2022-02-28 22:52:39 -0700 |
commit | cc45a355a4e76f749e4618a61b233f40a3c05180 (patch) | |
tree | 445eb9887060005896841d58d5c6bfb1f36ff62e /patches/server/0852-Fix-NotePlayEvent.patch | |
parent | 5071d50207620641e8c4bbc579dd9136ad6a2566 (diff) | |
download | Paper-cc45a355a4e76f749e4618a61b233f40a3c05180.tar.gz Paper-cc45a355a4e76f749e4618a61b233f40a3c05180.zip |
move decompile fixes to start of git history
Diffstat (limited to 'patches/server/0852-Fix-NotePlayEvent.patch')
-rw-r--r-- | patches/server/0852-Fix-NotePlayEvent.patch | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/patches/server/0852-Fix-NotePlayEvent.patch b/patches/server/0852-Fix-NotePlayEvent.patch deleted file mode 100644 index 3d7aa4d732..0000000000 --- a/patches/server/0852-Fix-NotePlayEvent.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Kieran Wallbanks <[email protected]> -Date: Mon, 21 Jun 2021 14:23:50 +0100 -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 ---- 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 - 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); -- } -+ // Paper end - // CraftBukkit end - } - -@@ -92,10 +91,14 @@ public class NoteBlock extends Block { - - @Override - public boolean triggerEvent(BlockState state, Level world, BlockPos pos, int type, int data) { -- int k = (Integer) state.getValue(NoteBlock.NOTE); -+ // Paper start - move NotePlayEvent call to fix instrument/note changes -+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, pos, state.getValue(INSTRUMENT), state.getValue(NOTE)); -+ if (event.isCancelled()) return false; -+ int k = event.getNote().getId(); - float f = (float) Math.pow(2.0D, (double) (k - 12) / 12.0D); - -- world.playSound((Player) null, pos, ((NoteBlockInstrument) state.getValue(NoteBlock.INSTRUMENT)).getSoundEvent(), SoundSource.RECORDS, 3.0F, f); -+ world.playSound(null, pos, org.bukkit.craftbukkit.block.data.CraftBlockData.toNMS(event.getInstrument(), NoteBlockInstrument.class).getSoundEvent(), SoundSource.RECORDS, 3.0F, f); -+ // Paper end - 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); - return true; - } |