Commit Graph

1995 Commits

Author SHA1 Message Date
Wesley Wolfe
dcd01bf0c0 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.
2012-08-22 16:41:46 -05:00
feildmaster
8fdb006143 Use constant Player for EnderPearls
Also make sure players are online before proceeding to each event
2012-08-22 14:32:10 -05:00
feildmaster
98c98d0f7a Fix entities not having valid "isValid" states. Addresses BUKKIT-2366 2012-08-22 14:16:51 -05:00
V10lator
e3ae188ed2 Fix instances where Signs have null lines. Addresses BUKKIT-684 2012-08-21 20:17:29 -05:00
EdGruberman
450edc3004 Use standard format function to format logs. Addresses BUKKIT-2246
Also fix "excess" Log Levels.
2012-08-21 19:17:29 -05:00
feildmaster
161ab5edc6 Implement API for Sound, and playing the sounds for Worlds and Players. Adds BUKKIT-1430, BUKKIT-1226 and BUKKIT-2019 2012-08-21 19:13:19 -05:00
Travis Watkins
ccc760d629 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.
2012-08-20 18:44:07 -05:00
feildmaster
e7e643d83a Implement API to retrieve and open EnderChests. Adds BUKKIT-2016 2012-08-20 16:00:53 -05:00
Travis Watkins
feb0327d22 Check unload queue so we don't accidentally leave a chunk loaded 2012-08-19 16:06:14 -05:00
Mike Primm
7dde6cc566 [Bleeding] Stub out MethodProfiler class
Instead of trying to track down every place this class is used we can
simply stub out the entire class so it has no extra overhead.
2012-08-19 09:51:09 -05:00
Mike Primm
e079d9457e [Bleeding] Strip out unused HashSet in IntHashMap 2012-08-19 09:51:07 -05:00
Mike Primm
eaa3154b0e [Bleeding] Cache packet ID instead of doing lookups each time it is needed 2012-08-19 09:51:04 -05:00
Mike Primm
627cf2ef8b [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.
2012-08-19 09:51:00 -05:00
Travis Watkins
97ac0a3f14 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.
2012-08-19 09:51:00 -05:00
Travis Watkins
7b20caf8fe Use TrigMath in hotspots
Use our implementation of atan2 in AI routines as profiling shows these are
hotspots and (for these cases) our implementation is much faster.
2012-08-19 09:51:00 -05:00
Mike Primm
8219081385 [Bleeding] Change Vec3DPool to a stack based pool
Avoid overhead of using an ArrayList and resizing it. Also allows for reuse
of objects in the pool during the same tick by explicitly releasing them
back to the pool. This allows for much better cache performance as well
as reduced cache footprint.
2012-08-19 09:50:57 -05:00
Travis Watkins
d628c886d2 Optimize entity AI goal selector
Remove redundant ArrayList to avoid excessive object creation and CPU
overhead, the entries are added to the list then immediately iterated through
to run so just run them directly.

Swap order of some conditionals to perform the more efficient check first
as if it fails the list lookup will not be executed.

Remove profiling hooks including some rather expensive calls to getSimpleName.
2012-08-19 09:50:57 -05:00
Travis Watkins
858d36efc9 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.
2012-08-19 09:50:57 -05:00
Mike Primm
6d777ade16 [Bleeding] Optimize chunk loading
ChunkSection.e() is called once per chunk section loaded and is quite
expensive (about 20% of CPU time for loading the chunk). This changes the
logic to add a fast path when extended block data is not being used and
reorganizes the loops for more optimal array traversal. Overall this saves
about 20-30% CPU time in this method.
2012-08-19 09:50:45 -05:00
Mike Primm
852602e430 Add files from mc-dev for diff visibility 2012-08-19 09:19:28 -05:00
EvilSeph
b44fc8ed28 Updated version to 1.3.1-R2.1-SNAPSHOT for development towards next release. 2012-08-19 09:01:23 -04:00
EvilSeph
29ca5d1f50 Updated version to 1.3.1-R2.0 in pom.xml for RB. 2012-08-19 08:47:47 -04:00
Mike Primm
5254993510 Fix issues with chunk saving. Fixes BUKKIT-2158, BUKKIT-2018 and BUKKIT-2229 2012-08-19 08:36:47 -04:00
Wesley Wolfe
cacfc71b46 Add more detailed CrashReport for CraftBukkit. Addresses BUKKIT-2319 2012-08-17 23:18:22 -05:00
Wesley Wolfe
acedd049c5 Add CrashReport for diff visiblity 2012-08-17 22:22:20 -05:00
John Driscoll
0bde47a173 Don't extend pistons until data is set. Fixes BUKKIT-2153 2012-08-17 17:06:46 -05:00
Wesley Wolfe
050a9276bc Removed unneeded mc-dev imports. Fixes BUKKIT-682 2012-08-17 16:37:53 -05:00
Travis Watkins
add387dee3 Call PlayerQuitEvent in correct location. Fixes BUKKIT-2193 2012-08-15 12:22:52 -05:00
feildmaster
fc35d000e4 Use correct SlotType's for merchants. Fixes BUKKIT-2257 2012-08-15 06:00:55 -05:00
feildmaster
b059962a5c Implement methods for spawning FallingBlocks and add various FallingBlock methods. Adds BUKKIT-2282 2012-08-14 07:38:23 -05:00
feildmaster
8748c8c757 Enable hardcore support. Fixes BUKKIT-2259
- Hardcore requires a newly generated world
- You will be banned if you die in a hardcore world
- You will NOT be banned if you die in a non-vanilla world
- Your "heart container" will not change without logging back in. (Vanilla bug)
2012-08-12 16:50:00 -05:00
feildmaster
aa92f0e313 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)
2012-08-12 14:11:36 -05:00
feildmaster
bfc5189818 Fix "block update packet" not being sent to the correct world. Fixes BUKKIT-2023 2012-08-12 14:11:34 -05:00
Wesley Wolfe
342f9c3bd3 Implement player speed API. Addresses BUKKIT-2205 2012-08-10 00:00:04 -05:00
Wesley Wolfe
77cda7e715 Add PlayerAbilities for diff visibility 2012-08-09 23:16:19 -05:00
feildmaster
27c1c85adb Implement BlockBreakEvent block experience. Adds BUKKIT-2033 2012-08-08 19:49:10 -05:00
feildmaster
8d946b88b3 Add BlockMobSpawner and BlockOre for diff visibility 2012-08-08 19:49:08 -05:00
Wesley Wolfe
a16e0b6323 Change socket traffic class try-catch. Fixes BUKKIT-2093 2012-08-08 07:00:41 -05:00
Wesley Wolfe
25fe93479f Restore port to the hostname. Fixes BUKKIT-2124 2012-08-08 07:00:29 -05:00
EvilSeph
24809ef986 Re-add support for full chunk saving so the server save-alls on stop. Fixes BUKKIT-2158 2012-08-08 03:08:46 -04:00
EvilSeph
a133bc7182 Make periodic chunk saving less aggressive and fixed double player data saving. Fixes BUKKIT-1994 and fixes BUKKIT-2144 2012-08-07 18:52:53 -04:00
EvilSeph
05b5a068cb Updated version to 1.3.1-R1.1-SNAPSHOT for development towards next release. 2012-08-07 17:10:11 -04:00
EvilSeph
fad4f39ac8 Updated version to 1.3.1-R1.0 in pom.xml for RB 2012-08-07 02:34:24 -04:00
Wesley Wolfe
2bb7a5f94d Implement new deprecated warning state configuration option 2012-08-06 23:52:49 -05:00
Travis Watkins
bfbdbbd05c Tripwire isn't redstone, only fire interact events. 2012-08-06 19:47:22 -05:00
Travis Watkins
7a3dfecba0 Don't force chunks to load again, causes chunk leaks with multiworld. 2012-08-06 17:31:03 -05:00
Wesley Wolfe
0792b15887 Pistons no longer extend before they are pistons. Fixes BUKKIT-1999 2012-08-06 09:55:38 -05:00
feildmaster
59aaa6a80a Fix dispenser removing data from items. Fixes BUKKIT-2045 2012-08-06 09:09:05 -05:00
THDigi
7dc47892a4 Don't rotate ShapedRecipes. Fixes BUKKIT-1334
ShapedRecipe's getShape() always returns a 90deg rotated shape of the original shape, this commit fixes it.
2012-08-06 07:11:35 -05:00
Travis Watkins
164c066453 Fix "moved too quickly" detection. 2012-08-05 23:57:22 -05:00