Still unfinished code in most areas but i have updated the position

logger and started coding the portal creator and editors in a way that
other plugins will be able to acess and controll it once its done.
This commit is contained in:
sekwah41 2013-10-09 22:42:03 +01:00
parent 4fe85da4bf
commit 4aca087656
5 changed files with 25 additions and 12 deletions

View File

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

View File

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

View File

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

View File

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

View File

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