mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-02-27 09:42:26 +01:00
updated config location and also fixed another bug
This commit is contained in:
parent
9adfc2e58b
commit
15bc1f0c44
@ -36,7 +36,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
if(sender.hasPermission("advancedportals.portal")){
|
||||
if(args.length > 0){
|
||||
if(args[0].toLowerCase().equals("wand") || args[0].toLowerCase().equals("selector")){
|
||||
@ -188,7 +188,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
else{
|
||||
hasTriggerBlock = false;
|
||||
ConfigAccessor Config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
||||
player.sendMessage("\u00A7ctriggerBlock: \u00A7edefault(" + Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
||||
|
||||
player.sendMessage("\u00A7cThe block " + triggerBlock.toUpperCase() + " is not a valid block name in minecraft so the trigger block has been set to the default!");
|
||||
@ -198,7 +198,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
}
|
||||
else{
|
||||
ConfigAccessor Config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
||||
player.sendMessage("\u00A7atriggerBlock: \u00A7edefault(" + Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
||||
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
||||
portalArgs = extraData.toArray(portalArgs);
|
||||
|
@ -51,27 +51,27 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
new Assets(this);
|
||||
|
||||
// Opens a channel that messages bungeeCord
|
||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
|
||||
saveDefaultConfig();
|
||||
|
||||
// thanks to the new config accessor code the config.saveDefaultConfig(); will now
|
||||
// only copy the file if it doesnt exist!
|
||||
ConfigAccessor config = new ConfigAccessor(this, "Config.yml");
|
||||
config.saveDefaultConfig();
|
||||
ConfigAccessor config = new ConfigAccessor(this, "config.yml");
|
||||
|
||||
this.useCustomPrefix = config.getConfig().getBoolean("UseCustomPrefix");
|
||||
if(useCustomPrefix){
|
||||
this.customPrefix = config.getConfig().getString("CustomPrefix");
|
||||
}
|
||||
|
||||
ConfigAccessor portalConfig = new ConfigAccessor(this, "Portals.yml");
|
||||
portalConfig.saveDefaultConfig();
|
||||
|
||||
ConfigAccessor destinationConfig = new ConfigAccessor(this, "Destinations.yml");
|
||||
destinationConfig.saveDefaultConfig();
|
||||
ConfigAccessor portalConfig = new ConfigAccessor(this, "Portals.yml");
|
||||
portalConfig.saveDefaultConfig();
|
||||
|
||||
ConfigAccessor destinationConfig = new ConfigAccessor(this, "Destinations.yml");
|
||||
destinationConfig.saveDefaultConfig();
|
||||
|
||||
new Assets(this);
|
||||
|
||||
// Opens a channel that messages bungeeCord
|
||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
|
||||
// Loads the portal and destination editors
|
||||
new Portal(this);
|
||||
|
@ -7,7 +7,7 @@ public class Assets {
|
||||
public static int currentWarpSound = 0;
|
||||
|
||||
public Assets(AdvancedPortalsPlugin plugin) {
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
currentWarpParticles = config.getConfig().getInt("WarpParticles");
|
||||
currentWarpSound = config.getConfig().getInt("WarpSound");
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class DestinationCommand implements CommandExecutor, TabCompleter {
|
||||
|
||||
plugin.getCommand("destination").setExecutor(this);
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
|
||||
PortalMessagesDisplay = config.getConfig().getInt("WarpMessageDisplay");
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class FlowStopper implements Listener {
|
||||
public FlowStopper(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
this.WaterFlow = config.getConfig().getBoolean("StopWaterFlow");
|
||||
|
||||
if(WaterFlow){
|
||||
|
@ -39,7 +39,7 @@ public class Listeners implements Listener {
|
||||
public Listeners(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
UseOnlyServerAxe = config.getConfig().getBoolean("UseOnlyServerMadeAxe");
|
||||
|
||||
String ItemID = config.getConfig().getString("AxeItemId");
|
||||
@ -61,7 +61,7 @@ public class Listeners implements Listener {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void reloadValues(AdvancedPortalsPlugin plugin) {
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
UseOnlyServerAxe = config.getConfig().getBoolean("UseOnlyServerMadeAxe");
|
||||
|
||||
ShowBungeeMessage = config.getConfig().getBoolean("ShowBungeeWarpMessage");
|
||||
@ -139,7 +139,9 @@ public class Listeners implements Listener {
|
||||
player.setMetadata("hasWarped", new FixedMetadataValue(plugin, true));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
public void run(){
|
||||
finalplayer.removeMetadata("hasWarped", plugin);
|
||||
if(finalplayer != null && finalplayer.isOnline()){
|
||||
finalplayer.removeMetadata("hasWarped", plugin);
|
||||
}
|
||||
}
|
||||
}, 10);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class PortalPlacer implements Listener {
|
||||
public PortalPlacer(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
this.PortalPlace = config.getConfig().getBoolean("CanBuildPortalBlock");
|
||||
|
||||
this.PortalProtectionRadius = config.getConfig().getDouble("PortalProtectionRadius");
|
||||
|
@ -26,7 +26,7 @@ public class PortalProtect implements Listener {
|
||||
public PortalProtect(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
this.PortalProtect = config.getConfig().getBoolean("PortalProtection");
|
||||
|
||||
this.PortalProtectionRadius = config.getConfig().getDouble("PortalProtectionRadius");
|
||||
|
@ -13,7 +13,7 @@ public class Selection {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void LoadData(AdvancedPortalsPlugin plugin) {
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
|
||||
timeout = config.getConfig().getInt("ShowSelectionShowDuration");
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class WarpCommand implements CommandExecutor, TabCompleter {
|
||||
this.plugin = plugin;
|
||||
|
||||
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
boolean useWarpCommand = !config.getConfig().getBoolean("DisableWarpCommand");
|
||||
//plugin.getCommand("warp").setExecutor(this);
|
||||
plugin.getCommand("awarp").setExecutor(this);
|
||||
|
@ -30,7 +30,7 @@ public class Portal {
|
||||
public static ConfigAccessor portalData = new ConfigAccessor(plugin, "Portals.yml");
|
||||
|
||||
public Portal(AdvancedPortalsPlugin plugin) {
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
ShowBungeeMessage = config.getConfig().getBoolean("ShowBungeeWarpMessage");
|
||||
|
||||
Portal.plugin = plugin;
|
||||
@ -249,7 +249,7 @@ public class Portal {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String create(Location pos1, Location pos2, String name, String destination, String serverName, PortalArg... extraData) { // add stuff for destination names or coordinates
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
|
||||
Material triggerBlockType;
|
||||
String BlockID = config.getConfig().getString("DefaultPortalTriggerBlock");
|
||||
|
@ -1,6 +1,6 @@
|
||||
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
|
||||
name: AdvancedPortals
|
||||
version: 0.0.13
|
||||
version: 0.0.14
|
||||
author: SEKWAH41
|
||||
description: An advanced portals plugin for bukkit.
|
||||
commands:
|
||||
|
Loading…
Reference in New Issue
Block a user