-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed bubble column sound playing in freecam
- Added some comments
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/net/xolt/freecam/mixins/BubbleColumnSoundPlayerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.xolt.freecam.mixins; | ||
|
||
import net.minecraft.client.network.ClientPlayerEntity; | ||
import net.minecraft.client.sound.BubbleColumnSoundPlayer; | ||
import net.xolt.freecam.util.FreeCamera; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(BubbleColumnSoundPlayer.class) | ||
public class BubbleColumnSoundPlayerMixin { | ||
|
||
@Shadow | ||
@Final | ||
private ClientPlayerEntity player; | ||
|
||
// Prevent bubble column sound in freecam | ||
@Inject(method = "tick", at = @At("HEAD"), cancellable = true) | ||
private void onTick(CallbackInfo ci) { | ||
if (player instanceof FreeCamera) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters