Commit Graph
35 Commits
Author SHA1 Message Date
Spottedleaf e052a9deff Fix foxes not dropping items 2019-05-07 08:20:32 -07:00
Spottedleaf f1e494aba9 Fix tracking dead entities 2019-05-07 06:50:02 -07:00
Spottedleaf 71b1db46b1 Fix entities refusing to die and portal search not working 2019-05-07 05:00:51 -07:00
Spottedleaf 5a6ef6ed50 Update upstream 2019-05-06 17:33:26 -07:00
Spottedleaf 96b32aa6bc Fix more runtime stuff
Remove chunk neighbour system until we can figure out the chunk system
2019-05-06 17:05:41 -07:00
Spottedleaf b372f891aa Fix some runtime issues 2019-05-06 13:45:02 -07:00
Spottedleaf b64ce880b7 It compiles 2019-05-06 12:30:27 -07:00
Spottedleaf 6281fc8f11 Fix some more compile errors 2019-05-05 20:53:47 -07:00
Spottedleaf f9f71eb14e Update Upstream 2019-05-05 19:58:04 -07:00
Spottedleaf 52cd8744e0 More compile error fixes 2019-05-05 17:57:14 -07:00
Spottedleaf fad9f189b6 Fix some compile errors 2019-05-05 16:24:37 -07:00
Spottedleaf e80bd49c80 Fix some issues on the list 2019-05-05 14:39:51 -07:00
Spottedleaf d42c203adc Shove decompile fixes into the proper patch 2019-05-05 11:09:29 -07:00
Spottedleaf 670fbcd29e More 1.14 patches
now we can rebase
2019-05-05 10:19:34 -07:00
Spottedleaf 70e4947867 Correct patches 2019-05-05 04:32:20 -07:00
Spottedleaf be2fdf029f More 1.14 patches 2019-04-30 15:51:03 -07:00
Spottedleaf cab9529fe8 More 1.14 patches 2019-04-28 20:14:31 -07:00
Spottedleaf 567bd0fcac More 1.14 patches 2019-04-28 10:59:47 -07:00
Spottedleaf 9c7e369607 More 1.14 work 2019-04-26 23:26:04 -07:00
Spottedleaf f7dfbc078c More 1.14 updates (#1995) 2019-04-26 20:05:36 -07:00
Spottedleaf 8ee42908e1 Add Heightmap API (#1724)
Resolves #1672 
This API is intended to expose useful heightmaps found in the server to API. This exposes all of the live world heightmaps currently in the server. 
If a heightmap becomes impossible to implement, api spec allows the implementation to throw UnsupportedOperationException (far better than returning some weird unexpected value).

Tested via:
https://gist.github.com/Spottedleaf/5d47f67c55a9fb870251ff344bfeb6b3
2019-04-10 20:36:31 -07:00
Spottedleaf 5040cddd28 Add static encode/decode for block long keys (#1712)
Should make this API easier to use.
2019-04-08 21:08:14 -07:00
Spottedleaf 6719e61704 Only flush to disk on chunk saves if paper.flush-on-save is true (#1942)
The cost of a call to sync() adds up quickly and especially for
HDDs. Playing around generating chunks for a while warranted a
3 min save time on a HDD. This is unacceptable default behaviour
and now the behaviour is hidden behind a flag for server owners
who are OK with taking a hit on saves (although SSDs will not have
this issue remotely as bad, since most of the time was spent seeking).
2019-04-06 02:59:42 -07:00
Spottedleaf 0891f63203 Optimize GameRules to use LinkedHashMap
Previously TreeMap was used which has poor get(K) performance.
2019-04-04 18:13:49 -07:00
Spottedleaf 5d5e321bf8 Make region files more reliable to write to
Previously we would write to header before writing our chunk data,
which opens a window for corruption (or we would overwrite entirely).
Now the saving process has been changed to follow this chain of events:

1. We always allocate a new space to write so we do not potentially
overwrite and corrupt the current data
2. Write the chunk data first (the order of the fields in
the chunk data isn't relevant though)
3. Flush to disk
4. Write to the region header last
5. Flush to disk
6. Then we free the previous space allocated

With this chain of events it is impossible for a chunk write to corrupt
a region file, unless the operating system has lied and we have NOT flushed
to disk.

However server administrators are still recommended to continue performing
regular backups.

Note that when Mojang finally decides to change their region format
to deal with oversized chunks this patch must be changed to deal with
whatever system they decide to impose.

We also make use of two flushes to disk per chunk save (to ensure
ordering and ensure data has gone to disk), so this will negatively
affect save performance.
2019-04-01 18:58:55 -07:00
Spottedleaf 7e58932043 Allow login events to fire only after the server has loaded
Plugins that rely on the async login event to fire can miss the event
if a player tries to log in before the server has loaded.

The solution is to simply block the event threads from executing until
the server has loaded. This will not have an adverse affect on logins
since the event threads are cached and are only used for executing events
asynchronously.
2019-03-31 22:18:39 -07:00
Spottedleaf e98c779a36 Fix World#getChunkAtAsync(Location) variants incorectly calculating chunk x
The blockX needs to be floored before converted to int, as float -> integer
operations are truncation. (i.e -0.5 -> 0, we want -0.5 -> -1)
2019-03-02 15:45:42 -08:00
Spottedleaf b20fb55df3 Disable watchdog early timeout for CraftServer#reload() invocations (#1718)
Fixes GH-1381
2018-12-12 17:41:11 -08:00
Spottedleaf 4742d47392 Add PlayerConnectionCloseEvent (#1552)
* Add PlayerConnectionCloseEvent

This event is invoked when a player has disconnected. It is guaranteed that,
if the server is in online-mode, that the provided uuid and username have been
validated.

The event is invoked for players who have not yet logged into the world, whereas
PlayerQuitEvent is only invoked on players who have logged into the world.

The event is invoked for players who have already logged into the world,
although whether or not the player exists in the world at the time of
firing is undefined. (That is, whether the plugin can retrieve a Player object
using the event parameters is undefined). However, it is guaranteed that this
event is invoked AFTER PlayerQuitEvent, if the player has already logged into
the world.

This event is guaranteed to never fire unless AsyncPlayerPreLoginEvent has
been invoked beforehand, and this event may not be called in parallel with
AsyncPlayerPreLoginEvent for the same connection.

Cancelling the AsyncPlayerPreLoginEvent guarantees the corresponding
PlayerConnectionCloseEvent is never called.

The event may be invoked asynchronously or synchronously. As it stands,
it is never invoked asynchronously. However, plugins should check
Event#isAsynchronous to be future-proof.

On purpose, the deprecated PlayerPreLoginEvent event is left out of the
API spec for this event. Plugins should not be using that event, and
how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent
is undefined.
2018-12-12 17:17:38 -08:00
Spottedleaf 9857d5a9b4 Fix MaterialTagTest deterministic ordering
Tacos > Burritos
2018-10-08 01:33:25 -04:00
Spottedleaf 2375f1fef2 Make CraftWorld#loadChunk(int, int, false) load unconverted chunks (#1407) 2018-09-02 20:40:14 -07:00
searchndstroy 612bf465f2 Allow Blocks to be accessed via a long key (#1335)
The key can be retrieved via methods Location#toBlockKey() and
Block#getBlockKey()

World provides lookup for blocks by long key via method World#getBlockAtKey(long)

The formatting for the key is as follows:

10 bit y|27 bit z|27 bit x

The y value is considered unsigned while z and x are considered two's complement

Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]


Checked encoding and decoding via https://gist.github.com/Spottedleaf/74f4e241012ca2fa67d8f1c7e8e34722
2018-08-17 14:55:01 -07:00
searchndstroy 93e3a60a2f Optimize BlockPosition helper methods (#1339)
Resolves #1338
2018-08-17 14:51:56 -07:00
searchndstroy 093dd0a9b9 Fix watchdog restarting on short timeout (#1344) 2018-08-17 09:09:08 -07:00
Spottedleaf 19fa8bcffc Use invokeinterface for methods defined in interfaces in the ASM executor 2017-02-14 03:04:20 -08:00