Skip to content

Commit

Permalink
Fix note block interaction causing doubled note increase
Browse files Browse the repository at this point in the history
  • Loading branch information
sciwhiz12 committed Feb 4, 2025
1 parent 0d494e8 commit fe2fc98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions patches/net/minecraft/world/level/block/NoteBlock.java.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
--- a/net/minecraft/world/level/block/NoteBlock.java
+++ b/net/minecraft/world/level/block/NoteBlock.java
@@ -122,6 +_,9 @@
@@ -121,7 +_,9 @@
@Override
protected InteractionResult useWithoutItem(BlockState p_316441_, Level p_316774_, BlockPos p_316344_, Player p_316884_, BlockHitResult p_316631_) {
if (!p_316774_.isClientSide) {
p_316441_ = p_316441_.cycle(NOTE);
- p_316441_ = p_316441_.cycle(NOTE);
+ int _new = net.neoforged.neoforge.common.CommonHooks.onNoteChange(p_316774_, p_316344_, p_316441_, p_316441_.getValue(NOTE), p_316441_.cycle(NOTE).getValue(NOTE));
+ if (_new == -1) return InteractionResult.FAIL;
+ p_316441_ = p_316441_.setValue(NOTE, _new);
Expand Down

0 comments on commit fe2fc98

Please sign in to comment.