diff --git a/.gitignore b/.gitignore index e79bca888..f632b0d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ eclipse bin build target -gradle .gradle forge-download out diff --git a/CHANGELOG.txt b/CHANGELOG.txt deleted file mode 100644 index 422a1f91b..000000000 --- a/CHANGELOG.txt +++ /dev/null @@ -1,1076 +0,0 @@ -6.1 -- Added support for Spigot for MC 1.8.3 to 1.8.6. -- Added rotation values to lit redstone torches. -- Added banners to usesDamageValue properties list. -- Added stone to usesData properties list. -- Changed cycler tool to use undo sessions rather than changing the world directly. -- Changed PEX support to use UUIDs wherever possible. -- Fixed imprecise rotations. -- Fixed incorrect support BlockBag and EditSession support in two of the tools. -- Fixed entity rotation floating point issues. -- Fixed button rotation and added support for up/down flipping. -- Fixed armor stands being included //butcher by default. -- Fixed /butcher text in the case of only one mob being killed. -- Fixed entity counter for //remove and //butcher. -- Fixed performance issues with some commands that use lists of entities. - -6.0.1 -- (Forge only) Add a permissions API (temporary) for interoperability. - -6.0.0 -- Update internal block lists for MC 1.8. -- (Bukkit only) Added support for users of Spigot 1.8. -- (Bukkit only) Fixed the missing configuration file. - -6.0-beta-1 -- Many major changes! - -5.6.3 -Note: We are working on WorldEdit 6.x so 5.x are maintenance releases and will -mostly contain bug fixes and minor changes. - -- Added support for CraftBukkit 1.7.10. -- Fixed activated hoppers rotating incorrectly. -- Fixed listing schematics with directories in the folder. - -5.6.2 -- Backport 1.7.9 support to WE 5.x - -5.6.1 -- Added support for Minecraft 1.7.5 on Bukkit. -- Added //flora command to place flora over grass. -- Fixed //forest accepting the wrong arguments. - -5.6 -- Added //forest that generates a forest in a selection. -- Added -s flag to //paste to select the pasted area. -- Added //line command and EditSession method. -- Added //curve. -- Added 1.7 blocks, biomes, trees, and items. -- Added a "hand" pseudo block type that uses the currently selected block. -- Added a "pos1" pseudo block type, which uses the block type from the - "primary position". -- Added a //generatebiome command, which uses formulae to generate free-form - biomes. -- Added a check for both superperms and PEX directly to support older versions - of PEX with inGroup. -- Added a SolidBlockMask (#solid). -- Added an item->block mapping for LocalPlayer.getBlockInHand(). -- Added colors for stained clay and carpet data values. -- Added configuration option to set the default for the /up and /ceil commands. -- Added data value mappings for certain blocks and made all other block types - wildcard matches. -- Added fly mode support for /up and /ceil, -- Added hollow lines. -- Added Line thickness support. -- Added new log/leaves to floating tree remover tool. -- Added non-cuboid support for //walls and //outline. -- Added query{,Abs,Rel}(x,y,z,typevar,datavar) to the expression parser. -- Added support for rotating hay blocks like logs. -- Added usage of non-existent variables in all LValue expressions. -- Changed /up and /ceil command to use glass block by default. Flight can be - done via -f flag now. -- Removed the /fill command as an alias of /material (which sets the brush - material). -- Fixed //deform not doing anything at all. -- Fixed //walls on non-cuboid regions so that they no longer introduces gaps - in walls beyond 45 degrees. -- Fixed /ascend and /descend to use the height of blocks properly. -- Fixed /green command so that it no longer affects permadirt and podzol. -- Fixed bed rotation. -- Fixed door rotation and disabled door y flipping. -- Fixed forest generator to make trees under snow tiles. -- Fixed head rotation. -- Fixed lever rotation. -- Fixed not flipping the center plane blocks. -- Fixed snapshot restore now so it now obeys masks again. -- Fixed some attachments that would result in items being dropped. -- Fixed the query functions not comparing data values at all for their - return values. -- Fixed improper block probability patterns (i.e. 20%,10%grass) causing an error. -- Fixed /we help not finding commands if uppercase names are used. - -5.5.8 -- Update for Minecraft 1.6.2 and 1.6.4 -- Made generation commands respect max-radius config setting -- Fixed use-inventory overrides not being applied in certain cases -- Made //move work with non-cuboid regions -- Added a convex polyhedron selector -- Made clipboard work with non-cuboid regions - -5.5.7 -- Update for Minecraft 1.6.1 -- Fixed a bug with GroupManager detection. -- Added a coordinate argument for //chunk -- Allowed cylinder selector to be changed to a rough polygon. -- Fix a typo - -5.5.6 -- Updated for Minecraft 1.5.2. -- Pistons can now be rotated with cycler tool. -- Hoppers no longer lose orientation. -- Using //setbiome now respects global biome masks. -- Fixed an issue with certain blocks that had multiple - possible TileEntities. (mods only) -- Added console support for /remove command. (removes from ALL worlds). - -5.5.5 -- Updated for Minecraft 1.5.1. - -5.5.4 -- Fixed a bug caused by MC 1.5 where block updates were not being sent. - -5.5.3 -- Fixed the error caused by Bukkit's change of the TNT minecart API. -- Added names for new items. - -5.5.2 -- Update to MineCraft 1.5. -- Fixed //flip going the wrong direction in certain cases. -- Fixed 4096 block id support in schematics and snapshots. -- Fixed max-blocks-changed not being used. - -5.5.1 -- Added support for multiple versions of Minecraft. A folder will be created in - plugins/WorldEdit/nmsblocks which contains different class files which will be - dynamically checked for compatibility with the current minecraft version. -- Added -d flags to //count and //distr, which allow separating blocks by data values. -- Added a butcher brush (//brush butcher) which works like the command in a brush. The flags - for the command can be passed an an argument for the brush. -- Fixed an issue with use-inventory where container blocks will spill when being removed. -- Added a setting to allow creative mode players to override use-inventory. - -5.5 -- Added failsafe for when Craftbukkit packaging switches versions. Note that using - mismatched WorldEdit and CraftBukkit version will cause data to be lost when - copy/pasting or loading certain blocks with advanced data. -- Updated cardinal directions to match newer Notchian values. - Using command that take a direction will now use these directions. -- Add support for setting skull blocks. Syntax is skull:data|MobType|rotation. MobType - can also be a player name. -- Removed old permissions for jumpto and thru. You must now use jumpto.command - or jumpto.tool respectively (or thru.). -- Added -c flag to //size and //distr. Operates on the clipboard instead of - current selection. -- Added support for rotating wooden logs. -- Add butcher-radius.maximum and butcher-radius.default to limits section of config. -- Added -b flag to //butcher to specify ambient mobs (currently only bats) -- Added -d and -n flags for //schematic list command. Sorts by date by newest/oldest. -- Added a configuration option to allow symbolic links (for backups, schematics, etc) -- Improved accuracy of command logging, as well as logging to file correctly. The - worldedit.log file (by default) should now be useful. -- Fixed //snow snowing on some blocks it shouldn't (like stairs) -- For developers: Added a LocalPlayer argument to the constructors for EditSession in - the factory. Also added @NestedCommand(executeBody=true/false) so that base commands - can be executed if no subcommands are passed. - -5.4.5: -- Fixed minor check issue with //center. - -5.4.4: -- Added official support for Minecraft 1.4. -- Added support for 4096 ID blocks (theoretically) in snapshots. -- Fixed issue with block IDs being returned negative in snapshots. -- Fixed //limit being overridden each time a LocalSession is fetched. -- Added EditSessionFactory class for developers. - -Thank you to ammaraskar for his contribution. - -5.4.3: -- Added block data support to BlockMask. -- Added //center command to set blocks at the center point of a selection. -- Correctly update session permissions on each operation. -- Fix errors when trying to set invalid blocks. -- Fix chests & similar not having their extended (tile entity) data being correctly copied back when the block currently in the location has the same type and data. -- Added emerald as an alias for the emerald block. -- Added string as an alias for the tripwire block (wire, not hook). - -Thanks for the contributions from aumgn - -5.4.2: -- Fixed //gen not having a proper minimum parameter count of 2. -- Added //re and //rep as aliases for //replace, and aliases /asc(end), - /desc(end), and /j(umpto). -- Fixed schematics not properly loading chests with the new code, meaning that - enchantments and other properties were not always properly loaded. -- Fixed -1 not being a valid data value in Block, which broke //replace. -- Fixed snapshots to support custom blocks/tile entity data. -- Updated bundled README.html to be current. - -5.4.1: -- Fixed lingering 256 block ID restriction preventing block IDs up to 4095. -- Fixed certain tile entity blocks not being set correctly. -- Fixed schematic loading code not properly handling the AddBlocks section. - -5.4: -- Added support for Minecraft 1.3. -- Added improved, but experimental, support for custom blocks added by - mods, and added by future Minecraft versions. -- Added help to //schematic. -- Added WECUI handshake option. -- Added improved //schem list output. -- Added configuration options for polygonal region limits. -- Added -r to //schematic to ignore format checks. -- Added //generate -c, which offsets the input coordinates from the selection - center. -- Added support for 4096 ID blocks. -- Added support for data values > 127 in schematic files. -- Added [g]closest(x,y,z,index,count,stride) to the expression parser. -- Added an all parameter, and a message indicating its radius, to /butcher. -- Added new "WorldEdit Foundation" classes to eventually replace the current - block/world/etc. classes (for developers!). -- Fixed a number of bugs in schematic handling that created errors. -- Fixed issues with biome processing. -- Fixed insufficient biome type checking. -- Fixed the error for missing schematics, making it easier to understand. -- Fixed snapshots not properly loading .mcr files. -- Fixed //chunk switching from //sel extend to //sel cuboid. -- Removed chat-based WECUI protocol (now replaced with packet 250). - -Thank you for the contributions from Ammar Askar (ammaraskar), aumgn, -Jim Nordb (Silentspy), snaxson, Socolin, and Zhuowei Zhang (zhuowei). - -5.3: -- Made #region mask keep the region selected when the pask was added, and - added #dregion mask that always uses the player's current -selection -- Allow inverted and under/overlay masks to affect masks, making them more - flexible. This allows for things like /gmask !$biome and -/gmask >>>#region -- Added basic entity handling with copy and paste. Paintings do not currently - respawn properly, entity pastes cannot be undone yet, and -schematics do not yet store entities -- Added getChunkCubes() to Region to get 16^3 chunks a region overlaps with -- Cleaned up ContainerBlock inventory reading from NBT. -- Added a command to list schematics and the abilitiy to autodetect schematic - format when loading schematics -- Added support for multiple schematic formats -- Corrected flag checks for biome commands -- Added allFlags setting to Command to prevent it from restricting allowed - flags (for dveleopers!) -- Make sure all WorldEdit files are in the plugins/WorldEdit folder -- Added initial support for plugin channels with WECUI -- Remove error-prone redundancy in Polygonal2D min/max management -- Updated for SpoutVanilla changes -- Added Falling sand/gravel entities to /remove command -- Added support for new tree types to TreeGenerator and make adding more tree - types later easier -- Updated for changes to SpoutAPI -- Fixed FloatingTreeRemover (/tool deltree) to work correctly with jungle trees -- Fix bPermissions instanlled check -- Add a -f (friendly) flag to butcher which applies -a, -n, -p, and -g, and a - -g flag which allows butchering of iron and snow golems -- Add FlatRegion interface and an associated iterator (for developers!) -- Fix a NPE with brush using a global mask and no brush mask -- Fixed //shift not updating polygonal regions properly. -- Add support for expand with reverse dir for Cylinder & Ellipsoid -- Make inset/outset use varargs contract/expand, so they can be used with - cylinders and ellipses. -- Add positive() to Vector and Vector2D -- In WorldGuard, teleport/spawn location yaw/pitch should now work. -- Register command permissions, integrate with the Bukkit help API -- Allow annotation-free registering of commands with other plugins - (for developers!) -- Added default radius setting for butcher and added permissions for killing - pets, npcs, and non hostile animals. -- Added support for new Anvil saving format, fixed old chunk saving format. -- Clean up some stray 128 values and update the fallbacks to 256 -- Add support for 1.2.4 and newer -- Updated for new 1.2 and 1.2.4 blocks, items, and mobs -- Fix Dispensers, Furnaces and remove redundant casts. -- Fix restoring enchantments from snapshots/schematics. -- Made tree planter tool try 10 times to make the tree before giving up. - -Thanks to Nidan, aumgn, Jadedwolf, wizjany, SpectralEdge, md_5, and desht for -their contributions - - -5.2: -- Made BlockBag use WorldVectors for add(Single)SourcePosition -- Fixed north face not being set with non-singleblockpatterns. -- Moved the block data check to LocalWorld, adding preliminary support for - custom blocks. -- Lookup by id if the string passed to Block/ItemType.lookup() is an integer -- Fixed issues with //replace. -- Factored lookup code from BlockType and ItemType into a method in StringUtil. -- BaseBlock changes -- Properly escape cuipattern -- Fix handling of empty strings passed to Block/ItemType -- Improved formatting and performance of YAMLProcessor when no comments are - present. -- Added bPermissions support -- Update for new events system -- Fixed /scriptname.js and no-double-slash settings not working -- Corrected usage message for maze.js -- Fixed mimimum height check for cylinder generation -- Get the items to be dropped for a block break from Bukkit - -5.1.1: -- Fixed some compatibility issues with SpoutPlugin -- Readded Permissions 2/3 support -- Fixed an issue with CylinderRegion - -5.1: -- Added a //help command (alias /we help). -- Fixed a NullPointerException in conjunction with CraftBook. -- Added support for console commands to WorldEditPlugin. -- Made /butcher, /searchitem (and /search) and /worldedit (and /we) work on the - console. -- Fixed //stack -s (again). -- Added a thickness parameter to //hollow. -- Added a block/pattern parameter to //hollow. -- Added a -l flag to /butcher, which spawns fake lightning on all killed - entities. -- Added support for dynamic command registration. -- //sel poly now keeps the previous selection, converting its outline into a - polygon if necessary. -- Fixed //sel selection clearing not being dispatched to CUI. -- Improve zip file recognition. -- Added WECUI protocol version support. Eventually, this will disable WECUI - until the user updates, but not yet. -- Added //desel and //deselect as aliases for //sel -- Added a gravity brush. -- Added support for ellipsoid and sphere selections. -- Add cuiVersion to LocalSession and set it via incoming CUI event Refactor - region selectors to handle legacy versions a bit better. Because chat - doesn't allow the section sign to be sent, I have to send non-color codes. Meh. closes #158 -- Some region selection fixes -- Removed redundant line from README.md. -- Add a cylindrical region selector. -- Added initial SpoutAPI compatibility -- Allow copying item stacks with damage of > Byte.MAX_VALUE. Closes #972 -- Improved output of YAMLProcessor and added support for root-level comments. - (for developers!) -- Removed support for Permissions2/3 -- Performance improvements -- 1.1 compatibility -Thanks to everyone for their contributions: -rjwboys, yetanotherx, and GiCodeWarrior - -5.0: -- Added a //g[en[erate]] command that can generate a shape given a formula -- Added a //deform command that deforms the current selection given a formula -- Added a //hollow command, which hollows out the object contained in the selection. - -- Added /snapshot sel, which preselects a snapshot for future operations -- Added //sel extend, which activates cuboid selector where you can extend - selections by right-clicking. -- Added -a and -n flags to //butcher to kill animals and NPCs, respectively -- Added support for stretched cylinders to //cyl and //hcyl (use //cyl x,z) -- Added sound and particle effects for the super pickaxe -- Added l[eft], r[ight], b[ack] and f[orward] to the commands that take a direction. -- Added an expression parser (for developers!) -- Added a YAML library (for developers!) -- Added extended help to commands manager (for developers!) - -- Support for the new blocks/items/mobs that were added with Minecraft 1.0 -- Support for non-128 world heights -- Block queues are now flushed based on attachment to other blocks. This should - fix doors popping out. -- Made blockbag (take blocks from inventory) system more consistent. -- Made some commands' syntax error messages more elaborate and useful -- Made /green break on liquids. -- Improved interaction with permission plugins -- Improved negated node support for Bukkit's permissions system -- Changed the WEPIF interface (for developers!) - -- Fixed data value handling for fire, chest, reed and jukebox -- Fixed config file generation on windows -- Fixed some navigation wand (compass) quirks -- Fixed the tree remover tool for large forests -- Fixed //stack -s to actually shift the selection to the end of the stack -- Bug fixes -Thanks to everyone for their contributions: -KenanY, Megalin, wizjany and ZachBora - -4.7: -- Added support for all the new items and blocks -- Added multiworld permissions support to WEPIF -- Added superperms and native PEX support to WEPIF -- Added /range command for brushes -- Added multiworld snapshot support (check the new structure on the wiki!) -- Added //naturalize command (makes stone/dirt/grass layers) -- Added a //farwand tool, allows selecting pos1 and pos2 at a distance -- Added a //lrbuild tool, allows "placing" and - "destroying" blocks at a distance -- Added /pyramid and /hpyramid generators -- Added underlay and overlay masks -- Added a /green command (adds a layer of grass on top of landscape) -- Added polygon support to the WorldEdit CUI -- Moved config permissions system and other WEPIF configuration to the - wepif.yml file -- Improved command logging to additionally log the position and region of - the player -- Added -n flag to //smooth (smooth only natural terrain) -- Improved item/block name matching -- //pos1 and //pos2 now accept an x,y,z arguement to - select arbitrary coordinates -- Non-integer (decimal) radii now work in cylinders, spheres, fill, drain, etc -- Added -s flag to //chunk (select all chunks in current selection) -- Block patterns now can be used in //replacenear, //walls, and //outline -- Block damage values can be used in //replace and //replacenear -- Added -p flag to flip, flipping the clipboard offset around the player -- Allowed performing //undo from other player's sessions -- Added ellipsoid support to //sphere and //hsphere (use //sphere x,y,z) -- Entity /remove command can now remove "xp", for xp orbs -- Using //set mobspawner is no longer case sensitive for mob type -- The /deltree tool now deletes floating mushrooms as well -- Added value flag support to the command system (for developers!) -- Fixed superpickaxe dropping the wrong items sometimes -- Fixed errors when manipulating note blocks -- Fixed cylinders generating too short -- Fixed inaccurate polygon edges -- Fixed flipping of signs and doors -- Fixed manipulating blocks in unloaded chunks -Thanks to everyone for their contributions: -zml2008, wizjany, TomyLobo, Nichts, mrapple, jjkoletar, robinjam, jascotty2, -Hretsam, Elizacat, masteroftime, x1337x, TLUL, Droolio, ZerothAngel, md-5, -and t3hk0d3 - -4.6: -- Updated for Minecraft 1.6. -- Added flood fill tool. Use /floodfill and right click blocks - to flood fill them. -- Added //gmask to set a *GLOBAL* mask that affects nearly ALL operations. - Now you can confine //sphere to a region or create //walls that do not - replace existing blocks. -- Added a region-based mask that confines changes to the current region - (when the mask is set). -- Added support for combining masks, i.e. /mask #region rock,brick -- Added //fast mode, which allows the server to skip the dirtying of chunks. - This means that you have to rejoin to see changes though, but most - operations are doubled in speed. This only applies to the Bukkit version - at the moment. -- Changed the block type check to be implementation-dependent. The Bukkit - plugin now checks Bukkit's Material. -- Added -p flag to //butcher to kill pet wolves. Thanks to wizjany. -- Added -s flag to //move and //stack to move the selection along with the - blocks. Thanks to wizjany. -- Made CUI selection clear on disable (including Bukkit's /reload). - Thanks to wizjany. -- Added "deltree" tool for removing floating trees. Thanks to moo0. -- Added rotation support to redstone repeaters. -- Fixed //expand vert not updating client. -- Fixed the issue with log files not being closed on unload in Bukkit. - Thanks to stoneLeaf. -- Fixed history size being 0 with old config files. - -4.5: -- Fixed the IllegalAccessException with /remove (hopefully). -- Removed wolves from /butcher. There's no way to check if a wolf is owned - or not in Bukkit yet. -- Added permission checks for tools on use, so now if you switch world or - lose your permissions, you lose your tools. -- Added expiration timer to sessions. Sessions will now last up to 10 minutes - (by default) before removed, so you can quickly disconnect (or crash) and - come back and still maintain your history. -- Removed minimum cap on history size (now you have history sizes under 15). - -4.4.1: -- Maven-built release. -- Sun Rhino removed. - -4.4: -- Updated for Minecraft 1.5. -- Updated for latest Bukkit. -- Add cycling for wall signs and steps. -- Fixed rotating wall signs. -- Fixed exception thrown by commands with multiple spaces between arguments. - -4.3: -- Updated for Minecraft 1.4. -- Added support for newer versions of Permissions. -- Took polygon-in-point algorithm from WorldGuard, which is a minor - improvement. Please submit a better algorithm that properly handles edges! -- Fixed WorldEdit unpacking the wrong config.yml. -- Added improved selection getting/setting API. -- Diagonal stacking added (not up or down yet) (thanks Valentin Stahlmann!) -- Palette option added to draw.js (thanks J0s3f!) -- CraftScripts: Made EditSession.rawSetBlock() public. - -4.2: -Bukkit users: Minimum build #: 541 -- Changed the compass so that left click is /jumpto and - right click is /thru. -- Add a basic API method to get a player's selection region. -- Added shortcut fire extinguisher brush. -- Added //regen to regenerate an area. -- Added McRegion support to /chunkinfo. -- Added /snap before [date] and /snap after [date]. - Example: /snap before last Monday 2am -- Added /worldedit tz to set your timezone. It currently does not persist - yet. Example: /we tz america/los_angeles -- Fixed block mine drops for 1.3. -- Possibly fixed item dropping with undo/redo. -- Fixed the permissions resolver not being loaded if it was loaded after - a plugin was enabled or re-enabled. -- Removed GroupUsers support. -- Added some support for the WorldEdit client-side UI (CUI) protocol. - -4.1: -- Added McRegion support. -- Optimized the case when worlds were not in the root directory of a zip. -- Fixed snapshot restoration not working on sign blocks and other special - tile entity blocks. -- Added beds as a place-last block. -- Fixed beds and redstone repeaters not being set. -- Added an alias for wool colors as though they were blocks, so you can now - do //set blue, etc. -- Removed "blue" as an alias for lapis lazuli. - -4.0-beta8: -- Added things for CraftBook. - -4.0-beta7: -- Added 1.3 block support. - -4.0-beta6: -- Fixed //count being ///count. -- Added a workaround to the fact that Minecraft no longer sends a block - dig packet for bedrock. WorldEdit now detects if you're hitting bedrock, - but it may not be entirely accurate (torches will trick it!). -- Removed /t on request of Kainzo. -- Fixed second position setting commands saying position one instead of two - when selecting cuboids. - -4.0-beta5: -- Fixed permissions with brush commands. - -4.0-beta4: -- /b changed to /br. - -4.0-beta3: -- Fixed BLOCK_DAMAGED bug. -- Fixed command conflicts. - -4.0-beta2: -- Fixed issue with too many commands being put into plugin.yml, causing - conflicts with other plugins. -- //size works properly again. -- /search is now an alias for /searchitem. - -4.0-beta1: -- Added /remove command to remove entities (paintings, items, minecarts, - boats, arrows, and primed TNT). -- /butcher now works for slimes and ghasts and will no longer drop items. -- The tool system has been overhauled so that when you use a tool, it gets - bound to your currently held item. For example, you could bind the tree - tool to a wooden sword and the brush tool to a diamond axe. -- Brush commands have been broken up. Use /brush, /mat, and /size to adjust - a brush's settings. A different brush can be bound to different items. -- //wand now gives the wand item directly. -- New mask support allows you to filter the blocks that would be changed. - This currently only works for brushes. -- Added some API methods. -- Added multiple undo/redo. -- Added -c flag to //distr to print to console. -- Added //outset and //inset commands to quickly adjust the size of - the current selection. -- Snapshot commands now are nested under /snap and /snapshot commands. -- Changed super pickaxe mode command to /sp. -- Added history size configuration option. -- //size is currently /m due to a bug. -- Added smooth brush. -- Added /we version and /we reload. -- Added 'no-op-permissions' setting for Bukkit. -- Added polygonal regions. These are still in development as they are - a bit inaccurate at the moment. -- Updated WorldEdit for Bukkit. -- Improved parsing of block pattern/data syntax. -- Improved block and item name list. -- Improved debugging messages (if that's enabled). - -3.2.2: -- Updated for Bukkit commit 8ccfad945663cd0ea60531b085748c81fc6fefb8. - -3.2.1: -- Added version information for SP. -- Improved Bukkit performance drastically. - -3.2: -- Fixed /forestgen having an incorrect number of maximum arguments. -- Re-added Sun Rhino implementation as a separate library bundled in - during creation of the .jar. -- Unified file selection and checking API. -- Fixed CraftScripts not properly loading files from the current - working directory as defined by the implementation. -- Enabled queue on EditSessions given to scripts. -- Improved draw.js to be more user friendly. -- Fixed /forestgen having an incorrect number of maximum arguments. -- Fixed /removenear not taking a default size argument. -- Improved overall performance. - -3.1: -- Added more tree generators. /tree [type] and - /forestgen [size] [type] [density] are the new commands. -- No longer using the internal Rhino JavaScript engine, so Windows users - will now have to download Rhino separately to use scripting. - -3.0: -- Added /searchitem or //l command to lookup items and block by name and ID. -- Added block data cycling super pickaxe tool. (/cycler) -- Added //paste [-ao] syntax to paste without air and at origin. -- Added support for //stack [-a] to not stack air. -- Added the ability to configure the schematic and CraftScript directories. -- Added better support for cake, added some more block/item aliases. -- Added support for rotation block orientation with the rotate and flip - commands (now stairs, torches, etc. will rotate correctly). -- Added distance to //size. -- Added more brush shapes (hollow sphere, cylinder, hollow cylinder, - and clipboard) for the brush tools. -- Added in a valid block ID check. -- Added debugging information for when no snapshots could be found. -- Added pattern support to //overlay (i.e. //overlay 3%torch,97%air). -- Added a clipboard pattern (//set #clipboard) -- useful for repeating - patterns over an area. -- Changed the arm swing tools to also work on right click. -- Improved block drop list (thanks to Gunther De Wachter). -- Fixed scripting.timeout setting taking no effect. -- Fixed group checking with Permissions. -- Moved commands around in the code and added hierarchical permissions - support in the process. All permission systems supported by WorldEdit - (and utilizing plugins) support hierarchy, regardless if they really - do or not. WorldEdit will simulate hierarchy as required. - -2.15.2: -- Minor additions for ease of integration. - -2.15.1: -- Fixed /script.js shortcut not stripping forward slashes. -- Changed some internal working directory handling code to better support - single player modifications. - -2.15: -- Added roof.js by Bentech. It makes a roof over your selection. -- Added wool as an alias for cloth. -- Added support for specifying color names instead of data values for cloth. -- For the brush tools and the compass, you now have to SWING with your arm. -- Right click with the compass now toggles between /thru and /jumpto. -- The algorithm for /thru was improved. -- Fixed quickshot.js not reading notes correctly. -- Fixed /butcher. (I also added necessary methods to Bukkit so you now - have to update that too.) -- draw.js now supports orientation and choses white wool for white pixels - instead of pink! (Thanks to Dean Ward.) -- Improved /info tool to handle more block data. -- Changed /s to /.s to avoid conflicts. -- Now you can use /script.js directly as a command. -- Improved /info tool to handle more block data. - -2.14.2: -- Fixed array out of bounds error with snapshots. - -2.14.1: -- Improved some error messages. -- Fixed snapshots not supporting all block types. -- Fixed forest generator. - -2.14: -- Added full block data support (furnaces, note blocks, etc.) for Bukkit. -- Added /s to repeat last script. - -2.13: -- Scripting support is back! -- Colored cloth blocks should now work. -- Fixed issue where the command's arguments were printed to chat when - you also did not have permissions. - -2.12: -- Added new flat file permissions resolver, added * support for - ConfigurationPermissionsResolver. -- Added support for Niji's permission system. -- Fixed bad list to array conversion in ConfigurationPermissionsResolver. -- Fixed default permissions with the built-in permission resolvers. -- Fixed issue with BlockWorldVector causing java.lang.VerifyError due to - how Bukkit loads plugins. -- Ops now have all permissions. -- Changed /reload WorldEdit to /reloadwe. -- Moved WorldEdit to use Bukkit's command registration. Let's hope - this didn't break things. - -2.11: -- Ported over toi's ray tracing code so that it's now included in - WorldEdit. This will make porting WorldEdit to single player - and other platforms easier. -- Fixed NullPointerExceptions that appeared while saving a chest. -- Fixed NullPointerExceptions in some super pickaxe modes, made arm swing - handler get called on item usage. This means that you can use - /brush and /rbrush now but you right click in the air instead of - swinging your arm. -- Made super pickaxe arm swing and right click modes mutually exclusive. -- Added the navigation wand. Normally a swing of your navigation wand - would call /jumpto, but in the mean time you have to right click. - -2.10: -- Inventory support now works for Bukkit. -- Now /jumpto and /thru works. -- Now prints an error message if permission is not available. -- Added support for cloth color with the super pickaxe drops. -- Updated GroupUsers support to use GroupUsers' new API. GroupUsers - must be updated as well. -- Added wand-item to default config.yml. - -2.9: -- Added pine tree tool. -- Bukkit: Added support for GroupUsers. If GroupUsers is not present, - WorldEdit will fall back to its own permissions system. -- Bukkit: Added sign support for Bukkit. - -2.8.1: -- Added some extra functions to Vector for WorldGuard. -- Made setup easier and less confusing. - -2.8: -- Improved Bukkit support. - -2.7.2: -- Fixed permissions checking for individual commands. -- /butcher should now kill animals again. -- /thru should now treat torches and such as pass-through blocks. - -2.7.1: -- Added tree and item drop support for the Bukkit version. - -2.7: -- Added sphere brush tool. Use /sphere [radius] [noReplace?] to - enable it and /none to disable it (note: /none also disables the - right click super pickaxe tool). The brush tool builds a sphere at the - location that you are looking at. For the last argument, put "true" - or "yes" to prevent the brush from replacing non-air blocks. -- Changed water to be considered a pass-through block. This means that - /thru, /jumpto, and such commands will ignore water. -- /tree now makes regular tree and /bigtree makes big trees. /forestgen - will still make big tree forests. -- The block replacer tool should now support inventory. -- Fixed the NullPointerException with /jumpto and similar commands. -- Made handling of non-right angles in getDirection() return more - relevant errors. Now //stack and similar commands won't give you the - cryptic error of "Unknown direction: me". -- Updated sample worldedit.properties file. - -2.6: -- Removed 'air' prefix from commands. Now //pasteair is just //paste, - //moveair is just //move, etc. -- Made /worldeditselect permission more encompassing, now including //chunk, - //expand, and //contract. -- Added syntax for //expand which allows - you to expand in two directions at once. This also works for //contract. -- Added //expand vert|vertical to expand the selection from top to bottom. -- Added /thaw to reverse /snow. -- Fixed WorldEdit not handling ice removal well. -- Fixed some inaccuracy problems regarding player positions caused by a - recent update. -- Fixed the tree generator. -- Code reorganized a little more. - -2.5.1: -- Fixed the WorldEdit bridge used by CraftBook and other plugins. -- Fixed issues with permissions where the only reliable permission was - /worldedit. - -2.5: -- Fixed issues with permissions not being read correctly. -- WorldEdit is now world-aware (not that the Minecraft server is). -- Abstracted super pickaxe mode/tools and changed commands to /tree, /info, - /none, /single, /area, and /recur. -- New /repl super pickaxe tool. -- Now bundling JNBT. -- Add a very rudimentary command line program that will check the integrity - (a very basic integrity check) of a world. - -2.4: -- Added the ability to use (require) inventory with operations, preventing - people from setting blocks that they don't have. -- Simplified the max blocks change limit to be binary (either you have it or - not). Also separated the 'max' limit and the 'default' limit in terms - of configuration. This means that the WorldEdit restrictions file is - no longer used. -- A large part of the code was moved around (again) to make porting - WorldEdit to other modding APIs easier, but this means that something - may have broken. -- Chest handling was rewritten for Minecraft beta, so it should be - reliable now and not cause exceptions. -- Item damage is now managed by WorldEdit's chest handling APIs. -- Worked around an issue with the java.util.zip implementation that - caused ZIP files containing backslashes to not work correctly. -- Changed the TrueZip support to use the API for java.util.zip, meaning - some bugs should be fixed. -- Made all commands support double forward slashes as the command prefix. - -2.3.4: -- Fixed issues with chests. -- Added configuration option that disables the "//" prefix and lets you use - single forward slashes too. - -2.3.3 -- Updated for beta. -- Fixed error caused by not specifying a mob spawner type when using mob - spawner blocks. -- Improved version detection to be more reliable. -- Fixed incorrect item drops for the super pickaxe. - -2.3.2: -- Fixed the history/queue array lists being iterated in the wrong direction. - //move should be fixed as a result. - -2.3.1: -- Updated for b129+ and v0.2.6_02. - -2.3: -- Blocks should now be set and removed correctly so that they don't - drop items. -- /fixwater and /fixlava should no longer cross solely diagonally connected - pools. -- Fixed //smooth lifting water upwards. -- Added //shift to move the selection. -- Added //flip to flip the clipboard. -- ; instead of | can be used when specifying extra tile entity data - for blocks that support them. -- Items are now dropped by the super pickaxe (configurable). -- The info tool is governed by the permission /infotool and the tree tool - is now goverened by the /treetool permission. -- New info tool (//tool info) that tells you information about the block - that you right click with a pickaxe on, including the type of mob - spawned by a mob spawner. -- Mob spawners are now supported for all operations. To specify a mob type, - use syntax like //set mobspawner;Pig or //set mobspawner|Pig -- Added a catch for the IOException now thrown by recent versions of hMod. - -2.2.1: -- Fixed compatibility with server v0.2.5. - -2.2: -- Added Grum's //smooth command to smooth terrain. Select the entire area - and use //smooth on it, perhaps specifying a number of iterations, - with a larger number of iterations meaning a smoother terrain. Trees and - other blocks like fences currently do not drop. -- Fixed output messages for //pos2 and //hpos2 when used. -- Updated for server version 0.2.5. - -2.1: -- Switched usage of HashMaps to double ArrayLists in the history function, - increasing the speed of everything by up to 20x. -- The data values of blocks that use them won't be set anymore, decreasing - the packet spam generated. -- Added //fillr that recursively fills (it's //fill except it will - fill nooks and crannies). -- Fixed /unstuck lifting you when you weren't stuck. -- Added a filename character whitelist to schematic saving/loading - routines. (regex: ^[A-Za-z0-9_\- \./\\'\$@~!%\^\*\(\)\[\]\+\{\},\?]+$) -- Expanded the character whitelist for snapshot names (to the same as the - one for schematic saving/loading). -- .schematics now save original copy offset. -- Added //count that counts the number of blocks in a region. -- Added //distr that prints the distribution of blocks in a region. -- Added /butcher to kill all/nearby mobs. -- Added mob killing to the super pickaxe. - -2.0.2: -- Fixed issues with /listsnapshot and //restore not working. -- Fixed help for //expand and //contract. -- /jumpto should work reliably again. - -2.0.1: -- Fixed the issue with the super pickaxe not working with bedrock. -- Fixed an issue with the recursive super pickaxe not working properly. -- Added an argument to /listsnapshots to show more snapshots. -- Added an argument to //restore that lets you select a snapshot for - restoring without //use. - -2.0: -- Added help message to //load telling users about //paste. -- Added Notch tree planting tool mode with the right click of the pickaxe. - (Undo is supported!) -- Added recursive super pickaxe mode that destroys blocks adjacent, - destroying only blocks of the same type as the block that you clicked on -- Added area super pickaxe mode that destroys a cuboid area on use, - destroying only blocks of the same type as the block that you clicked on. -- Added pasting at origin and saving origin to .schematics. -- Added /chunk to select all the blocks inside the chunk that you are in. -- Shortcut /replacenear lets you replace nearby blocks. - Example: /replacenear 50 rock glass -- /ascend, /descend, and /unstuck now detect pass-through blocks better. -- Added /up to go up some distance. -- Added /snow command to overlay snowfall and freeze lakes in the area. -- Both /pinegen and /forestgen (now) have a density argument. Values - between 0 and 100 are accepted. -- Changed old forest generator command to /pinegen. -- Changed /forestgen to generate forests using Notch's tree algorithm - (fully undoable). -- Improved speed of commands that iterated over cuboids by 5-40%. -- Support for setting random block content with //set. - Example: //set 5%diamondore,95%glass - Numbers don't have to add up to any particular number. -- Block IDs are now resolved with hMod as well, should it fail to resolve - with WorldEdit. -- Added support for replacing a list of blocks with //replace. -- Added register-help configuration to prevent WorldEdit commands from - showing up in help. -- /ascend, /descend, and /unstuck now clamp Y to >= 0. -- Added /worldeditselect permission that will give users access to all - commands and functions that let you define selections. -- Point selection functions now emit the coordinates. -- //size now displays coordinate information. -- Added per-group block change limit restrictions support. -- Possibly added .tar.bz2/tar.gz support. Untested and highly - unrecommended. -- Added command logging setting and logging to file. -- Added max-radius configuration to clamp radii and sizes. -- Added /fixlava. -- New /ex area fire extinguisher command (shortcut to /removenear fire 40). -- Added class to access WorldEdit selections from other plugins. -- //contract and //expand argument orders swapped to go with the other - direction commands like //stack. -- Super pickaxe now ignores TNT. (Before it caused ignition on client-side - only). -- Y coordinates are now clamped between 0 and 127 when blocks are set - by WorldEdit. This fixes some exceptions. -- Expanded the priority block list significantly to handle more block types. -- .schematic load/save error messages are now more descriptive. -- Fixed iron pick axe not working as a super pickaxe. -- Plugin .jar renamed from SMWorldEdit to WorldEdit as it was confusing. -- WorldEdit version is now printed on load. - -0.13.2: -- Added support for the new block types from the Halloween update. - -0.13.1: -- Updated for b123. -- New /pumpkins command. Happy Halloween! -- //fill now uses its own stack so that it doesn't cause stack overflow - errors for overly large regions. -- For commands that look for a block ID (//replace, /removenear), it will - no longer check against the WorldEdit block restriction list. - -0.12 -- Added /listchunks -- Added /delchunks (creates a shell script). - -0.11: -- New TrueZIP support. -- Fixed the issue with certain blocks dropping items (torches, etc.). -- Chests are partially supported. Double width chests don't paste too well yet. -- //expand and //contract are now bounded on the Y-axis. -- Cactus was removed from the list of allowed blocks. - -0.10: -- Issues with the permissions regarding the super pick axe mode and - the edit wand have been resolved. -- For the super pick axe to destroy bedrock, permission must be given for - /worldeditbedrock. -- Added /chunkinfo to tell you information about the chunk that you are in. -- Added support for restoring regions from a backup. /listsnapshots, //use, - and //restore have been added. -- Added //hpos1 and //hpos2 to set the corners of the cuboid to the block - that you are looking at. -- Added /jumpto to go to the spot that you are looking at. -- Added /thru to go through the wall in front of you. -- Added /ceil to get to the ceiling of a room. - -0.9: -- Giving permission to just /worldedit is now enough to have access to all - WorldEdit commands. -- The super pickaxe toggle command has been changed to //, but the old "/," - command will continue to work. When assigning permissions, give access to // -- Added //move and //moveair to move the selection. -- Fixed the help for //wand. -- Fixed a bug that caused commands to be case sensitive. -- Permissions for the non-air command (i.e. //stack vs //stackair) now - extend to the air command. -- Added /removenear to remove nearby blocks of a type. -- Fixed the incorrect help for some commands. -- Added //cyl and //hcyl to generate filled and hollow circles and cylinders. -- Added //sphere and //hsphere to generate filled and hollow spheres. -- Added //walls to generate the sides of a cuboid region. - -0.8.3: -- //rotate fixed. -- Fixed some floating point inaccurracy errors. -- Exceptions are now caught when handling commands so that they can be - reported to the current user. - -0.8.2: -- Signs that are not in a loaded chunk will no longer cause an exception. -- /unstuck, /ascend, and /descend are more accurate now. /descend also - won't drop you from 20 feet up and it won't drop you into the void anymore. - -0.8.1: -- Added a workaround for the onBlockDestroy hook returning (0, 0, 0). - -0.8: -- All operations now implicitly support working with block data, including - sign text. This applies to .schematic loading and saving. -- Scripting support has been removed. It may return in the future, possibly - as an additional plugin. -- /edit command prefix was changed to //. -- Added //expand and //contract to expand and contract the selected region. -- Fixed help for //stack and //stackair. -- Added /ascend to ascend to the next level up. -- Added /descend to descend down a level. -- Added /toggleeditwand to toggle use of the toggle wand. -- Re-implemented /forestgen in Java. -- Added /editrotate to rotate the clipboard around the minimum position. -- Added super-pick axe mode with command /, -- Added /toggleplace to switch to using position #1 instead of your feet. -- Plugin for hey0's server mod has been renamed to SMWorldEdit. -- //fill routine now keeps a track of visited blocks to prevent - infinite recursion caused by inconsistent states. -- /editcut will both copy and remove. -- All block name lookups now use WorldEdit's own list. -- New syntax to specify block data when specifying block type. Examples: - //set crops:7 - //set sign:4|Line1|Line2 -- Colored cloth blocks can no longer be created at all - (they crash clients). -- Added /fixwater to level and correct water. - -0.7: -- /editreplace now has reversed arguments. /editreplace [fromID] toID -- /editstack(air) now has reversed arguments. /editstack count [direction] -- /editstack(air) now can take longer direction names ('up' vs. just 'u'). -- Added /editdrain drains pools of lava and/or laval. -- Fixed help for /editstack(air) incorrectly referring to the clipboard. -- Removed the dependency on Apache commons and recompiled the JavaScript - engine to be smaller. - -0.6: -- Added a check that will warn you when the region you have selected is - larger than the .schematic format can support. -- Implemented smart block queuing that will intelligently create or - destroy blocks so that certain blocks (torches, etc.) will spawn - correctly (though perhaps not in the right orientation) and will - remove correctly (without dropping an item). -- When pasting, if you end up inside a block, you will now be put up top - of the paste. -- Added /editstack and /editstackair for stacking/repeating regions a - certain number of times. -- Added /removebelow. -- Added height parameter to /removeabove. -- Added /editwand to give you the wooden axe. -- Added /editlimit to allow you to clamp the number of blocks that can - changed in one go at a time. A new "max-blocks-changed" setting - lets you configure a default limit. - -0.5: -- You can now right click once with the wooden axe to select position 1 - and double right click to select position 2. -- /editoutline added to draw the faces of a region. -- New /editload and /editsave that work with .schematic files. -- /clearclipboard now works. -- meteorshower.js added: drop burning resources around you. -- Scripts can now be run directly as a command. -- The forest generator now tops the trees with leaves. -- Scripts will now be aborted if they take 3 seconds or longer to finish. -- Fixed a bug in the undo function that prevented generated forests from - ndoing properly. -- Added Teleport functions to the scripting interface. - - -0.4 -- Added history with undo/redo up to 15 states. -- /editreplace updated with the ability to replace only one type of block. -- Added /editcopy and /editpaste. -- New adjustable whitelist of usuable blocks. - -0.1 -- Initial release. diff --git a/COMPILING.md b/COMPILING.md index 53518b0c9..d3e5bac5c 100644 --- a/COMPILING.md +++ b/COMPILING.md @@ -1,7 +1,7 @@ Compiling ========= -You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 7 or newer. +You can compile WorldEdit as long as you have the [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html) for Java 8 or newer. You only need one version of the JDK installed. The build process uses Gradle, which you do *not* need to download. WorldEdit is a multi-module project with four modules: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index ce68574ef..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,69 +0,0 @@ -Contributing -============ - -Thank you for your interest in contributing to WorldEdit! We appreciate your -effort, but to make sure that the inclusion of your patch is a smooth process, we -ask that you make note of the following guidelines. - -* **Follow the [Oracle coding conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html).** - We can't stress this enough; if your code has notable issues, it may delay - the process significantly. -* **Target Java 7 for source and compilation.** Make sure to mark methods with - ` @Override` that override methods of parent classes, or that implement - methods of interfaces. -* **Use only spaces for indentation.** Our indents are 4-spaces long, and tabs - are unacceptable. -* **Wrap code to a 120 column limit.** We do this to make side by side diffs - and other such tasks easier. Ignore this guideline if it makes the code - too unreadable. -* **Write complete Javadocs.** Do so only for public methods, and make sure - that your `@param` and `@return` fields are not just blank. -* **Don't tag classes with @author.** Some legacy classes may have this tag, - but we are phasing it out. -* **Make sure the code is efficient.** One way you can achieve this is to spend - around ten minutes to think about what the code is doing and whether it - seems awfully roundabout. If you had to copy the same large piece of - code in several places, that's bad. -* **Keep commit summaries under 70 characters.** For more details, place two - new lines after the summary line and write away! -* **Test your code.** We're not interested in broken code, for the obvious reasons. -* **Write unit tests.** While this is strictly optional, we recommend it for - complicated algorithms. - - -Checklist ---------- - -Ready to submit? Perform the checklist below: - -1. Have all tabs been replaced into four spaces? Are indentations 4-space wide? -2. Have I written proper Javadocs for my public methods? Are the @param and - @return fields actually filled out? -3. Have I `git rebase`d my pull request to the latest commit of the target - branch? -4. Have I combined my commits into a reasonably small number (if not one) - commit using `git rebase`? -5. Have I made my pull request too large? Pull requests should introduce - small sets of changes at a time. Major changes should be discussed with - the team prior to starting work. -6. Are my commit messages descriptive? - -You should be aware of [`git rebase`](http://learn.github.com/p/rebasing.html). -It allows you to modify existing commit messages, and combine, break apart, or -adjust past changes. - -Example -------- - -This is **GOOD:** - - if (var.func(param1, param2)) { - // do things - } - -This is **EXTREMELY BAD:** - - if(var.func( param1, param2 )) - { - // do things - } diff --git a/HEADER.txt b/HEADER.txt new file mode 100644 index 000000000..a429eca27 --- /dev/null +++ b/HEADER.txt @@ -0,0 +1,16 @@ +WorldEdit, a Minecraft world manipulation toolkit +Copyright (C) sk89q +Copyright (C) WorldEdit team and contributors + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU Lesser 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 Lesser General Public License +for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . diff --git a/README.html b/README.html deleted file mode 100644 index 54e4fb40d..000000000 --- a/README.html +++ /dev/null @@ -1,197 +0,0 @@ - - - -${project.name} ${version} - - - - - -
-

${project.name} ${version}

-
-

Getting Started

-

- Thanks for choosing ${project.name}! When you first install ${project.name}, - no one will be able to do anything until you give permissions (unless everyone is an op). - Because ${project.name} is largely command-driven, it has no effect until - someone uses its commands, you can install WorldEdit and deal with - configuration whenever you are ready. -

- -

- Need help? - See the ways that you can get assistance. -

-
-
-

Common Issues

- -

I or others don't have permission to build.

-

- This is not a problem caused by ${project.name}. - ${project.name} doesn't deny build permissions as it is merely - a world editing program. -

- -

${project.name} doesn't seem to work.

-

- A common mistake is making - a syntax error in one of ${project.name}'s configuration files (this is very - fatal unfortunately, and can be caused by a single character typed in the wrong place). Try - asking in IRC - to see whether anyone can help you. -

- -

Can I use this with mod blocks?

-

- Yes, depending on what you are using WorldEdit with - (Bukkit, Single Player Commands, MinecraftEdu, etc.). We don't guarantee - 100% compatibility with all known custom blocks, - but we have pretty - decent support. Please be aware that support for these mods is - considered 'experimental,' and will likely be for the far forseeable - future. -

- -

How do I protect my spawn?

-

- You'll have to install our accompanying WorldGuard plugin, which works - in conjunction with ${project.name} in order to protect areas. With it, - you can make a selection with WorldEdit and then 'define' a region - that prevents other from building in it. -

- -

Can I use ${project.name}'s selections in my Bukkit plugin?

-

- Absolutely! We haven't documented how to yet, but you can try - looking at the Javadocs - for the plugin's main class. You'll have to get a reference to WorldEdit - from Bukkit's plugin manager (don't try to create WorldEditPlugin), and then - call one of its selection methods. -

- -

- Still need help? - See the ways that you can get assistance. -

-
-
-

Contributing

-

- Did you know that ${project.name} is open source? That means that you can - read the code and learn from it, as well as modify it and submit back - changes to help the community! -

- -
-
- - \ No newline at end of file diff --git a/README.md b/README.md index 75aa6a8d9..c0b87b6d7 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,23 @@ FAWE is a fork of WorldEdit that has huge speed and memory improvements and considerably more features -It is available for Bukkit, Forge, Sponge and Nukkit. +## Links -## Chat -### - **`> `**[`Discord`](https://discord.gg/ngZCzbU)`|`[`IRC`](http://webchat.esper.net/?nick=&channels=IntellectualCrafters)` | `[`Spigot Forums`](https://www.spigotmc.org/threads/fast-async-worldedit.100104/)**` <`** +* [Spigot Page](https://www.spigotmc.org/threads/fast-async-worldedit.100104/) +* [Discord](https://discord.gg/ngZCzbU) +* [Wiki](https://github.com/boy0001/FastAsyncWorldedit/wiki) +* [Report Issue](https://github.com/boy0001/FastAsyncWorldedit/issues/new) -## Releases +## Downloads +### 1.13+ +* [Download](https://empcraft.com/fawe/download/?bukkit113) +* [Jenkins](https://ci.athion.net/job/FAWE-1.13/) + +### <1.12.2 +* [Download](https://empcraft.com/fawe/download/?bukkit) +* [Jenkins](https://ci.athion.net/job/FastAsyncWorldEdit/) +* [Repository](https://github.com/boy0001/FastAsyncWorldedit) -### - [**`> Download <`**](https://empcraft.com/fawe/download/) -### - [**`> Jenkins <`**](https://ci.athion.net/job/FAWE-1.13/) ## Building FAWE uses gradle to build @@ -26,6 +34,6 @@ $ gradlew build ## Contributing Have an idea for an optimization, or a cool feature? - - I'll accept most PR's - - Let me know what you've tested / what may need further testing - - If you need any help, create a ticket or discuss on Discord + - We will accept most PR's + - Let us know what you've tested / what may need further testing + - If you need any help, create a ticket or discuss on [Discord](https://discord.gg/ngZCzbU) diff --git a/build.gradle b/build.gradle index d0a7d4a2d..a2dab283d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ -print new File('splash.txt').text - buildscript { repositories { + mavenLocal() mavenCentral() maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } jcenter() @@ -15,16 +14,24 @@ buildscript { } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3' - classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.3.0' - classpath 'org.ajoberstar:gradle-git:1.5.1' + classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' + classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.7.5' + classpath 'org.ajoberstar:gradle-git:1.7.2' } } +plugins { + id 'net.minecrell.licenser' version '0.4.1' apply false +} + apply plugin: 'java' clean { delete "target" } +print new File('splash.txt').text + group = 'com.boydti.fawe' + +def rootVersion = "1.13" def revision = "" def buildNumber = "" def date = "" @@ -33,13 +40,13 @@ ext { git = org.ajoberstar.grgit.Grgit.open(file(".git")) date = git.head().date.format("yy.MM.dd") revision = "-${git.head().abbreviatedId}" - index = 0; // Offset to match CI + index = -1960; // Offset to match CI parents = git.head().parentIds; for (; parents != null && !parents.isEmpty(); index++) { commit = git.getResolve().toCommit(parents.get(0)); parents = commit.getParentIds() } - buildNumber = "-${index}" + buildNumber = "${index}" } catch (Throwable ignore) { revision = "-unknown" } @@ -48,7 +55,7 @@ ext { if ( project.hasProperty("lzNoVersion") ) { // gradle build -PlzNoVersion version = "unknown" } else { - version = date + revision + buildNumber + version = String.format("%s.%s", rootVersion, buildNumber) } description = """FastAsyncWorldEdit""" @@ -56,9 +63,8 @@ subprojects { apply plugin: 'java' apply plugin: 'maven' apply plugin: 'com.github.johnrengelman.shadow' - - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + // Enable this requires putting license header files in many, many FAWE files + //apply plugin: 'net.minecrell.licenser' ext.internalVersion = version @@ -69,25 +75,32 @@ subprojects { repositories { mavenCentral() - maven { url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/" } maven { url "http://repo.bukkit.org/content/groups/public" } maven { url "http://maven.sk89q.com/repo/" } maven { url "http://repo.maven.apache.org/maven2" } // Fawe + maven {url "http://ci.athion.net/job/FAWE-WorldGuard-1.13/ws/mvn/"} maven {url "https://mvnrepository.com/artifact/"} maven {url "http://repo.dmulloy2.net/content/groups/public/"} maven {url "https://repo.destroystokyo.com/repository/maven-public//"} maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"} + mavenLocal() maven {url "http://empcraft.com/maven2"} maven {url "https://hub.spigotmc.org/nexus/content/groups/public/"} maven {url "http://ci.frostcast.net/plugin/repository/everything"} maven {url "http://maven.sk89q.com/artifactory/repo"} maven {url "http://repo.spongepowered.org/maven"} - maven {url "https://repo.inventivetalent.org/content/groups/public/"} maven {url "http://dl.bintray.com/tastybento/maven-repo"} maven {url "http://ci.emc.gs/nexus/content/groups/aikar/" } } + if (JavaVersion.current().isJava8Compatible()) { + // Java 8 turns on doclint which we fail + tasks.withType(Javadoc) { + options.addStringOption('Xdoclint:none', '-quiet') + } + } + task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir @@ -95,6 +108,7 @@ subprojects { artifacts { archives jar + archives javadocJar } if (!(name.equals('worldedit-forge') || name.equals('worldedit-sponge'))) { @@ -122,4 +136,10 @@ subprojects { exclude '.cache' exclude 'LICENSE*' } + + // Enable this requires putting license header files in many, many FAWE files + //license { + // header = rootProject.file("HEADER.txt") + // include '**/*.java' + //} } diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index cd403cf91..7872f45bc 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -53,11 +53,4 @@ - - - - - - - diff --git a/config/checkstyle/header.txt b/config/checkstyle/header.txt deleted file mode 100644 index 24392ded4..000000000 --- a/config/checkstyle/header.txt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * WorldEdit, a Minecraft world manipulation toolkit - * Copyright (C) sk89q - * Copyright (C) WorldEdit team and contributors - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU Lesser 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 Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ \ No newline at end of file diff --git a/favs/build.gradle b/favs/build.gradle index 96173f802..778e6aee2 100644 --- a/favs/build.gradle +++ b/favs/build.gradle @@ -1,5 +1,5 @@ repositories { - maven {url "http://vault.voxelmodpack.com/content/repositories/central/"} + maven {url "https://ci.athion.net/job/FAWE-WorldGuard-1.13/lastSuccessfulBuild/artifact/mvn"} } dependencies { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 0d4a95168..29953ea14 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9ebf67f22..e0b3fb8d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Thu Jul 26 14:29:48 AEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip diff --git a/splash.txt b/splash.txt index b5e673506..70cf461ed 100644 --- a/splash.txt +++ b/splash.txt @@ -1,4 +1,4 @@ - + ============= You are compiling: ============= _______ ___ ____ __ ____ _______ | ____| / \ \ \ / \ / / | ____| @@ -15,7 +15,6 @@ If you encounter trouble: - Use gradlew and not gradle - Ask us! - https://discord.gg/ngZCzbU (Discord) - - https://goo.gl/Zwvv8J (IRC) Files will be output to `/target` diff --git a/worldedit-bukkit/build.gradle b/worldedit-bukkit/build.gradle index e67742793..5e5b3f48b 100644 --- a/worldedit-bukkit/build.gradle +++ b/worldedit-bukkit/build.gradle @@ -4,13 +4,14 @@ apply plugin: 'maven' repositories { maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } + maven { url "https://ci.athion.net/job/FAWE-WorldGuard-1.13/lastSuccessfulBuild/artifact/mvn" } } dependencies { compile project(':worldedit-core') compile 'com.sk89q:dummypermscompat:1.8' compile 'com.destroystokyo.paper:paper-api:1.13-R0.1-SNAPSHOT' - compile "org.spigotmc:spigot-1.13:SNAPSHOT" + compile 'org.spigotmc:spigot:1.13.2-R0.1-SNAPSHOT' testCompile 'org.mockito:mockito-core:1.9.0-rc1' compile 'net.milkbowl.vault:VaultAPI:1.5.6' compile 'com.massivecraft:factions:2.8.0' @@ -28,9 +29,6 @@ dependencies { compile 'com.wasteofplastic:askyblock:3.0.8.2' compile 'com.sk89q:worldguard-core:latest' compile 'com.sk89q:worldguard-legacy:latest' - compile('org.inventivetalent:mapmanager:1.4.0-SNAPSHOT') { - transitive = false - } } processResources { diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index f9078c443..909f51ed9 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -91,7 +91,7 @@ public class FaweBukkit implements IFawe, Listener { } if (Bukkit.getVersion().contains("git-Spigot")) { debug("====== USE PAPER ======"); - debug("DOWNLOAD: https://ci.destroystokyo.com/job/PaperSpigot/"); + debug("DOWNLOAD: https://ci.destroystokyo.com/job/Paper-1.13/"); debug("GUIDE: https://www.spigotmc.org/threads/21726/"); debug(" - This is only a recommendation"); debug("=============================="); @@ -124,13 +124,13 @@ public class FaweBukkit implements IFawe, Listener { new ChunkListener_9(); } - try { + /*try { Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"); new AsyncTabCompleteListener(WorldEditPlugin.getInstance()); } catch (Throwable ignore) { Bukkit.getPluginManager().registerEvents(new SyncTabCompleteListener(WorldEditPlugin.getInstance()), plugin); - } + }*/ } }); } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java index aecb6df3d..e577a6fa5 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/v1_13_1/Spigot_v1_13_R2.java @@ -419,7 +419,7 @@ public final class Spigot_v1_13_R2 extends CachedBukkitAdapter implements Bukkit } else if (foreign instanceof NBTTagDouble) { return new DoubleTag(((NBTTagDouble) foreign).asDouble()); // getDouble } else if (foreign instanceof NBTTagFloat) { - return new FloatTag(((NBTTagFloat) foreign).asByte()); // getFloat + return new FloatTag(((NBTTagFloat) foreign).asFloat()); // getFloat } else if (foreign instanceof NBTTagInt) { return new IntTag(((NBTTagInt) foreign).asInt()); // getInt } else if (foreign instanceof NBTTagIntArray) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/FallbackRegistrationListener.java b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/FallbackRegistrationListener.java index fc797bfc4..035318341 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/FallbackRegistrationListener.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/bukkit/util/FallbackRegistrationListener.java @@ -38,4 +38,5 @@ public class FallbackRegistrationListener implements Listener { event.setCancelled(true); } } -} \ No newline at end of file + +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java index b309265d6..d61674c1e 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/ConfigurationPermissionsResolver.java @@ -19,16 +19,16 @@ package com.sk89q.wepif; +import com.sk89q.util.yaml.YAMLNode; +import com.sk89q.util.yaml.YAMLProcessor; +import org.bukkit.OfflinePlayer; + import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; -import com.sk89q.util.yaml.YAMLNode; -import com.sk89q.util.yaml.YAMLProcessor; -import org.bukkit.OfflinePlayer; - public class ConfigurationPermissionsResolver implements PermissionsResolver { private YAMLProcessor config; private Map> userPermissionsCache; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java index 182a29faf..fe23bfa46 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/NijiPermissionsResolver.java @@ -19,6 +19,7 @@ package com.sk89q.wepif; +import com.nijikokun.bukkit.Permissions.Permissions; import com.sk89q.util.yaml.YAMLProcessor; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; @@ -27,7 +28,6 @@ import org.bukkit.command.PluginCommand; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; -import com.nijikokun.bukkit.Permissions.Permissions; import java.util.logging.Level; import java.util.logging.Logger; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java index 27091ad84..01f04546b 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/wepif/PermissionsResolverManager.java @@ -21,7 +21,6 @@ package com.sk89q.wepif; import com.sk89q.util.yaml.YAMLFormat; import com.sk89q.util.yaml.YAMLProcessor; -import com.sk89q.worldedit.world.registry.LegacyMapper; import org.bukkit.OfflinePlayer; import org.bukkit.Server; import org.bukkit.event.EventHandler; @@ -103,6 +102,7 @@ public class PermissionsResolverManager implements PermissionsResolver { protected PermissionsResolverManager(Plugin plugin) { this.server = plugin.getServer(); (new ServerListener()).register(plugin); // Register the events + loadConfig(new File("wepif.yml")); findResolver(); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java index 8a69eaf31..cb0fea4de 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitBiomeRegistry.java @@ -25,11 +25,12 @@ import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.registry.BiomeRegistry; import org.bukkit.block.Biome; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry for Bukkit. */ diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java index 8f4b8e5ae..b392c50ac 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitCommandInspector.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.bukkit.util.CommandInspector; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -30,8 +32,6 @@ import org.bukkit.command.CommandSender; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitCommandInspector implements CommandInspector { private static final Logger logger = Logger.getLogger(BukkitCommandInspector.class.getCanonicalName()); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java index 0f94a160a..595a7fc9c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntity.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.bukkit.adapter.BukkitImplAdapter; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; @@ -28,10 +30,9 @@ import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.NullWorld; -import javax.annotation.Nullable; import java.lang.ref.WeakReference; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * An adapter to adapt a Bukkit entity into a WorldEdit one. diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java index 02521e87b..fd40f0203 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitEntityProperties.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.bukkit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.metadata.EntityProperties; import org.bukkit.entity.Ambient; import org.bukkit.entity.Animals; @@ -42,8 +44,6 @@ import org.bukkit.entity.Tameable; import org.bukkit.entity.Villager; import org.bukkit.entity.minecart.ExplosiveMinecart; -import static com.google.common.base.Preconditions.checkNotNull; - class BukkitEntityProperties implements EntityProperties { private final Entity entity; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java new file mode 100644 index 000000000..1345f6a81 --- /dev/null +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitImplementationTester.java @@ -0,0 +1,91 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.bukkit; + +/** + * Adds methods to test if different API methods are possible based on implementation. + */ +public class BukkitImplementationTester { + + private BukkitImplementationTester() { + } + + /** + * Known Bukkit implementations + */ + public enum BukkitImplementation { + CRAFTBUKKIT, + SPIGOT, + PAPER, + } + + private static final String implementationMessage = "************************************************" + + "* Note: PaperMC (https://papermc.io/) is *" + + "* recommended for optimal performance with *" + + "* WorldEdit, WorldGuard, or CraftBook. *" + + "************************************************"; + + private static BukkitImplementation implementation; + + /** + * Gets the implementation currently in use on the server. + * + * @return The server implementation + */ + public static BukkitImplementation getImplementation() { + if (implementation == null) { + try { + Class.forName("com.destroystokyo.paper.PaperConfig"); + implementation = BukkitImplementation.PAPER; + } catch (Exception e) { + try { + Class.forName("org.spigotmc.SpigotConfig"); + implementation = BukkitImplementation.SPIGOT; + } catch (Exception e2) { + implementation = BukkitImplementation.CRAFTBUKKIT; + } + } + + if (implementation != BukkitImplementation.PAPER) { +// Bukkit.getServer().getConsoleSender().sendMessage(implementationMessage); // TODO Decide if good idea. + } + } + + return implementation; + } + + /** + * Check if this implementation is compatible with Spigot APIs + * + * @return If compatible with Spigot APIs + */ + public static boolean isSpigotCompatible() { + return getImplementation() == BukkitImplementation.SPIGOT || getImplementation() == BukkitImplementation.PAPER; + } + + /** + * Check if this implementation is compatible with Paper APIs + * + * @return If compatible with Paper APIs + */ + public static boolean isPaperCompatible() { + return getImplementation() == BukkitImplementation.PAPER; + } +} diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java index e69eabe5f..925fa3893 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayerBlockBag.java @@ -21,7 +21,11 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.extent.inventory.*; +import com.sk89q.worldedit.extent.inventory.BlockBag; +import com.sk89q.worldedit.extent.inventory.BlockBagException; +import com.sk89q.worldedit.extent.inventory.OutOfBlocksException; +import com.sk89q.worldedit.extent.inventory.OutOfSpaceException; +import com.sk89q.worldedit.extent.inventory.SlottableBlockBag; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.world.block.BlockState; import org.bukkit.entity.Player; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 93ee3dab6..129f85859 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -177,6 +177,9 @@ public class WorldEditPlugin extends JavaPlugin //implements TabCompleter // platforms to be worried about... at the current time of writing WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); + // Setup the BukkitImplementationTester. + BukkitImplementationTester.getImplementation(); + { // Register 1.13 Material ids with LegacyMapper LegacyMapper legacyMapper = LegacyMapper.getInstance(); for (Material m : Material.values()) { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java index 366b2a974..e04fba6df 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/BukkitImplAdapter.java @@ -98,7 +98,7 @@ public interface BukkitImplAdapter extends IBukkitAdapter { Entity createEntity(Location location, BaseEntity state); /** - * Get a map of string -> properties + * Get a map of {@code string -> property}. * * @param blockType The block type * @return The properties map diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java index 8e80a57bc..e207e7b8d 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/DinnerPermsResolverTest.java @@ -19,13 +19,15 @@ package com.sk89q.wepif; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import org.bukkit.Server; import org.bukkit.plugin.PluginManager; import org.junit.Before; import org.junit.Test; -import static org.junit.Assert.*; - -import static org.mockito.Mockito.*; public class DinnerPermsResolverTest { private DinnerPermsResolver resolver; diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index a67351cd5..21c83228f 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -28,7 +28,11 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; public class TestOfflinePermissible implements OfflinePlayer, Permissible { private boolean op; diff --git a/worldedit-core/build.gradle b/worldedit-core/build.gradle index 91713b7cd..c140d1989 100644 --- a/worldedit-core/build.gradle +++ b/worldedit-core/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'eclipse' apply plugin: 'idea' - +repositories { + maven {url "http://ci.athion.net/job/PlotSquared/ws/mvn/"} +} dependencies { compile 'de.schlichtherle:truezip:6.8.3' compile 'rhino:js:1.7R2' diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java index 0e4690a1b..11d157824 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/MobSpawnerBlock.java @@ -26,7 +26,6 @@ import com.sk89q.jnbt.ShortTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.HashMap; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java index 8855c3491..028c17014 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SignBlock.java @@ -22,9 +22,8 @@ package com.sk89q.worldedit.blocks; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.util.gson.GsonUtil; +import com.sk89q.worldedit.world.block.BlockState; import java.util.HashMap; import java.util.Map; diff --git a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java index 338ca103f..af33bc8de 100644 --- a/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java +++ b/worldedit-core/src/legacy/java/com/sk89q/worldedit/blocks/SkullBlock.java @@ -23,7 +23,6 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashMap; import java.util.Map; @@ -114,4 +113,4 @@ public class SkullBlock extends BaseBlock { owner = ((StringTag) t).getValue(); } } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java index 6b56a41ba..4829dd13c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java @@ -362,6 +362,8 @@ public class Fawe { MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null); MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null); MainUtil.copyFile(MainUtil.getJarFile(), "fr/message.yml", null); + MainUtil.copyFile(MainUtil.getJarFile(), "cn/message.yml", null); + MainUtil.copyFile(MainUtil.getJarFile(), "it/message.yml", null); // Setting up config.yml File file = new File(this.IMP.getDirectory(), "config.yml"); Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", ""); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java b/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java index 9470e0e35..33d853177 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java @@ -118,7 +118,7 @@ public enum BBC { BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"), BRUSH_NONE("You aren't holding a brush!", "WorldEdit.Brush"), BRUSH_SCROLL_ACTION_SET("Set scroll action to %s0", "WorldEdit.Brush"), - BRUSH_SCROLL_ACTION_UNSET("Removed scrol action", "WorldEdit.Brush"), + BRUSH_SCROLL_ACTION_UNSET("Removed scroll action", "WorldEdit.Brush"), BRUSH_VISUAL_MODE_SET("Set visual mode to %s0", "WorldEdit.Brush"), BRUSH_TARGET_MODE_SET("Set target mode to %s0", "WorldEdit.Brush"), BRUSH_TARGET_MASK_SET("Set target mask to %s0", "WorldEdit.Brush"), diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java index 8ab3a990b..7909785a0 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java @@ -23,7 +23,7 @@ public class Settings extends Config { @Final public String PLATFORM; // These values are set from FAWE before loading - @Comment({"Options: de, es, fr, nl, ru, tr", + @Comment({"Options: cn, de, es, fr, it, nl, ru, tr", "Create a PR to contribute a translation: https://github.com/boy0001/FastAsyncWorldedit/new/master/core/src/main/resources",}) public String LANGUAGE = ""; @Comment({"Enable or disable automatic updates", @@ -325,7 +325,7 @@ public class Settings extends Config { public boolean ANVIL_QUEUE_MODE = false; @Comment({ "[SAFE] Dynamically increase the number of chunks rendered", - " - Requires Paper: ci.destroystokyo.com/job/PaperSpigot/", + " - Requires Paper: ci.destroystokyo.com/job/Paper-1.13/", " - Set your server view distance to 1 (spigot.yml, server.properties)", " - Based on tps and player movement", " - Note: If entities become hidden, increase the server view distance to 3", diff --git a/worldedit-core/src/main/java/com/boydti/fawe/installer/InstallerFrame.java b/worldedit-core/src/main/java/com/boydti/fawe/installer/InstallerFrame.java index 818926a97..ffc1f610e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/installer/InstallerFrame.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/installer/InstallerFrame.java @@ -160,7 +160,7 @@ public class InstallerFrame extends JFrame { } catch (Throwable ignore) { ignore.printStackTrace(); } - URL chat = new URL("http://webchat.esper.net/?nick=&channels=IntellectualCrafters&fg_color=000&fg_sec_color=000&bg_color=FFF"); + URL chat = new URL("https://discord.gg/ngZCzbU"); URLButton chatButton = new URLButton(chat, "Chat"); bottomBar.add(chatButton); URL wiki = new URL("https://github.com/boy0001/FastAsyncWorldedit/wiki"); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java b/worldedit-core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java index a5ee6d7de..ee1f57cbe 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/schematic/Schematic.java @@ -276,6 +276,10 @@ public class Schematic { final int entityOffsetZ = to.getBlockZ() - origin.getBlockZ(); // entities for (Entity entity : clipboard.getEntities()) { + // skip players on pasting schematic + if (entity.getState() != null && entity.getState().getType().getId().equals("minecraft:player")) { + continue; + } Location pos = entity.getLocation(); Location newPos = new Location(pos.getExtent(), pos.getX() + entityOffsetX, pos.getY() + entityOffsetY, pos.getZ() + entityOffsetZ, pos.getYaw(), pos.getPitch()); extent.createEntity(newPos, entity.getState()); diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java index 6faf8f326..da642d4db 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTag.java @@ -1,6 +1,24 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + package com.sk89q.jnbt; -import com.sk89q.worldedit.function.entity.ExtentEntityCopy; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -12,6 +30,7 @@ import java.util.Map; public final class CompoundTag extends Tag { private final Map value; + /** * Creates the tag with an empty name. * @@ -425,5 +444,4 @@ public final class CompoundTag extends Tag { return bldr.toString(); } - } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java index fad4adc44..1799993bb 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/CompoundTagBuilder.java @@ -19,11 +19,11 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.HashMap; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create compound tags. */ @@ -145,14 +145,14 @@ public class CompoundTagBuilder { return put(key, new LongArrayTag(value)); } - /** - * Put the given key and value into the compound tag as a - * {@code LongTag}. - * - * @param key they key - * @param value the value - * @return this object - */ + /** + * Put the given key and value into the compound tag as a + * {@code LongTag}. + * + * @param key they key + * @param value the value + * @return this object + */ public CompoundTagBuilder putLong(String key, long value) { return put(key, new LongTag(value)); } @@ -213,5 +213,4 @@ public class CompoundTagBuilder { return new CompoundTagBuilder(); } - } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java index c708b21fa..e9f92b99a 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTag.java @@ -1,12 +1,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * The {@code TAG_List} tag. @@ -64,7 +65,7 @@ public final class ListTag extends Tag { /** * Get the tag if it exists at the given index. - * + * * @param index the index * @return the tag or null */ @@ -419,6 +420,4 @@ public final class ListTag extends Tag { return bldr.toString(); } - - } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java index cd1f11e25..c410ec3ae 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/ListTagBuilder.java @@ -19,13 +19,13 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Helps create list tags. */ diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/LongArrayTag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/LongArrayTag.java index 7d2022fb1..30dad0cc3 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/LongArrayTag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/LongArrayTag.java @@ -16,13 +16,18 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ + package com.sk89q.jnbt; + import static com.google.common.base.Preconditions.checkNotNull; + /** * The {@code TAG_Long_Array} tag. */ public class LongArrayTag extends Tag { + private final long[] value; + /** * Creates the tag with an empty name. * @@ -33,10 +38,12 @@ public class LongArrayTag extends Tag { checkNotNull(value); this.value = value; } + @Override public long[] getValue() { return value; } + @Override public String toString() { StringBuilder hex = new StringBuilder(); @@ -49,4 +56,5 @@ public class LongArrayTag extends Tag { } return "TAG_Long_Array(" + hex + ")"; } -} \ No newline at end of file + +} diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java index 86ffde60c..414af43fd 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTInputStream.java @@ -37,7 +37,7 @@ import java.util.function.Function; * This class reads NBT, or Named Binary Tag * streams, and produces an object graph of subclasses of the {@code Tag} * object. - *

+ * *

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

@@ -49,7 +49,7 @@ public final class NBTInputStream implements Closeable { /** * Creates a new {@code NBTInputStream}, which will source its data * from the specified input stream. - * + * * @param is the input stream * @throws IOException if an I/O error occurs */ @@ -67,7 +67,7 @@ public final class NBTInputStream implements Closeable { /** * Reads an NBT tag from the stream. - * + * * @return The tag that was read. * @throws IOException if an I/O error occurs. */ @@ -87,7 +87,7 @@ public final class NBTInputStream implements Closeable { /** * 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. @@ -519,8 +519,8 @@ public final class NBTInputStream implements Closeable { /** * Reads the payload of a tag given the type. - * - * @param type the type + * + * @param type the type * @param depth the depth * @return the tag * @throws IOException if an I/O error occurs. @@ -617,5 +617,4 @@ public final class NBTInputStream implements Closeable { } } - } diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java index a9bf7e2b4..d1e860e6d 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTOutputStream.java @@ -19,6 +19,8 @@ package com.sk89q.jnbt; +import static com.google.common.base.Preconditions.checkNotNull; + import com.boydti.fawe.object.io.LittleEndianOutputStream; import java.io.Closeable; import java.io.DataOutput; @@ -29,13 +31,10 @@ import java.io.OutputStream; import java.util.List; import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; - /** * This class writes NBT, or Named Binary Tag * {@code Tag} objects to an underlying {@code OutputStream}. - *

+ * *

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

@@ -50,9 +49,11 @@ public final class NBTOutputStream implements Closeable { /** * Creates a new {@code NBTOutputStream}, which will write data to the * specified underlying output stream. - * - * @param os The output stream. - * @throws IOException if an I/O error occurs. + * + * @param os + * The output stream. + * @throws IOException + * if an I/O error occurs. */ public NBTOutputStream(OutputStream os) throws IOException { this.os = new DataOutputStream(os); @@ -74,13 +75,16 @@ public final class NBTOutputStream implements Closeable { /** * Writes a tag. - * - * @param tag The tag to write. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag to write. + * @throws IOException + * if an I/O error occurs. */ public void writeNamedTag(String name, Tag tag) throws IOException { checkNotNull(name); checkNotNull(tag); + int type = NBTUtils.getTypeCode(tag.getClass()); writeNamedTagName(name, type); if (type == NBTConstants.TYPE_END) { @@ -197,62 +201,66 @@ public final class NBTOutputStream implements Closeable { /** * Writes tag payload. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ public 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; - case NBTConstants.TYPE_INT_ARRAY: - writeIntArrayTagPayload((IntArrayTag) tag); - break; - case NBTConstants.TYPE_LONG_ARRAY: - writeLongArrayTagPayload((LongArrayTag) tag); - break; - default: - throw new IOException("Invalid tag type: " + 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; + case NBTConstants.TYPE_INT_ARRAY: + writeIntArrayTagPayload((IntArrayTag) tag); + break; + case NBTConstants.TYPE_LONG_ARRAY: + writeLongArrayTagPayload((LongArrayTag) tag); + break; + default: + throw new IOException("Invalid tag type: " + type + "."); } } /** * Writes a {@code TAG_Byte} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeByteTagPayload(ByteTag tag) throws IOException { os.writeByte(tag.getValue()); @@ -260,9 +268,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Byte_Array} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeByteArrayTagPayload(ByteArrayTag tag) throws IOException { byte[] bytes = tag.getValue(); @@ -272,9 +282,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Compound} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeCompoundTagPayload(CompoundTag tag) throws IOException { for (Map.Entry entry : tag.getValue().entrySet()) { @@ -285,9 +297,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_List} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeListTagPayload(ListTag tag) throws IOException { Class clazz = tag.getType(); @@ -310,9 +324,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_String} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @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); @@ -322,9 +338,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Double} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeDoubleTagPayload(DoubleTag tag) throws IOException { os.writeDouble(tag.getValue()); @@ -332,9 +350,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Float} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeFloatTagPayload(FloatTag tag) throws IOException { os.writeFloat(tag.getValue()); @@ -342,9 +362,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Long} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeLongTagPayload(LongTag tag) throws IOException { os.writeLong(tag.getValue()); @@ -352,9 +374,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Int} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeIntTagPayload(IntTag tag) throws IOException { os.writeInt(tag.getValue()); @@ -362,9 +386,11 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Short} tag. - * - * @param tag The tag. - * @throws IOException if an I/O error occurs. + * + * @param tag + * The tag. + * @throws IOException + * if an I/O error occurs. */ private void writeShortTagPayload(ShortTag tag) throws IOException { os.writeShort(tag.getValue()); @@ -372,19 +398,19 @@ public final class NBTOutputStream implements Closeable { /** * Writes a {@code TAG_Empty} tag. - * + * * @param tag the tag */ private void writeEndTagPayload(EndTag tag) { /* empty */ } - + private void writeIntArrayTagPayload(IntArrayTag tag) throws IOException { int[] data = tag.getValue(); os.writeInt(data.length); for (int aData : data) { os.writeInt(aData); - } + } } private void writeLongArrayTagPayload(LongArrayTag tag) throws IOException { diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java index 24581fe10..d0fdaae58 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/NBTUtils.java @@ -26,8 +26,6 @@ import com.sk89q.worldedit.world.storage.InvalidFormatException; import java.util.Map; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A class which contains NBT-related utility methods. * diff --git a/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java b/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java index f6eaa35ea..6ff25faa7 100644 --- a/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java +++ b/worldedit-core/src/main/java/com/sk89q/jnbt/Tag.java @@ -26,7 +26,7 @@ public abstract class Tag { /** * Gets the value of this tag. - * + * * @return the value */ public abstract Object getValue(); @@ -34,8 +34,4 @@ public abstract class Tag { public Object getRaw() { return getValue(); } - - - - } \ No newline at end of file diff --git a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java index 1dcbdde1e..4345793d1 100644 --- a/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java +++ b/worldedit-core/src/main/java/com/sk89q/minecraft/util/commands/CommandException.java @@ -19,12 +19,13 @@ package com.sk89q.minecraft.util.commands; -import javax.annotation.Nullable; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.ArrayList; import java.util.List; import java.util.ListIterator; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; public class CommandException extends Exception { diff --git a/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java b/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java index 30643ca06..bec4e79ed 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/util/ReflectionUtil.java @@ -28,7 +28,8 @@ import java.util.*; public final class ReflectionUtil { - private ReflectionUtil() {} + private ReflectionUtil() { + } @SuppressWarnings("unchecked") public static T getField(Object from, String name) { @@ -50,4 +51,5 @@ public final class ReflectionUtil { } while (checkClass.getSuperclass() != Object.class && ((checkClass = checkClass.getSuperclass()) != null)); return null; } + } diff --git a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java index f7b54c369..2571f71f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/util/StringUtil.java @@ -34,7 +34,7 @@ public final class StringUtil { /** * Trim a string if it is longer than a certain length. - * + * * @param str the stirng * @param len the length to trim to * @return a new string @@ -49,7 +49,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -68,7 +68,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -76,7 +76,7 @@ public final class StringUtil { * @return a new string */ public static String joinQuotedString(String[] str, String delimiter, - int initialIndex, String quote) { + int initialIndex, String quote) { if (str.length == 0) { return ""; } @@ -92,7 +92,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str the string array * @param delimiter the delimiter * @return a new string @@ -103,7 +103,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str an array of objects * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -122,7 +122,7 @@ public final class StringUtil { /** * Join an array of strings into a string. - * + * * @param str a list of integers * @param delimiter the delimiter * @param initialIndex the initial index to start form @@ -219,7 +219,7 @@ public final class StringUtil { * calculated). (Note that the arrays aren't really copied anymore, just * switched...this is clearly much better than cloning an array or doing * a System.arraycopy() each time through the outer loop.) - * + * * Effectively, the difference between the two implementations is this * one does not cause an out of memory condition when calculating the LD * over two very large strings. @@ -323,4 +323,4 @@ public final class StringUtil { return parsableBlocks; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java index 0a98bd7aa..158b72074 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLNode.java @@ -23,12 +23,13 @@ import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.Vector2; import com.sk89q.worldedit.math.Vector3; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a configuration node. */ diff --git a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java index 1296733a6..48eb06e69 100644 --- a/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java +++ b/worldedit-core/src/main/java/com/sk89q/util/yaml/YAMLProcessor.java @@ -27,7 +27,13 @@ import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.reader.UnicodeReader; import org.yaml.snakeyaml.representer.Representer; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.HashMap; @@ -294,4 +300,5 @@ public class YAMLProcessor extends YAMLNode { this.nullRepresenter = o -> representScalar(Tag.NULL, ""); } } -} \ No newline at end of file + +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 0b7d1d7b9..30e2004f3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -829,7 +829,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Return fast mode status. - *

+ * *

Fast mode may skip lighting checks or adjacent block * notification.

* @@ -1020,8 +1020,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Set a block, bypassing both history and block re-ordering. * * @param position the position to set the block at - * @param block the block - * @param stage the level + * @param block the block + * @param stage the level * @return whether the block changed * @throws WorldEditException thrown on a set error */ @@ -1648,7 +1648,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Sets all the blocks inside a region to a given pattern. * - * @param region the region + * @param region the region * @param pattern the pattern that provides the replacement block * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1702,8 +1702,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Replaces all the blocks matching a given mask, within a given region, to a block * returned by a given pattern. * - * @param region the region to replace the blocks within - * @param mask the mask that blocks must match + * @param region the region to replace the blocks within + * @param mask the mask that blocks must match * @param pattern the pattern that provides the new blocks * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1725,7 +1725,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * If the center sits between two blocks on a certain axis, then two blocks * will be placed to mark the center. * - * @param region the region to find the center of + * @param region the region to find the center of * @param pattern the replacement pattern * @return the number of blocks placed * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1752,7 +1752,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Make the faces of the given region as if it was a {@link CuboidRegion}. * * @param region the region - * @param block the block to place + * @param block the block to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -1764,7 +1764,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Make the faces of the given region as if it was a {@link CuboidRegion}. * - * @param region the region + * @param region the region * @param pattern the pattern to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1784,7 +1784,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * may be inefficient, because there may not be an efficient implementation supported * for that specific shape. * - * @param region the region + * @param region the region * @param pattern the pattern to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1801,12 +1801,13 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } } + /** * Make the walls (all faces but those parallel to the X-Z plane) of the given region * as if it was a {@link CuboidRegion}. * * @param region the region - * @param block the block to place + * @param block the block to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -1819,7 +1820,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Make the walls (all faces but those parallel to the X-Z plane) of the given region * as if it was a {@link CuboidRegion}. * - * @param region the region + * @param region the region * @param pattern the pattern to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1839,7 +1840,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * may be inefficient, because there may not be an efficient implementation supported * for that specific shape. * - * @param region the region + * @param region the region * @param pattern the pattern to place * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1869,7 +1870,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * (as if it were a cuboid). * * @param region the region - * @param block the placed block + * @param block the placed block * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -1882,7 +1883,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Places a layer of blocks on top of ground blocks in the given region * (as if it were a cuboid). * - * @param region the region + * @param region the region * @param pattern the placed block pattern * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1931,9 +1932,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Stack a cuboid region. * - * @param region the region to stack - * @param dir the direction to stack - * @param count the number of times to stack + * @param region the region to stack + * @param dir the direction to stack + * @param count the number of times to stack * @param copyAir true to also copy air blocks * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -1973,10 +1974,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Move the blocks in a region a certain direction. * - * @param region the region to move - * @param dir the direction - * @param distance the distance to move - * @param copyAir true to copy air blocks + * @param region the region to move + * @param dir the direction + * @param distance the distance to move + * @param copyAir true to copy air blocks * @param replacement the replacement block to fill in after moving, or null to use air * @return number of blocks moved * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -2030,10 +2031,10 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Move the blocks in a region a certain direction. * - * @param region the region to move - * @param dir the direction - * @param distance the distance to move - * @param copyAir true to copy air blocks + * @param region the region to move + * @param dir the direction + * @param distance the distance to move + * @param copyAir true to copy air blocks * @param replacement the replacement block to fill in after moving, or null to use air * @return number of blocks moved * @throws MaxChangedBlocksException thrown if too many blocks are changed @@ -2099,8 +2100,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Fix liquids so that they turn into stationary blocks and extend outward. * - * @param origin the original position - * @param radius the radius to fix + * @param origin the original position + * @param radius the radius to fix * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2131,8 +2132,8 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Makes a cylinder. * - * @param pos Center of the cylinder - * @param block The block pattern to use + * @param pos Center of the cylinder + * @param block The block pattern to use * @param radius The cylinder's radius * @param height The cylinder's up/down extent. If negative, extend downward. * @param filled If false, only a shell will be generated. @@ -2146,12 +2147,12 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Makes a cylinder. * - * @param pos Center of the cylinder - * @param block The block pattern to use + * @param pos Center of the cylinder + * @param block The block pattern to use * @param radiusX The cylinder's largest north/south extent * @param radiusZ The cylinder's largest east/west extent - * @param height The cylinder's up/down extent. If negative, extend downward. - * @param filled If false, only a shell will be generated. + * @param height The cylinder's up/down extent. If negative, extend downward. + * @param filled If false, only a shell will be generated. * @return number of blocks changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2360,28 +2361,28 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, } /** - * Makes a sphere. - * - * @param pos Center of the sphere or ellipsoid - * @param block The block pattern to use - * @param radius The sphere's radius - * @param filled If false, only a shell will be generated. - * @return number of blocks changed - * @throws MaxChangedBlocksException thrown if too many blocks are changed - */ + * Makes a sphere. + * + * @param pos Center of the sphere or ellipsoid + * @param block The block pattern to use + * @param radius The sphere's radius + * @param filled If false, only a shell will be generated. + * @return number of blocks changed + * @throws MaxChangedBlocksException thrown if too many blocks are changed + */ public int makeSphere(final BlockVector3 pos, final Pattern block, final double radius, final boolean filled) { - return this.makeSphere(pos, block, radius, radius, radius, filled); + return makeSphere(pos, block, radius, radius, radius, filled); } /** * Makes a sphere or ellipsoid. * - * @param pos Center of the sphere or ellipsoid - * @param block The block pattern to use + * @param pos Center of the sphere or ellipsoid + * @param block The block pattern to use * @param radiusX The sphere/ellipsoid's largest north/south extent * @param radiusY The sphere/ellipsoid's largest up/down extent * @param radiusZ The sphere/ellipsoid's largest east/west extent - * @param filled If false, only a shell will be generated. + * @param filled If false, only a shell will be generated. * @return number of blocks changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2458,9 +2459,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Makes a pyramid. * * @param position a position - * @param block a block - * @param size size of pyramid - * @param filled true if filled + * @param block a block + * @param size size of pyramid + * @param filled true if filled * @return number of blocks changed * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2488,7 +2489,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Thaw blocks in a radius. * * @param position the position - * @param radius the radius + * @param radius the radius * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2559,7 +2560,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Make snow in a radius. * * @param position a position - * @param radius a radius + * @param radius a radius * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2651,7 +2652,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Make dirt green. * * @param position a position - * @param radius a radius + * @param radius a radius * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -2735,7 +2736,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Makes pumpkin patches randomly in an area around the given position. * * @param position the base position - * @param apothem the apothem of the (square) area + * @param apothem the apothem of the (square) area * @return number of patches created * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -3047,9 +3048,9 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Hollows out the region (Semi-well-defined for non-cuboid selections). * - * @param region the region to hollow out. + * @param region the region to hollow out. * @param thickness the thickness of the shell to leave (manhattan distance) - * @param pattern The block pattern to use + * @param pattern The block pattern to use * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -3127,10 +3128,11 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, * Draws a line (out of blocks) between two vectors. * * @param pattern The block pattern used to draw the line. - * @param pos1 One of the points that define the line. - * @param pos2 The other point that defines the line. - * @param radius The radius (thickness) of the line. - * @param filled If false, only a shell will be generated. + * @param pos1 One of the points that define the line. + * @param pos2 The other point that defines the line. + * @param radius The radius (thickness) of the line. + * @param filled If false, only a shell will be generated. + * * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -3196,14 +3198,15 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, /** * Draws a spline (out of blocks) between specified vectors. * - * @param pattern The block pattern used to draw the spline. + * @param pattern The block pattern used to draw the spline. * @param nodevectors The list of vectors to draw through. - * @param tension The tension of every node. - * @param bias The bias of every node. - * @param continuity The continuity of every node. - * @param quality The quality of the spline. Must be greater than 0. - * @param radius The radius (thickness) of the spline. - * @param filled If false, only a shell will be generated. + * @param tension The tension of every node. + * @param bias The bias of every node. + * @param continuity The continuity of every node. + * @param quality The quality of the spline. Must be greater than 0. + * @param radius The radius (thickness) of the spline. + * @param filled If false, only a shell will be generated. + * * @return number of blocks affected * @throws MaxChangedBlocksException thrown if too many blocks are changed */ @@ -3335,7 +3338,7 @@ public class EditSession extends AbstractDelegateExtent implements HasFaweQueue, for (BlockVector3 recurseDirection : recurseDirections) { queue.addLast(current.add(recurseDirection)); } - } + } // while } public int makeBiomeShape(final Region region, final Vector3 zero, final Vector3 unit, final BaseBiome biomeType, final String expressionString, final boolean hollow) throws ExpressionException, MaxChangedBlocksException { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java index 8af5071c6..094da742e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionFactory.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.world.World; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Creates new {@link EditSession}s. To get an instance of this factory, * use {@link WorldEdit#getEditSessionFactory()}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java index 17b130f71..09459c761 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit; +import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.util.logging.LogFormat; import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.snapshot.SnapshotRepository; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index b80c5a261..a08290448 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -146,7 +146,7 @@ public class LocalSession implements TextureHolder { /** * Construct the object. - *

+ * *

{@link #setConfiguration(LocalConfiguration)} should be called * later with configuration.

*/ @@ -500,7 +500,7 @@ public class LocalSession implements TextureHolder { * Performs an undo. * * @param newBlockBag a new block bag - * @param player the player + * @param player the player * @return whether anything was undone */ public EditSession undo(@Nullable BlockBag newBlockBag, Player player) { @@ -536,7 +536,7 @@ public class LocalSession implements TextureHolder { * Performs a redo * * @param newBlockBag a new block bag - * @param player the player + * @param player the player * @return whether anything was redone */ public EditSession redo(@Nullable BlockBag newBlockBag, Player player) { @@ -625,7 +625,7 @@ public class LocalSession implements TextureHolder { /** * Set the region selector. * - * @param world the world + * @param world the world * @param selector the selector */ public void setRegionSelector(World world, RegionSelector selector) { @@ -782,7 +782,7 @@ public class LocalSession implements TextureHolder { /** * Sets the clipboard. - *

+ * *

Pass {@code null} to clear the clipboard.

* * @param clipboard the clipboard, or null if the clipboard is to be cleared @@ -974,7 +974,7 @@ public class LocalSession implements TextureHolder { * or the tool is not assigned, the slot will be replaced with the * brush tool. * - * @param item the item type ID + * @param item the item type * @return the tool, or {@code null} * @throws InvalidToolBindException if the item can't be bound to that item */ @@ -1015,7 +1015,7 @@ public class LocalSession implements TextureHolder { /** * Set the tool. * - * @param item the item type ID + * @param item the item type * @param tool the tool to set, which can be {@code null} * @throws InvalidToolBindException if the item can't be bound to that item */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/PlayerDirection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/PlayerDirection.java index 0c3aa122c..39a7c0409 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/PlayerDirection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/PlayerDirection.java @@ -56,4 +56,4 @@ public enum PlayerDirection { return isOrthogonal; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index f7544189b..9ef42ea0e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit; +import static com.sk89q.worldedit.event.platform.Interaction.HIT; +import static com.sk89q.worldedit.event.platform.Interaction.OPEN; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.sk89q.worldedit.blocks.BaseItem; @@ -58,7 +61,6 @@ import com.sk89q.worldedit.world.registry.BundledBlockData; import com.sk89q.worldedit.world.registry.BundledItemData; import com.sk89q.worldedit.world.registry.LegacyMapper; -import javax.script.ScriptException; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; @@ -71,8 +73,7 @@ import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; -import static com.sk89q.worldedit.event.platform.Interaction.HIT; -import static com.sk89q.worldedit.event.platform.Interaction.OPEN; +import javax.script.ScriptException; /** * The entry point and container for a working implementation of WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java index 23562fdf0..dd3ba1fc2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/blocks/ClothColor.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.blocks; -import javax.annotation.Nullable; -import java.util.Map; -import java.util.HashMap; import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +import javax.annotation.Nullable; /** * The colors for wool. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 2404f780c..32dfacfcf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -401,6 +401,7 @@ public class UtilityCommands extends MethodCommands { @Logging(PLACEMENT) public void removeNear(Player player, LocalSession session, EditSession editSession, Mask mask, @Optional("50") double size) throws WorldEditException { worldEdit.checkMaxRadius(size); + size = Math.max(1, size); int affected = editSession.removeNear(session.getPlacementPosition(player), mask, (int) size); player.print(BBC.getPrefix() + affected + " block(s) have been removed."); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java index 878fc013c..880c17fb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ItemParser.java @@ -24,13 +24,13 @@ import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; -import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.command.argument.CommandArgs; +import com.sk89q.worldedit.util.command.composition.SimpleCommand; import com.sk89q.worldedit.world.World; public class ItemParser extends SimpleCommand { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java index 10577b874..4d98103c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/ReplaceParser.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.argument; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extent.NullExtent; @@ -26,13 +28,9 @@ import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.EditContext; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.block.BlockReplace; -import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import com.sk89q.worldedit.world.block.BlockStateHolder; - -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; public class ReplaceParser extends SimpleCommand> { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java index 50c0710ea..a73748e4c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ApplyCommand.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.command.composition; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.command.argument.RegionFunctionParser; @@ -30,8 +32,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ApplyCommand extends SimpleCommand> { private final CommandExecutor> functionParser; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index efe6c3aab..35a8734b6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -20,6 +20,9 @@ package com.sk89q.worldedit.command.composition; import com.boydti.fawe.config.BBC; + +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.minecraft.util.commands.CommandPermissionsException; @@ -41,8 +44,6 @@ import com.sk89q.worldedit.util.command.argument.CommandArgs; import com.sk89q.worldedit.util.command.composition.CommandExecutor; import com.sk89q.worldedit.util.command.composition.SimpleCommand; -import static com.google.common.base.Preconditions.checkNotNull; - public class ShapedBrushCommand extends SimpleCommand { private final CommandExecutor> delegate; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java index 4f0160070..5fa95d04b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java @@ -19,7 +19,8 @@ package com.sk89q.worldedit.command.tool; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index be89294d7..59e21bfde 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -23,12 +23,12 @@ import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.blocks.MobSpawnerBlock; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Looks up information about a block. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java index 12a663ed3..cfebeaf17 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/CylinderBrush.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.function.pattern.BlockPattern; -import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; +import com.sk89q.worldedit.function.pattern.BlockPattern; +import com.sk89q.worldedit.function.pattern.Pattern; public class CylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java index be47971b7..bc2270fb5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowCylinderBrush.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class HollowCylinderBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java index 42a300048..09dc6844e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/HollowSphereBrush.java @@ -21,9 +21,9 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class HollowSphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java index a187f9df9..843fd105d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SmoothBrush.java @@ -20,13 +20,12 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; +import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.convolution.GaussianKernel; +import com.sk89q.worldedit.math.convolution.HeightMap; import com.sk89q.worldedit.math.convolution.HeightMapFilter; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java index 828e6a032..3b9f9f428 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/brush/SphereBrush.java @@ -21,10 +21,10 @@ package com.sk89q.worldedit.command.tool.brush; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.blocks.BaseBlock; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockTypes; public class SphereBrush implements Brush { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java index 862b79505..529f06f81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/EntityRemover.java @@ -21,14 +21,11 @@ package com.sk89q.worldedit.command.util; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.util.SetQueue; import com.boydti.fawe.util.TaskManager; -import com.google.common.base.Supplier; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.worldedit.entity.metadata.EntityProperties; import com.sk89q.worldedit.function.EntityFunction; -import java.util.concurrent.Callable; import java.util.regex.Pattern; import javax.annotation.Nullable; @@ -151,6 +148,7 @@ public class EntityRemover { return true; } } + return false; }; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java index fe897baca..456acaa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/BaseEntity.java @@ -19,16 +19,14 @@ package com.sk89q.worldedit.entity; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.world.NbtValued; import com.sk89q.worldedit.world.entity.EntityType; import javax.annotation.Nullable; -import java.util.HashMap; - -import static com.google.common.base.Preconditions.checkNotNull; - /** * Represents a mutable "snapshot" of an entity. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java index 2fdb4e443..7549518ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/BlockInteractEvent.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Called when a block is interacted with. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java index 8fa39c0ff..75483745e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/CommandSuggestionEvent.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.event.Event; import com.sk89q.worldedit.extension.platform.Actor; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Posted when suggestions for auto-completion are requested for command input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java index 73d23131c..1bfc11724 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/ConfigurationLoadEvent.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised when the configuration has been loaded or re-loaded. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java index 2bc39ee97..67ef25268 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/event/platform/PlayerInputEvent.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.event.platform; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.Cancellable; import com.sk89q.worldedit.event.Event; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Raised whenever a player sends input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java index 53d131de7..141124855 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/BlockFactory.java @@ -21,14 +21,10 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.internal.registry.AbstractFactory; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.Set; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java index 9d826fb25..01fef9803 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java @@ -39,6 +39,7 @@ public final class MaskFactory extends AbstractFactory { */ public MaskFactory(WorldEdit worldEdit) { super(worldEdit); + parsers.add(new DefaultMaskParser(worldEdit)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java index 08d453f66..dde70291e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/PatternFactory.java @@ -39,6 +39,7 @@ public final class PatternFactory extends AbstractFactory { */ public PatternFactory(WorldEdit worldEdit) { super(worldEdit); + parsers.add(new HashTagPatternParser(worldEdit)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java index cf3383c3a..2cc9eae94 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/RandomPatternParser.java @@ -21,14 +21,13 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; import com.sk89q.worldedit.internal.registry.InputParser; +import com.sk89q.worldedit.world.block.BlockStateHolder; class RandomPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java index 17833cf97..cd3adb5e7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/SingleBlockPatternParser.java @@ -20,11 +20,11 @@ package com.sk89q.worldedit.extension.factory; import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.registry.InputParser; -import com.sk89q.worldedit.extension.input.InputParseException; class SingleBlockPatternParser extends InputParser { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index 019a28be3..43f665423 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -19,7 +19,6 @@ package com.sk89q.worldedit.extension.platform; -import com.sk89q.worldedit.entity.metadata.Metadatable; import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.util.Identifiable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java index 517c98e93..3b37a98b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Platform.java @@ -25,10 +25,11 @@ import com.sk89q.worldedit.util.command.Dispatcher; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.registry.Registries; -import javax.annotation.Nullable; import java.util.List; import java.util.Map; +import javax.annotation.Nullable; + /** * Represents a platform that WorldEdit has been implemented for. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java index 5ecd2cca0..002ed755b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/OutputExtent.java @@ -20,12 +20,11 @@ package com.sk89q.worldedit.extent; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BlockStateHolder; import javax.annotation.Nullable; @@ -36,8 +35,8 @@ public interface OutputExtent { /** * Change the block at the given location to the given block. The operation may - * not tie the given {@link BlockState} to the world, so future changes to the - * {@link BlockState} do not affect the world until this method is called again. + * not tie the given {@link BlockStateHolder} to the world, so future changes to the + * {@link BlockStateHolder} do not affect the world until this method is called again. * *

The return value of this method indicates whether the change was probably * successful. It may not be successful if, for example, the location is out diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java index 5538f822d..ebb5afea5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/buffer/ForgetfulExtentBuffer.java @@ -22,9 +22,6 @@ package com.sk89q.worldedit.extent.buffer; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -35,6 +32,8 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.AbstractRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Iterator; import java.util.LinkedHashMap; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java index b13a76c4d..4fdb6e430 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/cache/LastAccessExtentCache.java @@ -64,4 +64,4 @@ public class LastAccessExtentCache extends AbstractDelegateExtent { } } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java index 4311ada18..4b56e5e06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/StoredEntity.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.extent.clipboard; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An implementation of {@link Entity} that stores a {@link BaseEntity} with it. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java index c248a3ad8..016984032 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardReader.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.world.registry.Registries; import java.io.Closeable; import java.io.IOException; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java index d3f7840c0..424dffcc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/NBTSchematicReader.java @@ -60,4 +60,4 @@ public abstract class NBTSchematicReader implements ClipboardReader { return expected.cast(test); } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java index cf2e33f1f..16a60c80d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/NBTCompatibilityHandler.java @@ -20,8 +20,6 @@ package com.sk89q.worldedit.extent.clipboard.io.legacycompat; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.Map; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java index 4851d5bee..ae2d5f055 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/SignCompatibilityHandler.java @@ -26,8 +26,6 @@ import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java index c5c11d51c..9639be219 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java @@ -35,8 +35,8 @@ import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.LocatedBlock; import com.sk89q.worldedit.util.collection.TupleArrayList; import com.sk89q.worldedit.world.block.BlockCategories; -import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockState; +import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Deque; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java index 795d1bbd1..0af3434cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/BlockChangeLimiter.java @@ -19,15 +19,13 @@ package com.sk89q.worldedit.extent.validation; +import static com.google.common.base.Preconditions.checkArgument; + import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; - -import static com.google.common.base.Preconditions.checkArgument; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockStateHolder; /** @@ -43,7 +41,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { * Create a new instance. * * @param extent the extent - * @param limit the limit (>= 0) or -1 for no limit + * @param limit the limit (>= 0) or -1 for no limit */ public BlockChangeLimiter(Extent extent, int limit) { super(extent); @@ -53,7 +51,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { /** * Get the limit. * - * @return the limit (>= 0) or -1 for no limit + * @return the limit (>= 0) or -1 for no limit */ public int getLimit() { return limit; @@ -62,7 +60,7 @@ public class BlockChangeLimiter extends AbstractDelegateExtent { /** * Set the limit. * - * @param limit the limit (>= 0) or -1 for no limit + * @param limit the limit (>= 0) or -1 for no limit */ public void setLimit(int limit) { checkArgument(limit >= -1, "limit >= -1 required"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java index f9650e14b..fbab92001 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/validation/DataValidatorExtent.java @@ -21,16 +21,13 @@ package com.sk89q.worldedit.extent.validation; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; /** * Validates set data to prevent creating invalid blocks and such. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java index 6899f8a0c..5640d5d83 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/BlockQuirkExtent.java @@ -21,18 +21,14 @@ package com.sk89q.worldedit.extent.world; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.extent.AbstractDelegateExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.world.World; /** * Handles various quirks when setting blocks, such as ice turning diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index e3099214b..897473fa8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -21,15 +21,12 @@ package com.sk89q.worldedit.extent.world; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; - -import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Automatically loads chunks when blocks are accessed. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java index d374017fa..23a0a6f79 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/FastModeExtent.java @@ -21,22 +21,19 @@ package com.sk89q.worldedit.extent.world; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.RunContext; -import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; +import com.sk89q.worldedit.world.block.BlockStateHolder; import java.util.HashSet; import java.util.List; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Implements "fast mode" which may skip physics, lighting, etc. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java index d9ee8c917..07c1515ba 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/EditContext.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - public class EditContext { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java index 831ecc8b2..acafd1f61 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/FlatRegionMaskingFilter.java @@ -21,11 +21,9 @@ package com.sk89q.worldedit.function; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask2D; -import com.sk89q.worldedit.math.BlockVector2; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Passes calls to {@link #apply(BlockVector2)} to the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java index debdf1298..630952678 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/GroundFunction.java @@ -21,12 +21,9 @@ package com.sk89q.worldedit.function; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.math.BlockVector3; - - -import static com.google.common.base.Preconditions.checkNotNull; /** * Applies a {@link RegionFunction} to the first ground block. @@ -40,7 +37,7 @@ public class GroundFunction implements LayerFunction { /** * Create a new ground function. * - * @param mask a mask + * @param mask a mask * @param function the function to apply */ public GroundFunction(Mask mask, RegionFunction function) { @@ -90,6 +87,7 @@ public class GroundFunction implements LayerFunction { affected++; } } + return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java index 09346a1f5..9feb385b5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/RegionMaskingFilter.java @@ -21,11 +21,9 @@ package com.sk89q.worldedit.function; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.mask.Mask; -import com.sk89q.worldedit.math.BlockVector3; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Passes calls to {@link #apply(BlockVector3)} to the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java index 1266c408e..500408700 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/biome/BiomeReplace.java @@ -21,14 +21,12 @@ package com.sk89q.worldedit.function.biome; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.FlatRegionFunction; -import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.world.biome.BaseBiome; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Replaces the biome at the locations that this function is applied to. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java index 7ff183a37..324fe72f1 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Apply.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.EditContext; import com.sk89q.worldedit.function.RegionFunction; @@ -27,9 +30,6 @@ import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Apply implements Contextual { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java index 58919f9fd..ac52933be 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java @@ -19,6 +19,9 @@ package com.sk89q.worldedit.function.factory; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; + import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.Extent; @@ -34,9 +37,6 @@ import com.sk89q.worldedit.regions.Region; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.sk89q.worldedit.util.GuavaUtil.firstNonNull; - public class Deform implements Contextual { private Extent destination; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java index 59762c606..61972bfe0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java @@ -20,14 +20,12 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.RandomPattern; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockTypes; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java index 2fdb7fcb6..7a6e81b8a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/ForestGenerator.java @@ -20,15 +20,13 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockTypes; -import com.sk89q.worldedit.function.RegionFunction; -import com.sk89q.worldedit.util.TreeGenerator; /** * Generates forests by searching for the ground starting from the given upper Y diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java index 4a653d8ea..dc18d3cc8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/GardenPatchGenerator.java @@ -21,14 +21,13 @@ package com.sk89q.worldedit.function.generator; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.pattern.BlockPattern; import com.sk89q.worldedit.function.pattern.Pattern; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Random; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java index 1d6eab112..dbb3f28cc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/AbstractExtentMask.java @@ -58,4 +58,4 @@ public abstract class AbstractExtentMask extends AbstractMask { this.extent = extent; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java index 1c456b088..c590a211a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BiomeMask2D.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.function.mask; import static com.google.common.base.Preconditions.checkNotNull; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.world.biome.BaseBiome; import java.util.Arrays; @@ -30,8 +30,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if the biome at applied points is the same as the one given. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java index 194b36f2b..2f72d5a1d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BoundedHeightMask.java @@ -25,8 +25,6 @@ import com.sk89q.worldedit.math.BlockVector3; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; - /** * Has the criteria where the Y value of passed positions must be within * a certain range of Y values (inclusive). diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java index ac4d24452..4c2b44ce9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExistingBlockMask.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.function.mask; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.extent.Extent; import javax.annotation.Nullable; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java index 7d36b71f4..2c4017559 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask.java @@ -21,16 +21,14 @@ package com.sk89q.worldedit.function.mask; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.shape.WorldEditExpressionEnvironment; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that evaluates an expression. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java index 283835f54..0afefab0c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/ExpressionMask2D.java @@ -21,12 +21,10 @@ package com.sk89q.worldedit.function.mask; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.runtime.EvaluationException; -import com.sk89q.worldedit.math.BlockVector2; - -import static com.google.common.base.Preconditions.checkNotNull; public class ExpressionMask2D extends AbstractMask2D { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java index 61d7c6355..eec35eab9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/MaskIntersection2D.java @@ -28,8 +28,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Tests true if all contained masks test true. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java index 4fb74dc19..ee9b6e44d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter.java @@ -27,9 +27,6 @@ import com.sk89q.worldedit.math.noise.NoiseGenerator; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java index ef4f7f104..a64889f54 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/NoiseFilter2D.java @@ -25,9 +25,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.noise.NoiseGenerator; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that uses a noise generator and returns true whenever the noise * generator returns a value above the given density. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java index 9418f8c89..94b595fdf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/OffsetMask2D.java @@ -23,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector2; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Checks whether another mask tests true for a position that is offset * a given vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java index a622aaf98..28df2c206 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/RegionMask.java @@ -26,8 +26,6 @@ import com.sk89q.worldedit.regions.Region; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A mask that tests whether given positions are contained within a region. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java index 509b103c1..69560ec56 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/DelegateOperation.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEditException; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes a delegete operation, but returns to another operation upon * completing the delegate. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index b2b5e5451..ede2ca6ac 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -54,7 +54,7 @@ import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.regions.Region; import java.util.ArrayList; import java.util.List; - +import java.util.stream.Collectors; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; @@ -355,7 +355,18 @@ public class ForwardExtentCopy implements Operation { blockCopy = new RegionVisitor(region, copy, queue instanceof MappedFaweQueue ? (MappedFaweQueue) queue : null); } - List entities = isCopyingEntities() ? source.getEntities(region) : new ArrayList<>(); + List entities; + if (isCopyingEntities()) { + // filter players since they can't be copied + entities = source.getEntities() + .stream() + .filter(entity -> entity.getState() != null && + entity.getState().getType().getId().equals("minecraft:player")) + .collect(Collectors.toList()); + } else { + entities = new ArrayList<>(); + } + for (int i = 0; i < repetitions; i++) { Operations.completeBlindly(blockCopy); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java index f4b2a95d7..53e79fa3d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/OperationQueue.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.function.operation; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Lists; import com.sk89q.worldedit.WorldEditException; @@ -27,8 +29,6 @@ import java.util.Collection; import java.util.Deque; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Executes multiple queues in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java index 8c83568c0..b53b75619 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/FlatRegionOffset.java @@ -21,11 +21,9 @@ package com.sk89q.worldedit.function.util; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; -import com.sk89q.worldedit.math.BlockVector2; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Offsets the position parameter by adding a given offset vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java index 7d618f712..a9e123fcf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/util/RegionOffset.java @@ -21,11 +21,9 @@ package com.sk89q.worldedit.function.util; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; -import com.sk89q.worldedit.math.BlockVector3; - -import static com.google.common.base.Preconditions.checkNotNull; /** * Offsets the position parameter by adding a given offset vector. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java index c03cb93e6..34ffc9e04 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/BlockChange.java @@ -21,12 +21,10 @@ package com.sk89q.worldedit.history.change; import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.history.UndoContext; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockStateHolder; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java index f9f644fe1..006839291 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/history/change/Change.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.history.change; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.history.UndoContext; +import com.sk89q.worldedit.history.changeset.ChangeSet; /** * Describes a change that can be undone or re-applied. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java index 5564b8245..7f42b3a36 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/annotation/Direction.java @@ -17,7 +17,6 @@ * along with this program. If not, see . */ - package com.sk89q.worldedit.internal.annotation; import com.sk89q.worldedit.math.Vector3; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java index 10ba092a3..c1c24925f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/CommandLoggingHandler.java @@ -19,15 +19,17 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandContext; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.Logging; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.command.parametric.AbstractInvokeListener; import com.sk89q.worldedit.util.command.parametric.InvokeHandler; import com.sk89q.worldedit.util.command.parametric.ParameterData; @@ -38,8 +40,6 @@ import java.lang.reflect.Method; import java.util.logging.Handler; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Logs called commands to a logger. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java index 5e0bbdbb7..a93363295 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/UserCommandCompleter.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.internal.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.extension.platform.Actor; @@ -33,8 +35,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Provides the names of connected users as suggestions. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java index a8e87f5e9..41cb27134 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/Expression.java @@ -40,7 +40,7 @@ import java.util.Map; *

Supported operators:

*

*

    - *
  • Logical: &&, ||, ! (unary)
  • + *
  • Logical: &&, ||, ! (unary)
  • *
  • Bitwise: ~ (unary), >>, <<
  • *
  • Arithmetic: +, -, *, /, % (modulo), ^ (power), - (unary), --, ++ (prefix only)
  • *
  • Comparison: <=, >=, >, <, ==, !=, ~= (near)
  • diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java index d1810bc9f..b50997cc6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/parser/ParserProcessors.java @@ -26,7 +26,11 @@ import com.sk89q.worldedit.internal.expression.runtime.Conditional; import com.sk89q.worldedit.internal.expression.runtime.Operators; import com.sk89q.worldedit.internal.expression.runtime.RValue; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; /** * Helper classfor Parser. Contains processors for statements and operators. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java index 17afffd7d..1a9a57d4a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/ExpressionEnvironment.java @@ -19,9 +19,6 @@ package com.sk89q.worldedit.internal.expression.runtime; -import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.world.block.BlockState; - /** * Represents a way to access blocks in a world. Has to accept non-rounded coordinates. */ @@ -34,5 +31,4 @@ public interface ExpressionEnvironment { int getBlockTypeRel(double x, double y, double z); int getBlockDataRel(double x, double y, double z); - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/SimpleFor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/SimpleFor.java index 6f1282aba..0faf0c3eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/SimpleFor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/SimpleFor.java @@ -100,4 +100,5 @@ public class SimpleFor extends Node { return this; } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/While.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/While.java index d6707e324..5eb3ed5f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/While.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/expression/runtime/While.java @@ -129,4 +129,5 @@ public class While extends Node { return this; } + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java index 4f4f36ea6..506663a81 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java @@ -19,16 +19,16 @@ package com.sk89q.worldedit.internal.registry; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; +import com.sk89q.worldedit.extension.input.ParserContext; import java.util.ArrayList; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * An abstract implementation of a factory for internal usage. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java index 059c95ba4..77c05c2e3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/InputParser.java @@ -20,8 +20,8 @@ package com.sk89q.worldedit.internal.registry; import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.InputParseException; +import com.sk89q.worldedit.extension.input.ParserContext; /** * Input parser interface for {@link AbstractFactory}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java index d4818004e..7b701f5fe 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/LinearInterpolation.java @@ -27,8 +27,6 @@ import com.sk89q.worldedit.math.Vector3; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Simple linear interpolation. Mainly used for testing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java index 8e3c0b24d..29a3ee5ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/ReparametrisingInterpolation.java @@ -30,8 +30,6 @@ import java.util.Map.Entry; import java.util.TreeMap; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Reparametrises another interpolation function by arc length. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java index ca33d9444..e5f2a2586 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/CombinedTransform.java @@ -28,8 +28,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Combines several transforms in order. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java index 71286507b..5d0412259 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/transform/Transforms.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.math.transform; -import com.sk89q.worldedit.util.Location; - import static com.google.common.base.Preconditions.checkNotNull; +import com.sk89q.worldedit.util.Location; + /** * Various utility methods related to {@link Transform}s. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java index a4da1b56a..911e40b8b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java @@ -28,12 +28,11 @@ import com.sk89q.worldedit.math.transform.Identity; import com.sk89q.worldedit.math.transform.Transform; import com.sk89q.worldedit.world.World; -import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Transforms another region according to a provided vector {@code Transform}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java index 786e04a2b..f36d44875 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegion3DIterator.java @@ -21,8 +21,8 @@ package com.sk89q.worldedit.regions.iterator; import static com.google.common.base.Preconditions.checkNotNull; -import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.regions.FlatRegion; import java.util.Iterator; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java index 42bda7d86..7bae580e8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/FlatRegionIterator.java @@ -21,14 +21,11 @@ package com.sk89q.worldedit.regions.iterator; import static com.google.common.base.Preconditions.checkNotNull; -import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import java.util.NoSuchElementException; - -import static com.google.common.base.Preconditions.checkNotNull; public class FlatRegionIterator implements Iterator { @@ -75,7 +72,7 @@ public class FlatRegionIterator implements Iterator { @Override public BlockVector2 next() { if (!hasNext()) { - throw new NoSuchElementException(); + throw new java.util.NoSuchElementException(); } BlockVector2 answer = new BlockVector2(nextX, nextZ); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java index 482d30151..3474231c6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/iterator/RegionIterator.java @@ -22,12 +22,11 @@ package com.sk89q.worldedit.regions.iterator; import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.regions.Region; import java.util.Iterator; -import static com.google.common.base.Preconditions.checkNotNull; - public class RegionIterator implements Iterator { private final Region region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java index dfff27af6..dcf098d3c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Edge.java @@ -23,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.Vector3; -import static com.google.common.base.Preconditions.checkNotNull; - public class Edge { private final Vector3 start; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java index 2d7240e03..5e5f7a770 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/polyhedron/Triangle.java @@ -23,8 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.sk89q.worldedit.math.Vector3; -import static com.google.common.base.Preconditions.checkNotNull; - public class Triangle { private String tag = "Triangle"; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java index 28c22cf96..a24308ab8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; + import javax.annotation.Nullable; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java index a37df4257..f4972db01 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java @@ -27,6 +27,7 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.world.World; + import javax.annotation.Nullable; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java index e18363721..a361b528f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/ArbitraryShape.java @@ -21,11 +21,10 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.world.block.BlockStateHolder; /** * Generates solid and hollow shapes according to materials returned by the @@ -93,4 +92,4 @@ public abstract class ArbitraryShape { return affected; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java index 321c80b32..08994c717 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/shape/RegionShape.java @@ -22,8 +22,6 @@ package com.sk89q.worldedit.regions.shape; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.regions.Region; /** * Generates solid and hollow shapes according to materials returned by the diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java index eee65a8ed..509054bbb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/registry/state/AbstractProperty.java @@ -116,6 +116,11 @@ public class AbstractProperty implements Property { return this.name; } + @Override + public String toString() { + return getClass().getSimpleName() + "{name=" + name + "}"; + } + @Override public int hashCode() { return name.hashCode(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java index c5423aa88..8f946800f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptEngine.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.scripting; import java.util.Map; + import javax.script.ScriptException; public interface CraftScriptEngine { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java index 7f3354bbc..79d51cefb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/RhinoCraftScriptEngine.java @@ -19,8 +19,7 @@ package com.sk89q.worldedit.scripting; -import java.util.Map; -import javax.script.ScriptException; +import com.sk89q.worldedit.WorldEditException; import org.mozilla.javascript.Context; import org.mozilla.javascript.ImporterTopLevel; import org.mozilla.javascript.JavaScriptException; @@ -29,7 +28,9 @@ import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ScriptableObject; import org.mozilla.javascript.WrappedException; -import com.sk89q.worldedit.WorldEditException; +import java.util.Map; + +import javax.script.ScriptException; public class RhinoCraftScriptEngine implements CraftScriptEngine { private int timeLimit; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java index 89cca721e..ee312229c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/java/RhinoScriptEngineFactory.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.scripting.java; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java index 9e37e4da0..70d8d2baf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/request/RequestSelection.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.session.request; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.NullRegion; import com.sk89q.worldedit.regions.Region; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java index 962ae4426..d7b2a9893 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/session/storage/JsonFileSessionStore.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.session.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; @@ -38,8 +40,6 @@ import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Stores sessions as JSON files in a directory. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java index 9f397c127..7e9160eb0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/Enums.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + /** * Helper methods for enums. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java index 927692140..b44850ca7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/FileDialogUtil.java @@ -21,13 +21,14 @@ package com.sk89q.worldedit.util; import com.sk89q.util.StringUtil; -import javax.swing.*; -import javax.swing.filechooser.FileFilter; import java.io.File; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; + public final class FileDialogUtil { private FileDialogUtil() { } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java index 1e6fddbfa..861858aed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/GuavaUtil.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util; -import javax.annotation.Nullable; - import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; + public final class GuavaUtil { private GuavaUtil() {} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java index 899ff229b..3a2fbc4c3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/TreeGenerator.java @@ -25,7 +25,6 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockTypes; import java.util.Collections; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java index d3bf38793..70c233704 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/DoubleArrayList.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.collection; -import java.util.List; import java.util.ArrayList; -import java.util.Map; import java.util.Iterator; +import java.util.List; import java.util.ListIterator; +import java.util.Map; import java.util.NoSuchElementException; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java index 75aea6b29..3182502f6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/collection/FastListIterator.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.util.collection; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * A fast iterator for lists that uses an internal index integer * and caches the size of the list. The size of the list cannot change diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java index 568db508e..a7f1405f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/Dispatcher.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Collection; import java.util.Set; +import javax.annotation.Nullable; + /** * Executes a command based on user input. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java index f121a2fe8..0ffbc4c1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/InvalidUsageException.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.command; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.minecraft.util.commands.CommandException; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Thrown when a command is not used properly. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java index b7b980acf..bca779d4b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/PrimaryAliasComparator.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.util.command; -import javax.annotation.Nullable; import java.util.Comparator; import java.util.regex.Pattern; +import javax.annotation.Nullable; + /** * Compares the primary aliases of two {@link CommandMapping} using * {@link String#compareTo(String)}. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java index ca03998b0..421602563 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/SimpleDispatcher.java @@ -112,7 +112,7 @@ public class SimpleDispatcher implements Dispatcher { @Override public Object call(String arguments, CommandLocals locals, String[] parentCommands) throws CommandException { // We have permission for this command if we have permissions for subcommands - if (!testPermission(locals)) { + if (parentCommands.length != 0 && !testPermission(locals)) { throw new CommandPermissionsException(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java index a26a195d4..3a4d78edf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/binding/PrimitiveBindings.java @@ -28,9 +28,10 @@ import com.sk89q.worldedit.util.command.parametric.BindingHelper; import com.sk89q.worldedit.util.command.parametric.BindingMatch; import com.sk89q.worldedit.util.command.parametric.ParameterException; -import javax.annotation.Nullable; import java.lang.annotation.Annotation; +import javax.annotation.Nullable; + /** * Handles basic Java types such as {@link String}s, {@link Byte}s, etc. * @@ -86,8 +87,8 @@ public final class PrimitiveBindings extends BindingHelper { * @throws ParameterException on error */ @BindingMatch(type = { Boolean.class, boolean.class }, - behavior = BindingBehavior.CONSUMES, - consumedCount = 1) + behavior = BindingBehavior.CONSUMES, + consumedCount = 1) public Boolean getBoolean(ArgumentStack context) throws ParameterException { return context.nextBoolean(); } @@ -117,6 +118,7 @@ public final class PrimitiveBindings extends BindingHelper { throw new ParameterException(String.format( "Expected '%s' to be a number or valid math expression (error: %s)", input, e.getMessage())); } + } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java index 2309adb53..479a62d6f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/composition/FlagParser.java @@ -25,15 +25,16 @@ import com.google.common.collect.Maps; import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.util.command.argument.CommandArgs; -import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; import com.sk89q.worldedit.util.command.argument.MissingArgumentException; +import com.sk89q.worldedit.util.command.composition.FlagParser.FlagData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.annotation.Nullable; + public class FlagParser implements CommandExecutor { private final Map> flags = Maps.newHashMap(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java index 25f7efa7e..a8ad5ab1b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/command/parametric/ParametricCallable.java @@ -201,7 +201,7 @@ public class ParametricCallable extends AParametricCallable { @Override public Object call(String stringArguments, CommandLocals locals, String[] parentCommands) throws CommandException { // Test permission - if (!testPermission(locals)) { + if (parentCommands.length != 0 && !testPermission(locals)) { throw new CommandPermissionsException(); } locals.putIfAbsent(CommandCallable.class, this); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java index 6488af945..aaafb4dc8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/EventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.InvocationTargetException; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.InvocationTargetException; + /** * Event handler object for {@link EventBus} that is able to dispatch * an event. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java index 5644e2aa3..92f1cb56b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/HierarchyCache.java @@ -23,7 +23,11 @@ import com.google.common.collect.Lists; import com.google.common.collect.Sets; import com.sk89q.worldedit.internal.annotation.RequiresNewerGuava; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.WeakHashMap; /** * Holds a cache of class hierarchy. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java index a0575e83f..1d825927e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/MethodEventHandler.java @@ -19,10 +19,10 @@ package com.sk89q.worldedit.util.eventbus; -import java.lang.reflect.Method; - import static com.google.common.base.Preconditions.checkNotNull; +import java.lang.reflect.Method; + /** * Invokes a {@link Method} to dispatch an event. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java index 6616ea65e..88b3222ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/eventbus/Subscribe.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.eventbus; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - /** * Used to mark methods as event handlers. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java index 4720cb41c..f7034093e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Fragment.java @@ -25,7 +25,7 @@ package com.sk89q.worldedit.util.formatting; public class Fragment { private final StringBuilder builder = new StringBuilder(); - + public Fragment() { } @@ -88,6 +88,5 @@ public class Fragment { public String toString() { return builder.toString(); } - - + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java index 856b03514..d6c70eeb8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/Style.java @@ -19,14 +19,14 @@ package com.sk89q.worldedit.util.formatting; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.collect.Maps; import java.util.Map; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - /** * All supported color values for chat. * @@ -221,7 +221,7 @@ public enum Style { * ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced * if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r. * - * @param altColorChar The alternate color code character to replace. Ex: & + * @param altColorChar The alternate color code character to replace. Ex: & * @param textToTranslate Text containing the alternate color code character. * @return Text containing the ChatColor.COLOR_CODE color code character. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java index 723db8123..1020d92cd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/function/LevenshteinDistance.java @@ -19,12 +19,13 @@ package com.sk89q.worldedit.util.function; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; -import javax.annotation.Nullable; import java.util.regex.Pattern; -import static com.google.common.base.Preconditions.checkNotNull; +import javax.annotation.Nullable; /** * Provides a Levenshtein distance between a given string and each string diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java index 76bf1a908..26ef6a0f9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/io/Closer.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.util.io; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Throwables; @@ -31,8 +33,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipFile; -import static com.google.common.base.Preconditions.checkNotNull; - public final class Closer implements Closeable { private static final Logger logger = Logger.getLogger(Closer.class.getCanonicalName()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java index 05a4c8378..d48b3d89a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/logging/LogFormat.java @@ -19,11 +19,11 @@ package com.sk89q.worldedit.util.logging; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.Date; import java.util.logging.Formatter; import java.util.logging.LogRecord; -import java.io.PrintWriter; -import java.io.StringWriter; /** * A standard logging format for WorldEdit. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java index feb1fbbfe..3e7bbf88c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/World.java @@ -24,9 +24,6 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; -import com.sk89q.worldedit.world.block.BlockStateHolder; -import com.sk89q.worldedit.world.block.BlockState; -import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; @@ -36,6 +33,8 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; +import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.weather.WeatherType; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java index 8bb7d977c..5bf051706 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BaseBiome.java @@ -84,7 +84,4 @@ public class BaseBiome { public int hashCode() { return id; } - - - } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java index 145d891cb..45018ed41 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/biome/BiomeName.java @@ -19,13 +19,13 @@ package com.sk89q.worldedit.world.biome; +import static com.google.common.base.Preconditions.checkNotNull; + import com.google.common.base.Function; import com.sk89q.worldedit.world.registry.BiomeRegistry; import javax.annotation.Nullable; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Returns the name of a biome using a given {@code BiomeRegistry}. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index b3406a083..4875e44d2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.world.block; +import static com.google.common.base.Preconditions.checkArgument; + import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BlockMaterial; @@ -99,7 +101,7 @@ public interface BlockType extends FawePattern, Comparable { } /** - * Gets the properties of this BlockType in a key->property mapping. + * Gets the properties of this BlockType in a {@code key->property} mapping. * * @return The properties map */ @@ -138,7 +140,9 @@ public interface BlockType extends FawePattern, Comparable { */ @Deprecated default Property getProperty(String name) { - return getPropertyMap().get(name); + Property property = getPropertyMap().get(name); + checkArgument(property != null, "%s has no property named %s", this, name); + return property; } default boolean hasProperty(PropertyKey key) { @@ -146,7 +150,9 @@ public interface BlockType extends FawePattern, Comparable { } default Property getProperty(PropertyKey key) { - return getPropertyMap().get(key.getId()); + Property property = getPropertyMap().get(key.getId()); + checkArgument(property != null, "%s has no property named %s", this, key.getId()); + return property; } /** @@ -163,6 +169,13 @@ public interface BlockType extends FawePattern, Comparable { */ List getAllStates(); + /** + * Gets a state of this BlockType with the given properties. + * + * @return The state, if it exists + */ + BlockState getState(Map, Object> key); + /** * Gets whether this block type has an item representation. * diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java index abe7cf68b..16ebfc85b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.world.block; +import static com.google.common.base.Preconditions.checkArgument; + import com.boydti.fawe.Fawe; import com.boydti.fawe.command.SuggestInputParseException; import com.boydti.fawe.util.MathMan; @@ -219,19 +221,24 @@ public enum BlockTypes implements BlockType { DARK_PRISMARINE_SLAB, DARK_PRISMARINE_STAIRS, DAYLIGHT_DETECTOR, + DEAD_BRAIN_CORAL, DEAD_BRAIN_CORAL_BLOCK, DEAD_BRAIN_CORAL_FAN, DEAD_BRAIN_CORAL_WALL_FAN, + DEAD_BUBBLE_CORAL, DEAD_BUBBLE_CORAL_BLOCK, DEAD_BUBBLE_CORAL_FAN, DEAD_BUBBLE_CORAL_WALL_FAN, DEAD_BUSH, + DEAD_FIRE_CORAL, DEAD_FIRE_CORAL_BLOCK, DEAD_FIRE_CORAL_FAN, DEAD_FIRE_CORAL_WALL_FAN, + DEAD_HORN_CORAL, DEAD_HORN_CORAL_BLOCK, DEAD_HORN_CORAL_FAN, DEAD_HORN_CORAL_WALL_FAN, + DEAD_TUBE_CORAL, DEAD_TUBE_CORAL_BLOCK, DEAD_TUBE_CORAL_FAN, DEAD_TUBE_CORAL_WALL_FAN, @@ -654,11 +661,6 @@ public enum BlockTypes implements BlockType { YELLOW_WOOL, ZOMBIE_HEAD, ZOMBIE_WALL_HEAD, - DEAD_BRAIN_CORAL, - DEAD_BUBBLE_CORAL, - DEAD_FIRE_CORAL, - DEAD_HORN_CORAL, - DEAD_TUBE_CORAL, ; @@ -825,6 +827,24 @@ public enum BlockTypes implements BlockType { return IntStream.of(settings.stateOrdinals).filter(i -> i != -1).mapToObj(i -> states[i]).collect(Collectors.toList()); } + public BlockState getState(Map, Object> key) { + int id = getInternalId(); + for (Map.Entry, Object> iter : key.entrySet()) { + Property prop = iter.getKey(); + Object value = iter.getValue(); + + /* + * TODO: + * This is likely wrong. The only place this seems to currently (Dec 23 2018) + * be invoked is via ForgeWorld, and value is a String when invoked there... + */ + AbstractProperty btp = settings.propertiesMap.get(prop.getName()); + checkArgument(btp != null, "%s has no property named %s", this, prop.getName()); + id = btp.modify(id, btp.getValueFor((String)value)); + } + return withStateId(id); + } + @Deprecated public int getMaxStateId() { return settings.permutations; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java index b6c594683..61c7c1173 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/item/ItemTypes.java @@ -245,15 +245,20 @@ public enum ItemTypes implements ItemType { DARK_PRISMARINE_SLAB, DARK_PRISMARINE_STAIRS, DAYLIGHT_DETECTOR, + DEAD_BRAIN_CORAL, DEAD_BRAIN_CORAL_BLOCK, DEAD_BRAIN_CORAL_FAN, + DEAD_BUBBLE_CORAL, DEAD_BUBBLE_CORAL_BLOCK, DEAD_BUBBLE_CORAL_FAN, DEAD_BUSH, + DEAD_FIRE_CORAL, DEAD_FIRE_CORAL_BLOCK, DEAD_FIRE_CORAL_FAN, + DEAD_HORN_CORAL, DEAD_HORN_CORAL_BLOCK, DEAD_HORN_CORAL_FAN, + DEAD_TUBE_CORAL, DEAD_TUBE_CORAL_BLOCK, DEAD_TUBE_CORAL_FAN, DEBUG_STICK, diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java index b734298f3..8a581b7a6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BiomeRegistry.java @@ -22,9 +22,10 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.List; +import javax.annotation.Nullable; + /** * Provides information on biomes. */ @@ -54,4 +55,5 @@ public interface BiomeRegistry { */ @Nullable BiomeData getData(BaseBiome biome); + } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 53948f3b6..1f1a2b317 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -46,4 +46,4 @@ public class BundledBlockRegistry implements BlockRegistry { return Collections.emptyMap(); // Oof } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java index 8bbf7c1ff..551cbc039 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java @@ -22,10 +22,11 @@ package com.sk89q.worldedit.world.registry; import com.sk89q.worldedit.world.biome.BaseBiome; import com.sk89q.worldedit.world.biome.BiomeData; -import javax.annotation.Nullable; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A biome registry that knows nothing. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java index 77f47ceed..d3ca0c251 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/Snapshot.java @@ -22,7 +22,14 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.DataException; -import com.sk89q.worldedit.world.storage.*; +import com.sk89q.worldedit.world.storage.ChunkStore; +import com.sk89q.worldedit.world.storage.FileLegacyChunkStore; +import com.sk89q.worldedit.world.storage.FileMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore; +import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore; +import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore; +import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore; + import java.io.File; import java.io.IOException; import java.util.Calendar; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java index df026e34c..323bef842 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotDateParser.java @@ -19,10 +19,11 @@ package com.sk89q.worldedit.world.snapshot; -import javax.annotation.Nullable; import java.io.File; import java.util.Calendar; +import javax.annotation.Nullable; + /** * A name parser attempts to make sense of a filename for a snapshot. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java index 2add97ec8..72650a408 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRepository.java @@ -23,7 +23,6 @@ package com.sk89q.worldedit.world.snapshot; import com.sk89q.worldedit.world.storage.MissingWorldException; -import javax.annotation.Nullable; import java.io.File; import java.io.FilenameFilter; import java.util.ArrayList; @@ -31,6 +30,8 @@ import java.util.Calendar; import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; + /** * A repository contains zero or more snapshots. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java index b243dcd3a..5b6691b85 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/snapshot/SnapshotRestore.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.world.DataException; import com.sk89q.worldedit.world.chunk.Chunk; import com.sk89q.worldedit.world.storage.ChunkStore; import com.sk89q.worldedit.world.storage.MissingChunkException; + import java.io.IOException; import java.util.ArrayList; import java.util.LinkedHashMap; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java index 4f270fade..07a4e06a5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ChunkStore.java @@ -45,8 +45,8 @@ public abstract class ChunkStore implements Closeable { public static final int DATA_VERSION_MC_1_13 = 1519; /** - * >> to chunk - * << from chunk + * {@code >>} - to chunk + * {@code <<} - from chunk */ public static final int CHUNK_SHIFTS = 4; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java index b3b5728fe..4d193b694 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/LegacyChunkStore.java @@ -29,6 +29,7 @@ import com.sk89q.worldedit.world.World; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Map; import java.util.zip.GZIPInputStream; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java index ad10929ae..6b61bddf9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/NBTConversions.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.world.storage; +import static com.google.common.base.Preconditions.checkNotNull; + import com.sk89q.jnbt.ListTag; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.util.Location; -import static com.google.common.base.Preconditions.checkNotNull; - /** * Utility methods for working with NBT data used in Minecraft. */ diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java index 155d65c51..19350d831 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedLegacyChunkStore.java @@ -24,11 +24,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java index 95356f445..581686ea4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/storage/ZippedMcRegionChunkStore.java @@ -26,11 +26,11 @@ import com.sk89q.worldedit.world.DataException; import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.util.Enumeration; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; -import java.util.Enumeration; /** * Represents the chunk store used by Minecraft alpha but zipped. diff --git a/worldedit-core/src/main/resources/cn/message.yml b/worldedit-core/src/main/resources/cn/message.yml new file mode 100644 index 000000000..1d7fd6cd6 --- /dev/null +++ b/worldedit-core/src/main/resources/cn/message.yml @@ -0,0 +1,322 @@ +# 原译者:Green_Chennai (MCBBS: ww2498010071) +# 2018年10月14日 08:44:53进行过第7次更新 + +# 佛壁灯于 2018年12月10日 21:24:35 (UTC+8) 大幅改进翻译质量 +# 请其他译者勿使用机器翻译。谢谢! + +info: + prefix: '&8(&4&lFAWE&8)&r&7' + file_deleted: '%s0 已被删除。' + schematic_pasting: '&7正在粘贴布局。此操作无法撤销。' + lighting_propogate_selection: '&7光照已在 %s0 个区块内传播。(注:您可使用 //removelight 移除)' + updated_lighting_selection: '&7已更新 %s0 个区块内的光照。(数据包可能要稍后发出)' + set_region: '&7选择区域已设置为您当前允许的区域' + worldedit_command_limit: '&7请等待完成您的当前操作' + worldedit_delayed: '&7正在处理您的快异创世操作,请稍后···' + worldedit_run: '&7很抱歉造成延误,现正执行 %s' + worldedit_complete: '&7编辑完成。' + require_selection_in_mask: '&7您选中的 %s 不在蒙版内。您只能在允许的区域内编辑。' + worldedit_volume: '&7您不能选择 %current% 大小的区域。所允许的最大区域为 %max%。' + worldedit_iterations: '&7您不能重复 %current% 次。所允许的最多重复为 %max% 次。' + worldedit_unsafe: '&7已阻止对此命令的访问' + worldedit_dangerous_worldedit: '&c%s1 在 %s0 处进行了不安全的编辑' + worldedit_toggle_tips_on: '&7已禁用快异创世提示。' + worldedit_toggle_tips_off: '&7已启用快异创世提示。' + + worldedit_bypassed: '&7正绕过快异创世限制。' + worldedit_unmasked: '&6您的快异创世编辑现已不受限制。' + + worldedit_restricted: '&6您的快异创世编辑现正受限制。' + worldedit_oom_admin: |- + &c可选项: + &8 - &7//fast + &8 - &7进行小编辑 + &8 - &7分配更多内存 + &8 - &7禁用 `max-memory-percent` + compressed: '已压缩历史。保存为 ~ %s0b(%s1 倍原大小)' + action_complete: '已在 %s0 秒内完成操作' + +error: + worldedit_extend: '&c您的编辑可能已超过所允许的范围。' + web_unauthorized: '仅允许来自已配置网页主机的链接: %s0' + command_syntax: '&c用法: &7%s0' + no_perm: '&c您缺少权限节点: %s0' + setting_disable: '&c缺少设置: %s0' + brush_not_found: '&c可用画笔: %s0' + brush_incompatible: '&c画笔与此版本不兼容' + schematic_not_found: '&c未找到布局: &7%s0' + no_region: '&c您当前没有允许修改的区域' + no_mask: '&c您当前没有蒙版集' + not_player: '&c您必须为玩家才能执行此操作!' + player_not_found: '&c玩家未找到:&7 %s0' + oom: |- + &8[&c致命错误&8] &c系统检测到可用内存 < 1%。我们将执行下列操作: + &8 - &7终止创世的方块放置 + &8 - &7清除创世历史 + &8 - &7卸载无用区块 + &8 - &7杀死实体 + &8 - &7收集垃圾 + &c若您正尝试使服务器崩溃,请忽略此消息 + &7注:低内存可能但不一定由创世导致 + worldedit_some_fails: '&c%s0 个方块由于在您所允许的区域外而无法放置。' + worldedit_some_fails_blockbag: '&c缺少方块: %s0' + +web: + generating_link: '正在上传 %s,请稍后···' + generating_link_failed: '&c生成下载链接失败!' + download_link: '%s' + +worldedit: + general: + mask_disabled: 已禁用全局蒙版 + mask: 已设置全局蒙版 + texture_disabled: 已重置纹理 + texture_set: 已设置纹理为 %s1 + source_mask_disabled: 已禁用全局源蒙版 + source_mask: 已设置全局源蒙版 + transform_disabled: 已禁用全局变形 + transform: 已设置全局变形 + fast_enabled: 已启用快速模式。历史及编辑将不受限制。 + fast_disabled: 已禁用快速模式 + place_enabled: '放置于位置 #1.' + place_disabled: 放置于您所站的方块。 + + copy: + command_copy: '已复制 %s0 个方块。' + cut: + command_cut_slow: '已剪切 %s0 个方块。' + command_cut_lazy: '%s0 个方块将在粘贴时被移除' + paste: + command_paste: 已粘贴剪贴板内容在 %s0 + rotate: + command_rotate: 已旋转剪贴板内容 + flip: + command_flipped: 已翻转剪贴板内容 + regen: + command_regen_0: 已重新生成区域。 + command_regen_1: 已重新生成区域。 + command_regen_2: 已重新生成区域。 + tree: + command_tree: '已生成 %s0 棵树木。' + command_pumpkin: '已生成 %s0 个南瓜。' + flora: + command_flora: '已生成 %s0 棵植物。' + history: + command_history_clear: 已清除历史记录 + command_redo_error: 无可重做项。(请使用 `/inspect` 或 `/frb` 查看) + command_history_other_error: 无法找到 %s0 的会话。 + command_redo_success: 重做成功%s0。 + command_undo_error: 无可撤销项。(请使用 `/inspect` 或 `/frb` 查看) + command_undo_success: 撤消成功%s0。 + operation: + operation: 操作已进入队列 (%s0) + selection: + selection_wand: '左击: 选择位置 #1;右击:选择位置 #2' + selection_wand_disable: 已禁用编辑手杖。 + selection_wand_enable: 已启用编辑手杖。 + selection_chunk: 已选中区块 (%s0) + selection_chunks: 已选中区块 (%s0) - (%s1) + selection_contract: 区域已缩小 %s0 个方块。 + selection_count: 共计 %s0 块。 + selection_distr: '# 方块总数: %s0' + selection_expand: 地区扩大%s0 块 + selection_expand_vert: 区域已增大 %s0 个方块。(从上到下) + selection_inset: 已插入区域 + selection_outset: 已移出区域 + selection_shift: 已移动区域 + selection_cleared: 已清除选择 + navigation: + navigation_wand_error: '&c无可传递项' + anvil: + world_is_loaded: 执行操作时世界不能被占用。请先卸载世界,或使用 -f 标记覆盖(请先保存) + brush: + brush_reset: 重置您的画笔。(SHIFT + 单击) + brush_none: 您未拿画笔! + brush_scroll_action_set: 已设置滚动操作至 %s0 + brush_scroll_action_unset: 已移除滚动操作 + brush_visual_mode_set: 已设置可视模式为 %s0 + brush_target_mode_set: 已设置目标模式为 %s0 + brush_target_mask_set: 已设置目标蒙版为 %s0 + brush_target_offset_set: 设置目的地偏移量 %s0 + brush_equipped: 已装备画笔 %s0 + brush_try_other: |- + &c 还有其他画笔可用,如: + &8 - &7//br height [半径=5] [#剪贴板|文件=null] [旋转=0] [纵坐标=1.00] + brush_copy: 左击要复制的对象,右击粘贴。您可增加画笔半径。 + brush_height_invalid: 高度图文件无效 (%s0) + brush_smooth: '注:您可用混合刷使凸起与洞穴处变得平滑。' + brush_spline: 点击添加点,请点击相同点完成 + brush_line_primary: 已添加点 %s0,请点击其他位置以创建线条 + brush_catenary_direction: 已添加点 %s0,请点击要创建样条曲线的方向 + brush_line_secondary: 已创建样条曲线 + brush_spline_primary_2: 已添加位置,请点击相同点合并! + brush_spline_secondary_error: 位置集不足! + brush_spline_secondary: 已创建样条曲线 + brush_size: 已设置画笔尺寸 + brush_range: 已设置画笔尺寸 + brush_mask_disabled: 已禁用画笔蒙版 + brush_mask: 已设置画笔蒙版 + brush_source_mask_disabled: 已禁用画笔源蒙版 + brush_source_mask: 已设置画笔源蒙版 + brush_transform_disabled: 已禁用画笔变形 + brush_transform: 已设置画笔变形 + brush_material: 已设置画笔材料 + rollback: + rollback_element: 正在撤消 %s0 + tool: + tool_inspect: 已绑定检查工具至 %s0。 + tool_inspect_info: '&7%s0 在 %s3 前将 %s1 更改为 %s2' + tool_inspect_info_footer: '&6共计: &7%s0 处更改' + tool_none: 工具已从您的当前物品上解绑。 + tool_info: 已绑定信息工具至 %s0。 + tool_tree: 已绑定造树工具至 %s0。 + tool_tree_error: 树型 %s0 未知。 + tool_repl: 已绑定方块替换工具至 %s0。 + tool_cycler: 已绑定方块数据循环工具至 %s0。 + tool_flood_fill: 已绑定方块洪水填充工具至 %s0。 + tool_range_error: '最大范围: %s0.' + tool_radius_error: '最大画笔半径: %s0.' + tool_deltree: 已绑定漂树移除工具至 %s0。 + tool_farwand: 已绑定远程手杖至 %s0。 + tool_lrbuild_bound: 已绑定远程建筑工具至 %s0。 + tool_lrbuild_info: 已设置左击为 %s0; 已设置右击为 %s1。 + superpickaxe_enabled: 已启用超级稿子。 + superpickaxe_disabled: 已禁用超级稿子。 + superpickaxe_area_enabled: 已更改模式。请使用稿子左击,使用 // 禁用此功能。 + snapshot: + snapshot_loaded: '已载入快照 %s0 ;正在恢复···' + snapshot_set: '已设置快照为: %s0' + snapshot_newest: 正使用最新版快照。 + snapshot_list_header: '世界快照 (%s0):' + snapshot_list_footer: 请使用 /snap use [快照] 或 /snap use latest。 + biome: + biome_list_header: '生态群系 (页 %s0/%s1):' + biome_changed: 已更改 %s0 列中的生态群系。 + utility: + kill_success: '已击杀半径 %s0 内的 %s1 个实体。' + nothing_confirmed: 您没有待确认的操作。 + page_footer: 请使用 %s0 前往下一页 + schematic: + schematic_prompt_clear: '&7您可能需先使用 &c%s0 &7来清除剪贴板' + schematic_show: |- + &7正在显示来自 &a%s1&7 的 &a%s0&7 个原理图: + &8 - &a左击&7将结构复制到您的剪贴板 + &8 - &a右击&7将结构添加到多重剪贴板 + &8 - &7使用 &a%s2&7 回到原世界 + schematic_format: '可用格式 (名称: 搜索名称)' + schematic_loaded: '已加载 %s0。请使用 //paste 粘贴' + schematic_saved: '已保存 %s0。' + schematic_page: 页数必须为 %s + schematic_none: 未找到文件。 + schematic_list: '可用文件 (文件名: 格式) [%s0/%s1]:' + schematic_list_elem: '&8 - &a%s0 &8- &7%s1' + schematic_move_exists: '&c%s0 已存在' + schematic_move_success: '&a%s0 -> %s1' + schematic_move_failed: '&a%s0 未移动: %s1' + clipboard: + clipboard_cleared: 已清除剪贴板 + clipboard_invalid_format: '未知剪贴板格式: %s0' + clipboard_uri_not_found: 您尚未加载 %s0 + visitor: + visitor_block: '共影响 %s0 个方块' + visitor_entity: '共影响 %s0 个实体' + visitor_flat: '共影响 %s0 列' + selector: + selector_fuzzy_pos1: 已从 %s0 %s1 处设置并扩展区域。 + selector_fuzzy_pos2: 已添加 %s0 %s1 的扩展区域。 + selector_invalid_coordinates: 坐标 %s0 无效 + selector_already_set: 已设置位置。 + selector_set_default: 您的默认区域选择器已更改为 %s0。 + selector_pos: '已设置位置 %s0 在 %s1 (%s2)。' + selector_center: 已设置中心为 %s0 (%s1)。 + selector_radius: 已设置半径为 %s0 (%s1)。 + selector_expanded: 已扩大区域至 %s0 (%s1) + timezone: + timezone_set: '已为此会话设置时区至: %s0' + timezone_display: '此时区的当前时间为: %s0' + command: + command_invalid_syntax: 命令使用有误 (无帮助可用)。 + help: + command_clarifying_bracket: '&7已为 &c%s0 &7添加阐述括号' + help_suggest: '&7无法找到 %s0。试试 &c%s1 &7吗?' + help_header_categories: 命令类型 + help_header_subcommands: 子命令 + help_header_command: '&7%s0 &c帮助' + help_item_allowed: '&a%s0&8 - &7%s1' + help_item_denied: '&c%s0&8 - &7%s1' + help_header: '帮助: 页 %s0/%s1' + help_footer: '&7维基页面: https://git.io/vSKE5' +progress: + progress_message: '剩余 %s1/%s0 (%s2%) @%s3cps %s4s' + progress_finished: '[ 完成! ]' +cancel: + worldedit_cancel_count: '&c已取消 %s0 次编辑。' + worldedit_cancel_reason_confirm: '&7您的选择区域过大 (&c%s0 &7-> &c%s1&7,内有 &c%s3&7 个方块)。请使用 &c//confirm &7继续执行 &c%s2' + worldedit_cancel_reason: '&c已取消您的创世操作:&7 %s0&c.' + worldedit_cancel_reason_manual: 手动取消 + worldedit_cancel_reason_low_memory: 内存不足 + worldedit_cancel_reason_max_changes: 方块更改过多 + worldedit_cancel_reason_max_checks: 方块检查过多 + worldedit_cancel_reason_max_tiles: 方块状态过多 + worldedit_cancel_reason_max_entities: 实体过多 + worldedit_cancel_reason_max_iterations: 最大重复次数 + worldedit_cancel_reason_no_region: 无允许区域 (请使用 /wea 绕过限制,或在 config.yml 中禁用 `region-restrictions`) + worldedit_failed_load_chunk: '&c已跳过区块载入: &7%s0;%s1&c。请尝试增加区块等待时长' + worldedit_cancel_reason_outside_level: 世界外 + worldedit_cancel_reason_outside_region: 允许区域外 (请使用 /wea 绕过限制,或在 config.yml 中禁用 `region-restrictions`) +navigation: + ascend_fail: 您上方无空位。 + ascended_plural: 已上升 %s0 格。 + ascended_singular: 已向上移动一层。 + unstuck: 起飞了! + descend_fail: 您下方无空位。 + descend_plural: 已下降 %s0 格。 + descend_singular: 已向下移动一层。 + whoosh: 嗖! + poof: 啪! + thru_fail: 您前方无空位。 + no_block: '视野内无方块!(或距离过远)' + up_fail: 您将碰到上方的物体。 +selection: + sel_cuboid: '立方体: 左击点 1, 右击点 2' + sel_cuboid_extend: '立方体: 左击起始点, 右击扩大' + sel_2d_polygon: '2D 多边形选择器: 左/右点击添加点。' + sel_ellipsiod: '椭圆体选择器: 左击选定中心,右击扩大' + sel_sphere: '球体选择器: 左击选定中心,右击设置半径' + sel_cylindrical: '圆柱选择器: 左击选定中心,右击扩大' + sel_max: '可选择至多 %s0 个点。' + sel_fuzzy: '模糊选择器: 左击选择所有可能的方块,右击添加。要选择气腔,请使用 //pos1。' + sel_convex_polyhedral: '凸多面体选择器: 左击选择首个顶点,右击选择更多顶点。' + sel_list: '要查看选择类型列表,请使用: &c//sel list' + sel_modes: '请选择下列模式之一:' +tips: + tip_sel_list: '提示: 请使用 &c//sel list &7查看不同的选择模式' + tip_select_connected: '提示: 请使用 //sel fuzzy 选择所有连接为一体的方块' + tip_set_pos1: '提示: 请使用 &c//set pos1 &7将点 1 作为样式' + tip_farwand: '提示: 请使用 &c//farwand &7选择远方的点' + tip_lazycut: '&7提示: 使用 &c//lazycut &7更为安全' + tip_fast: '&7提示: 请使用 &c//fast &7在不撤销的情况下快速放置方块' + tip_cancel: '&7提示: 您可使用 &c//cancel &7取消进行中的编辑' + tip_mask: '&7提示: 请使用 &c/gmask &7设置全局终点蒙版' + tip_mask_angle: '提示: 请使用 &c//replace /[-20][-3] bedrock &7替换 3-20 个方块的上坡' + tip_set_linear: '&7提示: 请使用 &c//set #l3d[wood,bedrock] &7线性放置方块' + tip_surface_spread: '&7提示: 请使用 &c//set #surfacespread[5][0][5][#existing] &7进行平面展开' + tip_set_hand: '&7提示: 请使用 &c//set hand &7来使用您的手' + tip_replace_id: '&7提示: 请使用 &c//replace woodenstair #编号[石台阶] &7来仅替换方块编号' + tip_replace_light: '提示: 请使用 &c//replace #brightness[1][15] 0 &7来移除光源' + tip_tab_complete: '提示: 替换命令支持 Tab 键补全功能' + tip_flip: '提示: 请使用 &c//flip &7创建镜像' + tip_deform: '提示: 请使用 &c//deform &7重新塑形' + tip_transform: '提示: 请使用 &c//gtransform &7设置变形' + tip_copypaste: '提示: 请使用 &c//br copypaste &7在点击时粘贴' + tip_source_mask: '提示: 请使用 &c/gsmask <蒙版> &7来设置源蒙版' + tip_replace_marker: '提示: 请使用 &c//replace wool #fullcopy &7使用剪切板完全替换方块' + tip_paste: '提示: 请使用 &c//paste &7放置方块' + tip_lazycopy: '提示: lazycopy 的速度更为快捷' + tip_download: '提示: 来试试 &c//download' + tip_rotate: '提示: 请使用 &c//rotate &7确定方位' + tip_copy_pattern: '提示: 请使用 &c#copy &7来作为样式使用' + tip_regen_0: '提示: 使用 &c/regen [生态群系] &7来重新生成生态群系' + tip_regen_1: '提示: 使用 &c/regen [生态群系] [种子] &7来重新生成生态群系' + tip_biome_pattern: '提示: &c#biome[forest]&7 样式可用于任意命令中' + tip_biome_mask: '提示: 您可使用 `$jungle` 蒙版来限定生态群系' diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json index 3e163855a..93dffaf2d 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/blocks.json @@ -3949,6 +3949,31 @@ "hasContainer": true } }, + { + "id": "minecraft:dead_brain_coral", + "localizedName": "Dead Brain Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_brain_coral_block", "localizedName": "Dead Brain Coral Block", @@ -4024,6 +4049,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_bubble_coral", + "localizedName": "Dead Bubble Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_bubble_coral_block", "localizedName": "Dead Bubble Coral Block", @@ -4124,6 +4174,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_fire_coral", + "localizedName": "Dead Fire Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_fire_coral_block", "localizedName": "Dead Fire Coral Block", @@ -4199,6 +4274,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_horn_coral", + "localizedName": "Dead Horn Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_horn_coral_block", "localizedName": "Dead Horn Coral Block", @@ -4274,6 +4374,31 @@ "hasContainer": false } }, + { + "id": "minecraft:dead_tube_coral", + "localizedName": "Dead Tube Coral", + "material": { + "powerSource": false, + "lightValue": 0, + "hardness": 0.0, + "resistance": 0.0, + "ticksRandomly": false, + "fullCube": false, + "slipperiness": 0.6, + "liquid": false, + "solid": true, + "movementBlocker": true, + "burnable": false, + "opaque": true, + "replacedDuringPlacement": false, + "toolRequired": true, + "fragileWhenPushed": false, + "unpushable": false, + "mapColor": "#707070", + "isTranslucent": false, + "hasContainer": false + } + }, { "id": "minecraft:dead_tube_coral_block", "localizedName": "Dead Tube Coral Block", @@ -6995,7 +7120,7 @@ "fragileWhenPushed": true, "unpushable": false, "mapColor": "#ff0000", - "isTranslucent": true, + "isTranslucent": false, "hasContainer": false } }, @@ -14045,7 +14170,7 @@ "fragileWhenPushed": true, "unpushable": false, "mapColor": "#4040ff", - "isTranslucent": true, + "isTranslucent": false, "hasContainer": false } }, diff --git a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json index c9eeb23b8..46829d927 100644 --- a/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json +++ b/worldedit-core/src/main/resources/com/sk89q/worldedit/world/registry/items.json @@ -803,6 +803,10 @@ "id": "minecraft:daylight_detector", "localizedName": "Air" }, + { + "id": "minecraft:dead_brain_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_brain_coral_block", "localizedName": "Air" @@ -811,6 +815,10 @@ "id": "minecraft:dead_brain_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_bubble_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_bubble_coral_block", "localizedName": "Air" @@ -823,6 +831,10 @@ "id": "minecraft:dead_bush", "localizedName": "Air" }, + { + "id": "minecraft:dead_fire_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_fire_coral_block", "localizedName": "Air" @@ -831,6 +843,10 @@ "id": "minecraft:dead_fire_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_horn_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_horn_coral_block", "localizedName": "Air" @@ -839,6 +855,10 @@ "id": "minecraft:dead_horn_coral_fan", "localizedName": "Air" }, + { + "id": "minecraft:dead_tube_coral", + "localizedName": "Air" + }, { "id": "minecraft:dead_tube_coral_block", "localizedName": "Air" @@ -1749,7 +1769,7 @@ }, { "id": "minecraft:lingering_potion", - "localizedName": "Lingering Potion" + "localizedName": "Lingering Water Bottle" }, { "id": "minecraft:llama_spawn_egg", @@ -2237,7 +2257,7 @@ }, { "id": "minecraft:potion", - "localizedName": "Potion" + "localizedName": "Water Bottle" }, { "id": "minecraft:powered_rail", @@ -2677,7 +2697,7 @@ }, { "id": "minecraft:splash_potion", - "localizedName": "Splash Potion" + "localizedName": "Splash Water Bottle" }, { "id": "minecraft:sponge", @@ -2885,7 +2905,7 @@ }, { "id": "minecraft:tipped_arrow", - "localizedName": "Tipped Arrow" + "localizedName": "Arrow of Poison" }, { "id": "minecraft:tnt", diff --git a/worldedit-core/src/main/resources/de/message.yml b/worldedit-core/src/main/resources/de/message.yml index 6cbb487e3..d5dce7147 100644 --- a/worldedit-core/src/main/resources/de/message.yml +++ b/worldedit-core/src/main/resources/de/message.yml @@ -1,4 +1,4 @@ -#Updated by NotMyFault +#Updated by NotMyFault and enterih info: prefix: '&8(&4&lFAWE&8)&r&7' schematic_pasting: '&7Die Schematic wird eingefügt. Dies kann nicht rückgängig gemacht @@ -17,7 +17,7 @@ info: Du darfst nur innerhalb erlaubter Regionen Veränderungen durchführen.' worldedit_volume: '&7Du kannst keine %current% verändern. Die maximale Anzahl an Blöcken die du verändern darfst ist %max%.' - worldedit_iterations: '&7Du kannst keine Aktion %current% Mal wiederholen. Die maximale + worldedit_iterations: '&7Du kannst %current% nicht wiederholen. Die maximale Anzahl an erlaubten Wiederholungen ist %max%.' worldedit_unsafe: '&7Der Zugang zu diesem Befehl wurde verboten.' worldedit_dangerous_worldedit: '&cFAWE führt unsicher WorldEdit Aktionen aus! Position: @@ -163,27 +163,27 @@ worldedit: brush_target_mask_set: Zielmaske auf %s0 gesetzt brush_target_offset_set: Zielausrichtung auf %s0 gesetzt brush_equipped: Brush %s0 ausgerüstet - brush_line_primary: Punkt %s0 hinzugefügt, klicke auf eine andere Position um + brush_line_primary: Punkt %s0 hinzugefügt. Klicke auf eine andere Position um die Linie zu erstellen brush_line_secondary: Spline erstellt - brush_spline_primary_2: Position hinzugefügt, klicke auf die gleiche Position + brush_spline_primary_2: Position hinzugefügt. Klicke auf die gleiche Position um zu beginnen! - brush_catenary_direction: Punkt %s0 hinzugefügt, klicke in die Richtung in der + brush_catenary_direction: Punkt %s0 hinzugefügt. Klicke in die Richtung in der du die spline generieren willst rollback: rollback_element: annulliere %s0 tool: - tool_inspect: Inpektions-Tool gebunden an %s0. + tool_inspect: Inpektions-Tool an %s0 gebunden. tool_inspect_info: '&7%s0 änderte %s1 zu %s2 %s3 zuvor' tool_inspect_info_footer: '&6Total: &7%s0 Änderungen' tool_none: Tool vom aktuellen Item entfernt. tool_info: Info-Tool gebunden an %s0. tool_tree: Tree-Tool gebunden an %s0. tool_tree_error: Baum Typ %s0 ist unbekannt. - tool_repl: Block Replacer-Tool gebunden an %s0. - tool_cycler: Block Data Cycler-Tool gebunden an %s0. - tool_flood_fill: Block Flood Fill-Tool gebunden an %s0. - tool_deltree: Floating Tree Remover-Tool gebunden an %s0. + tool_repl: Block Replacer-Tool an %s0 gebunden. + tool_cycler: Block Data Cycler-Tool an %s0 gebunden + tool_flood_fill: Block Flood Fill-Tool an %s0 gebunden + tool_deltree: Floating Tree Remover-Tool an %s0 gebunden tool_farwand: Far Wand-Tool gebunden an%s0. tool_lrbuild_bound: Long-range Building-Tool gebunden an %s0. tool_lrbuild_info: 'Linksklick: Setze Position %s0; Rechtsklick: Setze Position @@ -192,17 +192,17 @@ worldedit: superpickaxe_disabled: Super-Spitzhacke deaktiviert. tool_range_error: 'Maximale Reichweite: %s0.' tool_radius_error: 'Maximal erlaubter Brush Radius: %s0.' - superpickaxe_area_enabled: Modus geändert. Linksklick mit einer Spitzhacke. // + superpickaxe_area_enabled: Modus geändert. Linksklick mit einer Spitzhacke. Verwende // zum deaktivieren. schematic: schematic_format: 'Verfügbare Zwischenablage Formate (Name: Suche Namen)' schematic_loaded: Schematic %s0 geladen. Platziere sie mit //paste schematic_saved: Schematic %s0 gespeichert. - schematic_page: Seite muss %s sein + schematic_page: Seite muss %s sein. schematic_none: Keine Schematics gefunden. schematic_list: 'Verfügbare Schematics (Dateiname: Format) [%s0/%s1]:' schematic_list_elem: '&8 - &a%s0 &8- &7%s1' - schematic_prompt_clear: '&7Meintest du &c%s0 &7um deine Zwischenablage zu leeren' + schematic_prompt_clear: '&7Meintest du &c%s0 &7um deine Zwischenablage zu leeren?' schematic_show: |- &7Displaying &a%s0&7 Schematics von &a%s1&7: &8 - &aLinksklick &7a um der Zwischenablage hinzuzufügen @@ -214,7 +214,7 @@ worldedit: clipboard: clipboard_cleared: Zwischenablage geleert clipboard_invalid_format: 'Unbekanntes Zwischenablage Format: %s0' - clipboard_uri_not_found: Du hast %s0 nicht geladen + clipboard_uri_not_found: Du hast %s0 nicht geladen. visitor: visitor_block: '%s0 Blöcke betroffen' visitor_entity: '%s0 Entities betroffen' @@ -223,7 +223,7 @@ worldedit: selector_invalid_coordinates: Ungültige Koordinaten %s0 selector_already_set: Position bereits gesetzt. selector_fuzzy_pos1: Region gesetzt und expandiert von %s0 %s1. - selector_fuzzy_pos2: Erweiterung hinzugefügt um %s0 %s1. + selector_fuzzy_pos2: Erweiterung um %s0 %s1 hinzugefügt. selector_set_default: Dein Standard Auswahl-Tool ist nun %s0. selector_pos: Position%s0 zu %s1 (%s2) gesetzt. selector_center: Mittelpunkt zu %s0 (%s1) gesetzt. @@ -251,8 +251,8 @@ worldedit: navigation: navigation_wand_error: '&cNichts zu durchqueren' anvil: - world_is_loaded: Die Welt sollte nicht in Benutzung sein währen der Ausführung. - Entlade die Welt, oder überschreibe diese mit -f (vorher speichern) + world_is_loaded: Die Welt sollte während er Ausführung nicht in Benutzung sein. + Entlade die Welt oder überschreibe diese mit -f (vorher speichern) help: command_clarifying_bracket: '&7Klammer für&c%s0 wurde hinzugefügt' help_suggest: '&7%s0 konnte nicht gefunden werden. Versuche &c%s1 &7' @@ -282,43 +282,43 @@ cancel: worldedit_cancel_reason_confirm: '&7Deine Selektion ist zu groß (%s0 -> %s1). Benutze &c//confirm &7um &c%s2 auszuführen' worldedit_cancel_reason_outside_level: Außerhalb der Welt - worldedit_cancel_reason_outside_region: Außerhalb erlaubter Region (Umgehe mit /wea, + worldedit_cancel_reason_outside_region: Außerhalb erlaubter Region (Umgehe es mit /wea, oder deaktiviere `region-restrictions` in der config.yml) history: {} navigation: - ascend_fail: Kein freier Platz über dir gefunden. + ascend_fail: Über dir konnte kein freier Platz gefunden werden. ascended_plural: '%s0 Schichten aufgestiegen.' ascended_singular: Eine Schicht aufgestiegen. unstuck: Sollte jetzt besser sein! - descend_fail: Kein freier Platz unter dir gefunden. + descend_fail: Unter dir konnte kein freier Platz gefunden werden. descend_plural: '%s0 Schichten abgestiegen.' descend_singular: Eine Schicht abgestiegen. whoosh: Wusch! poof: Puff! - thru_fail: Kein freier Platz vor dir gefunden. + thru_fail: Vor dir konnte kein freier Platz gefunden werden. up_fail: Du würdest einen Block treffen! - no_block: Kein Block in Sichweite! (oder zu weit entfernt) + no_block: Es ist kein Block in Sichweite! (oder zu weit entfernt) selection: - sel_cuboid: 'Quader: Linksklick für Position1, Rechtsklick für Position2' - sel_cuboid_extend: 'Quader: Linksklick für einen Startpunkt, Rechtsklick zum erweitern' + sel_cuboid: 'Quader: Linksklick für Position1; Rechtsklick für Position2' + sel_cuboid_extend: 'Quader: Linksklick für einen Startpunkt; Rechtsklick zum erweitern' sel_2d_polygon: '2D Polygon Auswahl: Links/Rechtsklick um eine Markierung hinzuzufügen.' sel_ellipsiod: 'Ellipsen Auswahl: Linksklick=Mitte, Rechtsklick zum erweitern' sel_sphere: 'Kugel Auswahl : Linksklick=Mitte, Rechtsklick um den Radius zu setzen' sel_cylindrical: 'Zylinder Auswahl: Linksklick=Mitte, Rechtsklick zum erweitern' sel_max: '%s0 Punkte maximal.' - sel_fuzzy: 'Fuzzy Auswahl: Linksklick um alle verbundenen Blöcke zu markieren, Rechtsklick + sel_fuzzy: 'Fuzzy Auswahl: Linksklick um alle verbundenen Blöcke zu markieren; Rechtsklick zum hinzufügen' - sel_convex_polyhedral: 'Convexe Polyeder Auswahl: Linksklick=Erster Vertex, Rechtsklick, + sel_convex_polyhedral: 'Convexe Polyeder Auswahl: Linksklick=Erster Vertex; Rechtsklick, um mehr hinzuzufügen.' sel_list: Für eine Liste der Selektoren nutze:&c //sel sel_modes: 'Wähle einen der unten aufgelisteten Modi:' tips: - tip_cancel: 'Tipp: Du kannst eine Aktion abbrechen mit `//cancel`' + tip_cancel: 'Tipp: Du kannst eine Aktion mit `//cancel` abbrechen' tip_download: 'Tipp: Du kannst deine Zwischenablage mit `//download` herunterladen' tip_sel_list: 'Tipp: Liste die verschiedenen Selektoren auf mit &c//sel list' - tip_select_connected: 'Tipp: Wähle alle verbundenen Blöcke mit //sel fuzzy' + tip_select_connected: 'Tipp: Wähle alle verbundenen Blöcke mit &c//sel fuzzy' tip_set_pos1: 'Tipp: Nutze Position1 als Muster &c//set pos1' - tip_farwand: 'Tipp: Markiere entferne Blöcke mit &c//farwand' + tip_farwand: 'Tipp: Markiere entfernte Blöcke mit &c//farwand' tip_fast: '&7Tipp: Platziere schnell und ohne Undo-Historie &c//fast' tip_mask: '&7Tipp: Setze eine Globale Zielmaske mit &c/gmask' tip_mask_angle: 'Tipp: Ersetze aufwärts Steigungen von 3-20 Blöcken mit&c //replace @@ -327,9 +327,9 @@ tips: tip_surface_spread: '&7Tipp: Streue einen flachen Untergrund mit&c //set #surfacespread:5:0:5:#existing' tip_set_hand: '&7Tipp: Setze das Item in deiner Hand mit&c//set hand' tip_replace_id: '&7Tipp: Ersetze nur die Block-ID:&c //replace woodenstair #id:cobblestair' - tip_replace_light: 'Tipp: Entferne Licht-Quellen&c //replace #brightness:1:15 0' + tip_replace_light: 'Tipp: Entferne Licht-Quellen mit&c //replace #brightness:1:15 0' tip_tab_complete: 'Tipp: Der Replace-Befehl unterstützt Tab-Vervollständigung' - tip_flip: 'Tipp: Spiegeln mit &c//flip' + tip_flip: '&7Tipp: Du kannst mit &c//flip &7spiegeln' tip_deform: 'Tipp: Forme um mit &c//deform' tip_transform: 'Tipp: Platziere eine Umformung mit &c//gtransform' tip_copypaste: 'Tipp: Füge durch Klick ein mit &c//br copypaste' @@ -339,8 +339,8 @@ tips: tip_paste: 'Tipp: Füge deine Zwischeneinlage mit &c//paste ein' tip_lazycopy: 'Tipp: lazycopy ist schneller' tip_rotate: 'Tipp: Ausrichten mit &c//rotate' - tip_copy_pattern: 'Tipp: Um ein Muster zu verwenden nutze &c#copy' - tip_lazycut: '&7Tipp: Es ist sicherer den Befehl &c//lazycut zu verwenden.' + tip_copy_pattern: 'Tipp: Um ein Muster zu verwenden verwende &c#copy' + tip_lazycut: '&7Tipp: Es ist sicherer den Befehl &c//lazycut &7zu verwenden.' tip_regen_0: 'Tipp: Benutze ein Biom mit /regen [biome]' tip_regen_1: 'Tipp: Benutzte einen Seed mit /regen [biome] [seed]' tip_biome_pattern: 'Tipp: Das &c#biome[forest]&7 Muster kann in jedem Befehl genutzt diff --git a/worldedit-core/src/main/resources/es/message.yml b/worldedit-core/src/main/resources/es/message.yml index f76496e8e..0e643a385 100644 --- a/worldedit-core/src/main/resources/es/message.yml +++ b/worldedit-core/src/main/resources/es/message.yml @@ -1,5 +1,5 @@ info: - prefix: '&4&lFAWE:&f&7' + prefix: '&8(&4&lFAWE&8)&r&7' file_deleted: '%s0 ha sido eliminado.' schematic_pasting: '&7La schematic está peganda. Esto no se puede deshacer.' lighting_propogate_selection: '&7La iluminación se ha propagado en %s0 chunks. (Nota: @@ -74,6 +74,8 @@ worldedit: fast_disabled: Modo rápido inhabilitado. place_enabled: 'Ahora colocando en pos #1.' place_disabled: Ahora colocando en el bloque en el que estás. + texture_disabled: Reinicio de texturizado + texture_set: Establecer texturizado en %s1 copy: command_copy: Se copiaron %s0 bloques. cut: @@ -158,6 +160,7 @@ worldedit: brush_transform_disabled: Transformación de pincel desactivada brush_transform: Conjunto de transformación de pincel brush_material: Brush material set + brush_catenary_direction: Punto añadido %s0, Haga clic en la dirección que desee a la spline rollback: rollback_element: Deshacer %s0 tool: @@ -202,10 +205,19 @@ worldedit: schematic_none: No se han encontrado archivos. schematic_list: 'Archivos disponibles (Filename: Format) [%s0/%s1]:' schematic_list_elem: '&8 - &a%s0 &8- &7%s1' + schematic_prompt_clear: '&7Es posible que desee utilizar &c%s0 &7para borrar su actual primera' + schematic_show: |- + &7Mostrando &a%s0&7 esquemas de &a%s1&7: + &8 - &aClick izquierdo &7Una estructura para configurar tu portapapeles + &8 - &aBotón derecho del ratón &7para agregar una estructura a tu multipartículas + &8 - &7Utilizar &a%s2&7 para volver al mundo + schematic_move_exists: '&c%s0 ya existe' + schematic_move_success: '&a%s0 -> %s1' + schematic_move_failed: '&a%s0 no movido: %s1' clipboard: clipboard_cleared: Portapapeles despejado clipboard_invalid_format: 'Formato del portapapeles desconocido: %s0' - clipboard_uri_not_found: You do not have %s0 loaded + clipboard_uri_not_found: Usted no tiene %s0 cargado visitor: visitor_block: '%s0 bloques afectados' visitor_entity: '%s0 entidades afectadas' diff --git a/worldedit-core/src/main/resources/it/message.yml b/worldedit-core/src/main/resources/it/message.yml index f8e891a63..c6b52da03 100644 --- a/worldedit-core/src/main/resources/it/message.yml +++ b/worldedit-core/src/main/resources/it/message.yml @@ -274,7 +274,7 @@ tips: tip_fast: '&7Consiglio: Imposta velocemente e senza l''annullamento usando &c//fast' tip_cancel: '&7Consiglio: Puoi cancellare con &c//cancel &7una modifica in corso' tip_mask: '&7Consiglio: Imposta una maschera di destinazione globale con &c/gmask' - tip_mask_angle: 'Consiglio: Sostituire le pendenze verso l'alto di 3-20 blocchi usando&c //replace /[-20][-3] bedrock' + tip_mask_angle: 'Consiglio: Sostituire le pendenze verso l''alto di 3-20 blocchi usando&c //replace /[-20][-3] bedrock' tip_set_linear: '&7Consiglio: Imposta i blocchi linearmente con&c //set #l3d[wood,bedrock]' tip_surface_spread: '&7Consiglio: Propaga una superficie piana con&c //set #surfacespread[5][0][5][#existing]' tip_set_hand: '&7Consiglio: Usa la tua mano attuale con &c//set hand' diff --git a/worldedit-core/src/main/resources/ru/message.yml b/worldedit-core/src/main/resources/ru/message.yml index 1e910110f..24c112a16 100644 --- a/worldedit-core/src/main/resources/ru/message.yml +++ b/worldedit-core/src/main/resources/ru/message.yml @@ -1,5 +1,5 @@ info: - prefix: '&7' + prefix: '&8(&4&lFAWE&8)&r&7' file_deleted: '%s0 был удален.' schematic_pasting: '&7Вставка схематического файла. Это не может быть отменено.' lighting_propogate_selection: '&7Освещение было распространено в %s0 чанках. (Примечание: @@ -21,7 +21,6 @@ info: worldedit_unsafe: '&7Доступ к этой команде был заблокирован!' worldedit_dangerous_worldedit: '&cFAWE обрабатывает небезопасный WorldEdit в %s0 на %s1' - worldedit_bypass: '&7&oЧтобы обойти ваши ограничения используйте &c/wea' worldedit_toggle_tips_on: '&7Советы WorldEdit &cвключены&7.' worldedit_toggle_tips_off: '&7Советы WorldEdit &cвключены&7.' worldedit_bypassed: '&7Обход ограничений WorldEdit &cвключен&7.' @@ -59,6 +58,8 @@ error: пределами вашего региона.' worldedit_some_fails_blockbag: '&cНедостающие блоки: %s0' web_unauthorized: 'Разрешены только ссылки с настроенного веб-хостинга: %s0' + brush_not_found: '&cДоступные кисти: %s0' + brush_incompatible: '&cКисть не совместима с этой версией' web: generating_link: Загрузка %s, пожалуйста подождите... generating_link_failed: '&cНе удалось создать ссылку!' @@ -75,6 +76,8 @@ worldedit: fast_disabled: Быстрый режим отключен place_enabled: 'Теперь размещение в позиции #1.' place_disabled: Теперь размещение в блоке, на котором вы стоите. + texture_disabled: Сброс текстуры + texture_set: Установите текстурирование на %s1 copy: command_copy: '%s0 блок(ов) скопировано.' cut: @@ -129,27 +132,16 @@ worldedit: selection_cleared: Выделение очищено brush: brush_none: Вы не держите кисть! - brush_butcher: Кисть мясника сформирована (%s0) - brush_clipboard: Форма кисти буфера обемна сформирована - brush_cylinder: Цилиндрическая форма кисти сформирована (%s0 по %s1). - brush_extinguisher: Форма кисти огнерушения сформирована (%s0). - brush_gravity: Кисть гравитации сформирована (%s0) - brush_height: Кисть высоты сформирована (%s0) brush_try_other: |- &cFAWE добавляет другие, более подходящие кисти, например, &8 - &7//br height [radius=5] [#clipboard|file=null] [rotation=0] [yscale=1.00] - brush_copy: Кисть копирования сформирована (%s0). ПКМ по обьекту для копирования, ПКМ для вставки. При необходимости увеличьте радиус кисти. - brush_command: Командная кисть сформирована (%s0) + brush_copy: Кисть копирования сформирована (%s0). ПКМ по обьекту для копирования, + ПКМ для вставки. При необходимости увеличьте радиус кисти. brush_height_invalid: Неверная высота файла карты (%s0) brush_smooth: Кисть сглаживания сформирована (%s0 x %s1 используя %s2). - brush_sphere: Форма сферической кисти сформирована (%s0). - brush_line: Форма кисти линий сформирована (%s0). brush_spline: Форма кисти линий сформирована (%s0). ПКМ по концу, чтобы добавить форму brush_spline_secondary_error: Не хватает установленных позиций! brush_spline_secondary: Склеивание создано - brush_blend_ball: Кисть смеси шара сформирована (%s0). - brush_erode: Кисть разрушения сформирована (%s0). - brush_recursive: Кисть рекурсии сформирована (%s0). brush_size: Размер кисти установлен brush_range: Размер кисти установлен brush_mask_disabled: Маска кисти отключена @@ -163,10 +155,14 @@ worldedit: brush_visual_mode_set: Установлен визуальный режим для %s0 brush_target_mode_set: Установлен целевой режим для %s0 brush_spline_primary_2: Добавлена ​​позиция, Нажмите на том же месте, чтобы присоединиться! - brush_circle: Кисть создания круга оборудована (%s0). Щелкните правой кнопкой мыши, чтобы создать круг. - brush_shatter: Форма разрешающей кисти сформирована (%s0, %s1). - brush_stencil: Форма кисти по шаблону сформирована (%s0). - brush_scatter: Форма кисти рассеивания сформирована (%s0, %s1). + brush_reset: Сбросьте кисть. (SHIFT + Click) + brush_scroll_action_unset: Удалено действие прокрутки + brush_target_mask_set: Установите целевую маску на %s0 + brush_target_offset_set: Установите смещение цели на %s0 + brush_equipped: Оборудованная кисть %s0 + brush_line_primary: Добавленная точка %s0, нажмите другую позицию, чтобы создать линию + brush_catenary_direction: Добавленная точка %s0, нажмите другую позицию, чтобы создать сплайн + brush_line_secondary: Созданный сплайн rollback: rollback_element: Отмена %s0 tool: @@ -196,9 +192,20 @@ worldedit: schematic_page: Страница должна быть %s schematic_none: Схематических фалов не найдено. schematic_list: 'Доступные схематические файлы (Имя файла: Формат) [%s0/%s1]:' + schematic_prompt_clear: '&7Вы можете использовать &c%s0 &7очистить свой первый' + schematic_show: |- + &7Отображение &a%s0&7 схемы из &a%s1&7: + &8 - &aЩелчок левой кнопкой мыши &7структура для настройки вашего буфера обмена + &8 - &aЩелкните правойt кнопкой мыши &7добавить структуру в ваш мультибуфер + &8 - &7использование &a%s2&7 вернуться в мир + schematic_move_exists: '&c%s0 уже существует' + schematic_move_success: '&a%s0 -> %s1' + schematic_move_failed: '&a%s0 нет перемещенных: %s1' + schematic_list_elem: '&8 - &a%s0 &8- &7%s1' clipboard: clipboard_cleared: Буфер обмена очищен clipboard_invalid_format: 'Неизвестный формат буфера обмена: %s0' + clipboard_uri_not_found: У тебя нет %s0 нагруженный visitor: visitor_block: '%s0 блок(ов) затронуто' visitor_entity: '%s0 энтити затронуто' @@ -206,11 +213,13 @@ worldedit: selector: selector_fuzzy_pos1: Регион установлен и расширен %s0 %s1. selector_fuzzy_pos2: Добавлено расширение %s0 %s1. - selector_cuboid_pos1: Первая точка установлена на %s0 %s1. - selector_cuboid_pos2: Вторая точка установлена на %s0 %s1. selector_invalid_coordinates: Неверные координаты %s0 selector_already_set: Позиция уже установлена. selector_set_default: Ваш выбранный регион по умолчанию теперь %s0. + selector_pos: pos%s0 установлен в %s1 (%s2). + selector_center: Центр установлен на %s0 (%s1). + selector_radius: Радиус, установленный для %s0 (%s1). + selector_expanded: Расширенная область для %s0 (%s1) command: command_invalid_syntax: Команда не используется должным образом (нет больше помощи). snapshot: @@ -224,9 +233,25 @@ worldedit: biome_changed: Биом был изменен в %s0 колонн. utility: kill_success: Убито %s0 энтити в радиусе %s1. + nothing_confirmed: У вас нет действий в ожидании подтверждения. + page_footer: использование %s0 to go to the next page timezone: timezone_set: 'Часовой пояс для этой сессии: %s0' timezone_display: 'Текущее время в этом часовом поясе: %s0' + navigation: + navigation_wand_error: '&cНичто не может пройти' + anvil: + world_is_loaded: Мир не должен использоваться во время исполнения. Выгрузить или использовать -f переопределить (сохранить сначала) + help: + command_clarifying_bracket: '&7Added clarifying bracket for &c%s0' + help_suggest: '&7не мог найти %s0. Возможно, попробуйте один из &c%s1 &7?' + help_header_categories: Типы команд + help_header_subcommands: Подкоманды + help_header_command: '&cПомогите за: &7%s0' + help_item_allowed: '&a%s0&8 - &7%s1' + help_item_denied: '&c%s0&8 - &7%s1' + help_header: 'Помогите: страница %s0/%s1' + help_footer: '&7Wiki: https://git.io/vSKE5' progress: progress_message: '[ Очередь: %s0 | Отправляется: %s1 ]' progress_finished: '[ Готово! ]' @@ -240,10 +265,11 @@ cancel: worldedit_cancel_reason_max_tiles: Слишком много blockstates worldedit_cancel_reason_max_entities: Слишком много энтити worldedit_cancel_reason_max_iterations: Максимальное количество итераций - worldedit_cancel_reason_max_fails: Вне разрешенного региона (обход, используя /wea, или выключите `region-restrictions` в config.yml) worldedit_cancel_reason_no_region: Нет разрешенного региона (обход, используя /wea, или выключите `region-restrictions` в config.yml) - worldedit_failed_load_chunk: '&cПропущенные загруженные чанки: &7%s0;%s1&c. Попробуйте - увеличить ожидание чанка.' + worldedit_failed_load_chunk: '&cПропущенные загруженные чанки: &7%s0;%s1&c. Попробуйте увеличить ожидание чанка.' + worldedit_cancel_reason_confirm: '&7Ваш выбор большой (&c%s0 &7-> &c%s1&7, содержащий &c%s3&7 блоки). использование &c//confirm &7выполнить &c%s2' + worldedit_cancel_reason_outside_level: внешний мир + worldedit_cancel_reason_outside_region: Вне допустимой области (обход с /wea, или отключить `region-restrictions` в config.yml) history: {} navigation: ascend_fail: Свободного места над вами не найдено. @@ -266,10 +292,8 @@ selection: sel_sphere: 'Сферическое выделение: ЛКМ - центр, ПКМ для установки радиуса' sel_cylindrical: 'Цилиндрическое выделение: ЛКМ - центр, ПКМ для расширения' sel_max: '%s0 максимум точек.' - sel_fuzzy: 'Нечеткое выделение: ЛКМ, чтобы выбрать все условные блоки, ПКМ, чтобы - добавить' - sel_convex_polyhedral: 'Выпуклое многогранное выделение: ЛКМ - первая вершина, ПКМ - для добавления больше.' + sel_fuzzy: 'Нечеткое выделение: ЛКМ, чтобы выбрать все условные блоки, ПКМ, чтобы добавить' + sel_convex_polyhedral: 'Выпуклое многогранное выделение: ЛКМ - первая вершина, ПКМ для добавления больше.' sel_list: Для получения списка типов выделения используйте:&c //sel list sel_modes: 'Выберите один из перечисленных режимов ниже:' tips: @@ -280,37 +304,26 @@ tips: tip_fast: '&7Совет: Установить быстро и без отмены, используя &c//fast' tip_cancel: '&7Совет: Вы можете &c//cancel &7от изменений в процессе' tip_mask: '&7Совет: Задайте маску глобального назначения - &c/gmask' - tip_mask_angle: 'Совет: Заменить верхний слой 3-20 блоков -&c //replace /-20:-3 - bedrock' + tip_mask_angle: 'Совет: Заменить верхний слой 3-20 блоков -&c //replace /-20:-3 bedrock' tip_set_linear: '&7Совет: Установка блоков -&c //set #l3d:wood,bedrock' tip_surface_spread: '&7Совет: Распространение плоской поверхности -&c //set #surfacespread:5:0:5:#existing' tip_set_hand: '&7Совет: Используйте свою текущую руку - &c//set hand' tip_replace_id: '&7Совет: Заменить только ID блока -&c //replace woodenstair #id:cobblestair' - tip_replace_light: 'Совет: Удалить источники света -&c //replace #brightness:1:15 - 0' + tip_replace_light: 'Совет: Удалить источники света -&c //replace #brightness:1:15 0' tip_tab_complete: 'Совет: Команда replace поддерживает автозаполение' tip_flip: 'Совет: Отобразить - &c//flip' tip_deform: 'Совет: Изменить - &c//deform' tip_transform: 'Совет: Установка преобразования - &c//gtransform' tip_copypaste: 'Совет: Вставка по клику - &c//br copypaste' tip_source_mask: 'Совет: Установить маску источника - &c/gsmask &7' - tip_replace_marker: 'Совет: Замените блок с помощью полного буфера обмена - &c//replace - wool #fullcopy' + tip_replace_marker: 'Совет: Замените блок с помощью полного буфера обмена - &c//replace wool #fullcopy' tip_paste: 'Совет: Вставить - &c//paste' tip_lazycopy: 'Совет: lazycopy быстрее' tip_download: 'Совет: Попробовать - &c//download' tip_rotate: 'Совет: Ориентация - &c//rotate' tip_copy_pattern: 'Совет: Для использования шаблона используйте &c#copy' - tip_brush_spline: '&7Совет: Команда &c//brush &7соединяет несколько фигур вместе' - tip_brush_height: '&7Совет: Команда &c//brush &7плавно повышает или понижает ландшафт' - tip_brush_copy: '&7Совет: Команда &c//brush &7позволяет легко копировать и вставлять - объекты' - tip_brush_mask: '&7Совет: Задайте маску назначения кисти - &c/mask' - tip_brush_mask_source: '&7Совет: Задайте маску источника кисти - &c/smask' - tip_brush_transform: '&7Совет: Установите кисть преобразования - &c/transform' - tip_brush_relative: '&7Совет: Используйте шаблон относительного буфера обмена - - //br sphere #~:#copy' - tip_brush_command: '&7Совет: Попробуйте командную кисть - &c//br cmd ' tip_lazycut: '&7Совет: Это безопаснее использовать &c//lazycut' tip_regen_0: 'Совет: Используйте биом - &c/regen [biome]' tip_regen_1: 'Совет: Используйте сид - &c/regen [biome] [seed]' + tip_biome_pattern: 'Tip: The &c#biome[forest]&7 pattern can be used in any command' + tip_biome_mask: 'Tip: Restrict to a biome with the `$jungle` mask' diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java new file mode 100644 index 000000000..51d50f93b --- /dev/null +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/VectorTest.java @@ -0,0 +1,152 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class VectorTest { + @Test + public void collinearityTest() { + assertCollinear(0,0,0, 0,0,0); + + assertCollinear(0,0,0, 1,0,0); + assertCollinear(0,0,0, 0,1,0); + assertCollinear(0,0,0, 0,0,1); + + assertCollinear(1,0,0, 0,0,0); + assertCollinear(0,1,0, 0,0,0); + assertCollinear(0,0,1, 0,0,0); + + assertCollinear(1,0,0, 2,0,0); + assertNotCollinear(1,0,0, 0,1,0); + + assertNotCollinear(2,2,2, 8,4,4); + assertCollinear(8,2,2, 8,2,2); + assertNotCollinear(4,2,4, 4,4,4); + assertNotCollinear(1,1,2, 4,8,2); + assertNotCollinear(4,1,8, 1,4,4); + assertCollinear(2,4,2, 1,2,1); + assertNotCollinear(2,2,4, 1,2,1); + assertNotCollinear(4,4,1, 4,4,4); + assertNotCollinear(4,1,4, 1,8,2); + assertCollinear(8,8,4, 4,4,2); + assertNotCollinear(2,1,8, 1,1,2); + assertNotCollinear(8,1,2, 2,1,2); + assertNotCollinear(4,4,8, 2,2,8); + assertNotCollinear(8,4,8, 1,4,8); + assertNotCollinear(2,2,2, 1,4,2); + assertNotCollinear(1,1,2, 8,8,2); + assertNotCollinear(4,4,8, 8,4,4); + assertNotCollinear(1,8,2, 4,4,4); + assertNotCollinear(8,4,2, 1,2,2); + assertNotCollinear(1,8,2, 8,1,4); + assertNotCollinear(4,8,1, 4,8,8); + assertNotCollinear(8,1,8, 8,8,8); + assertNotCollinear(8,4,1, 4,2,2); + assertNotCollinear(4,8,1, 4,2,1); + assertNotCollinear(8,8,1, 2,4,2); + assertCollinear(8,1,4, 8,1,4); + assertNotCollinear(4,1,1, 2,4,8); + assertNotCollinear(4,2,8, 1,4,1); + assertNotCollinear(1,8,2, 1,8,1); + assertNotCollinear(1,1,2, 4,2,2); + + assertCollinear(0,0, 0,0); + + assertCollinear(0,0, 1,0); + assertCollinear(0,0, 0,1); + assertCollinear(0,0, 0,0); + + assertCollinear(1,0, 0,0); + assertCollinear(0,1, 0,0); + assertCollinear(0,0, 0,0); + + assertCollinear(1,0, 2,0); + assertNotCollinear(1,0, 0,1); + + assertNotCollinear(2,2, 8,4); + assertCollinear(8,2, 8,2); + assertNotCollinear(4,2, 4,4); + assertNotCollinear(1,1, 4,8); + assertNotCollinear(4,1, 1,4); + assertCollinear(2,4, 1,2); + assertNotCollinear(2,2, 1,2); + assertCollinear(4,4, 4,4); + assertNotCollinear(4,1, 1,8); + assertCollinear(8,8, 4,4); + assertNotCollinear(2,1, 1,1); + assertNotCollinear(8,1, 2,1); + assertCollinear(4,4, 2,2); + assertNotCollinear(8,4, 1,4); + assertNotCollinear(2,2, 1,4); + assertCollinear(1,1, 8,8); + assertNotCollinear(4,4, 8,4); + assertNotCollinear(1,8, 4,4); + assertNotCollinear(8,4, 1,2); + assertNotCollinear(1,8, 8,1); + assertCollinear(4,8, 4,8); + assertNotCollinear(8,1, 8,8); + assertCollinear(8,4, 4,2); + assertNotCollinear(4,8, 4,2); + assertNotCollinear(8,8, 2,4); + assertCollinear(8,1, 8,1); + assertNotCollinear(4,1, 2,4); + assertNotCollinear(4,2, 1,4); + assertCollinear(1,8, 1,8); + assertNotCollinear(1,1, 4,2); + } + + private void assertCollinear(double ax, double ay, double az, double bx, double by, double bz) { + final Vector a = new Vector(ax,ay,az); + final Vector b = new Vector(bx,by,bz); + assertTrue(a.isCollinearWith(b)); + assertTrue(b.isCollinearWith(a)); + assertTrue(a.multiply(-1.0).isCollinearWith(b)); + assertTrue(a.isCollinearWith(b.multiply(-1.0))); + } + private void assertNotCollinear(double ax, double ay, double az, double bx, double by, double bz) { + final Vector a = new Vector(ax,ay,az); + final Vector b = new Vector(bx,by,bz); + assertFalse(a.isCollinearWith(b)); + assertFalse(b.isCollinearWith(a)); + assertFalse(a.multiply(-1.0).isCollinearWith(b)); + assertFalse(a.isCollinearWith(b.multiply(-1.0))); + } + + private void assertCollinear(double ax, double az, double bx, double bz) { + final Vector2D a = new Vector2D(ax,az); + final Vector2D b = new Vector2D(bx,bz); + assertTrue(a.isCollinearWith(b)); + assertTrue(b.isCollinearWith(a)); + assertTrue(a.multiply(-1.0).isCollinearWith(b)); + assertTrue(a.isCollinearWith(b.multiply(-1.0))); + } + private void assertNotCollinear(double ax, double az, double bx, double bz) { + final Vector2D a = new Vector2D(ax,az); + final Vector2D b = new Vector2D(bx,bz); + assertFalse(a.isCollinearWith(b)); + assertFalse(b.isCollinearWith(a)); + assertFalse(a.multiply(-1.0).isCollinearWith(b)); + assertFalse(a.isCollinearWith(b.multiply(-1.0))); + } +} diff --git a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java index 9c2a08760..d7633c15c 100644 --- a/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java +++ b/worldedit-core/src/test/java/com/sk89q/worldedit/util/LocationTest.java @@ -26,9 +26,6 @@ import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.world.World; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; - /** * Tests {@link Location}. */ diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeAdapter.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeAdapter.java index b353e046c..335ef497d 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeAdapter.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeAdapter.java @@ -19,9 +19,6 @@ package com.sk89q.worldedit.forge; -<<<<<<< HEAD -import com.sk89q.worldedit.Vector; -======= import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; @@ -30,13 +27,20 @@ import com.sk89q.worldedit.registry.state.DirectionalProperty; import com.sk89q.worldedit.registry.state.EnumProperty; import com.sk89q.worldedit.registry.state.IntegerProperty; import com.sk89q.worldedit.registry.state.Property; ->>>>>>> 399e0ad5... Refactor vector system to be cleaner import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.world.World; + +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.properties.PropertyInteger; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; +import java.util.stream.Collectors; + final class ForgeAdapter { private ForgeAdapter() { @@ -71,9 +75,6 @@ final class ForgeAdapter { } } -<<<<<<< HEAD - public static BlockPos toBlockPos(Vector vector) { -======= public static Direction adaptEnumFacing(EnumFacing face) { switch (face) { case NORTH: return Direction.NORTH; @@ -88,8 +89,27 @@ final class ForgeAdapter { } public static BlockPos toBlockPos(BlockVector3 vector) { ->>>>>>> 399e0ad5... Refactor vector system to be cleaner return new BlockPos(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); } + public static Property adaptProperty(IProperty property) { + if (property instanceof PropertyBool) { + return new BooleanProperty(property.getName(), ImmutableList.copyOf(((PropertyBool) property).getAllowedValues())); + } + if (property instanceof PropertyInteger) { + return new IntegerProperty(property.getName(), ImmutableList.copyOf(((PropertyInteger) property).getAllowedValues())); + } + if (property instanceof PropertyDirection) { + return new DirectionalProperty(property.getName(), ((PropertyDirection) property).getAllowedValues().stream() + .map(ForgeAdapter::adaptEnumFacing) + .collect(Collectors.toList())); + } + if (property instanceof PropertyEnum) { + return new EnumProperty(property.getName(), ((PropertyEnum) property).getAllowedValues().stream() + .map(e -> e.getName()) + .collect(Collectors.toList())); + } + return new IPropertyAdapter<>(property); + } + } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockMaterial.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockMaterial.java new file mode 100644 index 000000000..9d98f39ef --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockMaterial.java @@ -0,0 +1,94 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.forge; + +import com.sk89q.worldedit.world.registry.BlockMaterial; +import com.sk89q.worldedit.world.registry.PassthroughBlockMaterial; + +import net.minecraft.block.material.EnumPushReaction; +import net.minecraft.block.material.Material; + +import javax.annotation.Nullable; + +/** + * Forge block material that pulls as much info as possible from the Minecraft + * Material, and passes the rest to another implementation, typically the + * bundled block info. + */ +public class ForgeBlockMaterial extends PassthroughBlockMaterial { + + private final Material delegate; + + public ForgeBlockMaterial(Material delegate, @Nullable BlockMaterial secondary) { + super(secondary); + this.delegate = delegate; + } + + @Override + public boolean isAir() { + return delegate == Material.AIR || super.isAir(); + } + + @Override + public boolean isOpaque() { + return delegate.isOpaque(); + } + + @Override + public boolean isLiquid() { + return delegate.isLiquid(); + } + + @Override + public boolean isSolid() { + return delegate.isSolid(); + } + + @Override + public boolean isFragileWhenPushed() { + return delegate.getMobilityFlag() == EnumPushReaction.DESTROY; + } + + @Override + public boolean isUnpushable() { + return delegate.getMobilityFlag() == EnumPushReaction.BLOCK; + } + + @Override + public boolean isMovementBlocker() { + return delegate.blocksMovement(); + } + + @Override + public boolean isBurnable() { + return delegate.getCanBurn(); + } + + @Override + public boolean isToolRequired() { + return !delegate.isToolNotRequired(); + } + + @Override + public boolean isReplacedDuringPlacement() { + return delegate.isReplaceable(); + } + +} diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockRegistry.java new file mode 100644 index 000000000..a2d59715a --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeBlockRegistry.java @@ -0,0 +1,58 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.forge; + +import com.sk89q.worldedit.registry.state.Property; +import com.sk89q.worldedit.world.block.BlockType; +import com.sk89q.worldedit.world.registry.BlockMaterial; +import com.sk89q.worldedit.world.registry.BundledBlockRegistry; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.TreeMap; + +public class ForgeBlockRegistry extends BundledBlockRegistry { + + private Map materialMap = new HashMap<>(); + + @Override + public BlockMaterial getMaterial(BlockType blockType) { + return materialMap.computeIfAbsent(Block.getBlockFromName(blockType.getId()).getDefaultState().getMaterial(), + m -> new ForgeBlockMaterial(m, super.getMaterial(blockType))); + } + + @Override + public Map> getProperties(BlockType blockType) { + Map> map = new TreeMap<>(); + Collection> propertyKeys = Block.getBlockFromName(blockType.getId()) + .getDefaultState() + .getPropertyKeys(); + for (IProperty key : propertyKeys) { + map.put(key.getName(), ForgeAdapter.adaptProperty(key)); + } + return map; + } + +} diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java index 216657581..c87033075 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeItemRegistry.java @@ -16,6 +16,7 @@ * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . */ + package com.sk89q.worldedit.forge; import com.sk89q.worldedit.blocks.BaseItem; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java index 7b8737fd8..27b6f36df 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeRegistries.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.forge; import com.sk89q.worldedit.world.registry.BiomeRegistry; +import com.sk89q.worldedit.world.registry.BlockRegistry; import com.sk89q.worldedit.world.registry.BundledRegistries; import com.sk89q.worldedit.world.registry.ItemRegistry; @@ -29,9 +30,15 @@ import com.sk89q.worldedit.world.registry.ItemRegistry; class ForgeRegistries extends BundledRegistries { private static final ForgeRegistries INSTANCE = new ForgeRegistries(); + private final BlockRegistry blockRegistry = new ForgeBlockRegistry(); private final BiomeRegistry biomeRegistry = new ForgeBiomeRegistry(); private final ItemRegistry itemRegistry = new ForgeItemRegistry(); + @Override + public BlockRegistry getBlockRegistry() { + return blockRegistry; + } + @Override public BiomeRegistry getBiomeRegistry() { return biomeRegistry; diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java index f0b68ebcb..9b8551f24 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorld.java @@ -23,39 +23,44 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.io.Files; import com.sk89q.jnbt.CompoundTag; -<<<<<<< HEAD import com.sk89q.worldedit.BlockVector; -======= ->>>>>>> 399e0ad5... Refactor vector system to be cleaner +import com.sk89q.worldedit.BlockVector2D; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; +import com.sk89q.worldedit.math.BlockVector2; +import com.sk89q.worldedit.math.BlockVector3; +import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.internal.Constants; -import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; +import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.AbstractWorld; import com.sk89q.worldedit.world.biome.BaseBiome; +import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; +import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.item.ItemTypes; -import com.sk89q.worldedit.world.registry.LegacyMapper; import com.sk89q.worldedit.world.weather.WeatherType; +import com.sk89q.worldedit.world.weather.WeatherTypes; + import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.BlockOldLeaf; import net.minecraft.block.BlockOldLog; import net.minecraft.block.BlockPlanks; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyDirection; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityList; import net.minecraft.entity.item.EntityItem; @@ -67,7 +72,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; +import net.minecraft.util.IStringSerializable; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -90,14 +97,17 @@ import net.minecraft.world.gen.feature.WorldGenTaiga1; import net.minecraft.world.gen.feature.WorldGenTaiga2; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraft.world.storage.WorldInfo; import net.minecraftforge.common.DimensionManager; import java.io.File; import java.lang.ref.WeakReference; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.Random; -import java.util.UUID; +import java.util.TreeMap; import javax.annotation.Nullable; @@ -174,7 +184,11 @@ public class ForgeWorld extends AbstractWorld { Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4); BlockPos pos = new BlockPos(x, y, z); IBlockState old = chunk.getBlockState(pos); - IBlockState newState = Block.getBlockById(block.getBlockType().getLegacyId()).getDefaultState(); // TODO .getStateFromMeta(block.getData()); + Block mcBlock = Block.getBlockFromName(block.getBlockType().getId()); + IBlockState newState = mcBlock.getDefaultState(); + @SuppressWarnings("unchecked") + Map, Object> states = block.getStates(); + newState = applyProperties(mcBlock.getBlockState(), newState, states); IBlockState successState = chunk.setBlockState(pos, newState); boolean successful = successState != null; @@ -200,16 +214,39 @@ public class ForgeWorld extends AbstractWorld { return successful; } + // Can't get the "Object" to be right for withProperty w/o this + @SuppressWarnings({ "rawtypes", "unchecked" }) + private IBlockState applyProperties(BlockStateContainer stateContainer, IBlockState newState, Map, Object> states) { + for (Map.Entry, Object> state : states.entrySet()) { + + IProperty property = stateContainer.getProperty(state.getKey().getName()); + Comparable value = (Comparable) state.getValue(); + // we may need to adapt this value, depending on the source prop + if (property instanceof PropertyDirection) { + Direction dir = (Direction) value; + value = ForgeAdapter.adapt(dir); + } else if (property instanceof PropertyEnum) { + String enumName = (String) value; + value = ((PropertyEnum) property).parseValue((String) value).or(() -> { + throw new IllegalStateException("Enum property " + property.getName() + " does not contain " + enumName); + }); + } + + newState = newState.withProperty(property, value); + } + return newState; + } + @Override public int getBlockLightLevel(BlockVector3 position) { checkNotNull(position); - return getWorld().getLight(ForgeAdapter.toBlockPos(position)); + return getWorld().getLight(new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ())); } @Override public boolean clearContainerBlockContents(BlockVector3 position) { checkNotNull(position); - TileEntity tile = getWorld().getTileEntity(ForgeAdapter.toBlockPos(position)); + TileEntity tile = getWorld().getTileEntity(new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ())); if ((tile instanceof IInventory)) { IInventory inv = (IInventory) tile; int size = inv.getSizeInventory(); @@ -356,8 +393,6 @@ public class ForgeWorld extends AbstractWorld { } @Override -<<<<<<< HEAD -======= public void checkLoadedChunk(BlockVector3 pt) { getWorld().getChunkFromBlockCoords(ForgeAdapter.toBlockPos(pt)); } @@ -382,34 +417,74 @@ public class ForgeWorld extends AbstractWorld { } @Override ->>>>>>> 399e0ad5... Refactor vector system to be cleaner public WeatherType getWeather() { - // TODO Weather implementation - return null; + WorldInfo info = getWorld().getWorldInfo(); + if (info.isThundering()) { + return WeatherTypes.THUNDER_STORM; + } + if (info.isRaining()) { + return WeatherTypes.RAIN; + } + return WeatherTypes.CLEAR; } @Override public long getRemainingWeatherDuration() { - return 0; + WorldInfo info = getWorld().getWorldInfo(); + if (info.isThundering()) { + return info.getThunderTime(); + } + if (info.isRaining()) { + return info.getRainTime(); + } + return info.getCleanWeatherTime(); } @Override public void setWeather(WeatherType weatherType) { - + setWeather(weatherType, 0); } @Override public void setWeather(WeatherType weatherType, long duration) { - + WorldInfo info = getWorld().getWorldInfo(); + if (WeatherTypes.THUNDER_STORM.equals(weatherType)) { + info.setCleanWeatherTime(0); + info.setThundering(true); + info.setThunderTime((int) duration); + } else if (WeatherTypes.RAIN.equals(weatherType)) { + info.setCleanWeatherTime(0); + info.setRaining(true); + info.setRainTime((int) duration); + } else if (WeatherTypes.CLEAR.equals(weatherType)) { + info.setRaining(false); + info.setThundering(false); + info.setCleanWeatherTime((int) duration); + } } @Override public BlockState getBlock(BlockVector3 position) { World world = getWorld(); BlockPos pos = new BlockPos(position.getBlockX(), position.getBlockY(), position.getBlockZ()); - IBlockState state = world.getBlockState(pos); + IBlockState mcState = world.getBlockState(pos); - return LegacyMapper.getInstance().getBlockFromLegacy(Block.getIdFromBlock(state.getBlock()), state.getBlock().getMetaFromState(state)); + BlockType blockType = BlockType.REGISTRY.get(Block.REGISTRY.getNameForObject(mcState.getBlock()).toString()); + return blockType.getState(adaptProperties(blockType, mcState.getProperties())); + } + + private Map, Object> adaptProperties(BlockType block, Map, Comparable> mcProps) { + Map, Object> props = new TreeMap<>(Comparator.comparing(Property::getName)); + for (Map.Entry, Comparable> prop : mcProps.entrySet()) { + Object value = prop.getValue(); + if (prop.getKey() instanceof PropertyDirection) { + value = ForgeAdapter.adaptEnumFacing((EnumFacing) value); + } else if (prop.getKey() instanceof PropertyEnum) { + value = ((IStringSerializable) value).getName(); + } + props.put(block.getProperty(prop.getKey().getName()), value); + } + return props; } @Override diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java index bf17292cd..d2198ade9 100644 --- a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/ForgeWorldEdit.java @@ -38,6 +38,7 @@ import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.CommandEvent; @@ -125,12 +126,18 @@ public class ForgeWorldEdit { this.provider = new ForgePermissionsProvider.VanillaPermissionsProvider(platform); } - for (Block block : Block.REGISTRY) { - BlockTypes.register(new BlockType(Block.REGISTRY.getNameForObject(block).toString())); + for (ResourceLocation name : Block.REGISTRY.getKeys()) { + String nameStr = name.toString(); + if (!BlockType.REGISTRY.keySet().contains(nameStr)) { + BlockTypes.register(new BlockType(nameStr)); + } } - for (Item item : Item.REGISTRY) { - ItemTypes.register(new ItemType(Item.REGISTRY.getNameForObject(item).toString())); + for (ResourceLocation name : Item.REGISTRY.getKeys()) { + String nameStr = name.toString(); + if (!ItemType.REGISTRY.keySet().contains(nameStr)) { + ItemTypes.register(new ItemType(nameStr)); + } } } diff --git a/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/IPropertyAdapter.java b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/IPropertyAdapter.java new file mode 100644 index 000000000..0ac900a55 --- /dev/null +++ b/worldedit-forge/src/main/java/com/sk89q/worldedit/forge/IPropertyAdapter.java @@ -0,0 +1,72 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser 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 Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.sk89q.worldedit.forge; + +import static com.google.common.base.Preconditions.checkArgument; + +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableList; +import com.sk89q.worldedit.registry.state.Property; + +import net.minecraft.block.properties.IProperty; + +import java.util.List; + +class IPropertyAdapter> implements Property { + + private final IProperty property; + private final List values; + + public IPropertyAdapter(IProperty property) { + this.property = property; + this.values = ImmutableList.copyOf(property.getAllowedValues()); + } + + @Override + public String getName() { + return property.getName(); + } + + @Override + public List getValues() { + return values; + } + + @Override + public T getValueFor(String string) throws IllegalArgumentException { + Optional val = property.parseValue(string); + checkArgument(val.isPresent(), "%s has no value for %s", getName(), string); + return val.get(); + } + + @Override + public int hashCode() { + return getName().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof Property)) { + return false; + } + return getName().equals(((Property) obj).getName()); + } + +}