Fix cycle happening in noteblock even though we're setting the new value as well..

Signed-off-by: cpw <cpw+github@weeksfamily.ca>
This commit is contained in:
cpw 2020-03-20 20:05:23 -04:00
parent 3e48066021
commit dd1d8737ad
No known key found for this signature in database
GPG key ID: 8EB3DF749553B1B7

View file

@ -9,17 +9,18 @@
p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0); p_196482_1_.func_175641_c(p_196482_2_, this, 0, 0);
} }
@@ -60,6 +60,9 @@ @@ -60,7 +60,9 @@
if (p_225533_2_.field_72995_K) { if (p_225533_2_.field_72995_K) {
return ActionResultType.SUCCESS; return ActionResultType.SUCCESS;
} else { } else {
- p_225533_1_ = p_225533_1_.func_177231_a(field_196485_c);
+ 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)); + 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; + if (_new == -1) return ActionResultType.FAIL;
+ p_225533_1_ = (BlockState)p_225533_1_.func_206870_a(field_196485_c, _new); + 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); p_225533_2_.func_180501_a(p_225533_3_, p_225533_1_, 3);
this.func_196482_a(p_225533_2_, p_225533_3_); this.func_196482_a(p_225533_2_, p_225533_3_);
@@ -76,6 +79,9 @@ p_225533_4_.func_195066_a(Stats.field_188087_U);
@@ -76,6 +78,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_) { 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_) {