Merge branch 'master' of github.com:MassiveCraft/Factions

This commit is contained in:
Olof Larsson 2011-10-16 11:58:21 +02:00
commit 3d33088f47
17 changed files with 39 additions and 20 deletions

View File

@ -3,6 +3,10 @@ version: 1.6.0_dev
main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, nChat, ChatManager, CAPI, AuthMe, Register, Spout, WorldEdit, WorldGuard]
commands:
factions:
description: Reference command for Factions.
aliases: [f]
permissions:
factions.kit.admin:
description: All faction permissions.

View File

@ -43,7 +43,7 @@ public class Conf
public static boolean showEnemyFactionsOnMap = true;
// Disallow joining/leaving/kicking while power is negative
public static boolean CanLeaveWithNegativePower = true;
public static boolean canLeaveWithNegativePower = true;
// Configuration for faction-only chat
public static boolean factionOnlyChat = true;
@ -250,6 +250,7 @@ public class Conf
territoryProtectedMaterials.add(Material.WOODEN_DOOR);
territoryProtectedMaterials.add(Material.TRAP_DOOR);
territoryProtectedMaterials.add(Material.FENCE_GATE);
territoryProtectedMaterials.add(Material.DISPENSER);
territoryProtectedMaterials.add(Material.CHEST);
territoryProtectedMaterials.add(Material.FURNACE);
@ -264,6 +265,7 @@ public class Conf
territoryProtectedMaterialsWhenOffline.add(Material.WOODEN_DOOR);
territoryProtectedMaterialsWhenOffline.add(Material.TRAP_DOOR);
territoryProtectedMaterialsWhenOffline.add(Material.FENCE_GATE);
territoryProtectedMaterialsWhenOffline.add(Material.DISPENSER);
territoryProtectedMaterialsWhenOffline.add(Material.CHEST);
territoryProtectedMaterialsWhenOffline.add(Material.FURNACE);

View File

@ -577,7 +577,7 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
return;
}
if (!Conf.CanLeaveWithNegativePower && this.getPower() < 0)
if (!Conf.canLeaveWithNegativePower && this.getPower() < 0)
{
msg("<b>You cannot leave until your power is positive.");
return;

View File

@ -12,7 +12,7 @@ public class CmdAutoClaim extends FCommand
this.aliases.add("autoclaim");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.AUTOCLAIM.node;
this.disableOnLock = true;

View File

@ -14,7 +14,7 @@ public class CmdAutoSafeclaim extends FCommand
this.aliases.add("autosafe");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.MANAGE_SAFE_ZONE.node;
this.disableOnLock = true;

View File

@ -12,10 +12,10 @@ public class CmdAutoWarclaim extends FCommand
public CmdAutoWarclaim()
{
super();
this.aliases.add("autosafe");
aliases.add("autowar");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.MANAGE_WAR_ZONE.node;
this.disableOnLock = true;
@ -24,8 +24,6 @@ public class CmdAutoWarclaim extends FCommand
senderMustBeMember = false;
senderMustBeModerator = true;
senderMustBeAdmin = false;
aliases.add("autowar");
this.setHelpShort("Auto-claim land for the warzone");
}

View File

@ -11,7 +11,7 @@ public class CmdBoom extends FCommand
this.aliases.add("noboom");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.NO_BOOM.node;
this.disableOnLock = true;

View File

@ -11,7 +11,7 @@ public class CmdBypass extends FCommand
this.aliases.add("bypass");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.BYPASS.node;
this.disableOnLock = false;

View File

@ -113,10 +113,8 @@ public class CmdHelp extends FCommand
pageLines = new ArrayList<String>();
pageLines.add( p.cmdBase.cmdMap.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdBoom.getUseageTemplate(true) );
pageLines.add("");
pageLines.add( p.cmdBase.cmdOwner.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdOwnerList.getUseageTemplate(true) );
pageLines.add("");
pageLines.add(p.txt.parse("<i>Claimed land with ownership set is further protected so"));
pageLines.add(p.txt.parse("<i>that only the owner(s), faction admin, and possibly the"));
pageLines.add(p.txt.parse("<i>faction moderators have full access."));

View File

@ -47,7 +47,7 @@ public class CmdJoin extends FCommand
return;
}
if (!Conf.CanLeaveWithNegativePower && fme.getPower() < 0)
if (!Conf.canLeaveWithNegativePower && fme.getPower() < 0)
{
msg("<b>You cannot join a faction until your power is positive.");
return;

View File

@ -57,7 +57,7 @@ public class CmdKick extends FCommand
return;
}
if ( ! Conf.CanLeaveWithNegativePower && you.getPower() < 0)
if ( ! Conf.canLeaveWithNegativePower && you.getPower() < 0)
{
msg("<b>You cannot kick that member until their power is positive.");
return;

View File

@ -17,7 +17,7 @@ public class CmdLock extends FCommand {
this.aliases.add("lock");
//this.requiredArgs.add("");
this.optionalArgs.put("on/off", "flipp");
this.optionalArgs.put("on/off", "flip");
this.permission = Permission.LOCK.node;
this.disableOnLock = false;

View File

@ -13,7 +13,7 @@ public class CmdOpen extends FCommand
this.aliases.add("open");
//this.requiredArgs.add("");
this.optionalArgs.put("yes/no", "flipp");
this.optionalArgs.put("yes/no", "flip");
this.permission = Permission.OPEN.node;
this.disableOnLock = false;

View File

@ -13,7 +13,7 @@ public class CmdSafeunclaimall extends FCommand
this.aliases.add("safedeclaimall");
//this.requiredArgs.add("");
this.optionalArgs.put("radius", "0");
//this.optionalArgs.put("radius", "0");
this.permission = Permission.MANAGE_SAFE_ZONE.node;
this.disableOnLock = true;

View File

@ -1,5 +1,7 @@
package com.massivecraft.factions.cmd;
import java.util.Collections;
import com.massivecraft.factions.Conf;
public class FCmdRoot extends FCommand
@ -55,6 +57,7 @@ public class FCmdRoot extends FCommand
{
super();
this.aliases.addAll(Conf.baseCommandAliases);
this.aliases.removeAll(Collections.singletonList(null)); // remove any nulls from extra commas
this.allowNoSlashAccess = Conf.allowNoSlashCommand;
//this.requiredArgs.add("");

View File

@ -58,7 +58,7 @@ public class Econ
}
else
{
P.p.log("Economy integration failed. The plugin \"Register\" is not installed.");
P.p.log("Economy integration is "+(Conf.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Register\" is not installed.");
}
P.p.cmdBase.cmdHelp.updateHelp();

View File

@ -1,17 +1,31 @@
package com.massivecraft.factions.zcore;
import java.util.Map;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.event.server.ServerListener;
public class MPluginSecretServerListener extends ServerListener
{
private MPlugin p;
private String refCommand;
public MPluginSecretServerListener(MPlugin p)
{
this.p = p;
refCommand = "";
// attempt to get first command defined in plugin.yml as reference command, if any commands are defined in there
// reference command will be used to prevent "unknown command" console messages
try
{
Map<String, Object> refCmd = (Map<String, Object>) p.getDescription().getCommands();
if (refCmd != null && !refCmd.isEmpty())
refCommand = (String)(refCmd.keySet().toArray()[0]);
}
catch (ClassCastException ex) {}
}
// This method is not perfect. It says unknown console command.
@Override
public void onServerCommand(ServerCommandEvent event)
{
@ -19,7 +33,7 @@ public class MPluginSecretServerListener extends ServerListener
if (p.handleCommand(event.getSender(), event.getCommand()))
{
event.setCommand("");
event.setCommand(refCommand);
}
}