mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2025-02-26 09:11:55 +01:00
Fix CMD sign NPE; resolves #822
This commit is contained in:
parent
3d6781b91b
commit
c7240462c0
@ -18,7 +18,6 @@ package de.erethon.dungeonsxl.sign.windup;
|
|||||||
|
|
||||||
import de.erethon.dungeonsxl.DungeonsXL;
|
import de.erethon.dungeonsxl.DungeonsXL;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@ -31,7 +30,7 @@ public class CommandScript {
|
|||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private File file;
|
private File file;
|
||||||
private List<String> commands = new ArrayList<>();
|
private List<String> commands;
|
||||||
|
|
||||||
public CommandScript(String name, List<String> commands, Permission permission) {
|
public CommandScript(String name, List<String> commands, Permission permission) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
@ -45,10 +44,7 @@ public class CommandScript {
|
|||||||
|
|
||||||
name = file.getName().replace(".yml", "");
|
name = file.getName().replace(".yml", "");
|
||||||
this.file = file;
|
this.file = file;
|
||||||
|
setCommands(config.getStringList("commands"));
|
||||||
if (config.getStringList("commands") != null) {
|
|
||||||
setCommands(config.getStringList("commands"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -86,6 +86,7 @@ public class CommandSign extends Windup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
script = ((DungeonsXL) api).getCommandScriptRegistry().get(getLine(1));
|
||||||
String[] attributes = getLine(2).split(",");
|
String[] attributes = getLine(2).split(",");
|
||||||
|
|
||||||
if (attributes.length == 3) {
|
if (attributes.length == 3) {
|
||||||
|
Loading…
Reference in New Issue
Block a user