Added new items for 1.4.6

Fix permission for other help command (why are there two?)
- Made registerhelp read from yaml (not that the setting does anything)
Added an option to override data value limits.
- This should fix some mods which use data values above 16
- May cause issues if set to true and people mess with vanilla data values
Dieser Commit ist enthalten in:
Wizjany 2012-12-24 01:01:01 -05:00
Ursprung 24662d6365
Commit e4771416aa
7 geänderte Dateien mit 21 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -90,7 +90,7 @@ public abstract class LocalConfiguration {
public int maxSuperPickaxeSize = 5; public int maxSuperPickaxeSize = 5;
public int maxBrushRadius = 6; public int maxBrushRadius = 6;
public boolean logCommands = false; public boolean logCommands = false;
public boolean registerHelp = true; public boolean registerHelp = true; // what is the point of this, it's not even used
public int wandItem = ItemID.WOOD_AXE; public int wandItem = ItemID.WOOD_AXE;
public boolean superPickaxeDrop = true; public boolean superPickaxeDrop = true;
public boolean superPickaxeManyDrop = true; public boolean superPickaxeManyDrop = true;
@ -106,6 +106,7 @@ public abstract class LocalConfiguration {
public boolean showFirstUseVersion = true; public boolean showFirstUseVersion = true;
public int butcherDefaultRadius = -1; public int butcherDefaultRadius = -1;
public int butcherMaxRadius = -1; public int butcherMaxRadius = -1;
public boolean allowExtraDataValues = false;
/** /**
* Loads the configuration. * Loads the configuration.

Datei anzeigen

@ -418,7 +418,7 @@ public class WorldEdit {
// Parse the block data (optional) // Parse the block data (optional)
try { try {
data = (typeAndData.length > 1 && typeAndData[1].length() > 0) ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0); data = (typeAndData.length > 1 && typeAndData[1].length() > 0) ? Integer.parseInt(typeAndData[1]) : (allowNoData ? -1 : 0);
if (data > 15 || (data < 0 && !(allAllowed && data == -1))) { if ((data > 15 && !config.allowExtraDataValues) || (data < 0 && !(allAllowed && data == -1))) {
data = 0; data = 0;
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
@ -443,15 +443,12 @@ public class WorldEdit {
case STONE: case STONE:
data = 0; data = 0;
break; break;
case SANDSTONE: case SANDSTONE:
data = 1; data = 1;
break; break;
case WOOD: case WOOD:
data = 2; data = 2;
break; break;
case COBBLESTONE: case COBBLESTONE:
data = 3; data = 3;
break; break;
@ -460,6 +457,10 @@ public class WorldEdit {
break; break;
case STONE_BRICK: case STONE_BRICK:
data = 5; data = 5;
break;
case NETHER_BRICK:
data = 6;
break;
default: default:
throw new InvalidItemException(arg, "Invalid step type '" + typeAndData[1] + "'"); throw new InvalidItemException(arg, "Invalid step type '" + typeAndData[1] + "'");

Datei anzeigen

@ -170,6 +170,9 @@ public final class ItemID {
public static final int CARROT_ON_A_STICK = 398; public static final int CARROT_ON_A_STICK = 398;
public static final int NETHER_STAR = 399; public static final int NETHER_STAR = 399;
public static final int PUMPKIN_PIE = 400; public static final int PUMPKIN_PIE = 400;
public static final int FIREWORK_ROCKET = 401;
public static final int FIREWORK_STAR = 402;
public static final int ENCHANTED_BOOK = 403;
@Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there @Deprecated public static final int GOLD_RECORD = 2256; // deprecated, but leave it there
@Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there @Deprecated public static final int GREEN_RECORD = 2257; // deprecated, but leave it there

Datei anzeigen

@ -328,6 +328,9 @@ public enum ItemType {
CARROT_ON_A_STICK(ItemID.CARROT_ON_A_STICK, "Carrot on a stick", "carrotonastick", "carrotonstick", "stickcarrot", "carrotstick"), CARROT_ON_A_STICK(ItemID.CARROT_ON_A_STICK, "Carrot on a stick", "carrotonastick", "carrotonstick", "stickcarrot", "carrotstick"),
NETHER_STAR(ItemID.NETHER_STAR, "Nether star", "netherstar", "starnether"), NETHER_STAR(ItemID.NETHER_STAR, "Nether star", "netherstar", "starnether"),
PUMPKIN_PIE(ItemID.PUMPKIN_PIE, "Pumpkin pie", "pumpkinpie"), PUMPKIN_PIE(ItemID.PUMPKIN_PIE, "Pumpkin pie", "pumpkinpie"),
FIREWORK_ROCKET(ItemID.FIREWORK_ROCKET, "Firework rocket", "firework", "rocket"),
FIREWORK_STAR(ItemID.FIREWORK_STAR, "Firework star", "fireworkstar", "fireworkcharge"),
ENCHANTED_BOOK(ItemID.ENCHANTED_BOOK, "Enchanted book", "enchantedbook", "spellbook", "enchantedtome", "tome"),
DISC_13(ItemID.DISC_13, "Music Disc - 13", "disc_13"), DISC_13(ItemID.DISC_13, "Music Disc - 13", "disc_13"),
DISC_CAT(ItemID.DISC_CAT, "Music Disc - Cat", "disc_cat"), DISC_CAT(ItemID.DISC_CAT, "Music Disc - Cat", "disc_cat"),
DISC_BLOCKS(ItemID.DISC_BLOCKS, "Music Disc - blocks", "disc_blocks"), DISC_BLOCKS(ItemID.DISC_BLOCKS, "Music Disc - blocks", "disc_blocks"),
@ -553,6 +556,9 @@ public enum ItemType {
shouldNotStack.add(ItemID.MAP); shouldNotStack.add(ItemID.MAP);
shouldNotStack.add(ItemID.SHEARS); shouldNotStack.add(ItemID.SHEARS);
shouldNotStack.add(ItemID.HEAD); shouldNotStack.add(ItemID.HEAD);
shouldNotStack.add(ItemID.FIREWORK_ROCKET);
shouldNotStack.add(ItemID.FIREWORK_STAR);
shouldNotStack.add(ItemID.ENCHANTED_BOOK);
shouldNotStack.add(ItemID.DISC_13); shouldNotStack.add(ItemID.DISC_13);
shouldNotStack.add(ItemID.DISC_CAT); shouldNotStack.add(ItemID.DISC_CAT);
shouldNotStack.add(ItemID.DISC_BLOCKS); shouldNotStack.add(ItemID.DISC_BLOCKS);

Datei anzeigen

@ -434,7 +434,7 @@ public class BukkitWorld extends LocalWorld {
* Gets the single block inventory for a potentially double chest. * Gets the single block inventory for a potentially double chest.
* Handles people who have an old version of Bukkit. * Handles people who have an old version of Bukkit.
* This should be replaced with {@link org.bukkit.block.Chest#getBlockInventory()} * This should be replaced with {@link org.bukkit.block.Chest#getBlockInventory()}
* in a few months (now = March 2012) * in a few months (now = March 2012) // note from future dev - lol
* *
* @param chest The chest to get a single block inventory for * @param chest The chest to get a single block inventory for
* @return The chest's inventory * @return The chest's inventory

Datei anzeigen

@ -497,6 +497,7 @@ public class UtilityCommands {
max = -1 max = -1
) )
@Console @Console
@CommandPermissions("worldedit.help")
public void help(CommandContext args, LocalSession session, LocalPlayer player, public void help(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException { EditSession editSession) throws WorldEditException {

Datei anzeigen

@ -73,7 +73,7 @@ public class YAMLConfiguration extends LocalConfiguration {
"limits.max-super-pickaxe-size", maxSuperPickaxeSize)); "limits.max-super-pickaxe-size", maxSuperPickaxeSize));
butcherDefaultRadius = Math.max(-1, config.getInt("limits.butcher-radius.default", butcherDefaultRadius)); butcherDefaultRadius = Math.max(-1, config.getInt("limits.butcher-radius.default", butcherDefaultRadius));
butcherMaxRadius = Math.max(-1, config.getInt("limits.butcher-radius.maximum", butcherMaxRadius)); butcherMaxRadius = Math.max(-1, config.getInt("limits.butcher-radius.maximum", butcherMaxRadius));
registerHelp = true; registerHelp = config.getBoolean("register-help");
logCommands = config.getBoolean("logging.log-commands", logCommands); logCommands = config.getBoolean("logging.log-commands", logCommands);
superPickaxeDrop = config.getBoolean("super-pickaxe.drop-items", superPickaxeDrop = config.getBoolean("super-pickaxe.drop-items",
superPickaxeDrop); superPickaxeDrop);
@ -97,6 +97,8 @@ public class YAMLConfiguration extends LocalConfiguration {
allowedDataCycleBlocks = new HashSet<Integer>(config.getIntList("limits.allowed-data-cycle-blocks", null)); allowedDataCycleBlocks = new HashSet<Integer>(config.getIntList("limits.allowed-data-cycle-blocks", null));
allowExtraDataValues = config.getBoolean("limits.allow-extra-data-values", false);
LocalSession.MAX_HISTORY_SIZE = Math.max(0, config.getInt("history.size", 15)); LocalSession.MAX_HISTORY_SIZE = Math.max(0, config.getInt("history.size", 15));
LocalSession.EXPIRATION_GRACE = config.getInt("history.expiration", 10) * 60 * 1000; LocalSession.EXPIRATION_GRACE = config.getInt("history.expiration", 10) * 60 * 1000;