Skip to content

Commit

Permalink
Problem causing all the portals to stop working has been solved
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed Apr 11, 2015
1 parent 6318716 commit 7f6f6cd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
14 changes: 10 additions & 4 deletions src/com/sekwah/advancedportals/AdvancedPortalsCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ else if(args[i].toLowerCase().startsWith("bungee:") && args[i].length() > 7){ //
else if(args[i].toLowerCase().startsWith("permission:") && args[i].length() > 11){ // not completely implemented
needsPermission = true;
permission = args[i].toLowerCase().replaceFirst("permission:", "");
extraData.add(new PortalArg("permission", serverName));
extraData.add(new PortalArg("permission", permission));
}
}
if(!hasName){
Expand Down Expand Up @@ -161,21 +161,27 @@ else if(destiPosX == null){
triggerBlockMat = Material.getMaterial(triggerBlock.toUpperCase());
if(triggerBlockMat != null){
player.sendMessage("\u00A7atriggerBlock: \u00A7e" + triggerBlock.toUpperCase());
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, triggerBlockMat, serverName, (PortalArg[]) extraData.toArray()));
PortalArg[] portalArgs = new PortalArg[extraData.size()];
portalArgs = extraData.toArray(portalArgs);
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, triggerBlockMat, serverName, portalArgs));
}
else{
hasTriggerBlock = false;
ConfigAccessor Config = new ConfigAccessor(plugin, "Config.yml");
player.sendMessage("\u00A7ctriggerBlock: \u00A7edefault(" + Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");

player.sendMessage("\u00A7cThe block " + triggerBlock.toUpperCase() + " is not a valid block name in minecraft so the trigger block has been set to the default!");
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, serverName, (PortalArg[]) extraData.toArray()));
PortalArg[] portalArgs = new PortalArg[extraData.size()];
portalArgs = extraData.toArray(portalArgs);
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, serverName, portalArgs));
}
}
else{
ConfigAccessor Config = new ConfigAccessor(plugin, "Config.yml");
player.sendMessage("\u00A7atriggerBlock: \u00A7edefault(" + Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, serverName, (PortalArg[]) extraData.toArray()));
PortalArg[] portalArgs = new PortalArg[extraData.size()];
portalArgs = extraData.toArray(portalArgs);
player.sendMessage(Portal.create(pos1, pos2, portalName, destination, serverName, portalArgs));
}
}
else{
Expand Down
2 changes: 1 addition & 1 deletion src/com/sekwah/advancedportals/DestinationCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ else if(args[0].toLowerCase().equals("remove")) {
}
else if(args[0].toLowerCase().equals("goto") || args[0].toLowerCase().equals("warp")) {
if(args.length > 1){
System.out.println(args[1]);
//System.out.println(args[1]);
ConfigAccessor configDesti = new ConfigAccessor(plugin, "Destinations.yml");
if(configDesti.getConfig().getString(args[1] + ".world") != null){
Destination.warp(sender, args[1]);
Expand Down
3 changes: 1 addition & 2 deletions src/com/sekwah/advancedportals/portals/Portal.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public static void loadPortals(){
}

Portals[portalId].trigger = blockType;
System.out.println("Test: " + portal.toString());
Portals[portalId].portalName = portal.toString();
Portals[portalId].worldName = config.getConfig().getString(portal.toString() + ".world");
World world = Bukkit.getWorld(config.getConfig().getString(portal.toString() + ".world"));
Expand Down Expand Up @@ -345,7 +344,7 @@ public static boolean activate(Player player, String portalName) {
String destiName = config.getConfig().getString(portalName + ".destination");
if(configDesti.getConfig().getString(destiName + ".world") != null){
String permission = config.getConfig().getString(portalName + ".portalArgs.permission");
if(permission != null && player.hasPermission(permission) || player.isOp()){
if(permission == null || (permission != null && player.hasPermission(permission)) || player.isOp()){
boolean warped = Destination.warp(player, destiName);
return warped;
}
Expand Down
6 changes: 5 additions & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: com.sekwah.advancedportals.AdvancedPortalsPlugin
name: AdvancedPortals
version: 0.0.4
version: 0.0.6
author: SEKWAH41
description: An advanced portals plugin for bukkit.
commands:
Expand All @@ -20,10 +20,14 @@ permissions:
description: Gives access to all portal commands
children:
advancedportals.createportal: true
advancedportals.portal: true
advancedportals.build: true
advancedportals.createportal:
description: Allows you to create portals
default: op
advancedportals.portal:
description: Allows use of portal commands
default: op
advancedportals.build:
description: Allows you to build in the portal regions
default: op

0 comments on commit 7f6f6cd

Please sign in to comment.