src/main/java/com/viper/PlaceholderSIGN/Main.java aktualisiert
This commit is contained in:
@@ -1,88 +1,88 @@
|
|||||||
package com.viper.PlaceholderSIGN;
|
package com.viper.PlaceholderSIGN;
|
||||||
|
|
||||||
import com.viper.PlaceholderSIGN.command.SignCommand;
|
import com.viper.PlaceholderSIGN.command.SignCommand;
|
||||||
import com.viper.PlaceholderSIGN.handler.SignListener;
|
import com.viper.PlaceholderSIGN.handler.SignListener;
|
||||||
import com.viper.PlaceholderSIGN.sign.SignManager;
|
import com.viper.PlaceholderSIGN.sign.SignManager;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
public static String noperm;
|
public static String noperm;
|
||||||
public static String click;
|
public static String click;
|
||||||
public static String abort;
|
public static String abort;
|
||||||
public static String numbers;
|
public static String numbers;
|
||||||
public static String usage;
|
public static String usage;
|
||||||
public static String update;
|
public static String update;
|
||||||
private static Main instance;
|
private static Main instance;
|
||||||
private static SignManager sm;
|
private static SignManager sm;
|
||||||
private boolean papi = false;
|
private boolean papi = false;
|
||||||
private boolean rgb = true;
|
private boolean rgb = true;
|
||||||
private int signMinimumDistance;
|
private int signMinimumDistance;
|
||||||
private int scrollSign;
|
private int scrollSign;
|
||||||
private int updateInterval;
|
private int updateInterval;
|
||||||
|
|
||||||
public static Main getInstance() {
|
public static Main getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SignManager getPSManager() {
|
public static SignManager getPSManager() {
|
||||||
return sm;
|
return sm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return "3.0.0";
|
return "3.0.0";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPAPI() {
|
public boolean hasPAPI() {
|
||||||
return this.papi;
|
return this.papi;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasRGB() {
|
public boolean hasRGB() {
|
||||||
return this.rgb;
|
return this.rgb;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSignMinimumDistance() {
|
public int getSignMinimumDistance() {
|
||||||
return this.signMinimumDistance;
|
return this.signMinimumDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getScrollSign() {
|
public int getScrollSign() {
|
||||||
return this.scrollSign;
|
return this.scrollSign;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUpdateInterval() {
|
public int getUpdateInterval() {
|
||||||
return this.updateInterval;
|
return this.updateInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
instance = this;
|
instance = this;
|
||||||
getConfig().options().copyDefaults(true);
|
getConfig().options().copyDefaults(true);
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
|
|
||||||
if (!Objects.requireNonNull(getConfig().getString("version")).equals("3.0.0")) {
|
if (!Objects.requireNonNull(getConfig().getString("version")).equals("3.0.0")) {
|
||||||
(new FileUtil()).updateConfig("config.yml");
|
(new FileUtil()).updateConfig("config.yml");
|
||||||
}
|
}
|
||||||
|
|
||||||
noperm = getConfig().getString("no_permission");
|
noperm = getConfig().getString("no_permission");
|
||||||
usage = getConfig().getString("usage_correct");
|
usage = getConfig().getString("usage_correct");
|
||||||
numbers = getConfig().getString("invalid_number");
|
numbers = getConfig().getString("invalid_number");
|
||||||
abort = getConfig().getString("aborted_action");
|
abort = getConfig().getString("aborted_action");
|
||||||
click = getConfig().getString("click_to_edit");
|
click = getConfig().getString("click_to_edit");
|
||||||
update = getConfig().getString("update_message");
|
update = getConfig().getString("update_message");
|
||||||
|
|
||||||
this.papi = Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI");
|
this.papi = Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI");
|
||||||
this.signMinimumDistance = getConfig().getInt("sign-minimum-distance");
|
this.signMinimumDistance = getConfig().getInt("sign-minimum-distance");
|
||||||
this.scrollSign = getConfig().getInt("scroll-time");
|
this.scrollSign = getConfig().getInt("scroll-time");
|
||||||
this.updateInterval = getConfig().getInt("update-interval", 1);
|
this.updateInterval = getConfig().getInt("update-interval", 1);
|
||||||
|
|
||||||
sm = new SignManager();
|
sm = new SignManager();
|
||||||
new SignCommand();
|
new SignCommand();
|
||||||
new SignListener();
|
new SignListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
sm.saveAll();
|
sm.saveAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user