-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be4ead9
commit a22c0c5
Showing
17 changed files
with
88 additions
and
13 deletions.
There are no files selected for viewing
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,4 @@ | ||
[InternetShortcut] | ||
https://freesound.org/people/qubodup/sounds/442677/ | ||
|
||
Used for primordial fire ambient sounds |
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,4 @@ | ||
[InternetShortcut] | ||
https://freesound.org/people/qubodup/sounds/739487/ | ||
|
||
Used for primordial fire ambient sounds |
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,4 @@ | ||
[InternetShortcut] | ||
https://freesound.org/people/GregorQuendel/sounds/671309/ | ||
|
||
Used for primordial fire ambient sounds |
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,4 @@ | ||
[InternetShortcut] | ||
https://freesound.org/people/GregorQuendel/sounds/421879/ | ||
|
||
Used for primordial fire ambient sounds |
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,4 @@ | ||
[InternetShortcut] | ||
https://freesound.org/people/GregorQuendel/sounds/671311/ | ||
|
||
Used for primordial fire ambient sounds |
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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/de/dafuqs/spectrum/sound/OnPrimordialFireSoundInstance.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,37 @@ | ||
package de.dafuqs.spectrum.sound; | ||
|
||
import de.dafuqs.spectrum.cca.*; | ||
import de.dafuqs.spectrum.registries.*; | ||
import net.minecraft.client.sound.*; | ||
import net.minecraft.entity.player.*; | ||
import net.minecraft.sound.*; | ||
import net.minecraft.util.math.*; | ||
|
||
public class OnPrimordialFireSoundInstance extends AbstractSoundInstance implements TickableSoundInstance { | ||
|
||
private final PlayerEntity player; | ||
private int fadeInTicks; | ||
|
||
public OnPrimordialFireSoundInstance(PlayerEntity player) { | ||
super(SpectrumSoundEvents.PRIMORDIAL_FIRE_DOT, SoundCategory.PLAYERS, player.getRandom()); | ||
this.repeat = true; | ||
this.repeatDelay = 0; | ||
this.volume = 0.05F; | ||
this.player = player; | ||
this.relative = true; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
if (player != null) { | ||
this.pitch = (float) (1 + Math.sin(player.age % 240000 / (Math.E * 100)) / 5); | ||
} | ||
this.volume = MathHelper.clampedLerp(0.05F, 0.92F, fadeInTicks / 20F); | ||
fadeInTicks++; | ||
} | ||
|
||
@Override | ||
public boolean isDone() { | ||
return player == null || !OnPrimordialFireComponent.isOnPrimordialFire(player); | ||
} | ||
} |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.