Made it so the plugin doesn't crash if the config is messed up
This commit is contained in:
@@ -42,8 +42,11 @@ public class ParticleConfig extends AbstractConfig {
|
||||
ConfigurationSection cs = particles.getConfigurationSection(key);
|
||||
if (cs == null)
|
||||
continue;
|
||||
APartType aPartType = APartType.valueOf(cs.getString("part-type"));
|
||||
ParticleSet particleSet = new ParticleSet(
|
||||
APartType aPartType;
|
||||
ParticleSet particleSet;
|
||||
try {
|
||||
aPartType = APartType.valueOf(cs.getString("part-type"));
|
||||
particleSet = new ParticleSet(
|
||||
getAParticle(cs),
|
||||
cs.getInt("frame-delay"),
|
||||
cs.getInt("repeat"),
|
||||
@@ -52,6 +55,10 @@ public class ParticleConfig extends AbstractConfig {
|
||||
cs.getString("unique-name"),
|
||||
cs.getString("permission"),
|
||||
new ItemStack(Material.valueOf(cs.getString("material"))));
|
||||
} catch (Exception e) {//Im lazy rn sorry
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
ParticleStorage.addParticleSet(aPartType, particleSet);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user