Skip to content

Commit

Permalink
Fix dancing bug.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Feb 23, 2024
1 parent 2e84091 commit c79eb0b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@

@Mixin(LivingEntity.class)
public abstract class LivingEntityMixin {
@Inject(method = "setNearbySongPlaying", at = @At("HEAD"))
private void beforeSetNearbySongPlaying(BlockPos songPosition, boolean playing, CallbackInfo ci) {
@Inject(method = "setNearbySongPlaying", at = @At("TAIL"))
private void afterSetNearbySongPlaying(BlockPos songPosition, boolean playing, CallbackInfo ci) {
if ((Object) this instanceof CatEntity cat) {
var geniusCat = CatsPlusData.getGeniusCat(cat);
geniusCat.songStartPlay(songPosition);

if (playing) {
geniusCat.songStartPlay(songPosition);
} else {
geniusCat.songStopPlay();
}
}
}
}

0 comments on commit c79eb0b

Please sign in to comment.