mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2026-01-04 15:31:38 +00:00
Allow playing custom sounds on discovery
This commit is contained in:
@@ -46,7 +46,7 @@ public class ConfiguredRegion {
|
||||
private String id;
|
||||
private String customName;
|
||||
private final List<DiscoveryReward> rewards;
|
||||
@NeedsGUI private Sound sound;
|
||||
@NeedsGUI private String soundName;
|
||||
private String icon;
|
||||
private int iconModel;
|
||||
private int undiscoveredIconModel;
|
||||
@@ -89,7 +89,7 @@ public class ConfiguredRegion {
|
||||
this.id = id;
|
||||
this.customName = customName;
|
||||
this.rewards = rewards;
|
||||
this.sound = Sound.UI_TOAST_CHALLENGE_COMPLETE;
|
||||
this.soundName = Sound.UI_TOAST_CHALLENGE_COMPLETE.name();
|
||||
Optional<Material> defaultIcon = Optional.of(Material.valueOf(RPGRegionsAPI.getAPI().getConfig().getString("settings.server.gui.default_region_icon")));
|
||||
this.icon = defaultIcon.map(Enum::name).orElseGet(Material.TOTEM_OF_UNDYING::name);
|
||||
this.undiscoveredIcon = defaultIcon.map(Enum::name).orElseGet(Material.TOTEM_OF_UNDYING::name);
|
||||
@@ -116,7 +116,7 @@ public class ConfiguredRegion {
|
||||
public ConfiguredRegion(@Nullable World world, String id, String customName,
|
||||
List<DiscoveryReward> rewards, List<RegionEffect> effects, Sound sound, Material icon) {
|
||||
this(world, id, customName, rewards, effects);
|
||||
this.sound = sound;
|
||||
this.soundName = sound.name();
|
||||
this.icon = icon.name();
|
||||
}
|
||||
|
||||
@@ -142,8 +142,8 @@ public class ConfiguredRegion {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Sound getSound() {
|
||||
return sound;
|
||||
public String getSoundName() {
|
||||
return soundName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user