33 lines
2.0 KiB
Diff
33 lines
2.0 KiB
Diff
--- a/net/minecraft/block/BlockNote.java
|
|
+++ b/net/minecraft/block/BlockNote.java
|
|
@@ -49,7 +49,7 @@
|
|
}
|
|
|
|
private void func_196482_a(World p_196482_1_, BlockPos p_196482_2_) {
|
|
- if (p_196482_1_.func_180495_p(p_196482_2_.func_177984_a()).func_196958_f()) {
|
|
+ if (p_196482_1_.func_175623_d(p_196482_2_.func_177984_a())) {
|
|
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
|
|
}
|
|
|
|
@@ -59,7 +59,9 @@
|
|
if (p_196250_2_.field_72995_K) {
|
|
return true;
|
|
} else {
|
|
- p_196250_1_ = (IBlockState)p_196250_1_.func_177231_a(field_196485_c);
|
|
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_196250_2_, p_196250_3_, p_196250_1_, p_196250_1_.func_177229_b(field_196485_c), p_196250_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c));
|
|
+ if (_new == -1) return false;
|
|
+ p_196250_1_ = (IBlockState)p_196250_1_.func_206870_a(field_196485_c, _new);
|
|
p_196250_2_.func_180501_a(p_196250_3_, p_196250_1_, 3);
|
|
this.func_196482_a(p_196250_2_, p_196250_3_);
|
|
p_196250_4_.func_195066_a(StatList.field_188087_U);
|
|
@@ -75,6 +77,9 @@
|
|
}
|
|
|
|
public boolean func_189539_a(IBlockState p_189539_1_, World p_189539_2_, BlockPos p_189539_3_, int p_189539_4_, int p_189539_5_) {
|
|
+ net.minecraftforge.event.world.NoteBlockEvent.Play e = new net.minecraftforge.event.world.NoteBlockEvent.Play(p_189539_2_, p_189539_3_, p_189539_1_, p_189539_1_.func_177229_b(field_196485_c), p_189539_1_.func_177229_b(field_196483_a));
|
|
+ if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(e)) return false;
|
|
+ p_189539_1_ = p_189539_1_.func_206870_a(field_196485_c, e.getVanillaNoteId()).func_206870_a(field_196483_a, e.getInstrument());
|
|
int i = p_189539_1_.func_177229_b(field_196485_c);
|
|
float f = (float)Math.pow(2.0D, (double)(i - 12) / 12.0D);
|
|
p_189539_2_.func_184133_a((EntityPlayer)null, p_189539_3_, ((NoteBlockInstrument)p_189539_1_.func_177229_b(field_196483_a)).func_208088_a(), SoundCategory.RECORDS, 3.0F, f);
|