Started the destination command

This commit is contained in:
sekwah41 2013-10-09 20:31:16 +01:00
parent 78ba57b841
commit 18976dd765
6 changed files with 48 additions and 13 deletions

View File

@ -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
UseOnlyServerMadeAxe: false

View File

@ -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{

View File

@ -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!");

View File

@ -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;
}
}

View File

@ -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);
}

View File

@ -7,4 +7,8 @@ commands:
advancedportals:
description: The main command for the advanced portals
aliases: [portals, aportals]
usage: /<command>
usage: /<command>
destination:
description: Can be used to access portal destinations.
aliases: [desti]
usage: /<command>