|
5 | 5 | import java.util.List;
|
6 | 6 |
|
7 | 7 | import net.minecraft.client.Minecraft;
|
8 |
| -import net.minecraft.client.audio.PositionedSoundRecord; |
| 8 | +import net.minecraft.client.audio.PositionedSound; |
9 | 9 | import net.minecraft.item.ItemStack;
|
10 | 10 | import net.minecraft.util.EnumChatFormatting;
|
11 | 11 | import net.minecraft.util.MathHelper;
|
|
14 | 14 |
|
15 | 15 | import org.lwjgl.opengl.GL11;
|
16 | 16 |
|
| 17 | +import betterquesting.api.properties.NativeProps; |
17 | 18 | import betterquesting.api.storage.BQ_Settings;
|
18 | 19 | import betterquesting.api.utils.RenderUtils;
|
19 | 20 | import betterquesting.api2.utils.QuestTranslation;
|
@@ -58,8 +59,10 @@ public void onDrawScreen(RenderGameOverlayEvent.Post event) {
|
58 | 59 | }
|
59 | 60 | notice.init = true;
|
60 | 61 | notice.startTime = Minecraft.getSystemTime();
|
| 62 | + // lower volume for default xp jingle, standard volume for custom sounds |
| 63 | + float volume = notice.sound.equals(NativeProps.SOUND_COMPLETE.getDefault()) ? 0.25f : 1f; |
61 | 64 | mc.getSoundHandler()
|
62 |
| - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation(notice.sound), 1.0F)); |
| 65 | + .playSound(new QuestCompleteSound(new ResourceLocation(notice.sound), volume)); |
63 | 66 | }
|
64 | 67 |
|
65 | 68 | if (notice.getTime() >= 6F) {
|
@@ -123,4 +126,18 @@ public float getTime() {
|
123 | 126 | }
|
124 | 127 | }
|
125 | 128 |
|
| 129 | + public static class QuestCompleteSound extends PositionedSound { |
| 130 | + |
| 131 | + public QuestCompleteSound(ResourceLocation resource, float volume) { |
| 132 | + super(resource); |
| 133 | + this.volume = volume; |
| 134 | + this.field_147663_c = 1; // Pitch |
| 135 | + this.xPosF = 0; |
| 136 | + this.yPosF = 0; |
| 137 | + this.zPosF = 0; |
| 138 | + this.repeat = false; |
| 139 | + this.field_147665_h = 0; // Repeat time |
| 140 | + this.field_147666_i = AttenuationType.NONE; |
| 141 | + } |
| 142 | + } |
126 | 143 | }
|
0 commit comments