Started the create and destroy files, added permissions and a plugin
messsages file that makes it easier to change all common messages.
This commit is contained in:
parent
18976dd765
commit
4fe85da4bf
|
@ -27,7 +27,7 @@ public class AdvancedPortalsCommand implements CommandExecutor {
|
|||
ConfigAccessor config = new ConfigAccessor(plugin, "Config.yml");
|
||||
if(args.length > 0){
|
||||
if(args[0].toLowerCase().equals("wand") || args[0].toLowerCase().equals("selector")){
|
||||
if(sender.hasPermission("AdvancedPortals.create")){
|
||||
if(sender.hasPermission("AdvancedPortals.CreatePortal")){
|
||||
PlayerInventory inventory = player.getInventory();
|
||||
|
||||
ItemStack regionselector = new ItemStack(Material.IRON_AXE);
|
||||
|
@ -41,9 +41,12 @@ public class AdvancedPortalsCommand implements CommandExecutor {
|
|||
sender.sendMessage("§a[§7AdvancedPortals§a] You have been given a §ePortal Region Selector§a!");
|
||||
}
|
||||
else{
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You do not have permission to create portals so you cannot give yourself a §ePortal Region Selector§c!");
|
||||
PluginMessages.NoPermission(sender, command);
|
||||
}
|
||||
}
|
||||
else{
|
||||
PluginMessages.UnknownCommand(sender, command);
|
||||
}
|
||||
}
|
||||
else{
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You need to type something after /" + command + "\n"
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
package com.sekwah.advancedportals;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class DestinationCommand implements CommandExecutor {
|
||||
|
||||
|
@ -17,8 +23,20 @@ public class DestinationCommand implements CommandExecutor {
|
|||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command cmd, String command, String[] args) {
|
||||
|
||||
|
||||
if(args.length > 0){
|
||||
if(args[0].toLowerCase().equals("create")){
|
||||
if(sender.hasPermission("AdvancedPortals.create")){
|
||||
|
||||
}
|
||||
else{
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You do not have permission to create portals so you cannot give yourself a §ePortal Region Selector§c!");
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You need to type something after /" + command + "\n"
|
||||
+ "if you do not know what you can put or would like some help with the commands please type /" + command + " help");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Listeners implements Listener {
|
|||
// also any other detections such as sign interaction or basic block protection
|
||||
Player player = event.getPlayer();
|
||||
Location blockloc = event.getClickedBlock().getLocation();
|
||||
if(player.hasPermission("AdvancedPortals.create")){
|
||||
if(player.hasPermission("AdvancedPortals.CreatePortal")){
|
||||
|
||||
// UseOnlyServerMadeAxe being set to true makes is so only the axe generated by the server can be used so other iron axes can be used normally,
|
||||
// by default its false but it is a nice feature in case the user wants to use the axe normally too, such as a admin playing survival or it being used
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.sekwah.advancedportals;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class PluginMessages {
|
||||
|
||||
// This class is so then the common messages in commands or just messages over the commands are the same and can be
|
||||
// easily changed.
|
||||
|
||||
public static void UnknownCommand(CommandSender sender, String command) {
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You need to type something after /" + command + "\n"
|
||||
+ "if you do not know what you can put or would like some help with the commands please type " + '"' + "/" + command + " help" + '"' + " or you can check out the Advanced Portals wiki"
|
||||
+ "\n ");
|
||||
}
|
||||
|
||||
public static void NoPermission(CommandSender sender, String command) {
|
||||
sender.sendMessage("§c[§7AdvancedPortals§c] You do not have permission to perform that command!");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sekwah.advancedportals.destinations;
|
||||
|
||||
public class CreateDestination {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sekwah.advancedportals.destinations;
|
||||
|
||||
public class DestroyDestination {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sekwah.advancedportals.portalcontrolls;
|
||||
|
||||
public class CreatePortal {
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.sekwah.advancedportals.portalcontrolls;
|
||||
|
||||
public class DestroyPortal {
|
||||
|
||||
}
|
Loading…
Reference in New Issue