summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit
Commit message (Collapse)AuthorAgeLines
* Rework skull dropping. Fixes BUKKIT-2930 and BUKKIT-2820Travis Watkins2012-11-14-9/+1
| | | | | | | | | Skulls need their tile entity in order to create an item correctly when broken unlike every other block. Instead of sprinkling special cases all over the code just override dropNaturally for skulls to read from their tile entity and make sure everything that wants to drop them calls this method before removing the block. There is only one case where this wasn't already true so we end up with much less special casing.
* Fixed some async tasks running synchronously. Fixes BUKKIT-2934Wesley Wolfe2012-11-14-39/+37
| | | | Additionally refactored cancel method to be more object-oriented.
* Update CraftBukkit to Minecraft 1.4.4.Travis Watkins2012-11-13-189/+22
|
* [Bleeding] Fix mistranslation affecting time of the server vs time of day.md_52012-11-02-2/+2
| | | | Fixes BUKKIT-2797
* Fix compile issue with chunk generation.Travis Watkins2012-11-02-0/+2
|
* Delegate recreateStructures to nms provider. Fixes BUKKIT-2760feildmaster2012-11-01-1/+6
| | | | This was a miss when updating to 1.4.2
* Add CraftArt mappings for Wither. Fixes BUKKIT-2667.Wesley Wolfe2012-11-01-7/+7
| | | | | | | | | | | | The static assertions are not normally evaluated in the JVM, and failed to fail when the enums went from size 25 to size 26. This meant missing values would not be detected at runtime and instead return null, compounding problems later. The switches should never evaluate to null so will instead throw runtime assertion errors. Additional unit tests were added to detect new paintings and assure they have proper, unique mappings. The test checks both that a mapping exists, is not null, and does not duplicate another mapping.
* Change ItemFrame to actually provide a defensive copy. Fixes BUKKIT-2784Wesley Wolfe2012-11-01-1/+14
| | | | | | | If a defensive copy is not used in the API, changes to the item are reflected in memory, but never updated to the client. It also goes against the general contract provided in Bukkit, where setItem should be the only way to change the underlying item frame.
* Add inventory and slot types for new containers. Fixes BUKKIT-2741Travis Watkins2012-10-31-0/+22
|
* Implement API for ambient mob spawn limit. Add spawn-limit.ambient toTravis Watkins2012-10-31-0/+21
| | | | bukkit.yml. Adds BUKKIT-2765
* Use BlockCommandSender for dispatching Command block commandsTravis Watkins2012-10-31-0/+42
| | | | Also allow commands that don't start with a / to match vanilla behavior
* Expose API for managing and using GameRules. Adds BUKKIT-2757feildmaster2012-10-31-0/+22
|
* Implement the API for ItemFrames. Adds BUKKIT-2668h31ix2012-10-31-1/+62
|
* Expose API for clearing a player's inventory with a successful countEvilSeph2012-10-30-0/+27
| | | | return. Adds BUKKIT-2745
* Expose API for giving and taking experience levels for use with ExpCommand's ↵EvilSeph2012-10-29-0/+4
| | | | new behaviour with Minecraft 1.4. Adds BUKKIT-2739
* Revert changing EntityType.FIREBALL to LARGE_FIREBALLfeildmaster2012-10-29-1/+1
|
* Get skull data before destroying block. Fixes BUKKIT-2723Travis Watkins2012-10-29-4/+15
| | | | | | | | | Skull blocks store their type in a tile entity and use their block data as rotation. When breaking a block the block data is used for determining what item to drop. Simply changing this to use the skull method for getting their drop data is not enough because their tile entity is already gone. Therefore we have to special case skulls to get the correct data _and_ get that data before breaking the block.
* Add isHardcore API to check if the server is in hardcore mode or not. Adds ↵EvilSeph2012-10-29-0/+4
| | | | BUKKIT-2707
* Add new entities to World.spawn method. Fixes BUKKIT-2658Travis Watkins2012-10-28-3/+19
|
* Remove spawn-radius setting in bukkit.yml in favour of spawn-protection inEvilSeph2012-10-28-1/+10
| | | | server.properties. Fixes BUKKIT-2657
* Update CraftBukkit to Minecraft 1.4(.2).Travis Watkins2012-10-27-92/+362
|
* Implement chat tab completion API. Fixes BUKKIT-2608. Adds BUKKIT-2607.Wesley Wolfe2012-10-17-4/+19
| | | | | The chat tab completion implementation also includes a sanity check to assure type-safety in the list.
* Delegate tab-completion. Fixes BUKKIT-2181. Adds BUKKIT-2602Score_Under2012-10-15-0/+38
| | | | | | CommandMap now contains the functionality for tab completion. This commit replaces the vanilla implementation and simply delegates it to the Bukkit API.
* Queue tasks from secondary threads. Fixes BUKKIT-2546 and BUKKIT-2600Wesley Wolfe2012-10-14-0/+46
| | | | | | | | | | | | | | | | | | | | | This change affects the old chat compatibility layer from an implementation only standpoint. It does not queue the 'event' to fire, but rather queues a runnable that allows the calling thread to wait for execution to finish. The other effect of this change is that rcon connects now have their commands queued to be run on next server tick using the same implementation. The internal implementation is in org.bukkit.craftbukkit.util.Waitable. It is very similar to a Future<T> task, but only contains minimal implementation with object.wait() and object.notify() calls under the hood of waitable.get() and waitable.run(). PlayerPreLoginEvent now properly implements thread-safe event execution by queuing the events similar to chat and rcon. This is still a poor way albeit proper way to implement thread-safety; PlayerPreLoginEvent will stay deprecated.
* Implement new scheduler API. Adds BUKKIT-836Wesley Wolfe2012-10-14-2/+31
| | | | | | The implementation for the new methods mimics the old methods. The final call for the old methods now maps to the new methods with an additional call to get id.
* Ensure entity isn't destroyed when trying to show it. Fixes BUKKIT-2038Travis Watkins2012-10-13-1/+0
| | | | | | | | | If two players (or a player and any other entity) are teleported to the same location in the same tick they will both get added to the other's destroy queue then have a new entity spawn packet sent. Next tick the destroy queue will be processed and they will then be invisible to each other. To prevent this situation we remove the entity from the destroy queue when sending out a spawn packet for them.
* Remove player from destroy queue when they go visible. Fixes BUKKIT-2071Travis Watkins2012-09-28-0/+1
| | | | | | | | | If a plugin calls player.hidePlayer(other); then player.showPlayer(other); in the same tick the other player will be added to the entity destroy queue then a spawn packet will be sent. On the next tick the queue will be processed and a destroy packet will be sent that renders the other player invisible. To correct this we ensure the destroy queue is in sync with use of the vanish API.
* Fix typo causing a task to be repeated in debug. Addresses BUKKIT-2549Wesley Wolfe2012-09-28-1/+1
| | | | | | An internal method for making the debug output for CraftScheduler's async tasks was erroneously using the 'this' reference when the loop should be referencing the current task.
* Map org.bukkit.Sound to String values for sending to client.Wesley Wolfe2012-09-26-2/+143
| | | | | | | This change was done to remove the internal sound names from the API. Along with moving the internal names into CraftBukkit, a unit test was added for any new sounds added in the API to assure they have a non-null mapping.
* Replace LongObjectHashMap with a more efficient implementationTravis Watkins2012-09-21-392/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | After further testing it appears that while the original LongHashtable has issues with object creation churn and is severly slower than even java.util.HashMap in general case benchmarks it is in fact very efficient for our use case. With this in mind I wrote a replacement LongObjectHashMap modeled after LongHashtable. Unlike the original implementation this one does not use Entry objects for storage so does not have the same object creation churn. It also uses a 2D array instead of a 3D one and does not use a cache as benchmarking shows this is more efficient. The "bucket size" was chosen based on benchmarking performance of the HashMap with contents that would be plausible for a 200+ player server. This means it uses a little extra memory for smaller servers but almost always uses less than the normal java.util.HashMap. To make up for the original LongHashtable being a poor choice for generic datasets I added a mixer to the new implementation based on code from MurmurHash. While this has no noticable effect positive or negative with our normal use of chunk coordinates it makes the HashMap perform just as well with nearly any kind of dataset. After these changes ChunkProviderServer.isChunkLoaded() goes from using 20% CPU time while sampling to not even showing up after 45 minutes of sampling due to the CPU usage being too low to be noticed.
* [Bleeding] Add autosave interval setting in bukkit.yml. Adds BUKKIT-2507Mike Primm2012-09-12-0/+2
| | | | | | | | | | | | | | | | | The new setting is located at "ticks-per.autosave". By changing this value, it affects how often a full save is automatically executed, measured in ticks. This value is defaulting to 0 (off) because we believe that the vast majority of servers already have a third-party solution to automatically saving the server at set intervals. Having the built in auto-save disabled by default ensures that we are not saving things twice; doing so leads to absolutely no benefits, but results in detrimental and noticeable unnecessary performance decrease. For servers that do not use an automated external script to perform saves, this setting can be turned on by setting the value higher than 0, with 900 being the value used in vanilla.
* Bulk pending cleanup.Wesley Wolfe2012-09-09-49/+42
|
* Change local jline checks to not use String literals. Fixes BUKKIT-2455.Luke Granger-Brown2012-09-09-2/+11
| | | | | | | | | | | | | | Refactoring dependencies 'changes' the string literal in the code. This commit changes the literal to instead use a char[] to initialize a new String. On a bytecode level, there will not exist a String literal for these two values; the shade plugin will no longer refactor them. Refactoring jline also changes the other String literals we use for notifying jline of the current state. To insure that our local code reflects the inner logic in jline, the key value was changed to the static final variable located in TerminalFactory. Likewise, UnsupportedTerminal uses the explicit class name (as reflection is used later with the value that has been set).
* Add information about async tasks to CrashReports. Addresses BUKKIT-2491Wesley Wolfe2012-09-09-1/+59
| | | | | | | | | | | | Async tasks are notorious for causing CMEs and corrupted data when accessing the API. This change makes a linked list to track recent tasks that may no longer be running. It is accessed via the toString method on the scheduler. This behavior is not guaranteed, but it is accessible as such currently. Although toString is located in the scheduler, its contract does not guarantee an accurate or up to date call when accessed from a second thread.
* Fix crash from console-commands throwing exception. Fixes BUKKIT-2479Wesley Wolfe2012-09-06-1/+6
| | | | | | When 1.3.1 was released, a try-catch block was removed from the tick loop that called the method in NMS to handle commands. This restores a try-catch to prevent the console from crashing the server.
* Fix Future task waiting logic. Fixes BUKKIT-2408Wesley Wolfe2012-08-26-1/+6
| | | | | | | | Previously, the timeout would erroneously get converted to milliseconds twice. The second conversion was removed. Spurious wakeups were not handled properly, and would instead throw a TimeoutException even if the waited time was not reached..
* Rewrite scheduler. Fixes BUKKIT-1831, and BUKKIT-845Wesley Wolfe2012-08-22-618/+533
| | | | | | | | | | | | | | | | | | | | | | | The new scheduler uses a non-blocking methodology. Combining volatile references to make a linked reference chain, with the atomic reference handling the tail, tasks are queued without waiting for locks. The main thread will no longer limit the length of time spend for scheduled tasks, but no task will run twice in the same tick. Scheduling a new task inside of a synchronous task will always run the new task during the same tick, assuming there is no supplied delay > 0. Asynchronous tasks are now run using a thread pool. Any thread-local implemenation should now account for threads being reused between executions. Race conditions were carefully examined and the order of logic is now very important. Each task is placed in a secondary collection before removal from primary collections. Thus, by reading tasks from the collections in the same order they travel, it retains state-safety. This does make modifications less responsive in some situations, as the task may be transitioning before the modifier accesses it. This cost outweighs the requirement to synchronize on the scheduler; previously any conflict would be first-come-first-serve, with the main thread backing out arbitrarily.
* Fix instances where Signs have null lines. Addresses BUKKIT-684V10lator2012-08-21-1/+7
|
* Use standard format function to format logs. Addresses BUKKIT-2246EdGruberman2012-08-21-1/+1
| | | | Also fix "excess" Log Levels.
* Implement API for Sound, and playing the sounds for Worlds and Players. Adds ↵feildmaster2012-08-21-0/+22
| | | | BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019
* Use a dynamic pool size for the iterator cacheTravis Watkins2012-08-20-21/+35
| | | | | | | | Many codepaths only end up with one iterator being used at a time and most of the rest only get up to two being used so using a static pool of three is wasteful. This also allows us to efficiently handle cases that exceed 3 iterators in use. Overall this dramatically increases the hit rate and results in less iterators being created.
* Implement API to retrieve and open EnderChests. Adds BUKKIT-2016feildmaster2012-08-20-0/+7
|
* [Bleeding] Remove redundant chunkList from ChunkProviderServerMike Primm2012-08-19-2/+2
| | | | | | This ArrayList duplicates part of the functionality of the much more efficient chunk map so can be removed as the map can be used in the few places this was needed.
* Add LongObjectHashMap and LongHashSetTravis Watkins2012-08-19-357/+839
| | | | | | | | | | | | | | | Replace uses of LongHashtable and LongHashset with new implementations. Remove EntryBase, LongBaseHashtable, LongHashset, and LongHashtable as they are no longer used. LongObjectHashMap does not use Entry or EntryBase classes internally for storage so has much lower object churn and greater performance. LongHashSet is not as much of performance win for our use case but for general use is up to seventeen times faster than the old implementation and is in fact faster than alternatives from "high performance" java libraries. This is being added so that if someone tries to use it in the future in a place unrelated to its current use they don't accidentally end up with something slower than the Java collections HashSet implementation.
* Add iterator cache to UnsafeList and use it in hotspotsTravis Watkins2012-08-19-14/+109
| | | | | Adds a specialized iterator for the list and a pool of iterators to avoid object churn. Also optimizes the clear() method to reduce object creation.
* Fix issues with chunk saving. Fixes BUKKIT-2158, BUKKIT-2018 and BUKKIT-2229Mike Primm2012-08-19-18/+5
|
* Add more detailed CrashReport for CraftBukkit. Addresses BUKKIT-2319Wesley Wolfe2012-08-17-0/+41
|
* Use correct SlotType's for merchants. Fixes BUKKIT-2257feildmaster2012-08-15-0/+7
|
* Implement methods for spawning FallingBlocks and add various FallingBlock ↵feildmaster2012-08-14-4/+49
| | | | methods. Adds BUKKIT-2282
* Update CreatureSpawner.setSpawnedType(EntityType) to 1.3feildmaster2012-08-12-4/+5
| | | | They can spawn any valid entities now. What is a "valid" entity? A "valid" entity is an EntityType with a non-null getName(). (for example: PRIMED_TNT, FALLING_BLOCK)