diff --git a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java index 95e711d..81ba631 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/AdvancedPortalsCommand.java @@ -11,6 +11,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.meta.ItemMeta; +import com.sekwah.advancedportals.portalcontrolls.CreatePortal; + public class AdvancedPortalsCommand implements CommandExecutor { private AdvancedPortalsPlugin plugin; @@ -44,6 +46,9 @@ public class AdvancedPortalsCommand implements CommandExecutor { PluginMessages.NoPermission(sender, command); } } + else if(args[0].toLowerCase().equals("create")) { + // CreatePortal.CreatePortal(pos1, pos2); need to get pos 1 and 2 + } else{ PluginMessages.UnknownCommand(sender, command); } diff --git a/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java b/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java index 04dca68..465d1d8 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/DestinationCommand.java @@ -1,14 +1,8 @@ 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 { diff --git a/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java b/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java index 128ca85..b6ab723 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/Listeners.java @@ -55,7 +55,8 @@ public class Listeners implements Listener { player.setMetadata("Pos1X", new FixedMetadataValue(plugin, blockloc.getBlockX())); player.setMetadata("Pos1Y", new FixedMetadataValue(plugin, blockloc.getBlockY())); player.setMetadata("Pos1Z", new FixedMetadataValue(plugin, blockloc.getBlockZ())); - player.sendMessage("§eYou have selected pos1! X:" + blockloc.getBlockX() + " Y:" + blockloc.getBlockY() + " Z:" + blockloc.getBlockZ()); + player.setMetadata("Pos1World", new FixedMetadataValue(plugin, blockloc.getWorld().getName())); + player.sendMessage("§eYou have selected pos1! X:" + blockloc.getBlockX() + " Y:" + blockloc.getBlockY() + " Z:" + blockloc.getBlockZ() + " World:" + blockloc.getWorld().getName()); // Stops the event so the block is not damaged event.setCancelled(true); @@ -67,7 +68,8 @@ public class Listeners implements Listener { player.setMetadata("Pos2X", new FixedMetadataValue(plugin, blockloc.getBlockX())); player.setMetadata("Pos2Y", new FixedMetadataValue(plugin, blockloc.getBlockY())); player.setMetadata("Pos2Z", new FixedMetadataValue(plugin, blockloc.getBlockZ())); - player.sendMessage("§eYou have selected pos2! X:" + blockloc.getBlockX() + " Y:" + blockloc.getBlockY() + " Z:" + blockloc.getBlockZ()); + player.setMetadata("Pos2World", new FixedMetadataValue(plugin, blockloc.getWorld().getName())); + player.sendMessage("§eYou have selected pos2! X:" + blockloc.getBlockX() + " Y:" + blockloc.getBlockY() + " Z:" + blockloc.getBlockZ() + " World:" + blockloc.getWorld().getName()); // Stops the event so the block is not interacted with event.setCancelled(true); diff --git a/Advanced Portals/src/com/sekwah/advancedportals/PluginMessages.java b/Advanced Portals/src/com/sekwah/advancedportals/PluginMessages.java index 61c843b..784ad3f 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/PluginMessages.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/PluginMessages.java @@ -8,9 +8,9 @@ public class PluginMessages { // 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 "); + sender.sendMessage(" "); + sender.sendMessage("§c[§7AdvancedPortals§c] You need to type something after /" + command + "\n"); + sender.sendMessage("§cIf you do not know what you can put or would like some help with the commands please type §e" + '"' + "§e/" + command + " help" + '"' + "§c\n"); } public static void NoPermission(CommandSender sender, String command) { diff --git a/Advanced Portals/src/com/sekwah/advancedportals/portalcontrolls/CreatePortal.java b/Advanced Portals/src/com/sekwah/advancedportals/portalcontrolls/CreatePortal.java index 86df410..2899097 100644 --- a/Advanced Portals/src/com/sekwah/advancedportals/portalcontrolls/CreatePortal.java +++ b/Advanced Portals/src/com/sekwah/advancedportals/portalcontrolls/CreatePortal.java @@ -1,5 +1,17 @@ package com.sekwah.advancedportals.portalcontrolls; -public class CreatePortal { +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +public class CreatePortal { + + public static void CreatePortal(Location pos1, Location pos2) { + if(pos1.getWorld() == pos2.getWorld()) { + // creation code + } + else{ + // code to say they have to be in the same world. + } + } + }