Files
CatServer/patches/net/minecraft/tileentity/TileEntityNote.java.patch
2018-09-08 17:51:33 +08:00

17 lines
744 B
Diff

--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java
@@ -63,7 +63,12 @@
i = 4;
}
- worldIn.addBlockEvent(posIn, Blocks.NOTEBLOCK, i, this.note);
+ // CraftBukkit start
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(this.worldObj, posIn.getX(), posIn.getY(), posIn.getZ(),(byte) i, this.note);
+ if (!event.isCancelled()) {
+ worldIn.addBlockEvent(posIn, Blocks.NOTEBLOCK, event.getInstrument().getType(), event.getNote().getId());
+ }
+ // CraftBukkit end
}
}
}