From e121442ee90790f33db3b2fc23b9950f58687b48 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 30 Apr 2011 19:04:03 -0700 Subject: [PATCH] Added pom.xml, moved files around. Sun Rhino support has been dropped. --- README.txt | 2 +- build.xml | 12 +- contrib/sunrhino/README.txt | 3 - contrib/sunrhino/build.xml | 47 --- .../scripting/SunRhinoContextFactory.java | 61 ---- .../scripting/SunRhinoCraftScriptEngine.java | 90 ----- pom.xml | 171 ++++++++++ src/assembly/default.xml | 35 ++ src/com/sk89q/jnbt/NBTInputStream.java | 192 ----------- src/com/sk89q/jnbt/NBTOutputStream.java | 271 --------------- src/com/sk89q/jnbt/NBTUtils.java | 166 --------- .../ConfigurationPermissionsResolver.java | 0 .../FlatFilePermissionsResolver.java | 0 .../migration/NijiPermissionsResolver.java | 0 .../bukkit/migration/PermissionsProvider.java | 0 .../bukkit/migration/PermissionsResolver.java | 0 .../migration/PermissionsResolverManager.java | 0 .../PermissionsResolverServerListener.java | 0 .../migration/PluginPermissionsResolver.java | 4 - .../com/sk89q/jnbt/ByteArrayTag.java | 82 ++--- src/{ => main}/com/sk89q/jnbt/ByteTag.java | 64 ++-- .../com/sk89q/jnbt/CompoundTag.java | 79 +++-- src/{ => main}/com/sk89q/jnbt/DoubleTag.java | 64 ++-- src/{ => main}/com/sk89q/jnbt/EndTag.java | 33 +- src/{ => main}/com/sk89q/jnbt/FloatTag.java | 64 ++-- src/{ => main}/com/sk89q/jnbt/IntTag.java | 62 ++-- src/{ => main}/com/sk89q/jnbt/ListTag.java | 111 +++--- src/{ => main}/com/sk89q/jnbt/LongTag.java | 64 ++-- .../com/sk89q/jnbt/NBTConstants.java | 50 ++- src/main/com/sk89q/jnbt/NBTInputStream.java | 211 ++++++++++++ src/main/com/sk89q/jnbt/NBTOutputStream.java | 316 ++++++++++++++++++ src/main/com/sk89q/jnbt/NBTUtils.java | 178 ++++++++++ src/{ => main}/com/sk89q/jnbt/ShortTag.java | 64 ++-- src/{ => main}/com/sk89q/jnbt/StringTag.java | 64 ++-- src/{ => main}/com/sk89q/jnbt/Tag.java | 61 ++-- .../minecraft/util/commands/Command.java | 0 .../util/commands/CommandContext.java | 0 .../util/commands/CommandException.java | 0 .../util/commands/CommandPermissions.java | 0 .../commands/CommandPermissionsException.java | 0 .../util/commands/CommandUsageException.java | 0 .../util/commands/CommandsManager.java | 0 .../MissingNestedCommandException.java | 0 .../util/commands/NestedCommand.java | 0 .../commands/UnhandledCommandException.java | 0 .../commands/WrappedCommandException.java | 0 src/{ => main}/com/sk89q/util/StringUtil.java | 0 .../com/sk89q/worldedit/BlockVector.java | 0 .../com/sk89q/worldedit/BlockVector2D.java | 0 .../com/sk89q/worldedit/BlockWorldVector.java | 0 .../com/sk89q/worldedit/Countable.java | 0 .../com/sk89q/worldedit/CuboidClipboard.java | 0 .../worldedit/DisallowedItemException.java | 0 .../com/sk89q/worldedit/DoubleArrayList.java | 0 .../com/sk89q/worldedit/EditSession.java | 0 .../worldedit/EmptyClipboardException.java | 0 .../FileSelectionAbortedException.java | 0 .../sk89q/worldedit/FilenameException.java | 0 .../FilenameResolutionException.java | 0 .../com/sk89q/worldedit/HeightMap.java | 0 .../worldedit/IncompleteRegionException.java | 0 .../worldedit/InvalidFilenameException.java | 0 .../sk89q/worldedit/InvalidItemException.java | 0 .../worldedit/InvalidToolBindException.java | 0 .../sk89q/worldedit/LocalConfiguration.java | 0 .../com/sk89q/worldedit/LocalPlayer.java | 0 .../com/sk89q/worldedit/LocalSession.java | 0 .../com/sk89q/worldedit/LocalWorld.java | 0 .../com/sk89q/worldedit/LogFormat.java | 0 .../worldedit/MaxChangedBlocksException.java | 0 .../sk89q/worldedit/MaxRadiusException.java | 0 .../com/sk89q/worldedit/PlayerDirection.java | 0 .../sk89q/worldedit/ReplacingEditSession.java | 0 .../com/sk89q/worldedit/ServerInterface.java | 0 .../worldedit/UnknownDirectionException.java | 0 .../sk89q/worldedit/UnknownItemException.java | 0 .../com/sk89q/worldedit/Vector.java | 0 .../com/sk89q/worldedit/Vector2D.java | 0 .../com/sk89q/worldedit/WorldEdit.java | 10 +- .../sk89q/worldedit/WorldEditException.java | 0 .../worldedit/WorldEditNotInstalled.java | 0 .../sk89q/worldedit/WorldEditOperation.java | 0 .../com/sk89q/worldedit/WorldVector.java | 0 .../com/sk89q/worldedit/bags/BlockBag.java | 0 .../worldedit/bags/BlockBagException.java | 0 .../worldedit/bags/OutOfBlocksException.java | 0 .../worldedit/bags/OutOfSpaceException.java | 0 .../bags/UnplaceableBlockException.java | 0 .../com/sk89q/worldedit/blocks/BaseBlock.java | 0 .../com/sk89q/worldedit/blocks/BaseItem.java | 0 .../sk89q/worldedit/blocks/BaseItemStack.java | 0 .../com/sk89q/worldedit/blocks/BlockID.java | 0 .../com/sk89q/worldedit/blocks/BlockType.java | 0 .../sk89q/worldedit/blocks/ChestBlock.java | 0 .../sk89q/worldedit/blocks/ClothColor.java | 0 .../worldedit/blocks/ContainerBlock.java | 0 .../worldedit/blocks/DispenserBlock.java | 0 .../sk89q/worldedit/blocks/FurnaceBlock.java | 0 .../com/sk89q/worldedit/blocks/ItemType.java | 0 .../worldedit/blocks/MobSpawnerBlock.java | 0 .../com/sk89q/worldedit/blocks/NoteBlock.java | 0 .../com/sk89q/worldedit/blocks/SignBlock.java | 0 .../worldedit/blocks/TileEntityBlock.java | 0 .../worldedit/bukkit/BukkitConfiguration.java | 0 .../sk89q/worldedit/bukkit/BukkitPlayer.java | 0 .../bukkit/BukkitPlayerBlockBag.java | 0 .../bukkit/BukkitServerInterface.java | 0 .../sk89q/worldedit/bukkit/BukkitUtil.java | 0 .../sk89q/worldedit/bukkit/BukkitWorld.java | 0 .../EditSessionBlockChangeDelegate.java | 0 .../sk89q/worldedit/bukkit/WorldEditAPI.java | 0 .../WorldEditCriticalPlayerListener.java | 0 .../bukkit/WorldEditPlayerListener.java | 0 .../worldedit/bukkit/WorldEditPlugin.java | 0 .../bukkit/selections/CuboidSelection.java | 0 .../selections/Polygonal2DSelection.java | 0 .../bukkit/selections/RegionSelection.java | 10 - .../bukkit/selections/Selection.java | 0 .../worldedit/commands/BrushCommands.java | 0 .../worldedit/commands/ChunkCommands.java | 0 .../worldedit/commands/ClipboardCommands.java | 0 .../worldedit/commands/GeneralCommands.java | 0 .../commands/GenerationCommands.java | 0 .../worldedit/commands/HistoryCommands.java | 0 .../InsufficientArgumentsException.java | 0 .../commands/NavigationCommands.java | 0 .../worldedit/commands/RegionCommands.java | 0 .../worldedit/commands/ScriptingCommands.java | 0 .../worldedit/commands/SelectionCommands.java | 0 .../worldedit/commands/SnapshotCommands.java | 0 .../commands/SnapshotUtilCommands.java | 0 .../commands/SuperPickaxeCommands.java | 0 .../worldedit/commands/ToolCommands.java | 0 .../worldedit/commands/ToolUtilCommands.java | 0 .../worldedit/commands/UtilityCommands.java | 0 .../worldedit/commands/WorldEditCommands.java | 0 .../com/sk89q/worldedit/cui/CUIEvent.java | 0 .../worldedit/cui/CUIPointBasedRegion.java | 0 .../worldedit/cui/SelectionPointEvent.java | 2 - .../worldedit/cui/SelectionShapeEvent.java | 2 - .../com/sk89q/worldedit/data/BlockData.java | 0 .../com/sk89q/worldedit/data/Chunk.java | 0 .../com/sk89q/worldedit/data/ChunkStore.java | 0 .../worldedit/data/ChunkStoreException.java | 0 .../sk89q/worldedit/data/DataException.java | 0 .../worldedit/data/FileLegacyChunkStore.java | 0 .../data/FileMcRegionChunkStore.java | 0 .../data/ForwardSeekableInputStream.java | 0 .../data/InvalidFormatException.java | 0 .../worldedit/data/LegacyChunkStore.java | 0 .../worldedit/data/McRegionChunkStore.java | 0 .../sk89q/worldedit/data/McRegionReader.java | 0 .../worldedit/data/MissingChunkException.java | 0 .../data/TrueZipLegacyChunkStore.java | 0 .../data/TrueZipMcRegionChunkStore.java | 0 .../data/ZippedLegacyChunkStore.java | 0 .../data/ZippedMcRegionChunkStore.java | 0 .../worldedit/dev/DocumentationPrinter.java | 0 .../worldedit/filtering/GaussianKernel.java | 0 .../worldedit/filtering/HeightMapFilter.java | 0 .../worldedit/filtering/LinearKernel.java | 0 .../sk89q/worldedit/masks/BlockTypeMask.java | 0 .../worldedit/masks/ExistingBlockMask.java | 0 .../masks/InvertedBlockTypeMask.java | 0 .../com/sk89q/worldedit/masks/Mask.java | 0 .../sk89q/worldedit/patterns/BlockChance.java | 0 .../worldedit/patterns/ClipboardPattern.java | 0 .../com/sk89q/worldedit/patterns/Pattern.java | 0 .../worldedit/patterns/RandomFillPattern.java | 0 .../patterns/SingleBlockPattern.java | 0 .../sk89q/worldedit/regions/CuboidRegion.java | 2 - .../regions/CuboidRegionSelector.java | 0 .../worldedit/regions/Polygonal2DRegion.java | 1 - .../regions/Polygonal2DRegionSelector.java | 0 .../com/sk89q/worldedit/regions/Region.java | 0 .../regions/RegionOperationException.java | 0 .../worldedit/regions/RegionSelector.java | 0 .../scripting/CraftScriptContext.java | 0 .../scripting/CraftScriptEngine.java | 0 .../scripting/CraftScriptEnvironment.java | 0 .../scripting/RhinoContextFactory.java | 0 .../scripting/RhinoCraftScriptEngine.java | 3 - .../scripting/java/RhinoScriptEngine.java | 3 - .../java/RhinoScriptEngineFactory.java | 12 - .../snapshots/InvalidSnapshotException.java | 0 .../snapshots/ModificationTimerParser.java | 1 - .../sk89q/worldedit/snapshots/Snapshot.java | 1 - .../snapshots/SnapshotDateParser.java | 0 .../snapshots/SnapshotRepository.java | 0 .../worldedit/snapshots/SnapshotRestore.java | 0 .../snapshots/YYMMDDHHIISSParser.java | 1 - .../sk89q/worldedit/tools/AreaPickaxe.java | 1 - .../sk89q/worldedit/tools/BlockDataCyler.java | 2 - .../sk89q/worldedit/tools/BlockReplacer.java | 2 - .../com/sk89q/worldedit/tools/BlockTool.java | 0 .../com/sk89q/worldedit/tools/BrushTool.java | 1 - .../tools/DoubleActionBlockTool.java | 0 .../com/sk89q/worldedit/tools/QueryTool.java | 1 - .../worldedit/tools/RecursivePickaxe.java | 1 - .../sk89q/worldedit/tools/SinglePickaxe.java | 2 +- .../com/sk89q/worldedit/tools/Tool.java | 0 .../com/sk89q/worldedit/tools/TraceTool.java | 0 .../sk89q/worldedit/tools/TreePlanter.java | 1 - .../sk89q/worldedit/tools/brushes/Brush.java | 0 .../tools/brushes/ClipboardBrush.java | 0 .../tools/brushes/CylinderBrush.java | 0 .../tools/brushes/HollowCylinderBrush.java | 0 .../tools/brushes/HollowSphereBrush.java | 0 .../worldedit/tools/brushes/SmoothBrush.java | 0 .../worldedit/tools/brushes/SphereBrush.java | 0 .../sk89q/worldedit/util/FileDialogUtil.java | 0 .../util/PropertiesConfiguration.java | 0 .../com/sk89q/worldedit/util/TargetBlock.java | 0 .../sk89q/worldedit/util/TreeGenerator.java | 0 config.yml => src/resources/config.yml | 0 plugin.yml => src/resources/plugin.yml | 2 +- 216 files changed, 1379 insertions(+), 1303 deletions(-) delete mode 100644 contrib/sunrhino/README.txt delete mode 100644 contrib/sunrhino/build.xml delete mode 100644 contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoContextFactory.java delete mode 100644 contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoCraftScriptEngine.java create mode 100644 pom.xml create mode 100644 src/assembly/default.xml delete mode 100644 src/com/sk89q/jnbt/NBTInputStream.java delete mode 100644 src/com/sk89q/jnbt/NBTOutputStream.java delete mode 100644 src/com/sk89q/jnbt/NBTUtils.java rename src/{ => main}/com/sk89q/bukkit/migration/ConfigurationPermissionsResolver.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/FlatFilePermissionsResolver.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/NijiPermissionsResolver.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/PermissionsProvider.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/PermissionsResolver.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/PermissionsResolverManager.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/PermissionsResolverServerListener.java (100%) rename src/{ => main}/com/sk89q/bukkit/migration/PluginPermissionsResolver.java (92%) rename src/{ => main}/com/sk89q/jnbt/ByteArrayTag.java (62%) rename src/{ => main}/com/sk89q/jnbt/ByteTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/CompoundTag.java (60%) rename src/{ => main}/com/sk89q/jnbt/DoubleTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/EndTag.java (85%) rename src/{ => main}/com/sk89q/jnbt/FloatTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/IntTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/ListTag.java (54%) rename src/{ => main}/com/sk89q/jnbt/LongTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/NBTConstants.java (75%) create mode 100644 src/main/com/sk89q/jnbt/NBTInputStream.java create mode 100644 src/main/com/sk89q/jnbt/NBTOutputStream.java create mode 100644 src/main/com/sk89q/jnbt/NBTUtils.java rename src/{ => main}/com/sk89q/jnbt/ShortTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/StringTag.java (70%) rename src/{ => main}/com/sk89q/jnbt/Tag.java (73%) rename src/{ => main}/com/sk89q/minecraft/util/commands/Command.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandContext.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandException.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandPermissions.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandPermissionsException.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandUsageException.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/CommandsManager.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/NestedCommand.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/UnhandledCommandException.java (100%) rename src/{ => main}/com/sk89q/minecraft/util/commands/WrappedCommandException.java (100%) rename src/{ => main}/com/sk89q/util/StringUtil.java (100%) rename src/{ => main}/com/sk89q/worldedit/BlockVector.java (100%) rename src/{ => main}/com/sk89q/worldedit/BlockVector2D.java (100%) rename src/{ => main}/com/sk89q/worldedit/BlockWorldVector.java (100%) rename src/{ => main}/com/sk89q/worldedit/Countable.java (100%) rename src/{ => main}/com/sk89q/worldedit/CuboidClipboard.java (100%) rename src/{ => main}/com/sk89q/worldedit/DisallowedItemException.java (100%) rename src/{ => main}/com/sk89q/worldedit/DoubleArrayList.java (100%) rename src/{ => main}/com/sk89q/worldedit/EditSession.java (100%) mode change 100755 => 100644 rename src/{ => main}/com/sk89q/worldedit/EmptyClipboardException.java (100%) rename src/{ => main}/com/sk89q/worldedit/FileSelectionAbortedException.java (100%) rename src/{ => main}/com/sk89q/worldedit/FilenameException.java (100%) rename src/{ => main}/com/sk89q/worldedit/FilenameResolutionException.java (100%) rename src/{ => main}/com/sk89q/worldedit/HeightMap.java (100%) mode change 100755 => 100644 rename src/{ => main}/com/sk89q/worldedit/IncompleteRegionException.java (100%) rename src/{ => main}/com/sk89q/worldedit/InvalidFilenameException.java (100%) rename src/{ => main}/com/sk89q/worldedit/InvalidItemException.java (100%) rename src/{ => main}/com/sk89q/worldedit/InvalidToolBindException.java (100%) rename src/{ => main}/com/sk89q/worldedit/LocalConfiguration.java (100%) rename src/{ => main}/com/sk89q/worldedit/LocalPlayer.java (100%) rename src/{ => main}/com/sk89q/worldedit/LocalSession.java (100%) rename src/{ => main}/com/sk89q/worldedit/LocalWorld.java (100%) rename src/{ => main}/com/sk89q/worldedit/LogFormat.java (100%) rename src/{ => main}/com/sk89q/worldedit/MaxChangedBlocksException.java (100%) rename src/{ => main}/com/sk89q/worldedit/MaxRadiusException.java (100%) rename src/{ => main}/com/sk89q/worldedit/PlayerDirection.java (100%) rename src/{ => main}/com/sk89q/worldedit/ReplacingEditSession.java (100%) rename src/{ => main}/com/sk89q/worldedit/ServerInterface.java (100%) rename src/{ => main}/com/sk89q/worldedit/UnknownDirectionException.java (100%) rename src/{ => main}/com/sk89q/worldedit/UnknownItemException.java (100%) rename src/{ => main}/com/sk89q/worldedit/Vector.java (100%) rename src/{ => main}/com/sk89q/worldedit/Vector2D.java (100%) rename src/{ => main}/com/sk89q/worldedit/WorldEdit.java (96%) rename src/{ => main}/com/sk89q/worldedit/WorldEditException.java (100%) rename src/{ => main}/com/sk89q/worldedit/WorldEditNotInstalled.java (100%) rename src/{ => main}/com/sk89q/worldedit/WorldEditOperation.java (100%) rename src/{ => main}/com/sk89q/worldedit/WorldVector.java (100%) rename src/{ => main}/com/sk89q/worldedit/bags/BlockBag.java (100%) rename src/{ => main}/com/sk89q/worldedit/bags/BlockBagException.java (100%) rename src/{ => main}/com/sk89q/worldedit/bags/OutOfBlocksException.java (100%) rename src/{ => main}/com/sk89q/worldedit/bags/OutOfSpaceException.java (100%) rename src/{ => main}/com/sk89q/worldedit/bags/UnplaceableBlockException.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/BaseBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/BaseItem.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/BaseItemStack.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/BlockID.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/BlockType.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/ChestBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/ClothColor.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/ContainerBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/DispenserBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/FurnaceBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/ItemType.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/MobSpawnerBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/NoteBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/SignBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/blocks/TileEntityBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitConfiguration.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitPlayer.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitServerInterface.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitUtil.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/BukkitWorld.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/WorldEditAPI.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/WorldEditCriticalPlayerListener.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/WorldEditPlayerListener.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/WorldEditPlugin.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java (100%) rename src/{ => main}/com/sk89q/worldedit/bukkit/selections/RegionSelection.java (91%) rename src/{ => main}/com/sk89q/worldedit/bukkit/selections/Selection.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/BrushCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/ChunkCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/ClipboardCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/GeneralCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/GenerationCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/HistoryCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/InsufficientArgumentsException.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/NavigationCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/RegionCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/ScriptingCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/SelectionCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/SnapshotCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/SnapshotUtilCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/SuperPickaxeCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/ToolCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/ToolUtilCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/UtilityCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/commands/WorldEditCommands.java (100%) rename src/{ => main}/com/sk89q/worldedit/cui/CUIEvent.java (100%) rename src/{ => main}/com/sk89q/worldedit/cui/CUIPointBasedRegion.java (100%) rename src/{ => main}/com/sk89q/worldedit/cui/SelectionPointEvent.java (94%) rename src/{ => main}/com/sk89q/worldedit/cui/SelectionShapeEvent.java (94%) rename src/{ => main}/com/sk89q/worldedit/data/BlockData.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/Chunk.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/ChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/ChunkStoreException.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/DataException.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/FileLegacyChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/FileMcRegionChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/ForwardSeekableInputStream.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/InvalidFormatException.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/LegacyChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/McRegionChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/McRegionReader.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/MissingChunkException.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/TrueZipLegacyChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/TrueZipMcRegionChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/ZippedLegacyChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/data/ZippedMcRegionChunkStore.java (100%) rename src/{ => main}/com/sk89q/worldedit/dev/DocumentationPrinter.java (100%) rename src/{ => main}/com/sk89q/worldedit/filtering/GaussianKernel.java (100%) rename src/{ => main}/com/sk89q/worldedit/filtering/HeightMapFilter.java (100%) rename src/{ => main}/com/sk89q/worldedit/filtering/LinearKernel.java (100%) rename src/{ => main}/com/sk89q/worldedit/masks/BlockTypeMask.java (100%) rename src/{ => main}/com/sk89q/worldedit/masks/ExistingBlockMask.java (100%) rename src/{ => main}/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java (100%) rename src/{ => main}/com/sk89q/worldedit/masks/Mask.java (100%) rename src/{ => main}/com/sk89q/worldedit/patterns/BlockChance.java (100%) rename src/{ => main}/com/sk89q/worldedit/patterns/ClipboardPattern.java (100%) rename src/{ => main}/com/sk89q/worldedit/patterns/Pattern.java (100%) rename src/{ => main}/com/sk89q/worldedit/patterns/RandomFillPattern.java (100%) rename src/{ => main}/com/sk89q/worldedit/patterns/SingleBlockPattern.java (100%) rename src/{ => main}/com/sk89q/worldedit/regions/CuboidRegion.java (99%) rename src/{ => main}/com/sk89q/worldedit/regions/CuboidRegionSelector.java (100%) rename src/{ => main}/com/sk89q/worldedit/regions/Polygonal2DRegion.java (96%) rename src/{ => main}/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java (100%) rename src/{ => main}/com/sk89q/worldedit/regions/Region.java (100%) rename src/{ => main}/com/sk89q/worldedit/regions/RegionOperationException.java (100%) rename src/{ => main}/com/sk89q/worldedit/regions/RegionSelector.java (100%) rename src/{ => main}/com/sk89q/worldedit/scripting/CraftScriptContext.java (100%) rename src/{ => main}/com/sk89q/worldedit/scripting/CraftScriptEngine.java (100%) rename src/{ => main}/com/sk89q/worldedit/scripting/CraftScriptEnvironment.java (100%) rename src/{ => main}/com/sk89q/worldedit/scripting/RhinoContextFactory.java (100%) rename src/{ => main}/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java (95%) rename src/{ => main}/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java (95%) rename src/{ => main}/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java (92%) rename src/{ => main}/com/sk89q/worldedit/snapshots/InvalidSnapshotException.java (100%) rename src/{ => main}/com/sk89q/worldedit/snapshots/ModificationTimerParser.java (95%) rename src/{ => main}/com/sk89q/worldedit/snapshots/Snapshot.java (99%) rename src/{ => main}/com/sk89q/worldedit/snapshots/SnapshotDateParser.java (100%) rename src/{ => main}/com/sk89q/worldedit/snapshots/SnapshotRepository.java (100%) rename src/{ => main}/com/sk89q/worldedit/snapshots/SnapshotRestore.java (100%) rename src/{ => main}/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/AreaPickaxe.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/BlockDataCyler.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/BlockReplacer.java (95%) rename src/{ => main}/com/sk89q/worldedit/tools/BlockTool.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/BrushTool.java (95%) rename src/{ => main}/com/sk89q/worldedit/tools/DoubleActionBlockTool.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/QueryTool.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/RecursivePickaxe.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/SinglePickaxe.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/Tool.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/TraceTool.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/TreePlanter.java (96%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/Brush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/ClipboardBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/CylinderBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/HollowCylinderBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/HollowSphereBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/SmoothBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/tools/brushes/SphereBrush.java (100%) rename src/{ => main}/com/sk89q/worldedit/util/FileDialogUtil.java (100%) rename src/{ => main}/com/sk89q/worldedit/util/PropertiesConfiguration.java (100%) rename src/{ => main}/com/sk89q/worldedit/util/TargetBlock.java (100%) rename src/{ => main}/com/sk89q/worldedit/util/TreeGenerator.java (100%) rename config.yml => src/resources/config.yml (100%) rename plugin.yml => src/resources/plugin.yml (96%) diff --git a/README.txt b/README.txt index cce7e138e..888db10c9 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -WorldEdit +WorldEdit ${project.version} Copyright (c) 2010, 2011 sk89q Licensed under the GNU General Public License v3 diff --git a/build.xml b/build.xml index 38f455c53..2d73a9da9 100644 --- a/build.xml +++ b/build.xml @@ -1,8 +1,9 @@ WorldEdit allows for editing the Minecraft SMP world en-masse, de-griefing, and fixing issues. - - + + + @@ -43,10 +44,10 @@ - - + + - + @@ -72,6 +73,7 @@ + diff --git a/contrib/sunrhino/README.txt b/contrib/sunrhino/README.txt deleted file mode 100644 index 29dd20bd6..000000000 --- a/contrib/sunrhino/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -This contains sources for an implementation of the Sun Rhino engine for -WorldEdit. However, this Rhino version is an internal component of -the Sun JVM and thus it is implementation specific. \ No newline at end of file diff --git a/contrib/sunrhino/build.xml b/contrib/sunrhino/build.xml deleted file mode 100644 index f710301e6..000000000 --- a/contrib/sunrhino/build.xml +++ /dev/null @@ -1,47 +0,0 @@ - - Sun Rhino implementation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoContextFactory.java b/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoContextFactory.java deleted file mode 100644 index aad0fa2ae..000000000 --- a/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoContextFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -// $Id$ -/* - * WorldEdit - * Copyright (C) 2010 sk89q - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.sk89q.worldedit.scripting; - -import sun.org.mozilla.javascript.internal.*; - -public class SunRhinoContextFactory extends ContextFactory { - protected int timeLimit; - - public SunRhinoContextFactory(int timeLimit) { - this.timeLimit = timeLimit; - } - - protected Context makeContext() { - RhinoContext cx = new RhinoContext(this); - cx.setInstructionObserverThreshold(10000); - return cx; - } - - protected void observeInstructionCount(Context cx, int instructionCount) { - RhinoContext mcx = (RhinoContext)cx; - long currentTime = System.currentTimeMillis(); - - if (currentTime - mcx.startTime > timeLimit) { - throw new Error("Script timed out (" + timeLimit + "ms)"); - } - } - - protected Object doTopCall(Callable callable, Context cx, Scriptable scope, - Scriptable thisObj, Object[] args) { - RhinoContext mcx = (RhinoContext)cx; - mcx.startTime = System.currentTimeMillis(); - - return super.doTopCall(callable, cx, scope, thisObj, args); - } - - private static class RhinoContext extends Context { - long startTime; - - public RhinoContext(ContextFactory factory) { - super(); - } - } -} \ No newline at end of file diff --git a/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoCraftScriptEngine.java b/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoCraftScriptEngine.java deleted file mode 100644 index 4706b69e4..000000000 --- a/contrib/sunrhino/src/com/sk89q/worldedit/scripting/SunRhinoCraftScriptEngine.java +++ /dev/null @@ -1,90 +0,0 @@ -// $Id$ -/* - * WorldEdit - * Copyright (C) 2010 sk89q - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ - -package com.sk89q.worldedit.scripting; - -import java.util.Map; -import javax.script.ScriptException; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.WorldEditException; -import sun.org.mozilla.javascript.internal.*; - -public class SunRhinoCraftScriptEngine implements CraftScriptEngine { - private int timeLimit; - - @Override - public void setTimeLimit(int milliseconds) { - timeLimit = milliseconds; - } - - @Override - public int getTimeLimit() { - return timeLimit; - } - - @Override - public Object evaluate(final String script, final String filename, - final Map args) - throws ScriptException, Throwable { - SunRhinoContextFactory factory = new SunRhinoContextFactory(timeLimit); - factory.initApplicationClassLoader(WorldEdit.class.getClassLoader()); - - try { - return factory.call(new ContextAction() { - public Object run(Context cx) { - Scriptable topLevel = new ImporterTopLevel(cx); - Scriptable scope = cx.initStandardObjects(); - topLevel.setParentScope(scope); - - for (Map.Entry entry : args.entrySet()) { - ScriptableObject.putProperty(scope, entry.getKey(), - Context.javaToJS(entry.getValue(), scope)); - } - - return cx.evaluateString(topLevel, script, filename, 1, null); - } - }); - } catch (Error e) { - throw new ScriptException(e.getMessage()); - } catch (RhinoException e) { - if (e instanceof WrappedException) { - Throwable cause = ((WrappedException)e).getCause(); - if (cause instanceof WorldEditException) { - throw ((WrappedException)e).getCause(); - } - } - - String msg; - int line = (line = e.lineNumber()) == 0 ? -1 : line; - - if (e instanceof JavaScriptException) { - msg = String.valueOf(((JavaScriptException)e).getValue()); - } else { - msg = e.getMessage(); - } - - ScriptException scriptException = - new ScriptException(msg, e.sourceName(), line); - scriptException.initCause(e); - - throw scriptException; - } - } - -} diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..55fe92d7f --- /dev/null +++ b/pom.xml @@ -0,0 +1,171 @@ + + + 4.0.0 + com.sk89q + worldedit + 4.4.0-SNAPSHOT + WorldEdit + WorldEdit allows for editing the Minecraft SMP world + en-masse, de-griefing, and fixing issues. + + + scm:git:git://github.com/sk89q/worldedit.git + https://github.com/sk89q/worldedit + scm:git:git@github.com:sk89q/worldedit.git + + + + + + sk89q-mvn2 + http://mvn2.sk89q.com/repo + + + + bukkit-repo + http://repo.bukkit.org/artifactory/repo + + + + + + + com.sk89q + dummypermscompat + 1.0 + + + + + org.bukkit + bukkit + 0.0.1-SNAPSHOT + + + + + de.schlichtherle + truezip + 6.8.3 + + + + + rhino + js + 1.7R2 + + + + + com.sk89q + jchronic + 0.2.4a + jar + compile + + + + + ${basedir}/src/main + + + + + + true + ${basedir} + + src/resources/plugin.yml + + + + defaults/ + true + ${basedir} + + src/resources/config.yml + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + + true + true + + truezip.jar WorldEdit/truezip.jar js.jar + WorldEdit/js.jar + true + true + + + + ${project.version} + + + + + + + + maven-assembly-plugin + 2.2-beta-2 + + ${basedir}/src/assembly/default.xml + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.4 + + + package + + shade + + + + + + com.sk89q:jchronic + + + + + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.1 + + + + \ No newline at end of file diff --git a/src/assembly/default.xml b/src/assembly/default.xml new file mode 100644 index 000000000..03805f40c --- /dev/null +++ b/src/assembly/default.xml @@ -0,0 +1,35 @@ + + + false + + tar.gz + tar.bz2 + zip + + + + ${project.build.directory}/${artifactId}-${project.version}.jar + WorldEdit.jar + / + false + + + README.txt + / + true + + + + + + LICENSE.txt + CHANGELOG.txt + NOTICE.txt + craftscripts/* + + + + \ No newline at end of file diff --git a/src/com/sk89q/jnbt/NBTInputStream.java b/src/com/sk89q/jnbt/NBTInputStream.java deleted file mode 100644 index 69bd5abb6..000000000 --- a/src/com/sk89q/jnbt/NBTInputStream.java +++ /dev/null @@ -1,192 +0,0 @@ -package com.sk89q.jnbt; - -/* - * JNBT License - * - * Copyright (c) 2010 Graham Edgecombe - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of the JNBT team nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -import java.io.Closeable; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.sk89q.jnbt.ByteArrayTag; -import com.sk89q.jnbt.ByteTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.DoubleTag; -import com.sk89q.jnbt.EndTag; -import com.sk89q.jnbt.FloatTag; -import com.sk89q.jnbt.IntTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.LongTag; -import com.sk89q.jnbt.NBTConstants; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; - -/** - *

This class reads NBT, or - * Named Binary Tag streams, and produces an object graph of - * subclasses of the Tag object.

- * - *

The NBT format was created by Markus Persson, and the specification may - * be found at - * http://www.minecraft.net/docs/NBT.txt.

- * @author Graham Edgecombe - * - */ -public final class NBTInputStream implements Closeable { - - /** - * The data input stream. - */ - private final DataInputStream is; - - /** - * Creates a new NBTInputStream, which will source its data - * from the specified input stream. - * @param is The input stream. - * @throws IOException if an I/O error occurs. - */ - public NBTInputStream(InputStream is) throws IOException { - this.is = new DataInputStream(is); - } - - /** - * Reads an NBT tag from the stream. - * @return The tag that was read. - * @throws IOException if an I/O error occurs. - */ - public Tag readTag() throws IOException { - return readTag(0); - } - - /** - * Reads an NBT from the stream. - * @param depth The depth of this tag. - * @return The tag that was read. - * @throws IOException if an I/O error occurs. - */ - private Tag readTag(int depth) throws IOException { - int type = is.readByte() & 0xFF; - - String name; - if(type != NBTConstants.TYPE_END) { - int nameLength = is.readShort() & 0xFFFF; - byte[] nameBytes = new byte[nameLength]; - is.readFully(nameBytes); - name = new String(nameBytes, NBTConstants.CHARSET); - } else { - name = ""; - } - - return readTagPayload(type, name, depth); - } - - /** - * Reads the payload of a tag, given the name and type. - * @param type The type. - * @param name The name. - * @param depth The depth. - * @return The tag. - * @throws IOException if an I/O error occurs. - */ - private Tag readTagPayload(int type, String name, int depth) throws IOException { - switch(type) { - case NBTConstants.TYPE_END: - if(depth == 0) { - throw new IOException("TAG_End found without a TAG_Compound/TAG_List tag preceding it."); - } else { - return new EndTag(); - } - case NBTConstants.TYPE_BYTE: - return new ByteTag(name, is.readByte()); - case NBTConstants.TYPE_SHORT: - return new ShortTag(name, is.readShort()); - case NBTConstants.TYPE_INT: - return new IntTag(name, is.readInt()); - case NBTConstants.TYPE_LONG: - return new LongTag(name, is.readLong()); - case NBTConstants.TYPE_FLOAT: - return new FloatTag(name, is.readFloat()); - case NBTConstants.TYPE_DOUBLE: - return new DoubleTag(name, is.readDouble()); - case NBTConstants.TYPE_BYTE_ARRAY: - int length = is.readInt(); - byte[] bytes = new byte[length]; - is.readFully(bytes); - return new ByteArrayTag(name, bytes); - case NBTConstants.TYPE_STRING: - length = is.readShort(); - bytes = new byte[length]; - is.readFully(bytes); - return new StringTag(name, new String(bytes, NBTConstants.CHARSET)); - case NBTConstants.TYPE_LIST: - int childType = is.readByte(); - length = is.readInt(); - - List tagList = new ArrayList(); - for(int i = 0; i < length; i++) { - Tag tag = readTagPayload(childType, "", depth + 1); - if(tag instanceof EndTag) { - throw new IOException("TAG_End not permitted in a list."); - } - tagList.add(tag); - } - - return new ListTag(name, NBTUtils.getTypeClass(childType), tagList); - case NBTConstants.TYPE_COMPOUND: - Map tagMap = new HashMap(); - while(true) { - Tag tag = readTag(depth + 1); - if(tag instanceof EndTag) { - break; - } else { - tagMap.put(tag.getName(), tag); - } - } - - return new CompoundTag(name, tagMap); - default: - throw new IOException("Invalid tag type: " + type + "."); - } - } - - @Override - public void close() throws IOException { - is.close(); - } - -} diff --git a/src/com/sk89q/jnbt/NBTOutputStream.java b/src/com/sk89q/jnbt/NBTOutputStream.java deleted file mode 100644 index 41bea562e..000000000 --- a/src/com/sk89q/jnbt/NBTOutputStream.java +++ /dev/null @@ -1,271 +0,0 @@ -package com.sk89q.jnbt; - -import java.io.Closeable; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.List; -import java.util.zip.GZIPOutputStream; -import com.sk89q.jnbt.ByteArrayTag; -import com.sk89q.jnbt.ByteTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.DoubleTag; -import com.sk89q.jnbt.EndTag; -import com.sk89q.jnbt.FloatTag; -import com.sk89q.jnbt.IntTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.LongTag; -import com.sk89q.jnbt.NBTConstants; -import com.sk89q.jnbt.NBTUtils; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; - -/* - * JNBT License - * - * Copyright (c) 2010 Graham Edgecombe - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of the JNBT team nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - *

This class writes NBT, or - * Named Binary Tag Tag objects to an underlying - * OutputStream.

- * - *

The NBT format was created by Markus Persson, and the specification may - * be found at - * http://www.minecraft.net/docs/NBT.txt.

- * @author Graham Edgecombe - * - */ -public final class NBTOutputStream implements Closeable { - - /** - * The output stream. - */ - private final DataOutputStream os; - - /** - * Creates a new NBTOutputStream, which will write data to the - * specified underlying output stream. - * @param os The output stream. - * @throws IOException if an I/O error occurs. - */ - public NBTOutputStream(OutputStream os) throws IOException { - this.os = new DataOutputStream(new GZIPOutputStream(os)); - } - - /** - * Writes a tag. - * @param tag The tag to write. - * @throws IOException if an I/O error occurs. - */ - public void writeTag(Tag tag) throws IOException { - int type = NBTUtils.getTypeCode(tag.getClass()); - String name = tag.getName(); - byte[] nameBytes = name.getBytes(NBTConstants.CHARSET); - - os.writeByte(type); - os.writeShort(nameBytes.length); - os.write(nameBytes); - - if(type == NBTConstants.TYPE_END) { - throw new IOException("Named TAG_End not permitted."); - } - - writeTagPayload(tag); - } - - /** - * Writes tag payload. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeTagPayload(Tag tag) throws IOException { - int type = NBTUtils.getTypeCode(tag.getClass()); - switch(type) { - case NBTConstants.TYPE_END: - writeEndTagPayload((EndTag) tag); - break; - case NBTConstants.TYPE_BYTE: - writeByteTagPayload((ByteTag) tag); - break; - case NBTConstants.TYPE_SHORT: - writeShortTagPayload((ShortTag) tag); - break; - case NBTConstants.TYPE_INT: - writeIntTagPayload((IntTag) tag); - break; - case NBTConstants.TYPE_LONG: - writeLongTagPayload((LongTag) tag); - break; - case NBTConstants.TYPE_FLOAT: - writeFloatTagPayload((FloatTag) tag); - break; - case NBTConstants.TYPE_DOUBLE: - writeDoubleTagPayload((DoubleTag) tag); - break; - case NBTConstants.TYPE_BYTE_ARRAY: - writeByteArrayTagPayload((ByteArrayTag) tag); - break; - case NBTConstants.TYPE_STRING: - writeStringTagPayload((StringTag) tag); - break; - case NBTConstants.TYPE_LIST: - writeListTagPayload((ListTag) tag); - break; - case NBTConstants.TYPE_COMPOUND: - writeCompoundTagPayload((CompoundTag) tag); - break; - default: - throw new IOException("Invalid tag type: " + type + "."); - } - } - - /** - * Writes a TAG_Byte tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeByteTagPayload(ByteTag tag) throws IOException { - os.writeByte(tag.getValue()); - } - - /** - * Writes a TAG_Byte_Array tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException { - byte[] bytes = tag.getValue(); - os.writeInt(bytes.length); - os.write(bytes); - } - - /** - * Writes a TAG_Compound tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeCompoundTagPayload(CompoundTag tag) throws IOException { - for(Tag childTag : tag.getValue().values()) { - writeTag(childTag); - } - os.writeByte((byte) 0); // end tag - better way? - } - - /** - * Writes a TAG_List tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeListTagPayload(ListTag tag) throws IOException { - Class clazz = tag.getType(); - List tags = tag.getValue(); - int size = tags.size(); - - os.writeByte(NBTUtils.getTypeCode(clazz)); - os.writeInt(size); - for(int i = 0; i < size; i++) { - writeTagPayload(tags.get(i)); - } - } - - /** - * Writes a TAG_String tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeStringTagPayload(StringTag tag) throws IOException { - byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET); - os.writeShort(bytes.length); - os.write(bytes); - } - - /** - * Writes a TAG_Double tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeDoubleTagPayload(DoubleTag tag) throws IOException { - os.writeDouble(tag.getValue()); - } - - /** - * Writes a TAG_Float tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeFloatTagPayload(FloatTag tag) throws IOException { - os.writeFloat(tag.getValue()); - } - - /** - * Writes a TAG_Long tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeLongTagPayload(LongTag tag) throws IOException { - os.writeLong(tag.getValue()); - } - - /** - * Writes a TAG_Int tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeIntTagPayload(IntTag tag) throws IOException { - os.writeInt(tag.getValue()); - } - - /** - * Writes a TAG_Short tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeShortTagPayload(ShortTag tag) throws IOException { - os.writeShort(tag.getValue()); - } - - /** - * Writes a TAG_Empty tag. - * @param tag The tag. - * @throws IOException if an I/O error occurs. - */ - private void writeEndTagPayload(EndTag tag) { - /* empty */ - } - - @Override - public void close() throws IOException { - os.close(); - } - -} diff --git a/src/com/sk89q/jnbt/NBTUtils.java b/src/com/sk89q/jnbt/NBTUtils.java deleted file mode 100644 index 1410453a4..000000000 --- a/src/com/sk89q/jnbt/NBTUtils.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.sk89q.jnbt; - -import com.sk89q.jnbt.ByteArrayTag; -import com.sk89q.jnbt.ByteTag; -import com.sk89q.jnbt.CompoundTag; -import com.sk89q.jnbt.DoubleTag; -import com.sk89q.jnbt.EndTag; -import com.sk89q.jnbt.FloatTag; -import com.sk89q.jnbt.IntTag; -import com.sk89q.jnbt.ListTag; -import com.sk89q.jnbt.LongTag; -import com.sk89q.jnbt.NBTConstants; -import com.sk89q.jnbt.ShortTag; -import com.sk89q.jnbt.StringTag; -import com.sk89q.jnbt.Tag; - -/* - * JNBT License - * - * Copyright (c) 2010 Graham Edgecombe - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of the JNBT team nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * A class which contains NBT-related utility methods. - * @author Graham Edgecombe - * - */ -public final class NBTUtils { - - /** - * Gets the type name of a tag. - * @param clazz The tag class. - * @return The type name. - */ - public static String getTypeName(Class clazz) { - if(clazz.equals(ByteArrayTag.class)) { - return "TAG_Byte_Array"; - } else if(clazz.equals(ByteTag.class)) { - return "TAG_Byte"; - } else if(clazz.equals(CompoundTag.class)) { - return "TAG_Compound"; - } else if(clazz.equals(DoubleTag.class)) { - return "TAG_Double"; - } else if(clazz.equals(EndTag.class)) { - return "TAG_End"; - } else if(clazz.equals(FloatTag.class)) { - return "TAG_Float"; - } else if(clazz.equals(IntTag.class)) { - return "TAG_Int"; - } else if(clazz.equals(ListTag.class)) { - return "TAG_List"; - } else if(clazz.equals(LongTag.class)) { - return "TAG_Long"; - } else if(clazz.equals(ShortTag.class)) { - return "TAG_Short"; - } else if(clazz.equals(StringTag.class)) { - return "TAG_String"; - } else { - throw new IllegalArgumentException("Invalid tag classs (" + clazz.getName() + ")."); - } - } - - /** - * Gets the type code of a tag class. - * @param clazz The tag class. - * @return The type code. - * @throws IllegalArgumentException if the tag class is invalid. - */ - public static int getTypeCode(Class clazz) { - if(clazz.equals(ByteArrayTag.class)) { - return NBTConstants.TYPE_BYTE_ARRAY; - } else if(clazz.equals(ByteTag.class)) { - return NBTConstants.TYPE_BYTE; - } else if(clazz.equals(CompoundTag.class)) { - return NBTConstants.TYPE_COMPOUND; - } else if(clazz.equals(DoubleTag.class)) { - return NBTConstants.TYPE_DOUBLE; - } else if(clazz.equals(EndTag.class)) { - return NBTConstants.TYPE_END; - } else if(clazz.equals(FloatTag.class)) { - return NBTConstants.TYPE_FLOAT; - } else if(clazz.equals(IntTag.class)) { - return NBTConstants.TYPE_INT; - } else if(clazz.equals(ListTag.class)) { - return NBTConstants.TYPE_LIST; - } else if(clazz.equals(LongTag.class)) { - return NBTConstants.TYPE_LONG; - } else if(clazz.equals(ShortTag.class)) { - return NBTConstants.TYPE_SHORT; - } else if(clazz.equals(StringTag.class)) { - return NBTConstants.TYPE_STRING; - } else { - throw new IllegalArgumentException("Invalid tag classs (" + clazz.getName() + ")."); - } - } - - /** - * Gets the class of a type of tag. - * @param type The type. - * @return The class. - * @throws IllegalArgumentException if the tag type is invalid. - */ - public static Class getTypeClass(int type) { - switch(type) { - case NBTConstants.TYPE_END: - return EndTag.class; - case NBTConstants.TYPE_BYTE: - return ByteTag.class; - case NBTConstants.TYPE_SHORT: - return ShortTag.class; - case NBTConstants.TYPE_INT: - return IntTag.class; - case NBTConstants.TYPE_LONG: - return LongTag.class; - case NBTConstants.TYPE_FLOAT: - return FloatTag.class; - case NBTConstants.TYPE_DOUBLE: - return DoubleTag.class; - case NBTConstants.TYPE_BYTE_ARRAY: - return ByteArrayTag.class; - case NBTConstants.TYPE_STRING: - return StringTag.class; - case NBTConstants.TYPE_LIST: - return ListTag.class; - case NBTConstants.TYPE_COMPOUND: - return CompoundTag.class; - default: - throw new IllegalArgumentException("Invalid tag type : " + type + "."); - } - } - - /** - * Default private constructor. - */ - private NBTUtils() { - - } - -} diff --git a/src/com/sk89q/bukkit/migration/ConfigurationPermissionsResolver.java b/src/main/com/sk89q/bukkit/migration/ConfigurationPermissionsResolver.java similarity index 100% rename from src/com/sk89q/bukkit/migration/ConfigurationPermissionsResolver.java rename to src/main/com/sk89q/bukkit/migration/ConfigurationPermissionsResolver.java diff --git a/src/com/sk89q/bukkit/migration/FlatFilePermissionsResolver.java b/src/main/com/sk89q/bukkit/migration/FlatFilePermissionsResolver.java similarity index 100% rename from src/com/sk89q/bukkit/migration/FlatFilePermissionsResolver.java rename to src/main/com/sk89q/bukkit/migration/FlatFilePermissionsResolver.java diff --git a/src/com/sk89q/bukkit/migration/NijiPermissionsResolver.java b/src/main/com/sk89q/bukkit/migration/NijiPermissionsResolver.java similarity index 100% rename from src/com/sk89q/bukkit/migration/NijiPermissionsResolver.java rename to src/main/com/sk89q/bukkit/migration/NijiPermissionsResolver.java diff --git a/src/com/sk89q/bukkit/migration/PermissionsProvider.java b/src/main/com/sk89q/bukkit/migration/PermissionsProvider.java similarity index 100% rename from src/com/sk89q/bukkit/migration/PermissionsProvider.java rename to src/main/com/sk89q/bukkit/migration/PermissionsProvider.java diff --git a/src/com/sk89q/bukkit/migration/PermissionsResolver.java b/src/main/com/sk89q/bukkit/migration/PermissionsResolver.java similarity index 100% rename from src/com/sk89q/bukkit/migration/PermissionsResolver.java rename to src/main/com/sk89q/bukkit/migration/PermissionsResolver.java diff --git a/src/com/sk89q/bukkit/migration/PermissionsResolverManager.java b/src/main/com/sk89q/bukkit/migration/PermissionsResolverManager.java similarity index 100% rename from src/com/sk89q/bukkit/migration/PermissionsResolverManager.java rename to src/main/com/sk89q/bukkit/migration/PermissionsResolverManager.java diff --git a/src/com/sk89q/bukkit/migration/PermissionsResolverServerListener.java b/src/main/com/sk89q/bukkit/migration/PermissionsResolverServerListener.java similarity index 100% rename from src/com/sk89q/bukkit/migration/PermissionsResolverServerListener.java rename to src/main/com/sk89q/bukkit/migration/PermissionsResolverServerListener.java diff --git a/src/com/sk89q/bukkit/migration/PluginPermissionsResolver.java b/src/main/com/sk89q/bukkit/migration/PluginPermissionsResolver.java similarity index 92% rename from src/com/sk89q/bukkit/migration/PluginPermissionsResolver.java rename to src/main/com/sk89q/bukkit/migration/PluginPermissionsResolver.java index 44990385f..48956736d 100644 --- a/src/com/sk89q/bukkit/migration/PluginPermissionsResolver.java +++ b/src/main/com/sk89q/bukkit/migration/PluginPermissionsResolver.java @@ -27,21 +27,17 @@ public class PluginPermissionsResolver implements PermissionsResolver { this.resolver = resolver; } - @Override public void load() { } - @Override public boolean hasPermission(String name, String permission) { return resolver.hasPermission(name, permission); } - @Override public boolean inGroup(String player, String group) { return resolver.inGroup(player, group); } - @Override public String[] getGroups(String player) { return resolver.getGroups(player); } diff --git a/src/com/sk89q/jnbt/ByteArrayTag.java b/src/main/com/sk89q/jnbt/ByteArrayTag.java similarity index 62% rename from src/com/sk89q/jnbt/ByteArrayTag.java rename to src/main/com/sk89q/jnbt/ByteArrayTag.java index 739203acc..53e6136a1 100644 --- a/src/com/sk89q/jnbt/ByteArrayTag.java +++ b/src/main/com/sk89q/jnbt/ByteArrayTag.java @@ -37,47 +37,51 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Byte_Array tag. + * * @author Graham Edgecombe - * + * */ public final class ByteArrayTag extends Tag { - - /** - * The value. - */ - private final byte[] value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public ByteArrayTag(String name, byte[] value) { - super(name); - this.value = value; - } - - @Override - public byte[] getValue() { - return value; - } - - @Override - public String toString() { - StringBuilder hex = new StringBuilder(); - for(byte b : value) { - String hexDigits = Integer.toHexString(b).toUpperCase(); - if(hexDigits.length() == 1) { - hex.append("0"); - } - hex.append(hexDigits).append(" "); - } - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Byte_Array" + append + ": " + hex.toString(); - } + + /** + * The value. + */ + private final byte[] value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public ByteArrayTag(String name, byte[] value) { + super(name); + this.value = value; + } + + @Override + public byte[] getValue() { + return value; + } + + @Override + public String toString() { + StringBuilder hex = new StringBuilder(); + for (byte b : value) { + String hexDigits = Integer.toHexString(b).toUpperCase(); + if (hexDigits.length() == 1) { + hex.append("0"); + } + hex.append(hexDigits).append(" "); + } + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Byte_Array" + append + ": " + hex.toString(); + } } diff --git a/src/com/sk89q/jnbt/ByteTag.java b/src/main/com/sk89q/jnbt/ByteTag.java similarity index 70% rename from src/com/sk89q/jnbt/ByteTag.java rename to src/main/com/sk89q/jnbt/ByteTag.java index 358ec889b..81051db0e 100644 --- a/src/com/sk89q/jnbt/ByteTag.java +++ b/src/main/com/sk89q/jnbt/ByteTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Byte tag. + * * @author Graham Edgecombe - * + * */ public final class ByteTag extends Tag { - /** - * The value. - */ - private final byte value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public ByteTag(String name, byte value) { - super(name); - this.value = value; - } + /** + * The value. + */ + private final byte value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public ByteTag(String name, byte value) { + super(name); + this.value = value; + } + + @Override + public Byte getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Byte" + append + ": " + value; + } - @Override - public Byte getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Byte" + append + ": " + value; - } - } diff --git a/src/com/sk89q/jnbt/CompoundTag.java b/src/main/com/sk89q/jnbt/CompoundTag.java similarity index 60% rename from src/com/sk89q/jnbt/CompoundTag.java rename to src/main/com/sk89q/jnbt/CompoundTag.java index a7f6d833a..f42d487bd 100644 --- a/src/com/sk89q/jnbt/CompoundTag.java +++ b/src/main/com/sk89q/jnbt/CompoundTag.java @@ -39,45 +39,52 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Compound tag. + * * @author Graham Edgecombe - * + * */ public final class CompoundTag extends Tag { - - /** - * The value. - */ - private final Map value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public CompoundTag(String name, Map value) { - super(name); - this.value = Collections.unmodifiableMap(value); - } - @Override - public Map getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - StringBuilder bldr = new StringBuilder(); - bldr.append("TAG_Compound" + append + ": " + value.size() + " entries\r\n{\r\n"); - for(Map.Entry entry : value.entrySet()) { - bldr.append(" " + entry.getValue().toString().replaceAll("\r\n", "\r\n ") + "\r\n"); - } - bldr.append("}"); - return bldr.toString(); - } + /** + * The value. + */ + private final Map value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public CompoundTag(String name, Map value) { + super(name); + this.value = Collections.unmodifiableMap(value); + } + + @Override + public Map getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + StringBuilder bldr = new StringBuilder(); + bldr.append("TAG_Compound" + append + ": " + value.size() + + " entries\r\n{\r\n"); + for (Map.Entry entry : value.entrySet()) { + bldr.append(" " + + entry.getValue().toString().replaceAll("\r\n", "\r\n ") + + "\r\n"); + } + bldr.append("}"); + return bldr.toString(); + } } diff --git a/src/com/sk89q/jnbt/DoubleTag.java b/src/main/com/sk89q/jnbt/DoubleTag.java similarity index 70% rename from src/com/sk89q/jnbt/DoubleTag.java rename to src/main/com/sk89q/jnbt/DoubleTag.java index ed74c14bc..8b7917f3b 100644 --- a/src/com/sk89q/jnbt/DoubleTag.java +++ b/src/main/com/sk89q/jnbt/DoubleTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Double tag. + * * @author Graham Edgecombe - * + * */ public final class DoubleTag extends Tag { - - /** - * The value. - */ - private final double value; - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public DoubleTag(String name, double value) { - super(name); - this.value = value; - } - - @Override - public Double getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Double" + append + ": " + value; - } + /** + * The value. + */ + private final double value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public DoubleTag(String name, double value) { + super(name); + this.value = value; + } + + @Override + public Double getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Double" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/EndTag.java b/src/main/com/sk89q/jnbt/EndTag.java similarity index 85% rename from src/com/sk89q/jnbt/EndTag.java rename to src/main/com/sk89q/jnbt/EndTag.java index 176c86ffc..5934fca9d 100644 --- a/src/com/sk89q/jnbt/EndTag.java +++ b/src/main/com/sk89q/jnbt/EndTag.java @@ -37,26 +37,27 @@ import com.sk89q.jnbt.Tag; /** * The TAG_End tag. + * * @author Graham Edgecombe - * + * */ public final class EndTag extends Tag { - /** - * Creates the tag. - */ - public EndTag() { - super(""); - } + /** + * Creates the tag. + */ + public EndTag() { + super(""); + } - @Override - public Object getValue() { - return null; - } - - @Override - public String toString() { - return "TAG_End"; - } + @Override + public Object getValue() { + return null; + } + + @Override + public String toString() { + return "TAG_End"; + } } diff --git a/src/com/sk89q/jnbt/FloatTag.java b/src/main/com/sk89q/jnbt/FloatTag.java similarity index 70% rename from src/com/sk89q/jnbt/FloatTag.java rename to src/main/com/sk89q/jnbt/FloatTag.java index 0d9055356..463b5db68 100644 --- a/src/com/sk89q/jnbt/FloatTag.java +++ b/src/main/com/sk89q/jnbt/FloatTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Float tag. + * * @author Graham Edgecombe - * + * */ public final class FloatTag extends Tag { - /** - * The value. - */ - private final float value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public FloatTag(String name, float value) { - super(name); - this.value = value; - } - - @Override - public Float getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Float" + append + ": " + value; - } + /** + * The value. + */ + private final float value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public FloatTag(String name, float value) { + super(name); + this.value = value; + } + + @Override + public Float getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Float" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/IntTag.java b/src/main/com/sk89q/jnbt/IntTag.java similarity index 70% rename from src/com/sk89q/jnbt/IntTag.java rename to src/main/com/sk89q/jnbt/IntTag.java index b5187b197..cfc643ffd 100644 --- a/src/com/sk89q/jnbt/IntTag.java +++ b/src/main/com/sk89q/jnbt/IntTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Int tag. + * * @author Graham Edgecombe - * + * */ public final class IntTag extends Tag { - /** - * The value. - */ - private final int value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public IntTag(String name, int value) { - super(name); - this.value = value; - } + /** + * The value. + */ + private final int value; - @Override - public Integer getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Int" + append + ": " + value; - } + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public IntTag(String name, int value) { + super(name); + this.value = value; + } + + @Override + public Integer getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Int" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/ListTag.java b/src/main/com/sk89q/jnbt/ListTag.java similarity index 54% rename from src/com/sk89q/jnbt/ListTag.java rename to src/main/com/sk89q/jnbt/ListTag.java index 17e8096eb..df701ea5f 100644 --- a/src/com/sk89q/jnbt/ListTag.java +++ b/src/main/com/sk89q/jnbt/ListTag.java @@ -40,60 +40,69 @@ import com.sk89q.jnbt.Tag; /** * The TAG_List tag. + * * @author Graham Edgecombe - * + * */ public final class ListTag extends Tag { - /** - * The type. - */ - private final Class type; - - /** - * The value. - */ - private final List value; - - /** - * Creates the tag. - * @param name The name. - * @param type The type of item in the list. - * @param value The value. - */ - public ListTag(String name, Class type, List value) { - super(name); - this.type = type; - this.value = Collections.unmodifiableList(value); - } - - /** - * Gets the type of item in this list. - * @return The type of item in this list. - */ - public Class getType() { - return type; - } - - @Override - public List getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - StringBuilder bldr = new StringBuilder(); - bldr.append("TAG_List" + append + ": " + value.size() + " entries of type " + NBTUtils.getTypeName(type) + "\r\n{\r\n"); - for(Tag t : value) { - bldr.append(" " + t.toString().replaceAll("\r\n", "\r\n ") + "\r\n"); - } - bldr.append("}"); - return bldr.toString(); - } + /** + * The type. + */ + private final Class type; + + /** + * The value. + */ + private final List value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param type + * The type of item in the list. + * @param value + * The value. + */ + public ListTag(String name, Class type, List value) { + super(name); + this.type = type; + this.value = Collections.unmodifiableList(value); + } + + /** + * Gets the type of item in this list. + * + * @return The type of item in this list. + */ + public Class getType() { + return type; + } + + @Override + public List getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + StringBuilder bldr = new StringBuilder(); + bldr.append("TAG_List" + append + ": " + value.size() + + " entries of type " + NBTUtils.getTypeName(type) + + "\r\n{\r\n"); + for (Tag t : value) { + bldr.append(" " + t.toString().replaceAll("\r\n", "\r\n ") + + "\r\n"); + } + bldr.append("}"); + return bldr.toString(); + } } diff --git a/src/com/sk89q/jnbt/LongTag.java b/src/main/com/sk89q/jnbt/LongTag.java similarity index 70% rename from src/com/sk89q/jnbt/LongTag.java rename to src/main/com/sk89q/jnbt/LongTag.java index 66390f350..aa383fbc9 100644 --- a/src/com/sk89q/jnbt/LongTag.java +++ b/src/main/com/sk89q/jnbt/LongTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Long tag. + * * @author Graham Edgecombe - * + * */ public final class LongTag extends Tag { - /** - * The value. - */ - private final long value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public LongTag(String name, long value) { - super(name); - this.value = value; - } - - @Override - public Long getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Long" + append + ": " + value; - } + /** + * The value. + */ + private final long value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public LongTag(String name, long value) { + super(name); + this.value = value; + } + + @Override + public Long getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Long" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/NBTConstants.java b/src/main/com/sk89q/jnbt/NBTConstants.java similarity index 75% rename from src/com/sk89q/jnbt/NBTConstants.java rename to src/main/com/sk89q/jnbt/NBTConstants.java index 7533d8574..b8fe8d105 100644 --- a/src/com/sk89q/jnbt/NBTConstants.java +++ b/src/main/com/sk89q/jnbt/NBTConstants.java @@ -37,36 +37,30 @@ import java.nio.charset.Charset; /** * A class which holds constant values. + * * @author Graham Edgecombe - * + * */ public final class NBTConstants { - - /** - * The character set used by NBT (UTF-8). - */ - public static final Charset CHARSET = Charset.forName("UTF-8"); - - /** - * Tag type constants. - */ - public static final int TYPE_END = 0, - TYPE_BYTE = 1, - TYPE_SHORT = 2, - TYPE_INT = 3, - TYPE_LONG = 4, - TYPE_FLOAT = 5, - TYPE_DOUBLE = 6, - TYPE_BYTE_ARRAY = 7, - TYPE_STRING = 8, - TYPE_LIST = 9, - TYPE_COMPOUND = 10; - - /** - * Default private constructor. - */ - private NBTConstants() { - - } + + /** + * The character set used by NBT (UTF-8). + */ + public static final Charset CHARSET = Charset.forName("UTF-8"); + + /** + * Tag type constants. + */ + public static final int TYPE_END = 0, TYPE_BYTE = 1, TYPE_SHORT = 2, + TYPE_INT = 3, TYPE_LONG = 4, TYPE_FLOAT = 5, TYPE_DOUBLE = 6, + TYPE_BYTE_ARRAY = 7, TYPE_STRING = 8, TYPE_LIST = 9, + TYPE_COMPOUND = 10; + + /** + * Default private constructor. + */ + private NBTConstants() { + + } } diff --git a/src/main/com/sk89q/jnbt/NBTInputStream.java b/src/main/com/sk89q/jnbt/NBTInputStream.java new file mode 100644 index 000000000..095f4b84a --- /dev/null +++ b/src/main/com/sk89q/jnbt/NBTInputStream.java @@ -0,0 +1,211 @@ +package com.sk89q.jnbt; + +/* + * JNBT License + * + * Copyright (c) 2010 Graham Edgecombe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the JNBT team nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import java.io.Closeable; +import java.io.DataInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.DoubleTag; +import com.sk89q.jnbt.EndTag; +import com.sk89q.jnbt.FloatTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.LongTag; +import com.sk89q.jnbt.NBTConstants; +import com.sk89q.jnbt.NBTUtils; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; + +/** + *

+ * This class reads NBT, or Named Binary Tag + * streams, and produces an object graph of subclasses of the Tag + * object. + *

+ * + *

+ * The NBT format was created by Markus Persson, and the specification may be + * found at + * http://www.minecraft.net/docs/NBT.txt. + *

+ * + * @author Graham Edgecombe + * + */ +public final class NBTInputStream implements Closeable { + + /** + * The data input stream. + */ + private final DataInputStream is; + + /** + * Creates a new NBTInputStream, which will source its data + * from the specified input stream. + * + * @param is + * The input stream. + * @throws IOException + * if an I/O error occurs. + */ + public NBTInputStream(InputStream is) throws IOException { + this.is = new DataInputStream(is); + } + + /** + * Reads an NBT tag from the stream. + * + * @return The tag that was read. + * @throws IOException + * if an I/O error occurs. + */ + public Tag readTag() throws IOException { + return readTag(0); + } + + /** + * Reads an NBT from the stream. + * + * @param depth + * The depth of this tag. + * @return The tag that was read. + * @throws IOException + * if an I/O error occurs. + */ + private Tag readTag(int depth) throws IOException { + int type = is.readByte() & 0xFF; + + String name; + if (type != NBTConstants.TYPE_END) { + int nameLength = is.readShort() & 0xFFFF; + byte[] nameBytes = new byte[nameLength]; + is.readFully(nameBytes); + name = new String(nameBytes, NBTConstants.CHARSET); + } else { + name = ""; + } + + return readTagPayload(type, name, depth); + } + + /** + * Reads the payload of a tag, given the name and type. + * + * @param type + * The type. + * @param name + * The name. + * @param depth + * The depth. + * @return The tag. + * @throws IOException + * if an I/O error occurs. + */ + private Tag readTagPayload(int type, String name, int depth) + throws IOException { + switch (type) { + case NBTConstants.TYPE_END: + if (depth == 0) { + throw new IOException( + "TAG_End found without a TAG_Compound/TAG_List tag preceding it."); + } else { + return new EndTag(); + } + case NBTConstants.TYPE_BYTE: + return new ByteTag(name, is.readByte()); + case NBTConstants.TYPE_SHORT: + return new ShortTag(name, is.readShort()); + case NBTConstants.TYPE_INT: + return new IntTag(name, is.readInt()); + case NBTConstants.TYPE_LONG: + return new LongTag(name, is.readLong()); + case NBTConstants.TYPE_FLOAT: + return new FloatTag(name, is.readFloat()); + case NBTConstants.TYPE_DOUBLE: + return new DoubleTag(name, is.readDouble()); + case NBTConstants.TYPE_BYTE_ARRAY: + int length = is.readInt(); + byte[] bytes = new byte[length]; + is.readFully(bytes); + return new ByteArrayTag(name, bytes); + case NBTConstants.TYPE_STRING: + length = is.readShort(); + bytes = new byte[length]; + is.readFully(bytes); + return new StringTag(name, new String(bytes, NBTConstants.CHARSET)); + case NBTConstants.TYPE_LIST: + int childType = is.readByte(); + length = is.readInt(); + + List tagList = new ArrayList(); + for (int i = 0; i < length; i++) { + Tag tag = readTagPayload(childType, "", depth + 1); + if (tag instanceof EndTag) { + throw new IOException("TAG_End not permitted in a list."); + } + tagList.add(tag); + } + + return new ListTag(name, NBTUtils.getTypeClass(childType), tagList); + case NBTConstants.TYPE_COMPOUND: + Map tagMap = new HashMap(); + while (true) { + Tag tag = readTag(depth + 1); + if (tag instanceof EndTag) { + break; + } else { + tagMap.put(tag.getName(), tag); + } + } + + return new CompoundTag(name, tagMap); + default: + throw new IOException("Invalid tag type: " + type + "."); + } + } + + public void close() throws IOException { + is.close(); + } + +} diff --git a/src/main/com/sk89q/jnbt/NBTOutputStream.java b/src/main/com/sk89q/jnbt/NBTOutputStream.java new file mode 100644 index 000000000..404253933 --- /dev/null +++ b/src/main/com/sk89q/jnbt/NBTOutputStream.java @@ -0,0 +1,316 @@ +package com.sk89q.jnbt; + +import java.io.Closeable; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; +import java.util.zip.GZIPOutputStream; +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.DoubleTag; +import com.sk89q.jnbt.EndTag; +import com.sk89q.jnbt.FloatTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.LongTag; +import com.sk89q.jnbt.NBTConstants; +import com.sk89q.jnbt.NBTUtils; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; + +/* + * JNBT License + * + * Copyright (c) 2010 Graham Edgecombe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the JNBT team nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + *

+ * This class writes NBT, or Named Binary Tag + * Tag objects to an underlying OutputStream. + *

+ * + *

+ * The NBT format was created by Markus Persson, and the specification may be + * found at + * http://www.minecraft.net/docs/NBT.txt. + *

+ * + * @author Graham Edgecombe + * + */ +public final class NBTOutputStream implements Closeable { + + /** + * The output stream. + */ + private final DataOutputStream os; + + /** + * Creates a new NBTOutputStream, which will write data to the + * specified underlying output stream. + * + * @param os + * The output stream. + * @throws IOException + * if an I/O error occurs. + */ + public NBTOutputStream(OutputStream os) throws IOException { + this.os = new DataOutputStream(new GZIPOutputStream(os)); + } + + /** + * Writes a tag. + * + * @param tag + * The tag to write. + * @throws IOException + * if an I/O error occurs. + */ + public void writeTag(Tag tag) throws IOException { + int type = NBTUtils.getTypeCode(tag.getClass()); + String name = tag.getName(); + byte[] nameBytes = name.getBytes(NBTConstants.CHARSET); + + os.writeByte(type); + os.writeShort(nameBytes.length); + os.write(nameBytes); + + if (type == NBTConstants.TYPE_END) { + throw new IOException("Named TAG_End not permitted."); + } + + writeTagPayload(tag); + } + + /** + * Writes tag payload. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeTagPayload(Tag tag) throws IOException { + int type = NBTUtils.getTypeCode(tag.getClass()); + switch (type) { + case NBTConstants.TYPE_END: + writeEndTagPayload((EndTag) tag); + break; + case NBTConstants.TYPE_BYTE: + writeByteTagPayload((ByteTag) tag); + break; + case NBTConstants.TYPE_SHORT: + writeShortTagPayload((ShortTag) tag); + break; + case NBTConstants.TYPE_INT: + writeIntTagPayload((IntTag) tag); + break; + case NBTConstants.TYPE_LONG: + writeLongTagPayload((LongTag) tag); + break; + case NBTConstants.TYPE_FLOAT: + writeFloatTagPayload((FloatTag) tag); + break; + case NBTConstants.TYPE_DOUBLE: + writeDoubleTagPayload((DoubleTag) tag); + break; + case NBTConstants.TYPE_BYTE_ARRAY: + writeByteArrayTagPayload((ByteArrayTag) tag); + break; + case NBTConstants.TYPE_STRING: + writeStringTagPayload((StringTag) tag); + break; + case NBTConstants.TYPE_LIST: + writeListTagPayload((ListTag) tag); + break; + case NBTConstants.TYPE_COMPOUND: + writeCompoundTagPayload((CompoundTag) tag); + break; + default: + throw new IOException("Invalid tag type: " + type + "."); + } + } + + /** + * Writes a TAG_Byte tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeByteTagPayload(ByteTag tag) throws IOException { + os.writeByte(tag.getValue()); + } + + /** + * Writes a TAG_Byte_Array tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException { + byte[] bytes = tag.getValue(); + os.writeInt(bytes.length); + os.write(bytes); + } + + /** + * Writes a TAG_Compound tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeCompoundTagPayload(CompoundTag tag) throws IOException { + for (Tag childTag : tag.getValue().values()) { + writeTag(childTag); + } + os.writeByte((byte) 0); // end tag - better way? + } + + /** + * Writes a TAG_List tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeListTagPayload(ListTag tag) throws IOException { + Class clazz = tag.getType(); + List tags = tag.getValue(); + int size = tags.size(); + + os.writeByte(NBTUtils.getTypeCode(clazz)); + os.writeInt(size); + for (int i = 0; i < size; i++) { + writeTagPayload(tags.get(i)); + } + } + + /** + * Writes a TAG_String tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeStringTagPayload(StringTag tag) throws IOException { + byte[] bytes = tag.getValue().getBytes(NBTConstants.CHARSET); + os.writeShort(bytes.length); + os.write(bytes); + } + + /** + * Writes a TAG_Double tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeDoubleTagPayload(DoubleTag tag) throws IOException { + os.writeDouble(tag.getValue()); + } + + /** + * Writes a TAG_Float tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeFloatTagPayload(FloatTag tag) throws IOException { + os.writeFloat(tag.getValue()); + } + + /** + * Writes a TAG_Long tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeLongTagPayload(LongTag tag) throws IOException { + os.writeLong(tag.getValue()); + } + + /** + * Writes a TAG_Int tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeIntTagPayload(IntTag tag) throws IOException { + os.writeInt(tag.getValue()); + } + + /** + * Writes a TAG_Short tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeShortTagPayload(ShortTag tag) throws IOException { + os.writeShort(tag.getValue()); + } + + /** + * Writes a TAG_Empty tag. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. + */ + private void writeEndTagPayload(EndTag tag) { + /* empty */ + } + + public void close() throws IOException { + os.close(); + } + +} diff --git a/src/main/com/sk89q/jnbt/NBTUtils.java b/src/main/com/sk89q/jnbt/NBTUtils.java new file mode 100644 index 000000000..8c217497a --- /dev/null +++ b/src/main/com/sk89q/jnbt/NBTUtils.java @@ -0,0 +1,178 @@ +package com.sk89q.jnbt; + +import com.sk89q.jnbt.ByteArrayTag; +import com.sk89q.jnbt.ByteTag; +import com.sk89q.jnbt.CompoundTag; +import com.sk89q.jnbt.DoubleTag; +import com.sk89q.jnbt.EndTag; +import com.sk89q.jnbt.FloatTag; +import com.sk89q.jnbt.IntTag; +import com.sk89q.jnbt.ListTag; +import com.sk89q.jnbt.LongTag; +import com.sk89q.jnbt.NBTConstants; +import com.sk89q.jnbt.ShortTag; +import com.sk89q.jnbt.StringTag; +import com.sk89q.jnbt.Tag; + +/* + * JNBT License + * + * Copyright (c) 2010 Graham Edgecombe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of the JNBT team nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * A class which contains NBT-related utility methods. + * + * @author Graham Edgecombe + * + */ +public final class NBTUtils { + + /** + * Gets the type name of a tag. + * + * @param clazz + * The tag class. + * @return The type name. + */ + public static String getTypeName(Class clazz) { + if (clazz.equals(ByteArrayTag.class)) { + return "TAG_Byte_Array"; + } else if (clazz.equals(ByteTag.class)) { + return "TAG_Byte"; + } else if (clazz.equals(CompoundTag.class)) { + return "TAG_Compound"; + } else if (clazz.equals(DoubleTag.class)) { + return "TAG_Double"; + } else if (clazz.equals(EndTag.class)) { + return "TAG_End"; + } else if (clazz.equals(FloatTag.class)) { + return "TAG_Float"; + } else if (clazz.equals(IntTag.class)) { + return "TAG_Int"; + } else if (clazz.equals(ListTag.class)) { + return "TAG_List"; + } else if (clazz.equals(LongTag.class)) { + return "TAG_Long"; + } else if (clazz.equals(ShortTag.class)) { + return "TAG_Short"; + } else if (clazz.equals(StringTag.class)) { + return "TAG_String"; + } else { + throw new IllegalArgumentException("Invalid tag classs (" + + clazz.getName() + ")."); + } + } + + /** + * Gets the type code of a tag class. + * + * @param clazz + * The tag class. + * @return The type code. + * @throws IllegalArgumentException + * if the tag class is invalid. + */ + public static int getTypeCode(Class clazz) { + if (clazz.equals(ByteArrayTag.class)) { + return NBTConstants.TYPE_BYTE_ARRAY; + } else if (clazz.equals(ByteTag.class)) { + return NBTConstants.TYPE_BYTE; + } else if (clazz.equals(CompoundTag.class)) { + return NBTConstants.TYPE_COMPOUND; + } else if (clazz.equals(DoubleTag.class)) { + return NBTConstants.TYPE_DOUBLE; + } else if (clazz.equals(EndTag.class)) { + return NBTConstants.TYPE_END; + } else if (clazz.equals(FloatTag.class)) { + return NBTConstants.TYPE_FLOAT; + } else if (clazz.equals(IntTag.class)) { + return NBTConstants.TYPE_INT; + } else if (clazz.equals(ListTag.class)) { + return NBTConstants.TYPE_LIST; + } else if (clazz.equals(LongTag.class)) { + return NBTConstants.TYPE_LONG; + } else if (clazz.equals(ShortTag.class)) { + return NBTConstants.TYPE_SHORT; + } else if (clazz.equals(StringTag.class)) { + return NBTConstants.TYPE_STRING; + } else { + throw new IllegalArgumentException("Invalid tag classs (" + + clazz.getName() + ")."); + } + } + + /** + * Gets the class of a type of tag. + * + * @param type + * The type. + * @return The class. + * @throws IllegalArgumentException + * if the tag type is invalid. + */ + public static Class getTypeClass(int type) { + switch (type) { + case NBTConstants.TYPE_END: + return EndTag.class; + case NBTConstants.TYPE_BYTE: + return ByteTag.class; + case NBTConstants.TYPE_SHORT: + return ShortTag.class; + case NBTConstants.TYPE_INT: + return IntTag.class; + case NBTConstants.TYPE_LONG: + return LongTag.class; + case NBTConstants.TYPE_FLOAT: + return FloatTag.class; + case NBTConstants.TYPE_DOUBLE: + return DoubleTag.class; + case NBTConstants.TYPE_BYTE_ARRAY: + return ByteArrayTag.class; + case NBTConstants.TYPE_STRING: + return StringTag.class; + case NBTConstants.TYPE_LIST: + return ListTag.class; + case NBTConstants.TYPE_COMPOUND: + return CompoundTag.class; + default: + throw new IllegalArgumentException("Invalid tag type : " + type + + "."); + } + } + + /** + * Default private constructor. + */ + private NBTUtils() { + + } + +} diff --git a/src/com/sk89q/jnbt/ShortTag.java b/src/main/com/sk89q/jnbt/ShortTag.java similarity index 70% rename from src/com/sk89q/jnbt/ShortTag.java rename to src/main/com/sk89q/jnbt/ShortTag.java index 559fd093f..b7952fc11 100644 --- a/src/com/sk89q/jnbt/ShortTag.java +++ b/src/main/com/sk89q/jnbt/ShortTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_Short tag. + * * @author Graham Edgecombe - * + * */ public final class ShortTag extends Tag { - /** - * The value. - */ - private final short value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public ShortTag(String name, short value) { - super(name); - this.value = value; - } - - @Override - public Short getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_Short" + append + ": " + value; - } + /** + * The value. + */ + private final short value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public ShortTag(String name, short value) { + super(name); + this.value = value; + } + + @Override + public Short getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_Short" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/StringTag.java b/src/main/com/sk89q/jnbt/StringTag.java similarity index 70% rename from src/com/sk89q/jnbt/StringTag.java rename to src/main/com/sk89q/jnbt/StringTag.java index 57ee7d85d..f2f15735d 100644 --- a/src/com/sk89q/jnbt/StringTag.java +++ b/src/main/com/sk89q/jnbt/StringTag.java @@ -37,39 +37,43 @@ import com.sk89q.jnbt.Tag; /** * The TAG_String tag. + * * @author Graham Edgecombe - * + * */ public final class StringTag extends Tag { - /** - * The value. - */ - private final String value; - - /** - * Creates the tag. - * @param name The name. - * @param value The value. - */ - public StringTag(String name, String value) { - super(name); - this.value = value; - } - - @Override - public String getValue() { - return value; - } - - @Override - public String toString() { - String name = getName(); - String append = ""; - if(name != null && !name.equals("")) { - append = "(\"" + this.getName() + "\")"; - } - return "TAG_String" + append + ": " + value; - } + /** + * The value. + */ + private final String value; + + /** + * Creates the tag. + * + * @param name + * The name. + * @param value + * The value. + */ + public StringTag(String name, String value) { + super(name); + this.value = value; + } + + @Override + public String getValue() { + return value; + } + + @Override + public String toString() { + String name = getName(); + String append = ""; + if (name != null && !name.equals("")) { + append = "(\"" + this.getName() + "\")"; + } + return "TAG_String" + append + ": " + value; + } } diff --git a/src/com/sk89q/jnbt/Tag.java b/src/main/com/sk89q/jnbt/Tag.java similarity index 73% rename from src/com/sk89q/jnbt/Tag.java rename to src/main/com/sk89q/jnbt/Tag.java index 79fa0ed20..7584d84ba 100644 --- a/src/com/sk89q/jnbt/Tag.java +++ b/src/main/com/sk89q/jnbt/Tag.java @@ -35,36 +35,41 @@ package com.sk89q.jnbt; /** * Represents a single NBT tag. + * * @author Graham Edgecombe - * + * */ public abstract class Tag { - - /** - * The name of this tag. - */ - private final String name; - - /** - * Creates the tag with the specified name. - * @param name The name. - */ - public Tag(String name) { - this.name = name; - } - - /** - * Gets the name of this tag. - * @return The name of this tag. - */ - public final String getName() { - return name; - } - - /** - * Gets the value of this tag. - * @return The value of this tag. - */ - public abstract Object getValue(); + + /** + * The name of this tag. + */ + private final String name; + + /** + * Creates the tag with the specified name. + * + * @param name + * The name. + */ + public Tag(String name) { + this.name = name; + } + + /** + * Gets the name of this tag. + * + * @return The name of this tag. + */ + public final String getName() { + return name; + } + + /** + * Gets the value of this tag. + * + * @return The value of this tag. + */ + public abstract Object getValue(); } diff --git a/src/com/sk89q/minecraft/util/commands/Command.java b/src/main/com/sk89q/minecraft/util/commands/Command.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/Command.java rename to src/main/com/sk89q/minecraft/util/commands/Command.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandContext.java b/src/main/com/sk89q/minecraft/util/commands/CommandContext.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandContext.java rename to src/main/com/sk89q/minecraft/util/commands/CommandContext.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandException.java b/src/main/com/sk89q/minecraft/util/commands/CommandException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandException.java rename to src/main/com/sk89q/minecraft/util/commands/CommandException.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandPermissions.java b/src/main/com/sk89q/minecraft/util/commands/CommandPermissions.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandPermissions.java rename to src/main/com/sk89q/minecraft/util/commands/CommandPermissions.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandPermissionsException.java b/src/main/com/sk89q/minecraft/util/commands/CommandPermissionsException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandPermissionsException.java rename to src/main/com/sk89q/minecraft/util/commands/CommandPermissionsException.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandUsageException.java b/src/main/com/sk89q/minecraft/util/commands/CommandUsageException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandUsageException.java rename to src/main/com/sk89q/minecraft/util/commands/CommandUsageException.java diff --git a/src/com/sk89q/minecraft/util/commands/CommandsManager.java b/src/main/com/sk89q/minecraft/util/commands/CommandsManager.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/CommandsManager.java rename to src/main/com/sk89q/minecraft/util/commands/CommandsManager.java diff --git a/src/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java b/src/main/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java rename to src/main/com/sk89q/minecraft/util/commands/MissingNestedCommandException.java diff --git a/src/com/sk89q/minecraft/util/commands/NestedCommand.java b/src/main/com/sk89q/minecraft/util/commands/NestedCommand.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/NestedCommand.java rename to src/main/com/sk89q/minecraft/util/commands/NestedCommand.java diff --git a/src/com/sk89q/minecraft/util/commands/UnhandledCommandException.java b/src/main/com/sk89q/minecraft/util/commands/UnhandledCommandException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/UnhandledCommandException.java rename to src/main/com/sk89q/minecraft/util/commands/UnhandledCommandException.java diff --git a/src/com/sk89q/minecraft/util/commands/WrappedCommandException.java b/src/main/com/sk89q/minecraft/util/commands/WrappedCommandException.java similarity index 100% rename from src/com/sk89q/minecraft/util/commands/WrappedCommandException.java rename to src/main/com/sk89q/minecraft/util/commands/WrappedCommandException.java diff --git a/src/com/sk89q/util/StringUtil.java b/src/main/com/sk89q/util/StringUtil.java similarity index 100% rename from src/com/sk89q/util/StringUtil.java rename to src/main/com/sk89q/util/StringUtil.java diff --git a/src/com/sk89q/worldedit/BlockVector.java b/src/main/com/sk89q/worldedit/BlockVector.java similarity index 100% rename from src/com/sk89q/worldedit/BlockVector.java rename to src/main/com/sk89q/worldedit/BlockVector.java diff --git a/src/com/sk89q/worldedit/BlockVector2D.java b/src/main/com/sk89q/worldedit/BlockVector2D.java similarity index 100% rename from src/com/sk89q/worldedit/BlockVector2D.java rename to src/main/com/sk89q/worldedit/BlockVector2D.java diff --git a/src/com/sk89q/worldedit/BlockWorldVector.java b/src/main/com/sk89q/worldedit/BlockWorldVector.java similarity index 100% rename from src/com/sk89q/worldedit/BlockWorldVector.java rename to src/main/com/sk89q/worldedit/BlockWorldVector.java diff --git a/src/com/sk89q/worldedit/Countable.java b/src/main/com/sk89q/worldedit/Countable.java similarity index 100% rename from src/com/sk89q/worldedit/Countable.java rename to src/main/com/sk89q/worldedit/Countable.java diff --git a/src/com/sk89q/worldedit/CuboidClipboard.java b/src/main/com/sk89q/worldedit/CuboidClipboard.java similarity index 100% rename from src/com/sk89q/worldedit/CuboidClipboard.java rename to src/main/com/sk89q/worldedit/CuboidClipboard.java diff --git a/src/com/sk89q/worldedit/DisallowedItemException.java b/src/main/com/sk89q/worldedit/DisallowedItemException.java similarity index 100% rename from src/com/sk89q/worldedit/DisallowedItemException.java rename to src/main/com/sk89q/worldedit/DisallowedItemException.java diff --git a/src/com/sk89q/worldedit/DoubleArrayList.java b/src/main/com/sk89q/worldedit/DoubleArrayList.java similarity index 100% rename from src/com/sk89q/worldedit/DoubleArrayList.java rename to src/main/com/sk89q/worldedit/DoubleArrayList.java diff --git a/src/com/sk89q/worldedit/EditSession.java b/src/main/com/sk89q/worldedit/EditSession.java old mode 100755 new mode 100644 similarity index 100% rename from src/com/sk89q/worldedit/EditSession.java rename to src/main/com/sk89q/worldedit/EditSession.java diff --git a/src/com/sk89q/worldedit/EmptyClipboardException.java b/src/main/com/sk89q/worldedit/EmptyClipboardException.java similarity index 100% rename from src/com/sk89q/worldedit/EmptyClipboardException.java rename to src/main/com/sk89q/worldedit/EmptyClipboardException.java diff --git a/src/com/sk89q/worldedit/FileSelectionAbortedException.java b/src/main/com/sk89q/worldedit/FileSelectionAbortedException.java similarity index 100% rename from src/com/sk89q/worldedit/FileSelectionAbortedException.java rename to src/main/com/sk89q/worldedit/FileSelectionAbortedException.java diff --git a/src/com/sk89q/worldedit/FilenameException.java b/src/main/com/sk89q/worldedit/FilenameException.java similarity index 100% rename from src/com/sk89q/worldedit/FilenameException.java rename to src/main/com/sk89q/worldedit/FilenameException.java diff --git a/src/com/sk89q/worldedit/FilenameResolutionException.java b/src/main/com/sk89q/worldedit/FilenameResolutionException.java similarity index 100% rename from src/com/sk89q/worldedit/FilenameResolutionException.java rename to src/main/com/sk89q/worldedit/FilenameResolutionException.java diff --git a/src/com/sk89q/worldedit/HeightMap.java b/src/main/com/sk89q/worldedit/HeightMap.java old mode 100755 new mode 100644 similarity index 100% rename from src/com/sk89q/worldedit/HeightMap.java rename to src/main/com/sk89q/worldedit/HeightMap.java diff --git a/src/com/sk89q/worldedit/IncompleteRegionException.java b/src/main/com/sk89q/worldedit/IncompleteRegionException.java similarity index 100% rename from src/com/sk89q/worldedit/IncompleteRegionException.java rename to src/main/com/sk89q/worldedit/IncompleteRegionException.java diff --git a/src/com/sk89q/worldedit/InvalidFilenameException.java b/src/main/com/sk89q/worldedit/InvalidFilenameException.java similarity index 100% rename from src/com/sk89q/worldedit/InvalidFilenameException.java rename to src/main/com/sk89q/worldedit/InvalidFilenameException.java diff --git a/src/com/sk89q/worldedit/InvalidItemException.java b/src/main/com/sk89q/worldedit/InvalidItemException.java similarity index 100% rename from src/com/sk89q/worldedit/InvalidItemException.java rename to src/main/com/sk89q/worldedit/InvalidItemException.java diff --git a/src/com/sk89q/worldedit/InvalidToolBindException.java b/src/main/com/sk89q/worldedit/InvalidToolBindException.java similarity index 100% rename from src/com/sk89q/worldedit/InvalidToolBindException.java rename to src/main/com/sk89q/worldedit/InvalidToolBindException.java diff --git a/src/com/sk89q/worldedit/LocalConfiguration.java b/src/main/com/sk89q/worldedit/LocalConfiguration.java similarity index 100% rename from src/com/sk89q/worldedit/LocalConfiguration.java rename to src/main/com/sk89q/worldedit/LocalConfiguration.java diff --git a/src/com/sk89q/worldedit/LocalPlayer.java b/src/main/com/sk89q/worldedit/LocalPlayer.java similarity index 100% rename from src/com/sk89q/worldedit/LocalPlayer.java rename to src/main/com/sk89q/worldedit/LocalPlayer.java diff --git a/src/com/sk89q/worldedit/LocalSession.java b/src/main/com/sk89q/worldedit/LocalSession.java similarity index 100% rename from src/com/sk89q/worldedit/LocalSession.java rename to src/main/com/sk89q/worldedit/LocalSession.java diff --git a/src/com/sk89q/worldedit/LocalWorld.java b/src/main/com/sk89q/worldedit/LocalWorld.java similarity index 100% rename from src/com/sk89q/worldedit/LocalWorld.java rename to src/main/com/sk89q/worldedit/LocalWorld.java diff --git a/src/com/sk89q/worldedit/LogFormat.java b/src/main/com/sk89q/worldedit/LogFormat.java similarity index 100% rename from src/com/sk89q/worldedit/LogFormat.java rename to src/main/com/sk89q/worldedit/LogFormat.java diff --git a/src/com/sk89q/worldedit/MaxChangedBlocksException.java b/src/main/com/sk89q/worldedit/MaxChangedBlocksException.java similarity index 100% rename from src/com/sk89q/worldedit/MaxChangedBlocksException.java rename to src/main/com/sk89q/worldedit/MaxChangedBlocksException.java diff --git a/src/com/sk89q/worldedit/MaxRadiusException.java b/src/main/com/sk89q/worldedit/MaxRadiusException.java similarity index 100% rename from src/com/sk89q/worldedit/MaxRadiusException.java rename to src/main/com/sk89q/worldedit/MaxRadiusException.java diff --git a/src/com/sk89q/worldedit/PlayerDirection.java b/src/main/com/sk89q/worldedit/PlayerDirection.java similarity index 100% rename from src/com/sk89q/worldedit/PlayerDirection.java rename to src/main/com/sk89q/worldedit/PlayerDirection.java diff --git a/src/com/sk89q/worldedit/ReplacingEditSession.java b/src/main/com/sk89q/worldedit/ReplacingEditSession.java similarity index 100% rename from src/com/sk89q/worldedit/ReplacingEditSession.java rename to src/main/com/sk89q/worldedit/ReplacingEditSession.java diff --git a/src/com/sk89q/worldedit/ServerInterface.java b/src/main/com/sk89q/worldedit/ServerInterface.java similarity index 100% rename from src/com/sk89q/worldedit/ServerInterface.java rename to src/main/com/sk89q/worldedit/ServerInterface.java diff --git a/src/com/sk89q/worldedit/UnknownDirectionException.java b/src/main/com/sk89q/worldedit/UnknownDirectionException.java similarity index 100% rename from src/com/sk89q/worldedit/UnknownDirectionException.java rename to src/main/com/sk89q/worldedit/UnknownDirectionException.java diff --git a/src/com/sk89q/worldedit/UnknownItemException.java b/src/main/com/sk89q/worldedit/UnknownItemException.java similarity index 100% rename from src/com/sk89q/worldedit/UnknownItemException.java rename to src/main/com/sk89q/worldedit/UnknownItemException.java diff --git a/src/com/sk89q/worldedit/Vector.java b/src/main/com/sk89q/worldedit/Vector.java similarity index 100% rename from src/com/sk89q/worldedit/Vector.java rename to src/main/com/sk89q/worldedit/Vector.java diff --git a/src/com/sk89q/worldedit/Vector2D.java b/src/main/com/sk89q/worldedit/Vector2D.java similarity index 100% rename from src/com/sk89q/worldedit/Vector2D.java rename to src/main/com/sk89q/worldedit/Vector2D.java diff --git a/src/com/sk89q/worldedit/WorldEdit.java b/src/main/com/sk89q/worldedit/WorldEdit.java similarity index 96% rename from src/com/sk89q/worldedit/WorldEdit.java rename to src/main/com/sk89q/worldedit/WorldEdit.java index 6446740ca..237848dc5 100644 --- a/src/com/sk89q/worldedit/WorldEdit.java +++ b/src/main/com/sk89q/worldedit/WorldEdit.java @@ -1099,13 +1099,9 @@ public class WorldEdit { try { engine = new RhinoCraftScriptEngine(); } catch (NoClassDefFoundError e) { - try { - engine = new SunRhinoCraftScriptEngine(); - } catch (NoClassDefFoundError e2) { - player.printError("Failed to find an installed script engine."); - player.printError("Please see http://wiki.sk89q.com/wiki/WorldEdit/Installation"); - return; - } + player.printError("Failed to find an installed script engine."); + player.printError("Please see http://wiki.sk89q.com/wiki/WorldEdit/Installation"); + return; } engine.setTimeLimit(config.scriptTimeout); diff --git a/src/com/sk89q/worldedit/WorldEditException.java b/src/main/com/sk89q/worldedit/WorldEditException.java similarity index 100% rename from src/com/sk89q/worldedit/WorldEditException.java rename to src/main/com/sk89q/worldedit/WorldEditException.java diff --git a/src/com/sk89q/worldedit/WorldEditNotInstalled.java b/src/main/com/sk89q/worldedit/WorldEditNotInstalled.java similarity index 100% rename from src/com/sk89q/worldedit/WorldEditNotInstalled.java rename to src/main/com/sk89q/worldedit/WorldEditNotInstalled.java diff --git a/src/com/sk89q/worldedit/WorldEditOperation.java b/src/main/com/sk89q/worldedit/WorldEditOperation.java similarity index 100% rename from src/com/sk89q/worldedit/WorldEditOperation.java rename to src/main/com/sk89q/worldedit/WorldEditOperation.java diff --git a/src/com/sk89q/worldedit/WorldVector.java b/src/main/com/sk89q/worldedit/WorldVector.java similarity index 100% rename from src/com/sk89q/worldedit/WorldVector.java rename to src/main/com/sk89q/worldedit/WorldVector.java diff --git a/src/com/sk89q/worldedit/bags/BlockBag.java b/src/main/com/sk89q/worldedit/bags/BlockBag.java similarity index 100% rename from src/com/sk89q/worldedit/bags/BlockBag.java rename to src/main/com/sk89q/worldedit/bags/BlockBag.java diff --git a/src/com/sk89q/worldedit/bags/BlockBagException.java b/src/main/com/sk89q/worldedit/bags/BlockBagException.java similarity index 100% rename from src/com/sk89q/worldedit/bags/BlockBagException.java rename to src/main/com/sk89q/worldedit/bags/BlockBagException.java diff --git a/src/com/sk89q/worldedit/bags/OutOfBlocksException.java b/src/main/com/sk89q/worldedit/bags/OutOfBlocksException.java similarity index 100% rename from src/com/sk89q/worldedit/bags/OutOfBlocksException.java rename to src/main/com/sk89q/worldedit/bags/OutOfBlocksException.java diff --git a/src/com/sk89q/worldedit/bags/OutOfSpaceException.java b/src/main/com/sk89q/worldedit/bags/OutOfSpaceException.java similarity index 100% rename from src/com/sk89q/worldedit/bags/OutOfSpaceException.java rename to src/main/com/sk89q/worldedit/bags/OutOfSpaceException.java diff --git a/src/com/sk89q/worldedit/bags/UnplaceableBlockException.java b/src/main/com/sk89q/worldedit/bags/UnplaceableBlockException.java similarity index 100% rename from src/com/sk89q/worldedit/bags/UnplaceableBlockException.java rename to src/main/com/sk89q/worldedit/bags/UnplaceableBlockException.java diff --git a/src/com/sk89q/worldedit/blocks/BaseBlock.java b/src/main/com/sk89q/worldedit/blocks/BaseBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/BaseBlock.java rename to src/main/com/sk89q/worldedit/blocks/BaseBlock.java diff --git a/src/com/sk89q/worldedit/blocks/BaseItem.java b/src/main/com/sk89q/worldedit/blocks/BaseItem.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/BaseItem.java rename to src/main/com/sk89q/worldedit/blocks/BaseItem.java diff --git a/src/com/sk89q/worldedit/blocks/BaseItemStack.java b/src/main/com/sk89q/worldedit/blocks/BaseItemStack.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/BaseItemStack.java rename to src/main/com/sk89q/worldedit/blocks/BaseItemStack.java diff --git a/src/com/sk89q/worldedit/blocks/BlockID.java b/src/main/com/sk89q/worldedit/blocks/BlockID.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/BlockID.java rename to src/main/com/sk89q/worldedit/blocks/BlockID.java diff --git a/src/com/sk89q/worldedit/blocks/BlockType.java b/src/main/com/sk89q/worldedit/blocks/BlockType.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/BlockType.java rename to src/main/com/sk89q/worldedit/blocks/BlockType.java diff --git a/src/com/sk89q/worldedit/blocks/ChestBlock.java b/src/main/com/sk89q/worldedit/blocks/ChestBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/ChestBlock.java rename to src/main/com/sk89q/worldedit/blocks/ChestBlock.java diff --git a/src/com/sk89q/worldedit/blocks/ClothColor.java b/src/main/com/sk89q/worldedit/blocks/ClothColor.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/ClothColor.java rename to src/main/com/sk89q/worldedit/blocks/ClothColor.java diff --git a/src/com/sk89q/worldedit/blocks/ContainerBlock.java b/src/main/com/sk89q/worldedit/blocks/ContainerBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/ContainerBlock.java rename to src/main/com/sk89q/worldedit/blocks/ContainerBlock.java diff --git a/src/com/sk89q/worldedit/blocks/DispenserBlock.java b/src/main/com/sk89q/worldedit/blocks/DispenserBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/DispenserBlock.java rename to src/main/com/sk89q/worldedit/blocks/DispenserBlock.java diff --git a/src/com/sk89q/worldedit/blocks/FurnaceBlock.java b/src/main/com/sk89q/worldedit/blocks/FurnaceBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/FurnaceBlock.java rename to src/main/com/sk89q/worldedit/blocks/FurnaceBlock.java diff --git a/src/com/sk89q/worldedit/blocks/ItemType.java b/src/main/com/sk89q/worldedit/blocks/ItemType.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/ItemType.java rename to src/main/com/sk89q/worldedit/blocks/ItemType.java diff --git a/src/com/sk89q/worldedit/blocks/MobSpawnerBlock.java b/src/main/com/sk89q/worldedit/blocks/MobSpawnerBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/MobSpawnerBlock.java rename to src/main/com/sk89q/worldedit/blocks/MobSpawnerBlock.java diff --git a/src/com/sk89q/worldedit/blocks/NoteBlock.java b/src/main/com/sk89q/worldedit/blocks/NoteBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/NoteBlock.java rename to src/main/com/sk89q/worldedit/blocks/NoteBlock.java diff --git a/src/com/sk89q/worldedit/blocks/SignBlock.java b/src/main/com/sk89q/worldedit/blocks/SignBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/SignBlock.java rename to src/main/com/sk89q/worldedit/blocks/SignBlock.java diff --git a/src/com/sk89q/worldedit/blocks/TileEntityBlock.java b/src/main/com/sk89q/worldedit/blocks/TileEntityBlock.java similarity index 100% rename from src/com/sk89q/worldedit/blocks/TileEntityBlock.java rename to src/main/com/sk89q/worldedit/blocks/TileEntityBlock.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitConfiguration.java b/src/main/com/sk89q/worldedit/bukkit/BukkitConfiguration.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitConfiguration.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitConfiguration.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/src/main/com/sk89q/worldedit/bukkit/BukkitPlayer.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitPlayer.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitPlayer.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/src/main/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/src/main/com/sk89q/worldedit/bukkit/BukkitServerInterface.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitServerInterface.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitServerInterface.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitUtil.java b/src/main/com/sk89q/worldedit/bukkit/BukkitUtil.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitUtil.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitUtil.java diff --git a/src/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/com/sk89q/worldedit/bukkit/BukkitWorld.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/BukkitWorld.java rename to src/main/com/sk89q/worldedit/bukkit/BukkitWorld.java diff --git a/src/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/src/main/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java rename to src/main/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java diff --git a/src/com/sk89q/worldedit/bukkit/WorldEditAPI.java b/src/main/com/sk89q/worldedit/bukkit/WorldEditAPI.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/WorldEditAPI.java rename to src/main/com/sk89q/worldedit/bukkit/WorldEditAPI.java diff --git a/src/com/sk89q/worldedit/bukkit/WorldEditCriticalPlayerListener.java b/src/main/com/sk89q/worldedit/bukkit/WorldEditCriticalPlayerListener.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/WorldEditCriticalPlayerListener.java rename to src/main/com/sk89q/worldedit/bukkit/WorldEditCriticalPlayerListener.java diff --git a/src/com/sk89q/worldedit/bukkit/WorldEditPlayerListener.java b/src/main/com/sk89q/worldedit/bukkit/WorldEditPlayerListener.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/WorldEditPlayerListener.java rename to src/main/com/sk89q/worldedit/bukkit/WorldEditPlayerListener.java diff --git a/src/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/src/main/com/sk89q/worldedit/bukkit/WorldEditPlugin.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/WorldEditPlugin.java rename to src/main/com/sk89q/worldedit/bukkit/WorldEditPlugin.java diff --git a/src/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java b/src/main/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java rename to src/main/com/sk89q/worldedit/bukkit/selections/CuboidSelection.java diff --git a/src/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java b/src/main/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java rename to src/main/com/sk89q/worldedit/bukkit/selections/Polygonal2DSelection.java diff --git a/src/com/sk89q/worldedit/bukkit/selections/RegionSelection.java b/src/main/com/sk89q/worldedit/bukkit/selections/RegionSelection.java similarity index 91% rename from src/com/sk89q/worldedit/bukkit/selections/RegionSelection.java rename to src/main/com/sk89q/worldedit/bukkit/selections/RegionSelection.java index d1c597b99..dc286bb00 100644 --- a/src/com/sk89q/worldedit/bukkit/selections/RegionSelection.java +++ b/src/main/com/sk89q/worldedit/bukkit/selections/RegionSelection.java @@ -59,52 +59,42 @@ public abstract class RegionSelection implements Selection { this.selector = selector; } - @Override public Location getMinimumPoint() { return toLocation(world, region.getMinimumPoint()); } - @Override public Vector getNativeMinimumPoint() { return region.getMinimumPoint(); } - @Override public Location getMaximumPoint() { return toLocation(world, region.getMaximumPoint()); } - @Override public Vector getNativeMaximumPoint() { return region.getMaximumPoint(); } - @Override public World getWorld() { return world; } - @Override public int getArea() { return region.getArea(); } - @Override public int getWidth() { return region.getWidth(); } - @Override public int getHeight() { return region.getHeight(); } - @Override public int getLength() { return region.getLength(); } - @Override public boolean contains(Location pt) { if (!pt.getWorld().equals(world)) { return false; diff --git a/src/com/sk89q/worldedit/bukkit/selections/Selection.java b/src/main/com/sk89q/worldedit/bukkit/selections/Selection.java similarity index 100% rename from src/com/sk89q/worldedit/bukkit/selections/Selection.java rename to src/main/com/sk89q/worldedit/bukkit/selections/Selection.java diff --git a/src/com/sk89q/worldedit/commands/BrushCommands.java b/src/main/com/sk89q/worldedit/commands/BrushCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/BrushCommands.java rename to src/main/com/sk89q/worldedit/commands/BrushCommands.java diff --git a/src/com/sk89q/worldedit/commands/ChunkCommands.java b/src/main/com/sk89q/worldedit/commands/ChunkCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/ChunkCommands.java rename to src/main/com/sk89q/worldedit/commands/ChunkCommands.java diff --git a/src/com/sk89q/worldedit/commands/ClipboardCommands.java b/src/main/com/sk89q/worldedit/commands/ClipboardCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/ClipboardCommands.java rename to src/main/com/sk89q/worldedit/commands/ClipboardCommands.java diff --git a/src/com/sk89q/worldedit/commands/GeneralCommands.java b/src/main/com/sk89q/worldedit/commands/GeneralCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/GeneralCommands.java rename to src/main/com/sk89q/worldedit/commands/GeneralCommands.java diff --git a/src/com/sk89q/worldedit/commands/GenerationCommands.java b/src/main/com/sk89q/worldedit/commands/GenerationCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/GenerationCommands.java rename to src/main/com/sk89q/worldedit/commands/GenerationCommands.java diff --git a/src/com/sk89q/worldedit/commands/HistoryCommands.java b/src/main/com/sk89q/worldedit/commands/HistoryCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/HistoryCommands.java rename to src/main/com/sk89q/worldedit/commands/HistoryCommands.java diff --git a/src/com/sk89q/worldedit/commands/InsufficientArgumentsException.java b/src/main/com/sk89q/worldedit/commands/InsufficientArgumentsException.java similarity index 100% rename from src/com/sk89q/worldedit/commands/InsufficientArgumentsException.java rename to src/main/com/sk89q/worldedit/commands/InsufficientArgumentsException.java diff --git a/src/com/sk89q/worldedit/commands/NavigationCommands.java b/src/main/com/sk89q/worldedit/commands/NavigationCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/NavigationCommands.java rename to src/main/com/sk89q/worldedit/commands/NavigationCommands.java diff --git a/src/com/sk89q/worldedit/commands/RegionCommands.java b/src/main/com/sk89q/worldedit/commands/RegionCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/RegionCommands.java rename to src/main/com/sk89q/worldedit/commands/RegionCommands.java diff --git a/src/com/sk89q/worldedit/commands/ScriptingCommands.java b/src/main/com/sk89q/worldedit/commands/ScriptingCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/ScriptingCommands.java rename to src/main/com/sk89q/worldedit/commands/ScriptingCommands.java diff --git a/src/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/com/sk89q/worldedit/commands/SelectionCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/SelectionCommands.java rename to src/main/com/sk89q/worldedit/commands/SelectionCommands.java diff --git a/src/com/sk89q/worldedit/commands/SnapshotCommands.java b/src/main/com/sk89q/worldedit/commands/SnapshotCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/SnapshotCommands.java rename to src/main/com/sk89q/worldedit/commands/SnapshotCommands.java diff --git a/src/com/sk89q/worldedit/commands/SnapshotUtilCommands.java b/src/main/com/sk89q/worldedit/commands/SnapshotUtilCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/SnapshotUtilCommands.java rename to src/main/com/sk89q/worldedit/commands/SnapshotUtilCommands.java diff --git a/src/com/sk89q/worldedit/commands/SuperPickaxeCommands.java b/src/main/com/sk89q/worldedit/commands/SuperPickaxeCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/SuperPickaxeCommands.java rename to src/main/com/sk89q/worldedit/commands/SuperPickaxeCommands.java diff --git a/src/com/sk89q/worldedit/commands/ToolCommands.java b/src/main/com/sk89q/worldedit/commands/ToolCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/ToolCommands.java rename to src/main/com/sk89q/worldedit/commands/ToolCommands.java diff --git a/src/com/sk89q/worldedit/commands/ToolUtilCommands.java b/src/main/com/sk89q/worldedit/commands/ToolUtilCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/ToolUtilCommands.java rename to src/main/com/sk89q/worldedit/commands/ToolUtilCommands.java diff --git a/src/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/com/sk89q/worldedit/commands/UtilityCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/UtilityCommands.java rename to src/main/com/sk89q/worldedit/commands/UtilityCommands.java diff --git a/src/com/sk89q/worldedit/commands/WorldEditCommands.java b/src/main/com/sk89q/worldedit/commands/WorldEditCommands.java similarity index 100% rename from src/com/sk89q/worldedit/commands/WorldEditCommands.java rename to src/main/com/sk89q/worldedit/commands/WorldEditCommands.java diff --git a/src/com/sk89q/worldedit/cui/CUIEvent.java b/src/main/com/sk89q/worldedit/cui/CUIEvent.java similarity index 100% rename from src/com/sk89q/worldedit/cui/CUIEvent.java rename to src/main/com/sk89q/worldedit/cui/CUIEvent.java diff --git a/src/com/sk89q/worldedit/cui/CUIPointBasedRegion.java b/src/main/com/sk89q/worldedit/cui/CUIPointBasedRegion.java similarity index 100% rename from src/com/sk89q/worldedit/cui/CUIPointBasedRegion.java rename to src/main/com/sk89q/worldedit/cui/CUIPointBasedRegion.java diff --git a/src/com/sk89q/worldedit/cui/SelectionPointEvent.java b/src/main/com/sk89q/worldedit/cui/SelectionPointEvent.java similarity index 94% rename from src/com/sk89q/worldedit/cui/SelectionPointEvent.java rename to src/main/com/sk89q/worldedit/cui/SelectionPointEvent.java index f09c4a239..f6d024b1d 100644 --- a/src/com/sk89q/worldedit/cui/SelectionPointEvent.java +++ b/src/main/com/sk89q/worldedit/cui/SelectionPointEvent.java @@ -33,12 +33,10 @@ public class SelectionPointEvent implements CUIEvent { this.area = area; } - @Override public String getTypeId() { return "p"; } - @Override public String[] getParameters() { return new String[] { String.valueOf(id), diff --git a/src/com/sk89q/worldedit/cui/SelectionShapeEvent.java b/src/main/com/sk89q/worldedit/cui/SelectionShapeEvent.java similarity index 94% rename from src/com/sk89q/worldedit/cui/SelectionShapeEvent.java rename to src/main/com/sk89q/worldedit/cui/SelectionShapeEvent.java index 815fb4a22..3430fdd38 100644 --- a/src/com/sk89q/worldedit/cui/SelectionShapeEvent.java +++ b/src/main/com/sk89q/worldedit/cui/SelectionShapeEvent.java @@ -27,12 +27,10 @@ public class SelectionShapeEvent implements CUIEvent { this.shapeName = shapeName; } - @Override public String getTypeId() { return "s"; } - @Override public String[] getParameters() { return new String[] { shapeName }; } diff --git a/src/com/sk89q/worldedit/data/BlockData.java b/src/main/com/sk89q/worldedit/data/BlockData.java similarity index 100% rename from src/com/sk89q/worldedit/data/BlockData.java rename to src/main/com/sk89q/worldedit/data/BlockData.java diff --git a/src/com/sk89q/worldedit/data/Chunk.java b/src/main/com/sk89q/worldedit/data/Chunk.java similarity index 100% rename from src/com/sk89q/worldedit/data/Chunk.java rename to src/main/com/sk89q/worldedit/data/Chunk.java diff --git a/src/com/sk89q/worldedit/data/ChunkStore.java b/src/main/com/sk89q/worldedit/data/ChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/ChunkStore.java rename to src/main/com/sk89q/worldedit/data/ChunkStore.java diff --git a/src/com/sk89q/worldedit/data/ChunkStoreException.java b/src/main/com/sk89q/worldedit/data/ChunkStoreException.java similarity index 100% rename from src/com/sk89q/worldedit/data/ChunkStoreException.java rename to src/main/com/sk89q/worldedit/data/ChunkStoreException.java diff --git a/src/com/sk89q/worldedit/data/DataException.java b/src/main/com/sk89q/worldedit/data/DataException.java similarity index 100% rename from src/com/sk89q/worldedit/data/DataException.java rename to src/main/com/sk89q/worldedit/data/DataException.java diff --git a/src/com/sk89q/worldedit/data/FileLegacyChunkStore.java b/src/main/com/sk89q/worldedit/data/FileLegacyChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/FileLegacyChunkStore.java rename to src/main/com/sk89q/worldedit/data/FileLegacyChunkStore.java diff --git a/src/com/sk89q/worldedit/data/FileMcRegionChunkStore.java b/src/main/com/sk89q/worldedit/data/FileMcRegionChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/FileMcRegionChunkStore.java rename to src/main/com/sk89q/worldedit/data/FileMcRegionChunkStore.java diff --git a/src/com/sk89q/worldedit/data/ForwardSeekableInputStream.java b/src/main/com/sk89q/worldedit/data/ForwardSeekableInputStream.java similarity index 100% rename from src/com/sk89q/worldedit/data/ForwardSeekableInputStream.java rename to src/main/com/sk89q/worldedit/data/ForwardSeekableInputStream.java diff --git a/src/com/sk89q/worldedit/data/InvalidFormatException.java b/src/main/com/sk89q/worldedit/data/InvalidFormatException.java similarity index 100% rename from src/com/sk89q/worldedit/data/InvalidFormatException.java rename to src/main/com/sk89q/worldedit/data/InvalidFormatException.java diff --git a/src/com/sk89q/worldedit/data/LegacyChunkStore.java b/src/main/com/sk89q/worldedit/data/LegacyChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/LegacyChunkStore.java rename to src/main/com/sk89q/worldedit/data/LegacyChunkStore.java diff --git a/src/com/sk89q/worldedit/data/McRegionChunkStore.java b/src/main/com/sk89q/worldedit/data/McRegionChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/McRegionChunkStore.java rename to src/main/com/sk89q/worldedit/data/McRegionChunkStore.java diff --git a/src/com/sk89q/worldedit/data/McRegionReader.java b/src/main/com/sk89q/worldedit/data/McRegionReader.java similarity index 100% rename from src/com/sk89q/worldedit/data/McRegionReader.java rename to src/main/com/sk89q/worldedit/data/McRegionReader.java diff --git a/src/com/sk89q/worldedit/data/MissingChunkException.java b/src/main/com/sk89q/worldedit/data/MissingChunkException.java similarity index 100% rename from src/com/sk89q/worldedit/data/MissingChunkException.java rename to src/main/com/sk89q/worldedit/data/MissingChunkException.java diff --git a/src/com/sk89q/worldedit/data/TrueZipLegacyChunkStore.java b/src/main/com/sk89q/worldedit/data/TrueZipLegacyChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/TrueZipLegacyChunkStore.java rename to src/main/com/sk89q/worldedit/data/TrueZipLegacyChunkStore.java diff --git a/src/com/sk89q/worldedit/data/TrueZipMcRegionChunkStore.java b/src/main/com/sk89q/worldedit/data/TrueZipMcRegionChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/TrueZipMcRegionChunkStore.java rename to src/main/com/sk89q/worldedit/data/TrueZipMcRegionChunkStore.java diff --git a/src/com/sk89q/worldedit/data/ZippedLegacyChunkStore.java b/src/main/com/sk89q/worldedit/data/ZippedLegacyChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/ZippedLegacyChunkStore.java rename to src/main/com/sk89q/worldedit/data/ZippedLegacyChunkStore.java diff --git a/src/com/sk89q/worldedit/data/ZippedMcRegionChunkStore.java b/src/main/com/sk89q/worldedit/data/ZippedMcRegionChunkStore.java similarity index 100% rename from src/com/sk89q/worldedit/data/ZippedMcRegionChunkStore.java rename to src/main/com/sk89q/worldedit/data/ZippedMcRegionChunkStore.java diff --git a/src/com/sk89q/worldedit/dev/DocumentationPrinter.java b/src/main/com/sk89q/worldedit/dev/DocumentationPrinter.java similarity index 100% rename from src/com/sk89q/worldedit/dev/DocumentationPrinter.java rename to src/main/com/sk89q/worldedit/dev/DocumentationPrinter.java diff --git a/src/com/sk89q/worldedit/filtering/GaussianKernel.java b/src/main/com/sk89q/worldedit/filtering/GaussianKernel.java similarity index 100% rename from src/com/sk89q/worldedit/filtering/GaussianKernel.java rename to src/main/com/sk89q/worldedit/filtering/GaussianKernel.java diff --git a/src/com/sk89q/worldedit/filtering/HeightMapFilter.java b/src/main/com/sk89q/worldedit/filtering/HeightMapFilter.java similarity index 100% rename from src/com/sk89q/worldedit/filtering/HeightMapFilter.java rename to src/main/com/sk89q/worldedit/filtering/HeightMapFilter.java diff --git a/src/com/sk89q/worldedit/filtering/LinearKernel.java b/src/main/com/sk89q/worldedit/filtering/LinearKernel.java similarity index 100% rename from src/com/sk89q/worldedit/filtering/LinearKernel.java rename to src/main/com/sk89q/worldedit/filtering/LinearKernel.java diff --git a/src/com/sk89q/worldedit/masks/BlockTypeMask.java b/src/main/com/sk89q/worldedit/masks/BlockTypeMask.java similarity index 100% rename from src/com/sk89q/worldedit/masks/BlockTypeMask.java rename to src/main/com/sk89q/worldedit/masks/BlockTypeMask.java diff --git a/src/com/sk89q/worldedit/masks/ExistingBlockMask.java b/src/main/com/sk89q/worldedit/masks/ExistingBlockMask.java similarity index 100% rename from src/com/sk89q/worldedit/masks/ExistingBlockMask.java rename to src/main/com/sk89q/worldedit/masks/ExistingBlockMask.java diff --git a/src/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java b/src/main/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java similarity index 100% rename from src/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java rename to src/main/com/sk89q/worldedit/masks/InvertedBlockTypeMask.java diff --git a/src/com/sk89q/worldedit/masks/Mask.java b/src/main/com/sk89q/worldedit/masks/Mask.java similarity index 100% rename from src/com/sk89q/worldedit/masks/Mask.java rename to src/main/com/sk89q/worldedit/masks/Mask.java diff --git a/src/com/sk89q/worldedit/patterns/BlockChance.java b/src/main/com/sk89q/worldedit/patterns/BlockChance.java similarity index 100% rename from src/com/sk89q/worldedit/patterns/BlockChance.java rename to src/main/com/sk89q/worldedit/patterns/BlockChance.java diff --git a/src/com/sk89q/worldedit/patterns/ClipboardPattern.java b/src/main/com/sk89q/worldedit/patterns/ClipboardPattern.java similarity index 100% rename from src/com/sk89q/worldedit/patterns/ClipboardPattern.java rename to src/main/com/sk89q/worldedit/patterns/ClipboardPattern.java diff --git a/src/com/sk89q/worldedit/patterns/Pattern.java b/src/main/com/sk89q/worldedit/patterns/Pattern.java similarity index 100% rename from src/com/sk89q/worldedit/patterns/Pattern.java rename to src/main/com/sk89q/worldedit/patterns/Pattern.java diff --git a/src/com/sk89q/worldedit/patterns/RandomFillPattern.java b/src/main/com/sk89q/worldedit/patterns/RandomFillPattern.java similarity index 100% rename from src/com/sk89q/worldedit/patterns/RandomFillPattern.java rename to src/main/com/sk89q/worldedit/patterns/RandomFillPattern.java diff --git a/src/com/sk89q/worldedit/patterns/SingleBlockPattern.java b/src/main/com/sk89q/worldedit/patterns/SingleBlockPattern.java similarity index 100% rename from src/com/sk89q/worldedit/patterns/SingleBlockPattern.java rename to src/main/com/sk89q/worldedit/patterns/SingleBlockPattern.java diff --git a/src/com/sk89q/worldedit/regions/CuboidRegion.java b/src/main/com/sk89q/worldedit/regions/CuboidRegion.java similarity index 99% rename from src/com/sk89q/worldedit/regions/CuboidRegion.java rename to src/main/com/sk89q/worldedit/regions/CuboidRegion.java index 2823ed7df..05456253e 100644 --- a/src/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/src/main/com/sk89q/worldedit/regions/CuboidRegion.java @@ -57,7 +57,6 @@ public class CuboidRegion implements Region { * * @return min point */ - @Override public Vector getMinimumPoint() { return new Vector(Math.min(pos1.getX(), pos2.getX()), Math.min(pos1.getY(), pos2.getY()), @@ -69,7 +68,6 @@ public class CuboidRegion implements Region { * * @return max point */ - @Override public Vector getMaximumPoint() { return new Vector(Math.max(pos1.getX(), pos2.getX()), Math.max(pos1.getY(), pos2.getY()), diff --git a/src/com/sk89q/worldedit/regions/CuboidRegionSelector.java b/src/main/com/sk89q/worldedit/regions/CuboidRegionSelector.java similarity index 100% rename from src/com/sk89q/worldedit/regions/CuboidRegionSelector.java rename to src/main/com/sk89q/worldedit/regions/CuboidRegionSelector.java diff --git a/src/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/src/main/com/sk89q/worldedit/regions/Polygonal2DRegion.java similarity index 96% rename from src/com/sk89q/worldedit/regions/Polygonal2DRegion.java rename to src/main/com/sk89q/worldedit/regions/Polygonal2DRegion.java index 957216d85..9c6714322 100644 --- a/src/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/src/main/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -270,7 +270,6 @@ public class Polygonal2DRegion implements Region { /** * Checks to see if a point is inside this region. */ - @Override public boolean contains(Vector pt) { return contains(points, minY, maxY, pt); } diff --git a/src/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java b/src/main/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java similarity index 100% rename from src/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java rename to src/main/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java diff --git a/src/com/sk89q/worldedit/regions/Region.java b/src/main/com/sk89q/worldedit/regions/Region.java similarity index 100% rename from src/com/sk89q/worldedit/regions/Region.java rename to src/main/com/sk89q/worldedit/regions/Region.java diff --git a/src/com/sk89q/worldedit/regions/RegionOperationException.java b/src/main/com/sk89q/worldedit/regions/RegionOperationException.java similarity index 100% rename from src/com/sk89q/worldedit/regions/RegionOperationException.java rename to src/main/com/sk89q/worldedit/regions/RegionOperationException.java diff --git a/src/com/sk89q/worldedit/regions/RegionSelector.java b/src/main/com/sk89q/worldedit/regions/RegionSelector.java similarity index 100% rename from src/com/sk89q/worldedit/regions/RegionSelector.java rename to src/main/com/sk89q/worldedit/regions/RegionSelector.java diff --git a/src/com/sk89q/worldedit/scripting/CraftScriptContext.java b/src/main/com/sk89q/worldedit/scripting/CraftScriptContext.java similarity index 100% rename from src/com/sk89q/worldedit/scripting/CraftScriptContext.java rename to src/main/com/sk89q/worldedit/scripting/CraftScriptContext.java diff --git a/src/com/sk89q/worldedit/scripting/CraftScriptEngine.java b/src/main/com/sk89q/worldedit/scripting/CraftScriptEngine.java similarity index 100% rename from src/com/sk89q/worldedit/scripting/CraftScriptEngine.java rename to src/main/com/sk89q/worldedit/scripting/CraftScriptEngine.java diff --git a/src/com/sk89q/worldedit/scripting/CraftScriptEnvironment.java b/src/main/com/sk89q/worldedit/scripting/CraftScriptEnvironment.java similarity index 100% rename from src/com/sk89q/worldedit/scripting/CraftScriptEnvironment.java rename to src/main/com/sk89q/worldedit/scripting/CraftScriptEnvironment.java diff --git a/src/com/sk89q/worldedit/scripting/RhinoContextFactory.java b/src/main/com/sk89q/worldedit/scripting/RhinoContextFactory.java similarity index 100% rename from src/com/sk89q/worldedit/scripting/RhinoContextFactory.java rename to src/main/com/sk89q/worldedit/scripting/RhinoContextFactory.java diff --git a/src/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java b/src/main/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java similarity index 95% rename from src/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java rename to src/main/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java index c6aac2743..347797267 100644 --- a/src/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java +++ b/src/main/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java @@ -27,17 +27,14 @@ import com.sk89q.worldedit.WorldEditException; public class RhinoCraftScriptEngine implements CraftScriptEngine { private int timeLimit; - @Override public void setTimeLimit(int milliseconds) { timeLimit = milliseconds; } - @Override public int getTimeLimit() { return timeLimit; } - @Override public Object evaluate(String script, String filename, Map args) throws ScriptException, Throwable { RhinoContextFactory factory = new RhinoContextFactory(timeLimit); diff --git a/src/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java b/src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java similarity index 95% rename from src/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java rename to src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java index 4fd93000e..dfae2e77e 100644 --- a/src/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java +++ b/src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java @@ -37,7 +37,6 @@ public class RhinoScriptEngine extends AbstractScriptEngine { return new SimpleBindings(); } - @Override public Object eval(String script, ScriptContext context) throws ScriptException { @@ -68,7 +67,6 @@ public class RhinoScriptEngine extends AbstractScriptEngine { } } - @Override public Object eval(Reader reader, ScriptContext context) throws ScriptException { @@ -101,7 +99,6 @@ public class RhinoScriptEngine extends AbstractScriptEngine { } } - @Override public ScriptEngineFactory getFactory() { if (factory != null) { return factory; diff --git a/src/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java b/src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java similarity index 92% rename from src/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java rename to src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java index 0dd82acaf..5d9c251c9 100644 --- a/src/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java +++ b/src/main/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java @@ -52,32 +52,26 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { extensions = Collections.unmodifiableList(extensions); } - @Override public String getEngineName() { return "Rhino JavaScript Engine (SK)"; } - @Override public String getEngineVersion() { return "unknown"; } - @Override public List getExtensions() { return extensions; } - @Override public String getLanguageName() { return "EMCAScript"; } - @Override public String getLanguageVersion() { return "1.8"; } - @Override public String getMethodCallSyntax(String obj, String m, String ... args) { StringBuilder s = new StringBuilder(); s.append(obj); @@ -97,24 +91,20 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { return s.toString(); } - @Override public List getMimeTypes() { return mimeTypes; } - @Override public List getNames() { return names; } - @Override public String getOutputStatement(String str) { return "print(" + str.replace("\\", "\\\\") .replace("\"", "\\\\\"") .replace(";", "\\\\;") + ")"; } - @Override public Object getParameter(String key) { if (key.equals(ScriptEngine.ENGINE)) { return getEngineName(); @@ -133,7 +123,6 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { } } - @Override public String getProgram(String ... statements) { StringBuilder s = new StringBuilder(); for (String stmt : statements) { @@ -143,7 +132,6 @@ public class RhinoScriptEngineFactory implements ScriptEngineFactory { return s.toString(); } - @Override public ScriptEngine getScriptEngine() { return new RhinoScriptEngine(); } diff --git a/src/com/sk89q/worldedit/snapshots/InvalidSnapshotException.java b/src/main/com/sk89q/worldedit/snapshots/InvalidSnapshotException.java similarity index 100% rename from src/com/sk89q/worldedit/snapshots/InvalidSnapshotException.java rename to src/main/com/sk89q/worldedit/snapshots/InvalidSnapshotException.java diff --git a/src/com/sk89q/worldedit/snapshots/ModificationTimerParser.java b/src/main/com/sk89q/worldedit/snapshots/ModificationTimerParser.java similarity index 95% rename from src/com/sk89q/worldedit/snapshots/ModificationTimerParser.java rename to src/main/com/sk89q/worldedit/snapshots/ModificationTimerParser.java index 7d723e682..289ebe6d3 100644 --- a/src/com/sk89q/worldedit/snapshots/ModificationTimerParser.java +++ b/src/main/com/sk89q/worldedit/snapshots/ModificationTimerParser.java @@ -25,7 +25,6 @@ import java.util.GregorianCalendar; public class ModificationTimerParser implements SnapshotDateParser { - @Override public Calendar detectDate(File file) { Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(file.lastModified()); diff --git a/src/com/sk89q/worldedit/snapshots/Snapshot.java b/src/main/com/sk89q/worldedit/snapshots/Snapshot.java similarity index 99% rename from src/com/sk89q/worldedit/snapshots/Snapshot.java rename to src/main/com/sk89q/worldedit/snapshots/Snapshot.java index a1d422bfe..255727655 100644 --- a/src/com/sk89q/worldedit/snapshots/Snapshot.java +++ b/src/main/com/sk89q/worldedit/snapshots/Snapshot.java @@ -158,7 +158,6 @@ public class Snapshot implements Comparable { this.date = date; } - @Override public int compareTo(Snapshot o) { if (o.date == null || date == null) { return name.compareTo(o.name); diff --git a/src/com/sk89q/worldedit/snapshots/SnapshotDateParser.java b/src/main/com/sk89q/worldedit/snapshots/SnapshotDateParser.java similarity index 100% rename from src/com/sk89q/worldedit/snapshots/SnapshotDateParser.java rename to src/main/com/sk89q/worldedit/snapshots/SnapshotDateParser.java diff --git a/src/com/sk89q/worldedit/snapshots/SnapshotRepository.java b/src/main/com/sk89q/worldedit/snapshots/SnapshotRepository.java similarity index 100% rename from src/com/sk89q/worldedit/snapshots/SnapshotRepository.java rename to src/main/com/sk89q/worldedit/snapshots/SnapshotRepository.java diff --git a/src/com/sk89q/worldedit/snapshots/SnapshotRestore.java b/src/main/com/sk89q/worldedit/snapshots/SnapshotRestore.java similarity index 100% rename from src/com/sk89q/worldedit/snapshots/SnapshotRestore.java rename to src/main/com/sk89q/worldedit/snapshots/SnapshotRestore.java diff --git a/src/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java b/src/main/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java similarity index 96% rename from src/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java rename to src/main/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java index 35ec1f580..23e9699a8 100644 --- a/src/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java +++ b/src/main/com/sk89q/worldedit/snapshots/YYMMDDHHIISSParser.java @@ -31,7 +31,6 @@ public class YYMMDDHHIISSParser implements SnapshotDateParser { Pattern.compile("([0-9]+)[^0-9]?([0-9]+)[^0-9]?([0-9]+)[^0-9]?" + "([0-9]+)[^0-9]?([0-9]+)[^0-9]?([0-9]+)"); - @Override public Calendar detectDate(File file) { Matcher matcher = patt.matcher(file.getName()); if (matcher.matches()) { diff --git a/src/com/sk89q/worldedit/tools/AreaPickaxe.java b/src/main/com/sk89q/worldedit/tools/AreaPickaxe.java similarity index 96% rename from src/com/sk89q/worldedit/tools/AreaPickaxe.java rename to src/main/com/sk89q/worldedit/tools/AreaPickaxe.java index e8a8530d7..fcbea9804 100644 --- a/src/com/sk89q/worldedit/tools/AreaPickaxe.java +++ b/src/main/com/sk89q/worldedit/tools/AreaPickaxe.java @@ -36,7 +36,6 @@ public class AreaPickaxe implements BlockTool { this.range = range; } - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { LocalWorld world = clicked.getWorld(); diff --git a/src/com/sk89q/worldedit/tools/BlockDataCyler.java b/src/main/com/sk89q/worldedit/tools/BlockDataCyler.java similarity index 96% rename from src/com/sk89q/worldedit/tools/BlockDataCyler.java rename to src/main/com/sk89q/worldedit/tools/BlockDataCyler.java index fdda86477..b69060581 100644 --- a/src/com/sk89q/worldedit/tools/BlockDataCyler.java +++ b/src/main/com/sk89q/worldedit/tools/BlockDataCyler.java @@ -98,13 +98,11 @@ public class BlockDataCyler implements DoubleActionBlockTool { return true; } - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { return handleCycle(server, config, player, session, clicked, true); } - @Override public boolean actSecondary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { diff --git a/src/com/sk89q/worldedit/tools/BlockReplacer.java b/src/main/com/sk89q/worldedit/tools/BlockReplacer.java similarity index 95% rename from src/com/sk89q/worldedit/tools/BlockReplacer.java rename to src/main/com/sk89q/worldedit/tools/BlockReplacer.java index 83ae422e2..1092d040e 100644 --- a/src/com/sk89q/worldedit/tools/BlockReplacer.java +++ b/src/main/com/sk89q/worldedit/tools/BlockReplacer.java @@ -36,7 +36,6 @@ public class BlockReplacer implements DoubleActionBlockTool { this.targetBlock = targetBlock; } - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { @@ -58,7 +57,6 @@ public class BlockReplacer implements DoubleActionBlockTool { return true; } - @Override public boolean actSecondary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { diff --git a/src/com/sk89q/worldedit/tools/BlockTool.java b/src/main/com/sk89q/worldedit/tools/BlockTool.java similarity index 100% rename from src/com/sk89q/worldedit/tools/BlockTool.java rename to src/main/com/sk89q/worldedit/tools/BlockTool.java diff --git a/src/com/sk89q/worldedit/tools/BrushTool.java b/src/main/com/sk89q/worldedit/tools/BrushTool.java similarity index 95% rename from src/com/sk89q/worldedit/tools/BrushTool.java rename to src/main/com/sk89q/worldedit/tools/BrushTool.java index f354abb5b..cec0e233c 100644 --- a/src/com/sk89q/worldedit/tools/BrushTool.java +++ b/src/main/com/sk89q/worldedit/tools/BrushTool.java @@ -120,7 +120,6 @@ public class BrushTool implements TraceTool { * @param session * @return true to deny */ - @Override public boolean act(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session) { WorldVector target = player.getBlockTrace(500); diff --git a/src/com/sk89q/worldedit/tools/DoubleActionBlockTool.java b/src/main/com/sk89q/worldedit/tools/DoubleActionBlockTool.java similarity index 100% rename from src/com/sk89q/worldedit/tools/DoubleActionBlockTool.java rename to src/main/com/sk89q/worldedit/tools/DoubleActionBlockTool.java diff --git a/src/com/sk89q/worldedit/tools/QueryTool.java b/src/main/com/sk89q/worldedit/tools/QueryTool.java similarity index 96% rename from src/com/sk89q/worldedit/tools/QueryTool.java rename to src/main/com/sk89q/worldedit/tools/QueryTool.java index da30b3dd5..8303e6a9e 100644 --- a/src/com/sk89q/worldedit/tools/QueryTool.java +++ b/src/main/com/sk89q/worldedit/tools/QueryTool.java @@ -29,7 +29,6 @@ import com.sk89q.worldedit.blocks.*; */ public class QueryTool implements BlockTool { - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { diff --git a/src/com/sk89q/worldedit/tools/RecursivePickaxe.java b/src/main/com/sk89q/worldedit/tools/RecursivePickaxe.java similarity index 96% rename from src/com/sk89q/worldedit/tools/RecursivePickaxe.java rename to src/main/com/sk89q/worldedit/tools/RecursivePickaxe.java index 0b6e2c9c5..a5ac0b6a0 100644 --- a/src/com/sk89q/worldedit/tools/RecursivePickaxe.java +++ b/src/main/com/sk89q/worldedit/tools/RecursivePickaxe.java @@ -39,7 +39,6 @@ public class RecursivePickaxe implements BlockTool { this.range = range; } - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { LocalWorld world = clicked.getWorld(); diff --git a/src/com/sk89q/worldedit/tools/SinglePickaxe.java b/src/main/com/sk89q/worldedit/tools/SinglePickaxe.java similarity index 96% rename from src/com/sk89q/worldedit/tools/SinglePickaxe.java rename to src/main/com/sk89q/worldedit/tools/SinglePickaxe.java index d90f3a276..d58e3bbd9 100644 --- a/src/com/sk89q/worldedit/tools/SinglePickaxe.java +++ b/src/main/com/sk89q/worldedit/tools/SinglePickaxe.java @@ -28,7 +28,7 @@ import com.sk89q.worldedit.blocks.BlockID; * @author sk89q */ public class SinglePickaxe implements BlockTool { - @Override + public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { LocalWorld world = clicked.getWorld(); diff --git a/src/com/sk89q/worldedit/tools/Tool.java b/src/main/com/sk89q/worldedit/tools/Tool.java similarity index 100% rename from src/com/sk89q/worldedit/tools/Tool.java rename to src/main/com/sk89q/worldedit/tools/Tool.java diff --git a/src/com/sk89q/worldedit/tools/TraceTool.java b/src/main/com/sk89q/worldedit/tools/TraceTool.java similarity index 100% rename from src/com/sk89q/worldedit/tools/TraceTool.java rename to src/main/com/sk89q/worldedit/tools/TraceTool.java diff --git a/src/com/sk89q/worldedit/tools/TreePlanter.java b/src/main/com/sk89q/worldedit/tools/TreePlanter.java similarity index 96% rename from src/com/sk89q/worldedit/tools/TreePlanter.java rename to src/main/com/sk89q/worldedit/tools/TreePlanter.java index 239bc2449..2728f20cb 100644 --- a/src/com/sk89q/worldedit/tools/TreePlanter.java +++ b/src/main/com/sk89q/worldedit/tools/TreePlanter.java @@ -34,7 +34,6 @@ public class TreePlanter implements BlockTool { this.gen = gen; } - @Override public boolean actPrimary(ServerInterface server, LocalConfiguration config, LocalPlayer player, LocalSession session, WorldVector clicked) { diff --git a/src/com/sk89q/worldedit/tools/brushes/Brush.java b/src/main/com/sk89q/worldedit/tools/brushes/Brush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/Brush.java rename to src/main/com/sk89q/worldedit/tools/brushes/Brush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/ClipboardBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/ClipboardBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/ClipboardBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/ClipboardBrush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/CylinderBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/CylinderBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/CylinderBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/CylinderBrush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/HollowCylinderBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/HollowCylinderBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/HollowCylinderBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/HollowCylinderBrush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/HollowSphereBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/HollowSphereBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/HollowSphereBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/HollowSphereBrush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/SmoothBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/SmoothBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/SmoothBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/SmoothBrush.java diff --git a/src/com/sk89q/worldedit/tools/brushes/SphereBrush.java b/src/main/com/sk89q/worldedit/tools/brushes/SphereBrush.java similarity index 100% rename from src/com/sk89q/worldedit/tools/brushes/SphereBrush.java rename to src/main/com/sk89q/worldedit/tools/brushes/SphereBrush.java diff --git a/src/com/sk89q/worldedit/util/FileDialogUtil.java b/src/main/com/sk89q/worldedit/util/FileDialogUtil.java similarity index 100% rename from src/com/sk89q/worldedit/util/FileDialogUtil.java rename to src/main/com/sk89q/worldedit/util/FileDialogUtil.java diff --git a/src/com/sk89q/worldedit/util/PropertiesConfiguration.java b/src/main/com/sk89q/worldedit/util/PropertiesConfiguration.java similarity index 100% rename from src/com/sk89q/worldedit/util/PropertiesConfiguration.java rename to src/main/com/sk89q/worldedit/util/PropertiesConfiguration.java diff --git a/src/com/sk89q/worldedit/util/TargetBlock.java b/src/main/com/sk89q/worldedit/util/TargetBlock.java similarity index 100% rename from src/com/sk89q/worldedit/util/TargetBlock.java rename to src/main/com/sk89q/worldedit/util/TargetBlock.java diff --git a/src/com/sk89q/worldedit/util/TreeGenerator.java b/src/main/com/sk89q/worldedit/util/TreeGenerator.java similarity index 100% rename from src/com/sk89q/worldedit/util/TreeGenerator.java rename to src/main/com/sk89q/worldedit/util/TreeGenerator.java diff --git a/config.yml b/src/resources/config.yml similarity index 100% rename from config.yml rename to src/resources/config.yml diff --git a/plugin.yml b/src/resources/plugin.yml similarity index 96% rename from plugin.yml rename to src/resources/plugin.yml index 47db61f03..4db198fee 100644 --- a/plugin.yml +++ b/src/resources/plugin.yml @@ -1,6 +1,6 @@ name: WorldEdit main: com.sk89q.worldedit.bukkit.WorldEditPlugin -version: "WEVERSIONMACRO" +version: "${project.version}" commands: chunkinfo: description: Get information about the chunk that you are inside