32 lines
1.9 KiB
Diff
32 lines
1.9 KiB
Diff
--- a/net/minecraft/block/NoteBlock.java
|
|
+++ b/net/minecraft/block/NoteBlock.java
|
|
@@ -50,7 +50,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);
|
|
}
|
|
|
|
@@ -60,6 +60,9 @@
|
|
if (p_225533_2_.field_72995_K) {
|
|
return ActionResultType.SUCCESS;
|
|
} else {
|
|
+ int _new = net.minecraftforge.common.ForgeHooks.onNoteChange(p_225533_2_, p_225533_3_, p_225533_1_, p_225533_1_.func_177229_b(field_196485_c), p_225533_1_.func_177231_a(field_196485_c).func_177229_b(field_196485_c));
|
|
+ if (_new == -1) return ActionResultType.FAIL;
|
|
+ p_225533_1_ = (BlockState)p_225533_1_.func_206870_a(field_196485_c, _new);
|
|
p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
|
|
p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3);
|
|
this.func_196482_a(p_225533_2_, p_225533_3_);
|
|
@@ -76,6 +79,9 @@
|
|
}
|
|
|
|
public boolean func_189539_a(BlockState 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((PlayerEntity)null, p_189539_3_, p_189539_1_.func_177229_b(field_196483_a).func_208088_a(), SoundCategory.RECORDS, 3.0F, f);
|