Fix SoundGroup preventing the plugin from loading
This commit is contained in:
parent
17a53e22e4
commit
84f48b0346
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
<!-- A good example on why temporary names for project identification shouldn't be used -->
|
<!-- A good example on why temporary names for project identification shouldn't be used -->
|
||||||
<groupId>LibsDisguises</groupId>
|
<groupId>LibsDisguises</groupId>
|
||||||
<artifactId>LibsDisguises</artifactId>
|
<artifactId>LibsDisguises</artifactId>
|
||||||
<version>10.0.11</version>
|
<version>10.0.11-SNAPSHOT</version>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>exec:java clean install</defaultGoal>
|
<defaultGoal>exec:java clean install</defaultGoal>
|
||||||
|
@ -286,13 +286,13 @@ public class DisguiseConfig {
|
|||||||
updaterTask = Bukkit.getScheduler().runTaskTimer(LibsDisguises.getInstance(), new Runnable() {
|
updaterTask = Bukkit.getScheduler().runTaskTimer(LibsDisguises.getInstance(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (Set<TargetedDisguise> disguises : DisguiseUtilities.getDisguises().values()){
|
for (Set<TargetedDisguise> disguises : DisguiseUtilities.getDisguises().values()) {
|
||||||
for (Disguise disguise : disguises) {
|
for (Disguise disguise : disguises) {
|
||||||
disguise.getWatcher().setSprinting(true);
|
disguise.getWatcher().setSprinting(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, TimeUnit.HOURS.toSeconds(1)*20, (20 * TimeUnit.MINUTES.toSeconds(10)));
|
}, TimeUnit.HOURS.toSeconds(1) * 20, (20 * TimeUnit.MINUTES.toSeconds(10)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updaterTask == null != startTask) {
|
if (updaterTask == null != startTask) {
|
||||||
@ -968,14 +968,18 @@ public class DisguiseConfig {
|
|||||||
try {
|
try {
|
||||||
addCustomDisguise(key, toParse);
|
addCustomDisguise(key, toParse);
|
||||||
}
|
}
|
||||||
catch (DisguiseParseException e) {
|
catch (Exception e) {
|
||||||
failedCustomDisguises++;
|
failedCustomDisguises++;
|
||||||
|
|
||||||
if (e.getMessage() != null) {
|
if (e instanceof DisguiseParseException) {
|
||||||
DisguiseUtilities.getLogger().severe(e.getMessage());
|
if (e.getMessage() != null) {
|
||||||
}
|
DisguiseUtilities.getLogger().severe(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
if (e.getCause() != null) {
|
if (e.getCause() != null) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,17 +120,16 @@ public class LibsDisguises extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReflectionManager.init();
|
ReflectionManager.init();
|
||||||
new SoundManager().load();
|
|
||||||
|
|
||||||
PacketsManager.init();
|
PacketsManager.init();
|
||||||
DisguiseUtilities.init();
|
DisguiseUtilities.init();
|
||||||
|
|
||||||
ReflectionManager.registerValues();
|
ReflectionManager.registerValues();
|
||||||
|
DisguiseParser.createDefaultMethods();
|
||||||
|
new SoundManager().load();
|
||||||
|
|
||||||
DisguiseConfig.loadConfig();
|
DisguiseConfig.loadConfig();
|
||||||
|
|
||||||
DisguiseParser.createDefaultMethods();
|
|
||||||
|
|
||||||
PacketsManager.addPacketListeners();
|
PacketsManager.addPacketListeners();
|
||||||
|
|
||||||
listener = new DisguiseListener(this);
|
listener = new DisguiseListener(this);
|
||||||
|
@ -91,7 +91,8 @@ public class ParamInfoManager {
|
|||||||
ParamInfoTypes infoTypes = new ParamInfoTypes();
|
ParamInfoTypes infoTypes = new ParamInfoTypes();
|
||||||
paramList = infoTypes.getParamInfos();
|
paramList = infoTypes.getParamInfos();
|
||||||
paramInfoItemBlock = infoTypes.getParamInfoBlock();
|
paramInfoItemBlock = infoTypes.getParamInfoBlock();
|
||||||
paramInfoSoundGroup = infoTypes.getParamInfoSoundGroup();
|
paramInfoSoundGroup = (ParamInfoSoundGroup) paramList.stream().filter(p -> p instanceof ParamInfoSoundGroup)
|
||||||
|
.findAny().orElse(null);
|
||||||
disguiseMethods = new DisguiseMethods();
|
disguiseMethods = new DisguiseMethods();
|
||||||
|
|
||||||
//paramList.sort((o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()));
|
//paramList.sort((o1, o2) -> String.CASE_INSENSITIVE_ORDER.compare(o1.getName(), o2.getName()));
|
||||||
|
@ -134,7 +134,7 @@ public class ParamInfoTypes {
|
|||||||
paramInfos.add(new ParamInfoInteger("Number", "A whole number without decimals"));
|
paramInfos.add(new ParamInfoInteger("Number", "A whole number without decimals"));
|
||||||
paramInfos.add(new ParamInfoFloat("Number.0", "A number which can have decimal places"));
|
paramInfos.add(new ParamInfoFloat("Number.0", "A number which can have decimal places"));
|
||||||
paramInfos.add(new ParamInfoDouble("Number.0", "A number which can have decimal places"));
|
paramInfos.add(new ParamInfoDouble("Number.0", "A number which can have decimal places"));
|
||||||
paramInfos.add(getParamInfoSoundGroup());
|
paramInfos.add(new ParamInfoSoundGroup());
|
||||||
|
|
||||||
return paramInfos;
|
return paramInfos;
|
||||||
}
|
}
|
||||||
|
@ -19,14 +19,14 @@ public class ParamInfoSoundGroup extends ParamInfoEnum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void recalculate() {
|
public void recalculate() {
|
||||||
LinkedHashMap<String, Object> possibleSoundGroups = new LinkedHashMap<>();
|
LinkedHashMap<String, String> possibleSoundGroups = new LinkedHashMap<>();
|
||||||
|
|
||||||
ArrayList<String> list = new ArrayList<>(SoundGroup.getGroups().keySet());
|
ArrayList<String> list = new ArrayList<>(SoundGroup.getGroups().keySet());
|
||||||
|
|
||||||
list.sort(String.CASE_INSENSITIVE_ORDER);
|
list.sort(String.CASE_INSENSITIVE_ORDER);
|
||||||
|
|
||||||
for (String s : list) {
|
for (String s : list) {
|
||||||
possibleSoundGroups.put(s, SoundGroup.getGroup(s));
|
possibleSoundGroups.put(s, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
getValues().clear();
|
getValues().clear();
|
||||||
|
@ -3,6 +3,7 @@ package me.libraryaddict.disguise.utilities.sounds;
|
|||||||
import me.libraryaddict.disguise.LibsDisguises;
|
import me.libraryaddict.disguise.LibsDisguises;
|
||||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||||
import me.libraryaddict.disguise.utilities.params.ParamInfoManager;
|
import me.libraryaddict.disguise.utilities.params.ParamInfoManager;
|
||||||
|
import me.libraryaddict.disguise.utilities.params.ParamInfoTypes;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@ -18,8 +19,10 @@ import java.util.stream.Collectors;
|
|||||||
public class SoundManager {
|
public class SoundManager {
|
||||||
public void load() {
|
public void load() {
|
||||||
SoundGroup.getGroups().clear();
|
SoundGroup.getGroups().clear();
|
||||||
|
|
||||||
loadSounds();
|
loadSounds();
|
||||||
loadCustomSounds();
|
loadCustomSounds();
|
||||||
|
|
||||||
ParamInfoManager.getParamInfoSoundGroup().recalculate();
|
ParamInfoManager.getParamInfoSoundGroup().recalculate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user