Log a few more things. Added BiomeCommands to doc printer.

This commit is contained in:
Wizjany 2013-01-02 02:11:42 -05:00
parent e09a0c64ad
commit 76a77f04e7
3 changed files with 52 additions and 8 deletions

View File

@ -30,11 +30,30 @@ import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface Logging {
public enum LogMode {
POSITION, // Player position
REGION, // Region selection
ORIENTATION_REGION, // player orientation and Region selection
PLACEMENT, // Either the player position or pos1, depending on the placeAtPos1 flag
ALL // Log all information available
/**
* Player position
*/
POSITION,
/**
* Region selection
*/
REGION,
/**
* Player orientation and region selection
*/
ORIENTATION_REGION,
/**
* Either the player position or pos1, depending on the placeAtPos1 flag
*/
PLACEMENT,
/**
* Log all information available
*/
ALL
}
/**

View File

@ -19,16 +19,32 @@
package com.sk89q.worldedit.commands;
import static com.sk89q.minecraft.util.commands.Logging.LogMode.POSITION;
import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandAlias;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandPermissions;
import com.sk89q.worldedit.*;
import com.sk89q.minecraft.util.commands.Logging;
import com.sk89q.worldedit.Countable;
import com.sk89q.worldedit.CuboidClipboard;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalPlayer;
import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.Vector2D;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.blocks.BlockType;
import com.sk89q.worldedit.data.ChunkStore;
import com.sk89q.worldedit.regions.CuboidRegionSelector;
import com.sk89q.worldedit.regions.CylinderRegionSelector;
import com.sk89q.worldedit.regions.EllipsoidRegionSelector;
import com.sk89q.worldedit.regions.ExtendingCuboidRegionSelector;
import com.sk89q.worldedit.regions.Polygonal2DRegionSelector;
@ -36,8 +52,6 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.regions.RegionOperationException;
import com.sk89q.worldedit.regions.RegionSelector;
import com.sk89q.worldedit.regions.SphereRegionSelector;
import com.sk89q.worldedit.blocks.*;
import com.sk89q.worldedit.regions.CylinderRegionSelector;
/**
* Selection commands.
@ -58,6 +72,7 @@ public class SelectionCommands {
min = 0,
max = 1
)
@Logging(POSITION)
@CommandPermissions("worldedit.selection.pos")
public void pos1(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -92,6 +107,7 @@ public class SelectionCommands {
min = 0,
max = 1
)
@Logging(POSITION)
@CommandPermissions("worldedit.selection.pos")
public void pos2(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -186,6 +202,7 @@ public class SelectionCommands {
min = 0,
max = 0
)
@Logging(POSITION)
@CommandPermissions("worldedit.selection.chunk")
public void chunk(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -270,6 +287,7 @@ public class SelectionCommands {
min = 1,
max = 3
)
@Logging(REGION)
@CommandPermissions("worldedit.selection.expand")
public void expand(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -346,6 +364,7 @@ public class SelectionCommands {
min = 1,
max = 3
)
@Logging(REGION)
@CommandPermissions("worldedit.selection.contract")
public void contract(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -401,6 +420,7 @@ public class SelectionCommands {
min = 1,
max = 2
)
@Logging(REGION)
@CommandPermissions("worldedit.selection.shift")
public void shift(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -439,6 +459,7 @@ public class SelectionCommands {
min = 1,
max = 1
)
@Logging(REGION)
@CommandPermissions("worldedit.selection.outset")
public void outset(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {
@ -462,6 +483,7 @@ public class SelectionCommands {
min = 1,
max = 1
)
@Logging(REGION)
@CommandPermissions("worldedit.selection.inset")
public void inset(CommandContext args, LocalSession session, LocalPlayer player,
EditSession editSession) throws WorldEditException {

View File

@ -27,9 +27,11 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandPermissions;
import com.sk89q.minecraft.util.commands.NestedCommand;
import com.sk89q.worldedit.commands.BiomeCommands;
import com.sk89q.worldedit.commands.ChunkCommands;
import com.sk89q.worldedit.commands.ClipboardCommands;
import com.sk89q.worldedit.commands.GeneralCommands;
@ -61,6 +63,7 @@ public class DocumentationPrinter {
private static List<Class<?>> getCommandClasses(File dir) {
List<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(BiomeCommands.class);
classes.add(ChunkCommands.class);
classes.add(ClipboardCommands.class);
classes.add(GeneralCommands.class);