Commit Graph
99 Commits
Author SHA1 Message Date
TomyLobo 0ca66ce350 Moved check for fastLightingAvailable from BukkitWorld.fixAfterFastMode to fixLighting and adjusted the description for //generate. 2011-10-26 23:24:23 +02:00
TomyLobo 906b6dd832 Forgot to save... 2011-10-25 23:26:25 +02:00
TomyLoboandTomyLobo 9fa5c4030b Added a //g[en[erate]] command, which generates a shape according to a mathematical formula.
(result > 0) = true = inside
(result <= 0) = false = outside.
2011-10-25 18:46:14 +02:00
TomyLoboandTomyLobo d4c2832437 Added an ArbitraryShape class which can be used to generate hollow and solid shapes based on an in/out condition. 2011-10-25 18:46:12 +02:00
TomyLobo c2191f4fc7 Generalized the Lexer a bit more and renamed a function in the parser. 2011-10-25 18:45:52 +02:00
TomyLobo 7dfc2a34e5 Improved fast mode.
BukkitWorld's fast lighting mode now also does what the old fast mode did.
In addition, both fast lighting mode and the fallback resend all modified chunks when done.
This should prevent display issues.
2011-10-25 18:41:07 +02:00
TomyLobo 3ed867ed53 Added left, right, back and forward directions to all directional commands. 2011-10-25 01:07:08 +02:00
TomyLobo 2d654b59c5 Reduced code duplication in the WorldEdit.get*Direction methods. 2011-10-25 01:06:18 +02:00
TomyLobo 3962e6c9d8 Added LocalPlayer.getCardinalDirection(int yawOffset) 2011-10-25 01:02:50 +02:00
TomyLobo a1fb1fd4e4 Using Notch's block lighting functions now.
Also removed some debug messages
2011-10-24 23:42:04 +02:00
TomyLobo a0461aeb2c BukkitWorld.fixLighting now also fixes block light. 2011-10-24 20:49:17 +02:00
TomyLobo b31d77536a Added some new functions to BlockType.
- emitsLight which returns whether the given block type emits light
- isTranslucent, which returns whether the block lets any light pass
2011-10-24 20:49:17 +02:00
TomyLobo a97a427127 Updated changelog with some more changes since 4.7. 2011-10-24 14:03:07 +02:00
TomyLoboandTomyLobo 4f7e1a6b31 Improved speed greatly by deferring lighting until after all blocks are in place.
This needs CraftBukkit to work.
2011-10-24 13:44:22 +02:00
TomyLoboandTomyLobo e8dcee1acf Added LocalWorld.fixLighting(Set<BlockVector2D>)
This method redos lighting in the given chunks.
BukkitWorld's current implementation introduces some slight errors and doesn't redo torch light, but it's better than nothing.
2011-10-24 13:35:48 +02:00
TomyLoboandTomyLobo ef88c04550 Gave //fast an on|off parameter and adjusted its message to reflect a future change. 2011-10-24 04:33:19 +02:00
TomyLobo 542aed6ffd Fixed warnings. 2011-10-24 04:32:02 +02:00
TomyLobo ffe5f89afc EditSession.flushQueue(): queueLast is now ordered with attachments in mind. 2011-10-24 04:31:34 +02:00
TomyLobo d93d85cd37 Added an expression parser. 2011-10-18 01:04:04 +02:00
TomyLobo 99002c786b Updated changelog with the changes since 4.7. 2011-10-17 17:04:21 +02:00
TomyLobo e2c71e4269 Added cactus to getAttachment. 2011-09-30 08:56:09 +02:00
TomyLobo 7fec065d4a Apparently the wiki has wrong data values for the stone button.
Also added top attachment for vines.
2011-09-29 21:11:51 +02:00
TomyLobo 69367e7762 Added BlockType.getAttachment.
See javadoc for details.
2011-09-29 15:54:28 +02:00
TomyLobo f354ab392f Refactored BlockData test case to reduce code duplication. 2011-09-29 08:19:02 +02:00
TomyLobo cbc331da7d Added some constants com.sk89q.worldedit.blocks.ClothColor.ID.X = ClothColor.X.getID() 2011-09-28 10:57:30 +02:00
TomyLobo 21c6ab894c Moved BlockData to the blocks package and left a stub with deprecated delegates behind. 2011-09-28 10:45:32 +02:00
TomyLobo accd841b51 Fixed a few warnings 2011-09-28 08:05:50 +02:00
TomyLobo c6c55c3b2a Adjusted some of the cycler code and added a test case for it.
- Added range checks for most blocks
- torches: Fixed cycle from 0->1->2->3->0 to 1->2->3->4->1
- mushroom caps: Included data value 10 (stem) in cycle
- vines: Included data value 0 (top attachment only) in the cycle
- furnaces/dispensers: Linearised the cycle. It's now 2->3->4->5->2
- chests/ladders: Added cycle code.
- rails: Linearised the cycle. It's now 6->7->8->9->6
2011-09-25 10:52:29 +02:00
TomyLobo 93f36955ca Added a test case for BlockData.
Fixed some non-breaking inaccuracies to make the test case work.
2011-09-25 06:08:31 +02:00
TomyLobo 63fa72af5e Added rotate code for brick and stone brick stairs and made powered/detector rails not lose their charge when rotating. 2011-09-25 06:01:01 +02:00
TomyLobo b06caa9fd3 Cleanup 2011-09-25 05:15:20 +02:00
TomyLobo 50009cc855 Improved hashCode implementations for the Vector classes.
Block[World]Vector was ignoring changes of y < 128 (i.e. all of them) and changes of x < 8192.
2011-09-25 04:56:54 +02:00
TomyLobo 7c18327fdc Fixed extended piston rotation. 2011-09-24 11:20:37 +02:00
TomyLobo bfc877cdb2 Added rotate code for vines, fence gates and mushroom caps. 2011-09-23 16:32:50 +02:00
TomyLobo a3cd58fda1 Added flip code for vines, fence gates and mushroom caps. 2011-09-23 14:00:49 +02:00
TomyLobo 4b760fd17b Swapped flipY and flipZ in BlockData.flip and formatted the function more consistently. 2011-09-23 12:50:57 +02:00
TomyLobo fa82482823 Added a new test for get[Padded]Slice and renamed testHangingQuote to testUnmatchedQuote. 2011-09-20 03:41:07 +02:00
TomyLobo 67918f171b Internal restructuring of CommandContext
- getJoinedStrings(n) will now return literally everything after the first space following the (n-1)th argument. Mixing flags in after that is undefined
- What was in args before is now a List named parsedArgs, which also no longer contains the command, which was split off into a separate field.
- get[Padded]Slice now operates on the unparsed args with flags and all, allowing whoever uses it (script commands) to obtain a more low-level input.
- Added a test for the exactness of getJoinedStrings and adjusted an existing test to the new old behaviour.
2011-09-20 03:25:35 +02:00
TomyLobo 2d86b1b40d Fixed and cleaned up CommandContext.
- Removed all the inefficient removePortionOfArray stuff and replaced it by ArrayLists that accumulate content instead.
- Added new tests
- Swapped the arguments to assertEquals everywhere. First argument is "expected".
- Fixed warnings in the test case
- I put my original flag parser back and added support for putting flags anywhere. Looks and works better than that undocumented mindfuck zml put there.
2011-09-19 23:14:49 +02:00
TomyLobo c78e8a10d7 Made shouldNotStack use a HashSet instead of a bunch of or'ed comparisons. 2011-09-19 09:13:51 +02:00
TomyLobo a4618fa3c0 It just a test case but meh... 2011-09-19 09:08:10 +02:00
TomyLobo c1f1e29617 Replace ItemType.X.getID() with ItemID.X everywhere. 2011-09-19 08:38:30 +02:00
TomyLobo 16a4e5ccb3 Added/fixed some copyright notices. 2011-09-19 08:24:21 +02:00
TomyLobo 088001f099 Used ItemID in ItemType 2011-09-19 08:08:05 +02:00
TomyLobo 51d4b572cb De-craftbooked some copyright notices. 2011-09-19 07:43:49 +02:00
TomyLobo 5b5c25f1ae Added an ItemID class, containing all the item IDs. 2011-09-19 07:39:28 +02:00
TomyLobo 88b4f4de18 Cleanup.
- Fixed a few warnings
- Unified the formatting of the command prologue
- Put down why it was deprecated in the javadoc of a deprecated method.
- Gave //none a better usage line
- Switchcaseified some elseifs
2011-09-19 07:24:49 +02:00
TomyLobo d6ed17dd9d Made some variables final. 2011-09-16 05:48:09 +02:00
TomyLobo 633145d796 Adjusted some BlockType flags.
Beds, glass panes and fence gates should no longer be placed last
Fence gates can no longer be passed through, since they can't, if they're closed.
2011-09-16 05:46:07 +02:00
TomyLobo 7798319896 Optimized all of the public static boolean BlockType.*(int id) functions by using HashSets and put the blockDrops HashMap next to the getDroppedBlock function. 2011-09-16 05:02:39 +02:00
TomyLobo f0308efdd0 Made the static initializer for BlockType.blockDrops refer to the BlockID constants instead of having the literal IDs. 2011-09-16 03:32:58 +02:00
TomyLobo 19eedecdaf Re-re-introduced a small optimization in the flag parser. 2011-09-16 02:16:11 +02:00
TomyLobo 6cdfd86f0b CommandContext:
- Adjusted comment of CommandContext(String[] args, Set<Character> valueFlags) to reflect the actual semantics
- Optimized several parts of the parser (still not happy with the frequent reallocations inside removePortionOfArray)
- Someone (unintentionally?) forgot to break if a non-flag argument was found. If this was indeed intended behaviour, just change the "break;" in line 83 to "continue;".
- Reduced the number of nested control structures a bit.
2011-09-14 18:56:42 +02:00
TomyLobo cb927d17e1 Fixed a warning. 2011-09-14 18:33:07 +02:00
TomyLobo 3bcd9a932b Replaced lots of else if constructs by switch/case and other simpler constructs. 2011-09-05 04:20:36 +02:00
TomyLobo 9ea977af77 Fixed some warnings. 2011-09-04 23:20:03 +02:00
TomyLobo bb2f8bb350 Cleaned up WorldEdit.getFlipDirection. 2011-09-04 23:18:37 +02:00
TomyLobo 8c0d0f9ed4 //[h]sphere can now generate ellipsoid (stretched sphere) shapes 2011-09-03 18:59:18 +02:00
TomyLobo 780d07a9ba Fixed a warning. Seriously, guys... 2011-09-02 21:32:23 +02:00
TomyLobo 3205904003 //copy and //paste now respect /toggleplace. 2011-09-02 21:03:22 +02:00
TomyLobo d64fd95173 Added support for value flags to the command system 2011-08-29 14:46:36 +02:00
TomyLobo b8a310dfdc Changed data type of BaseBlock.data from char to byte 2011-08-29 14:46:35 +02:00
TomyLobo 4dcbae03fe Made some variables in CuboidClipboard.flip final 2011-08-28 12:28:31 +02:00
TomyLobo 447de4b206 - CommandContext's valueFlag constructor will now ignore the 0th element of args (no idea why that is even there)
- Limited flags to a-zA-Z
- Passing null to the valueFlag constructor will disable flag parsing altogether
- Adjusted the error message
- Added javadoc to CommandContext(String[], Set<Character>)
- Added CommandContext(String, Set<Character>)
2011-08-27 16:12:49 +02:00
TomyLobo 799b84622f Added support for value flags to CommandContext. 2011-08-26 18:40:51 +02:00
TomyLobo 8ac8cb77a5 Cleaned up bukkit event registration a bit and fixed 2 warnings. 2011-08-26 18:40:21 +02:00
TomyLobo 3f58187790 Fixed sign post flipping 2011-08-26 16:48:31 +02:00
TomyLobo c6843a2c6d When flipping a door upside-down, the top and bottom parts are now swapped. 2011-08-26 14:08:02 +02:00
TomyLobo c8bbcbd133 Fixed flipping of the central blocks in a clipboard with odd length. 2011-08-26 14:04:38 +02:00
TomyLobo 8e84e7ae18 - Added proper block flipping code for all blocks with proper rotation code except sign posts
- Fixed block rotation code for some blocks and cleaned it up a lot
- Added block rotation code for powered rails and detector rails
- //flip now flips all blocks, not just half of them
2011-08-26 13:14:39 +02:00
TomyLobo 2281684f20 - Added a -p flag to //flip that makes it flip around the player instead of the center of the clipboard.
- Code cleanup
2011-08-26 05:04:07 +02:00
TomyLobo 9de9004834 - Moved Bukkit event registration from WorldEditPlugin into the respective listeners.
- Changed registerEvent to the string-based system WorldGuard has, which should improve compatibility with differing Bukkit versions.
2011-08-21 23:05:03 +02:00
TomyLobo d12bff993b Added //-prefixed aliases for most /-prefixed commands 2011-08-21 22:35:27 +02:00
TomyLobo e09a66d859 Gave /green a larger "ignored blocks" set. 2011-08-20 15:51:25 +02:00
TomyLobo 2893438f8e /green now fails a bit less. 2011-08-20 15:18:17 +02:00
TomyLobo 93620ec168 The /green command should now only affect dirt on the top layer. 2011-08-17 13:19:35 +02:00
TomyLobo 151b4c0fa1 Added a /green command, which greens the surrounding landscape. 2011-08-16 18:43:13 +02:00
TomyLobo 6c5d1236c7 Fixed non-integer radius support for /thaw and /snow. 2011-08-16 18:42:29 +02:00
TomyLobo ea445ebcf5 Added a -s flag to //chunk, which extends your current selection to the encompassed chunks. 2011-08-16 10:10:23 +02:00
TomyLobo c79d90bb99 Added support for non-integer radius to //fill, //fillr, //drain, //fixlava, //fixwater, //snow and //thaw. 2011-08-15 14:35:21 +02:00
TomyLobo a57830706e Added support for non-integer radius to //superpickaxe recursive and improved performance a bit by making the recurse method static. 2011-08-15 14:22:35 +02:00
TomyLobo e67ea1e769 Commands that consider the player's look direction now also use up/down when the player's pitch is outside the [-67.5;67.5] interval. 2011-08-15 14:09:19 +02:00
TomyLobo af2429467d Optimized //(h)sphere a bit and made the shell for //hsphere as thin as possible. 2011-08-12 08:20:40 +02:00
TomyLobo b74670fda6 Fixed a warning 2011-08-12 08:20:40 +02:00
TomyLobo 5e45fd1625 Disabling global masks while regnerating because they only affect the area outside the selection. 2011-08-10 04:16:54 +02:00
TomyLobo 2af31fe231 Added position logging to /up, /ceil, position+orientation+region logging for the script commands and changed the logging for //move and //stack to orientation+region 2011-08-09 01:23:16 +02:00
TomyLobo d30cad6340 Added ORIENTATION_REGION and ALL LogModes, which log orientation+region and position+orientation+region respectively. 2011-08-09 01:23:08 +02:00
TomyLobo e320d34b32 Added an optional on/off argument to the toggle pickaxe command. 2011-08-09 00:19:58 +02:00
TomyLobo cc917b424c Added position/region logging. 2011-08-08 14:40:02 +02:00
TomyLobo 6f79df8398 Added to toString() method to CuboidRegion. 2011-08-08 14:39:16 +02:00
TomyLobo 2c155c241b Added an invokeMethod hook to CommandsManager, that wraps method invocation and can be overridden 2011-08-08 14:06:28 +02:00
TomyLobo 96eb94155c Fixed the desciption of the //outline (//faces) command. 2011-08-08 09:20:55 +02:00
TomyLobo 7a3ddfe7bc Fixed //flip sometimes throwing errors about unknown directions. 2011-08-08 09:19:24 +02:00
TomyLobo 8d688165ee Fixed exceptions in //brush since build #115. 2011-08-08 02:23:42 +02:00
TomyLobo 0040ba9867 Added support for non-integer radius to the sphere, cylinder, smooth and extinguish brushes. 2011-08-07 05:24:20 +02:00
TomyLobo 57b5c5b546 Added support for non-integer radius to //cyl, //hcyl, //sphere and //hsphere 2011-08-07 05:24:19 +02:00
TomyLobo 9d98ca3db8 Added library support for non-integer radius spheres and cylinders. 2011-08-07 05:19:17 +02:00
TomyLobo a527b59770 Fixed more warnings. 2011-08-07 02:53:48 +02:00
TomyLobo 79f8a032f3 Fixed warnings. 2011-08-07 02:34:30 +02:00