Commit graph

999 commits

Author SHA1 Message Date
CraftBukkit/Spigot
b2439099d0 Updated version to 1.3.2-R3.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-10-27 21:10:46 -04:00
CraftBukkit/Spigot
d451e774c8 Updated version to 1.3.2-R2.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-10-17 07:36:44 -04:00
CraftBukkit/Spigot
60dfb3206a Updated version to 1.3.2-R2.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-10-17 07:30:23 -04:00
CraftBukkit/Spigot
246fa5b12f Implement chat tab completion API. Fixes BUKKIT-2608. Adds BUKKIT-2607.
The chat tab completion implementation also includes a sanity check to
assure type-safety in the list.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-17 04:31:36 -05:00
CraftBukkit/Spigot
bb2c1736c3 Delegate tab-completion. Fixes BUKKIT-2181. Adds BUKKIT-2602
CommandMap now contains the functionality for tab completion. This
commit replaces the vanilla implementation and simply delegates it to
the Bukkit API.

By: Score_Under <seejay.11@gmail.com>
2012-10-09 19:44:04 +01:00
CraftBukkit/Spigot
730e3ceb1b Queue tasks from secondary threads. Fixes BUKKIT-2546 and BUKKIT-2600
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-07 15:08:21 -05:00
CraftBukkit/Spigot
dd1816bda4 Implement new scheduler API. Adds BUKKIT-836
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-10-06 16:23:56 -05:00
CraftBukkit/Spigot
e29c5d9725 Ensure entity isn't destroyed when trying to show it. Fixes BUKKIT-2038
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-10-13 15:27:45 -05:00
CraftBukkit/Spigot
515032c89a Updated version to 1.3.2-R1.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-09-28 16:34:17 -04:00
CraftBukkit/Spigot
15b7c17284 Updated version to 1.3.2-R1.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-09-28 16:31:23 -04:00
CraftBukkit/Spigot
980784204e Remove player from destroy queue when they go visible. Fixes BUKKIT-2071
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-09-28 14:53:28 -05:00
CraftBukkit/Spigot
0d3ff61b07 Fix typo causing a task to be repeated in debug. Addresses BUKKIT-2549
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-28 02:39:22 -05:00
CraftBukkit/Spigot
64da1ccd5c Updated version to 1.3.2-R0.3-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-09-26 19:20:20 -04:00
CraftBukkit/Spigot
59300b50a1 Updated version to 1.3.2-R0.2 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-09-26 19:16:20 -04:00
CraftBukkit/Spigot
f57bc0f77f Map org.bukkit.Sound to String values for sending to client.
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-26 16:34:06 -05:00
CraftBukkit/Spigot
4277872612 Replace LongObjectHashMap with a more efficient implementation
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-09-11 05:51:09 -05:00
CraftBukkit/Spigot
42dfd206a6 [Bleeding] Add autosave interval setting in bukkit.yml. Adds BUKKIT-2507
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.

By: Mike Primm <mike@primmhome.com>
2012-08-18 17:36:39 -05:00
CraftBukkit/Spigot
2a57bac117 Bulk pending cleanup.
By: Wesley Wolfe <weswolf@aol.com>
2012-09-09 23:19:28 -05:00
CraftBukkit/Spigot
bc59fff79a Change local jline checks to not use String literals. Fixes BUKKIT-2455.
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).

By: Luke Granger-Brown <git@lukegb.com>
2012-09-02 00:56:13 +01:00
CraftBukkit/Spigot
c650c443b3 Add information about async tasks to CrashReports. Addresses BUKKIT-2491
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-09 00:34:41 -05:00
CraftBukkit/Spigot
66380e6d14 Fix crash from console-commands throwing exception. Fixes BUKKIT-2479
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-09-06 22:11:17 -05:00
CraftBukkit/Spigot
e719bbd88c Fix Future task waiting logic. Fixes BUKKIT-2408
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..

By: Wesley Wolfe <weswolf@aol.com>
2012-08-26 10:25:11 -05:00
CraftBukkit/Spigot
2ff57fb6b9 Updated version to 1.3.2-R0.2-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-08-25 04:02:20 -04:00
CraftBukkit/Spigot
e48ae897a2 Updated version to 1.3.2-R0.1 in pom.xml for Beta.
By: EvilSeph <evilseph@gmail.com>
2012-08-25 00:55:38 -04:00
CraftBukkit/Spigot
c535d5adc6 Update to 1.3.2
By: Travis Watkins <amaranth@ubuntu.com>
2012-08-24 19:51:51 -05:00
CraftBukkit/Spigot
1a7e5e4725 Don't refactor packages with natives
By: feildmaster <admin@feildmaster.com>
2012-08-22 18:32:48 -05:00
CraftBukkit/Spigot
f190bf3da3 Refactor CraftBukkit dependencies. Fixes BUKKIT-2329
The maven shade plugin has the ability to change the namespace for
included dependencies and packages. This change is being implemented to
remove all conflicts with any possible libraries in an execution
environment.

The only dependencies to be refactored are specific to CraftBukkit. To
refactor dependencies included with Bukkit breaks any plugin compiled
against those specific dependencies, especially ebeans--an API
specifically encouraged for database management.

By: Wesley Wolfe <weswolf@aol.com>
2012-08-19 15:42:54 -05:00
CraftBukkit/Spigot
b1d40801aa Rewrite scheduler. Fixes BUKKIT-1831, and BUKKIT-845
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.

By: Wesley Wolfe <weswolf@aol.com>
2012-08-14 06:09:51 -05:00
CraftBukkit/Spigot
757465f533 Fix instances where Signs have null lines. Addresses BUKKIT-684
By: V10lator <v10lator@myway.de>
2012-08-18 14:50:09 +02:00
CraftBukkit/Spigot
9c8b353591 Use standard format function to format logs. Addresses BUKKIT-2246
Also fix "excess" Log Levels.

By: EdGruberman <ed@rjump.com>
2012-08-11 16:29:50 -07:00
CraftBukkit/Spigot
ae2357b96e Implement API for Sound, and playing the sounds for Worlds and Players. Adds BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019
By: feildmaster <admin@feildmaster.com>
2012-08-21 17:23:17 -05:00
CraftBukkit/Spigot
c144b2459c Use a dynamic pool size for the iterator cache
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-08-19 19:59:58 -05:00
CraftBukkit/Spigot
7a4660c49e Implement API to retrieve and open EnderChests. Adds BUKKIT-2016
By: feildmaster <admin@feildmaster.com>
2012-08-20 15:52:44 -05:00
CraftBukkit/Spigot
4ada047593 [Bleeding] Remove redundant chunkList from ChunkProviderServer
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.

By: Mike Primm <mike@primmhome.com>
2012-08-11 17:34:22 -05:00
CraftBukkit/Spigot
327e789c7f Add LongObjectHashMap and LongHashSet
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-08-17 18:53:59 -05:00
CraftBukkit/Spigot
9c569d394d Add iterator cache to UnsafeList and use it in hotspots
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.

By: Travis Watkins <amaranth@ubuntu.com>
2012-08-17 12:55:33 -05:00
CraftBukkit/Spigot
f694f8215b Updated version to 1.3.1-R2.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-08-19 09:01:23 -04:00
CraftBukkit/Spigot
61e4d2c4ad Updated version to 1.3.1-R2.0 in pom.xml for RB.
By: EvilSeph <evilseph@gmail.com>
2012-08-19 08:47:47 -04:00
CraftBukkit/Spigot
4c88eae55b Fix issues with chunk saving. Fixes BUKKIT-2158, BUKKIT-2018 and BUKKIT-2229
By: Mike Primm <mike@primmhome.com>
2012-08-12 18:40:49 -05:00
CraftBukkit/Spigot
84483a55f2 Add more detailed CrashReport for CraftBukkit. Addresses BUKKIT-2319
By: Wesley Wolfe <weswolf@aol.com>
2012-08-17 23:11:26 -05:00
CraftBukkit/Spigot
c0ce2ea3a1 Use correct SlotType's for merchants. Fixes BUKKIT-2257
By: feildmaster <admin@feildmaster.com>
2012-08-14 18:28:00 -05:00
CraftBukkit/Spigot
73cf129db7 Implement methods for spawning FallingBlocks and add various FallingBlock methods. Adds BUKKIT-2282
By: feildmaster <admin@feildmaster.com>
2012-08-13 22:21:10 -05:00
CraftBukkit/Spigot
cc018c2203 Update CreatureSpawner.setSpawnedType(EntityType) to 1.3
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)

By: feildmaster <admin@feildmaster.com>
2012-08-12 14:02:57 -05:00
CraftBukkit/Spigot
939c2c8477 Implement player speed API. Addresses BUKKIT-2205
By: Wesley Wolfe <weswolf@aol.com>
2012-08-10 00:00:04 -05:00
CraftBukkit/Spigot
7c3b98a7f9 Updated version to 1.3.1-R1.1-SNAPSHOT for development towards next release.
By: EvilSeph <evilseph@gmail.com>
2012-08-07 17:10:11 -04:00
CraftBukkit/Spigot
1fc2417f5d Updated version to 1.3.1-R1.0 in pom.xml for RB
By: EvilSeph <evilseph@gmail.com>
2012-08-07 02:31:21 -04:00
CraftBukkit/Spigot
24abca3c43 Implement new deprecated warning state configuration option
By: Wesley Wolfe <weswolf@aol.com>
2012-08-06 23:52:49 -05:00
CraftBukkit/Spigot
bf9001a3d3 Put forceChunkLoad back to its original value.
By: Travis Watkins <amaranth@ubuntu.com>
2012-08-05 20:03:12 -05:00
CraftBukkit/Spigot
7383d52df7 Implement new AsyncPlayerChatEvent. Addresses BUKKIT-2064
Added two utility collections for use with PlayerChatEvents allowing lazier
initialization of events and less need to synchronize against the player
list.

Provided a hidden queue system for similar logic to pre-1.3 chat. When a
plugin is listening for the deprecated PlayerChatEvent, all chat will be
delayed to be mirror executed from the main thread. All developers are
encouraged to immediately update to the developmental Bukkit chat API as a
minimum transition for server stability.

Additionally, changes were required to bring thread-safety to the flow
logic. CopyOnWriteArrayList is the only viable means to produce thread
safety with minimal diff; using a sane pre-implemented collection would
require reworking of sections of NMS logic.

As a minor change, implemented expected functionality for
PlayerCommandPreProcessEvent. Setting the player should now change the
player executing the command.

By: Wesley Wolfe <weswolf@aol.com>
2012-08-03 06:24:55 -05:00
CraftBukkit/Spigot
a1a672d052 Fix mapping of ChunkSection nibble data to snapshot. Fixes BUKKIT-1977
By: Mike Primm <mike@primmhome.com>
2012-08-02 11:21:40 -05:00