diff --git a/Advanced Portals/src/Config.yml b/Advanced Portals/src/Config.yml index 87f77a6d..f44e38da 100644 --- a/Advanced Portals/src/Config.yml +++ b/Advanced Portals/src/Config.yml @@ -5,4 +5,4 @@ # Set to true if you want the normal axes to work normally but the ones gived with /portals selector or wand will still work though -UseOnlyServerMadeAxe: false \ No newline at end of file +UseOnlyServerMadeAxe: false diff --git a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java index ffbb5cc3..3fa25a53 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java @@ -17,6 +17,8 @@ public class AdvancedPortalsCommand implements CommandExecutor { public AdvancedPortalsCommand(AdvancedPortalsPlugin plugin) { this.plugin = plugin; + + plugin.getCommand("advancedportals").setExecutor(this); } @Override @@ -28,14 +30,14 @@ public class AdvancedPortalsCommand implements CommandExecutor { if(sender.hasPermission("AdvancedPortals.create")){ PlayerInventory inventory = player.getInventory(); - ItemStack shopitem = new ItemStack(Material.IRON_AXE); - ItemMeta shopname = shopitem.getItemMeta(); - shopname.setDisplayName("§ePortal Region Selector"); - shopname.setLore(Arrays.asList("§rThis iron axe with has the power to help" + ItemStack regionselector = new ItemStack(Material.IRON_AXE); + ItemMeta selectorname = regionselector.getItemMeta(); + selectorname.setDisplayName("§ePortal Region Selector"); + selectorname.setLore(Arrays.asList("§rThis iron axe with has the power to help" , "§r create portals bistowed upon it!")); - shopitem.setItemMeta(shopname); + regionselector.setItemMeta(selectorname); - inventory.addItem(shopitem); + inventory.addItem(regionselector); sender.sendMessage("§a[§7AdvancedPortals§a] You have been given a §ePortal Region Selector§a!"); } else{ diff --git a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java index d08fd5d6..50baff50 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsPlugin.java @@ -1,7 +1,5 @@ package com.sekwah.advancedportals; -import java.io.File; - import org.bukkit.plugin.java.JavaPlugin; public class AdvancedPortalsPlugin extends JavaPlugin { @@ -13,7 +11,12 @@ public class AdvancedPortalsPlugin extends JavaPlugin { ConfigAccessor config = new ConfigAccessor(this, "Config.yml"); config.saveDefaultConfig(); - getCommand("advancedportals").setExecutor(new AdvancedPortalsCommand(this)); + + // These register the commands + new AdvancedPortalsCommand(this); + new DestinationCommand(this); + + // These register the listeners new Listeners(this); this.getServer().getConsoleSender().sendMessage("§aAdvanced portals have been sucsessfully enabled!"); diff --git a/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java b/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java new file mode 100644 index 00000000..2b7d7395 --- /dev/null +++ b/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java @@ -0,0 +1,26 @@ +package com.sekwah.advancedportals; + +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; + +public class DestinationCommand implements CommandExecutor { + + private AdvancedPortalsPlugin plugin; + + public DestinationCommand(AdvancedPortalsPlugin plugin) { + this.plugin = plugin; + + plugin.getCommand("destination").setExecutor(this); + } + + + @Override + public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) { + + + return true; + } + + +} diff --git a/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java b/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java index b9039ae8..a9ae078e 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java @@ -1,7 +1,5 @@ package com.sekwah.advancedportals; -import java.io.File; - import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -22,8 +20,10 @@ public class Listeners implements Listener { public Listeners(AdvancedPortalsPlugin plugin) { this.plugin = plugin; + ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml"); this.UseOnlyServerAxe = config.getConfig().getBoolean("UseOnlyServerMadeAxe"); + plugin.getServer().getPluginManager().registerEvents(this, plugin); } diff --git a/Advanced Portals/src/plugin.yml b/Advanced Portals/src/plugin.yml index e97e45d5..d93021ff 100644 --- a/Advanced Portals/src/plugin.yml +++ b/Advanced Portals/src/plugin.yml @@ -7,4 +7,8 @@ commands: advancedportals: description: The main command for the advanced portals aliases: [portals, aportals] - usage: / \ No newline at end of file + usage: / + destination: + description: Can be used to access portal destinations. + aliases: [desti] + usage: /