mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
24 lines
1.4 KiB
Diff
24 lines
1.4 KiB
Diff
--- ../src-base/minecraft/net/minecraft/block/BlockNote.java
|
|
+++ ../src-work/minecraft/net/minecraft/block/BlockNote.java
|
|
@@ -63,7 +63,9 @@
|
|
if (tileentity instanceof TileEntityNote)
|
|
{
|
|
TileEntityNote tileentitynote = (TileEntityNote)tileentity;
|
|
+ int old = tileentitynote.note;
|
|
tileentitynote.changePitch();
|
|
+ if (old == tileentitynote.note) return false;
|
|
tileentitynote.triggerNote(worldIn, pos);
|
|
playerIn.addStat(StatList.NOTEBLOCK_TUNED);
|
|
}
|
|
@@ -103,6 +105,10 @@
|
|
|
|
public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param)
|
|
{
|
|
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(worldIn, pos, state, param, id);
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
|
+ id = e.getInstrument().ordinal();
|
|
+ param = e.getVanillaNoteId();
|
|
float f = (float)Math.pow(2.0D, (double)(param - 12) / 12.0D);
|
|
worldIn.playSound((EntityPlayer)null, pos, this.getInstrument(id), SoundCategory.RECORDS, 3.0F, f);
|
|
worldIn.spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)param / 24.0D, 0.0D, 0.0D);
|