mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fire NotePlayEvent. Fixes BUKKIT-1779
This commit is contained in:
1 parent
72d64b516c
commit
e35f6f2526
2 files changed
+14
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
|
||||
public class TileEntityNote extends TileEntity {
|
||||
|
||||
public byte note = 0;
|
||||
@@ -50,7 +52,12 @@ public class TileEntityNote extends TileEntity {
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
world.playNote(i, j, k, b0, this.note);
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.block.NotePlayEvent event = CraftEventFactory.callNotePlayEvent(this.world, i, j, k, b0, this.note);
|
||||
if (!event.isCancelled()) {
|
||||
this.world.playNote(i, j, k, event.getInstrument().getType(), event.getNote().getId());
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user