Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sj-hub9796 committed Nov 9, 2024
1 parent 66cf22f commit 1e60c88
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions patches/minecraft/net/minecraft/world/item/RecordItem.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,27 @@
}

public InteractionResult useOn(UseOnContext p_43048_) {
@@ -42,6 +_,7 @@
if (blockstate.is(Blocks.JUKEBOX) && !blockstate.getValue(JukeboxBlock.HAS_RECORD)) {
@@ -43,6 +_,10 @@
ItemStack itemstack = p_43048_.getItemInHand();
if (!level.isClientSide) {
+ if (true) return InteractionResult.SUCCESS; // CraftBukkit - handled in ItemStack
Player player = p_43048_.getPlayer();
+ if (player != null) {
+ player.awardStat(Stats.PLAY_RECORD);
+ }
+ if (true) return InteractionResult.SUCCESS; // CraftBukkit - handled in ItemStack
BlockEntity blockentity = level.getBlockEntity(blockpos);
if (blockentity instanceof JukeboxBlockEntity) {
JukeboxBlockEntity jukeboxblockentity = (JukeboxBlockEntity)blockentity;
@@ -51,9 +_,6 @@
}

itemstack.shrink(1);
- if (player != null) {
- player.awardStat(Stats.PLAY_RECORD);
- }
}

return InteractionResult.sidedSuccess(level.isClientSide);
@@ -80,7 +_,7 @@
}

Expand Down

0 comments on commit 1e60c88

Please sign in to comment.