mirror of https://github.com/taoneill/war.git
Literally none of those new features worked
I better test before commit next time :)
This commit is contained in:
parent
64ae4c617f
commit
8bf6d6047d
|
@ -1326,11 +1326,11 @@ public class War extends JavaPlugin {
|
||||||
/**
|
/**
|
||||||
* Convert serialized effect to actual effect.
|
* Convert serialized effect to actual effect.
|
||||||
* @param serializedEffect String stored in configuration.
|
* @param serializedEffect String stored in configuration.
|
||||||
* Format: TYPE:DURATION:AMPLIFY
|
* Format: TYPE;DURATION;AMPLIFY
|
||||||
* @return Potion effect or null otherwise
|
* @return Potion effect or null otherwise
|
||||||
*/
|
*/
|
||||||
public PotionEffect getPotionEffect(String serializedEffect) {
|
public PotionEffect getPotionEffect(String serializedEffect) {
|
||||||
String[] arr = serializedEffect.split(":");
|
String[] arr = serializedEffect.split(";");
|
||||||
if (arr.length != 3) return null;
|
if (arr.length != 3) return null;
|
||||||
try {
|
try {
|
||||||
PotionEffectType type = PotionEffectType.getByName(arr[0]);
|
PotionEffectType type = PotionEffectType.getByName(arr[0]);
|
||||||
|
|
|
@ -453,10 +453,15 @@ public class Warzone {
|
||||||
// clear potion effects
|
// clear potion effects
|
||||||
PotionEffectHelper.clearPotionEffects(player);
|
PotionEffectHelper.clearPotionEffects(player);
|
||||||
|
|
||||||
if (!team.getTeamConfig().getString(TeamConfig.APPLYPOTION).isEmpty()) {
|
String potionEffect = team.getTeamConfig().resolveString(TeamConfig.APPLYPOTION);
|
||||||
PotionEffect effect = War.war.getPotionEffect(team.getTeamConfig().getString(TeamConfig.APPLYPOTION));
|
if (!potionEffect.isEmpty()) {
|
||||||
|
PotionEffect effect = War.war.getPotionEffect(potionEffect);
|
||||||
if (effect != null) {
|
if (effect != null) {
|
||||||
player.addPotionEffect(effect);
|
player.addPotionEffect(effect);
|
||||||
|
} else {
|
||||||
|
War.war.getLogger().log(Level.WARNING,
|
||||||
|
"Failed to apply potion effect {0} in warzone {1}.",
|
||||||
|
new Object[] {potionEffect, name});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class WarPlayerListener implements Listener {
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onPlayerJoin(final PlayerJoinEvent event) {
|
public void onPlayerJoin(final PlayerJoinEvent event) {
|
||||||
String autojoinName = War.war.getWarConfig().getString(WarConfig.AUTOJOIN);
|
String autojoinName = War.war.getWarConfig().getString(WarConfig.AUTOJOIN);
|
||||||
boolean autojoinEnabled = autojoinName.isEmpty();
|
boolean autojoinEnabled = !autojoinName.isEmpty();
|
||||||
if (autojoinEnabled) { // Won't be able to find warzone if unset
|
if (autojoinEnabled) { // Won't be able to find warzone if unset
|
||||||
Warzone autojoinWarzone = Warzone.getZoneByNameExact(autojoinName);
|
Warzone autojoinWarzone = Warzone.getZoneByNameExact(autojoinName);
|
||||||
if (autojoinWarzone == null) {
|
if (autojoinWarzone == null) {
|
||||||
|
|
Loading…
Reference in New Issue