From 76a77f04e7feee0ae5fc5e376aa560fd13d220cf Mon Sep 17 00:00:00 2001 From: Wizjany Date: Wed, 2 Jan 2013 02:11:42 -0500 Subject: [PATCH] Log a few more things. Added BiomeCommands to doc printer. --- .../minecraft/util/commands/Logging.java | 29 +++++++++++++++---- .../worldedit/commands/SelectionCommands.java | 28 ++++++++++++++++-- .../worldedit/dev/DocumentationPrinter.java | 3 ++ 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/minecraft/util/commands/Logging.java b/src/main/java/com/sk89q/minecraft/util/commands/Logging.java index 604878a8e..654b9861c 100644 --- a/src/main/java/com/sk89q/minecraft/util/commands/Logging.java +++ b/src/main/java/com/sk89q/minecraft/util/commands/Logging.java @@ -30,11 +30,30 @@ @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 } /** diff --git a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java index 10e173b80..2e5c50a88 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java @@ -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.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 SelectionCommands(WorldEdit we) { 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 void pos1(CommandContext args, LocalSession session, LocalPlayer player, 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 void hpos2(CommandContext args, LocalSession session, LocalPlayer player, 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 void toggleWand(CommandContext args, LocalSession session, LocalPlayer pl 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 void expand(CommandContext args, LocalSession session, LocalPlayer player 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 void contract(CommandContext args, LocalSession session, LocalPlayer play 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 void shift(CommandContext args, LocalSession session, LocalPlayer player, 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 void outset(CommandContext args, LocalSession session, LocalPlayer player min = 1, max = 1 ) + @Logging(REGION) @CommandPermissions("worldedit.selection.inset") public void inset(CommandContext args, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { diff --git a/src/main/java/com/sk89q/worldedit/dev/DocumentationPrinter.java b/src/main/java/com/sk89q/worldedit/dev/DocumentationPrinter.java index 83441cb25..0a738d34c 100644 --- a/src/main/java/com/sk89q/worldedit/dev/DocumentationPrinter.java +++ b/src/main/java/com/sk89q/worldedit/dev/DocumentationPrinter.java @@ -27,9 +27,11 @@ 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 static void main(String[] args) throws IOException { private static List> getCommandClasses(File dir) { List> classes = new ArrayList>(); + classes.add(BiomeCommands.class); classes.add(ChunkCommands.class); classes.add(ClipboardCommands.class); classes.add(GeneralCommands.class);