Skip to content

Commit

Permalink
More formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 8, 2013
1 parent 33cfbfa commit 2854933
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 53 deletions.
Expand Up @@ -188,4 +188,4 @@ public void describe(CommandSender sender, int page) throws CommandException {
throw new CommandException(Messages.COMMAND_PAGE_MISSING, page);
}

}
}
5 changes: 1 addition & 4 deletions src/main/java/net/aufdemrand/denizen/objects/Properties.java
@@ -1,9 +1,6 @@
package net.aufdemrand.denizen.objects;


import net.aufdemrand.denizen.objects.properties.Property;

import java.util.List;
// TODO: Whatever this is!

public interface Properties {

Expand Down
20 changes: 6 additions & 14 deletions src/main/java/net/aufdemrand/denizen/objects/aH.java
Expand Up @@ -12,7 +12,7 @@
import java.util.regex.Pattern;

/**
* The dScript Argument Helper will aid you in parsing and formatting arguments from a
* The dScript Argument Helper will aid you in parsing and formatting arguments from a
* dScript argument string (such as those found in a ScriptEntry.getArguments() method).
*
* @author aufdemrand
Expand Down Expand Up @@ -63,7 +63,7 @@ public Argument(String string) {

// dB.log("Constructed Argument: " + prefix + ":" + value);
}

public static Argument valueOf(String string) {
return new Argument(string);
}
Expand All @@ -75,7 +75,7 @@ public boolean startsWith(String string) {
public boolean hasPrefix() {
return has_prefix;
}

public Argument getPrefix() {
if (prefix == null)
return null;
Expand Down Expand Up @@ -154,12 +154,12 @@ public boolean matchesArgumentType(Class<? extends dObject> dClass) {

return false;
}

// Check if this argument matches a dList of a certain dObject
public boolean matchesArgumentList(Class<? extends dObject> dClass) {

dList list = new dList(this.getValue());

return list.filter(dClass) != null;
}

Expand Down Expand Up @@ -407,7 +407,7 @@ public static boolean matchesValueArg(String names, String string_arg, ArgumentT

case String:
return true;

case Custom:
return true;

Expand Down Expand Up @@ -603,12 +603,4 @@ else if (arg.toUpperCase().startsWith("(state|toggle):"))
final static Pattern matchesScriptPtrn = Pattern.compile("script:(.+)", Pattern.CASE_INSENSITIVE);










}
3 changes: 0 additions & 3 deletions src/main/java/net/aufdemrand/denizen/objects/dCuboid.java
Expand Up @@ -442,7 +442,4 @@ public String getAttribute(Attribute attribute) {
return new Element(identify()).getAttribute(attribute.fulfill(0));
}




}
1 change: 0 additions & 1 deletion src/main/java/net/aufdemrand/denizen/objects/dObject.java
Expand Up @@ -74,5 +74,4 @@ public interface dObject {
*/
public String getAttribute(Attribute attribute);


}
Expand Up @@ -10,9 +10,7 @@
public class ItemColor implements Property {

public static boolean describes(dItem item) {
if (item.getItemStack() instanceof Colorable)
return true;
else return false;
return item.getItemStack() instanceof Colorable;
}

public static ItemColor getFrom(dItem item) {
Expand Down
@@ -1,12 +1,7 @@
package net.aufdemrand.denizen.objects.properties;

/**
* Created with IntelliJ IDEA.
* User: denizen_
* Date: 9/7/13
* Time: 1:01 AM
* To change this template use File | Settings | File Templates.
*/
// TODO: Whatever this is!

public class PropertyParser {


Expand Down
Expand Up @@ -13,11 +13,11 @@
import java.util.List;

public class BookScriptContainer extends ScriptContainer {

public BookScriptContainer(ConfigurationSection configurationSection, String scriptContainerName) {
super(configurationSection, scriptContainerName);
}

public dItem getBookFrom() {
return getBookFrom(null, null);
}
Expand All @@ -30,13 +30,13 @@ public dItem getBookFrom(dPlayer player, dNPC npc) {
public dItem writeBookTo(dItem book, dPlayer player, dNPC npc) {
// Get current ItemMeta from the book
BookMeta bookInfo = (BookMeta) book.getItemStack().getItemMeta();

if (contains("TITLE")) {
String title = getString("TITLE");
title = TagManager.tag(player, npc, title, false);
bookInfo.setTitle(title);
}

if (contains("AUTHOR")) {
String author = getString("AUTHOR");
author = TagManager.tag(player, npc, author, false);
Expand All @@ -56,4 +56,4 @@ public dItem writeBookTo(dItem book, dPlayer player, dNPC npc) {
return book;
}

}
}
Expand Up @@ -98,8 +98,4 @@ public CommandExecuter getScriptExecuter() {
return commandExecuter;
}





}
Expand Up @@ -546,5 +546,4 @@ public int getQueueSize() {
return script_entries.size();
}


}
Expand Up @@ -170,5 +170,4 @@ protected boolean shouldRevolve() {
}



}
Expand Up @@ -14,10 +14,10 @@ public class FlaggedRequirement extends AbstractRequirement {

/* FLAGGED TYPE FLAG:value
* Example: FLAGGED PLAYER Cookies:3
*
*
* Arguments: [] - Required, () - Optional
*/

private enum Type { GLOBAL, NPC, PLAYER }

@Override
Expand All @@ -28,17 +28,17 @@ public boolean check(RequirementsContext context, List<String> args) throws Requ
String value = "true";
String index = "";
Type type = Type.PLAYER;

for(String arg: args) {

if (aH.matchesArg("GLOBAL, NPC, DENIZEN, GLOBAL", arg))
type = Type.valueOf(arg.toUpperCase().replace("DENIZEN", "NPC"));

else if (arg.split(":", 2).length > 1)
{
String[] flagArgs = arg.split(":");
value = flagArgs[1].toUpperCase();

if (flagArgs[0].contains("["))
{
name = flagArgs[0].split("\\[", 2)[0].trim();
Expand All @@ -49,15 +49,15 @@ else if (arg.split(":", 2).length > 1)
name = flagArgs[0].toUpperCase();
}
}

else
name = arg.toUpperCase();
}

FlagManager flagMng = DenizenAPI.getCurrentInstance().flagManager();
FlagManager.Flag flag = null;
String player = context.getPlayer().getName();

switch (type) {
case NPC:
flag = flagMng.getNPCFlag(context.getNPC().getId(), name);
Expand Down Expand Up @@ -88,4 +88,4 @@ else if (index.matches("\\d+"))
return outcome;
}

}
}

0 comments on commit 2854933

Please sign in to comment.