-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plane sound config #7437
base: main
Are you sure you want to change the base?
Plane sound config #7437
Conversation
@Redirect(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/SoundType;getVolume()F")) | ||
private float modifyVolume(SoundType instance, BlockPlaceContext context) { | ||
if (context.getPlayer() instanceof FakePlayer | ||
&& context.getPlayer().getGameProfile().getName().equals("[AE2]")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather compare the profile UIID than the name here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you guys use a special UUID for the AE2 fakeplayer? My goal was to limit the effect of this volume control to just AE2 fakeplayer events.
private float modifyVolume(SoundType instance, BlockPlaceContext context) { | ||
if (context.getPlayer() instanceof FakePlayer | ||
&& context.getPlayer().getGameProfile().getName().equals("[AE2]")) { | ||
return ((float) AEConfig.instance().getPlaneVolumeLevel()) - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to look up what the volume actually means in this case, and why you are subtracting 1 :-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am new to mixins. The argument I am modifying is in the following line and they add 1.
level.playSound(player, blockPos, this.getPlaceSound(blockState2), SoundSource.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F);
@@ -703,6 +711,7 @@ public CommonConfig(ConfigSection root) { | |||
|
|||
ConfigSection automation = root.subsection("automation"); | |||
formationPlaneEntityLimit = automation.addInt("formationPlaneEntityLimit", 128); | |||
planeVolumeLevel = automation.addDouble("planeVolumeLevel", 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the volume really 0 and has no min/max? It should have a description to say what it is and reduce the volume by default vs. what it is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going off of the original feedback from @Technici4n who suggested a value from 0 to 1. I could see the argument for either, just let me know. I will look into adding a description though.
Resolves #6440