-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher White <[email protected]>
- Loading branch information
1 parent
87278fe
commit e61683f
Showing
3 changed files
with
80 additions
and
0 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
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,38 @@ | ||
package tc.oc.pgm.action; | ||
|
||
public enum SoundType { | ||
CUSTOM("note.pling", 1f, 1f), | ||
TIP("mob.endermen.idle", 1f, 1.2f), | ||
ALERT("note.pling", 1f, 2f), | ||
PORTAL("mob.endermen.portal", 1f, 1f), | ||
SCORE("random.levelup", 1f, 1f), | ||
OBJECTIVE_FIREWORKS_FAR("fireworks.blast_far", 0.75f, 1f), | ||
OBJECTIVE_FIREWORKS_TWINKLE("fireworks.twinkle_far", 0.75f, 1f), | ||
OBJECTIVE_GOOD("portal.travel", 0.7f, 2f), | ||
OBJECTIVE_BAD("mob.blaze.death", 0.8f, 0.8f), | ||
OBJECTIVE_MODE("mob.zombie.remedy", 0.15f, 1.2f), | ||
DEATH_OWN("mob.irongolem.death", 1f, 1f), | ||
DEATH_OTHER("mob.irongolem.hit", 1f, 1f); | ||
|
||
private final String resource; | ||
private final float volume; | ||
private final float pitch; | ||
|
||
SoundType(String resource, float volume, float pitch) { | ||
this.resource = resource; | ||
this.volume = volume; | ||
this.pitch = pitch; | ||
} | ||
|
||
public String getResource() { | ||
return resource; | ||
} | ||
|
||
public float getVolume() { | ||
return volume; | ||
} | ||
|
||
public float getPitch() { | ||
return pitch; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
core/src/main/java/tc/oc/pgm/action/actions/SoundAction.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,18 @@ | ||
package tc.oc.pgm.action.actions; | ||
|
||
import net.kyori.adventure.sound.Sound; | ||
import tc.oc.pgm.util.Audience; | ||
|
||
public class SoundAction extends AbstractAction<Audience> { | ||
private final Sound sound; | ||
|
||
public SoundAction(Sound sound) { | ||
super(Audience.class); | ||
this.sound = sound; | ||
} | ||
|
||
@Override | ||
public void trigger(Audience audience) { | ||
audience.playSound(sound); | ||
} | ||
} |