Commit Graph

7655 Commits

Author SHA1 Message Date
60836ebec9 Updated resources json to use base64 instead of hex 2018-06-12 18:32:26 +01:00
3def3cd502 Item: use base64 instead of hex for json encoding NBT 2018-06-12 18:31:35 +01:00
b5da6b1591 Added a pocketmine.yml kill switch for development builds 2018-06-12 17:11:01 +01:00
8a9af7bf2f Update and sync extension dependencies 2018-06-12 16:27:52 +01:00
8cfd5604cf PocketMine.php: remove 1.3 legacy things 2018-06-12 14:35:11 +01:00
f51743765d Start console reader in a more sensible place 2018-06-12 11:26:34 +01:00
0b9ce8a0d4 Remove server codename
This has long been a waste of time and creativity, and that's only going to continue to be the case now that we're going to be properly versioning. New codenames every couple of months is not worth the bother.
2018-06-12 10:51:49 +01:00
c3c360f589 Bump API to 3.0.0
This may raise a few eyebrows.

Does this mean that all the things that were planned for API 3.0.0 are done?
Not at all. The plans laid out in December 2016 for API 3.0.0 were far too ambitious, and as a result the ALPHA series dragged out forever (18 months now). This is a break away from those plans, to bring development and release flow back to some sort of sanity.

Does this mean that my plugins will stop breaking all the time now?
No, it does not! Development isn't going to stop, although breaking changes will be confined only to major API releases. It's anticipated that the major API version will be bumped as nearly as often as the ALPHA version was during the last 18 months. The reason for this return to 3.0.0 is to allow us to fine-tune our release flow so that plugin developers can get advantage of newer, non-breaking API features without having to bump the API in a breaking way.

What are the criteria for the API versions now?
- Major: This will be bumped for breaking changes, changes which will break plugins. it's expected that we'll roll out new major versions regularly.
- Minor: This will be bumped when non-breaking feature additions are made, such that API 3.0.0 plugins would still load on 3.1.0. However, plugins requiring 3.1.0 will not run on 3.0.0.
- Patch: This will be bumped for bugfix updates. Plugins requiring 3.0.0 will work on 3.0.1, but not vice versa.

TL;DR: This insanity has gone on far too long.
2018-06-12 10:39:49 +01:00
5a55d434ab Nuke plugin loaders from orbit
This features a near-total rewrite of PluginLoaders and some code associated with them.

Highlights:
- PluginManager->registerInterface() does not return anything, and now accepts a PluginLoader instance instead of a string.
- PluginLoader itself is drastically simplified. getPluginFilters(), enablePlugin() and disablePlugin() are now removed. loadPlugin() responsibilities are now solely confined to doing whatever is necessary to make the plugin's classes visible by the server, and does not emit log messages or check for data directories.
- PluginBase->init() and PluginBase->isInitialized() have been removed.
- Plugin interface now declares a signature for the constructor which implementations must comply with.
- Plugin interface now declares setEnabled().
2018-06-12 10:23:49 +01:00
19d2d6b91c PluginManager: use null coalesce in getPermission() 2018-06-11 16:38:27 +01:00
ff2e99ecdc McRegion: nbtDeserialize() cannot return null 2018-06-11 15:05:38 +01:00
07a156f5c4 BaseLevelProvider: remove leftover from b54197904d 2018-06-11 14:32:42 +01:00
13fe8ee96d PluginDescription: fix precedence issue with ?? and cast
this would cause issues if the api field was null or not found.
2018-06-11 13:53:49 +01:00
eb0276d459 Apply nullable and void typehints to events namespace 2018-06-11 13:49:16 +01:00
cfb10360ff Furnace: remove trailing whitespace 2018-06-11 13:31:05 +01:00
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +01:00
b3ea9606c7 Server: fixed doc comment for shutdown() 2018-06-11 12:32:38 +01:00
a080a9b75c Player: remove redundant parameter from checkNearEntities() 2018-06-11 12:25:01 +01:00
137a05c418 Player: remove useless return value from orderChunks() 2018-06-11 12:22:46 +01:00
245f5c6bef Player: remove obsolete TODO 2018-06-11 12:20:11 +01:00
3be6665e3d AsyncWorker IDs now start from 0 instead of 1
this now matches their IDs in the AsyncWorker pool, as used by submitTask().
2018-06-11 11:58:24 +01:00
8704d378d4 PluginBase::getResources() returns associative array (#2193)
Now, it has string keys, which is the path of the resource file relative to the resources folder.
2018-06-11 11:06:54 +01:00
b9718f9e87 Remove redundant second parameters for BlockFactory::get() 2018-06-11 11:03:23 +01:00
1d1e6966a2 Biome: remove useless abstract class 2018-06-11 11:00:33 +01:00
610b7bd8b0 RiverBiome: don't generate grass underwater 2018-06-11 10:58:30 +01:00
17607b8116 AsyncPool: added some void typehints 2018-06-11 10:41:40 +01:00
4c98d9d3ad AsyncPool: add a type doc to $size 2018-06-11 10:40:01 +01:00
7d5b3079bc AsyncPool: more documentation 2018-06-11 10:38:51 +01:00
88d83e0fca AsyncPool: Lazy-start AsyncWorkers when they are needed only
This changes how the AsyncPool works so that it does not immediately always start all of the workers in the pool.
Instead, workers will be started only when an idle worker was not found.
This allows for significant memory footprint reductions while idle.

In effect the async-workers setting in pocketmine.yml now dictates a _maximum_ pool size, not a fixed pool size.
2018-06-11 10:23:46 +01:00
4b221c0601 OceanBiome: don't inherit from GrassyBiome, change ground cover to gravel 2018-06-11 09:58:48 +01:00
e867427f71 Leaves: remove useless $check parameter
this is only written to and never read from.
2018-06-10 17:20:34 +01:00
c4c6c58615 Added some missing typehints 2018-06-10 17:18:55 +01:00
89643ff9af MainLogger: Added getFormat() and setFormat()
this allows plugins to easily alter the output of the console logger.
2018-06-10 10:49:12 +01:00
9657d50aeb MainLogger: workaround --disable-ansi not being respected on other threads 2018-06-10 10:24:49 +01:00
3725bea3e5 AsyncPool: Slightly reduce worker memory usage with more conservative start options
this results in a memory footprint reduction of maybe 4MB for a total of 8 workers. Not much, but it's something.
2018-06-10 10:18:07 +01:00
f3a84b332b Updated RakLib and SPL dependencies, allow any 0.3.x SPL 2018-06-09 20:13:27 +01:00
f6481eab8f Implemented an InventoryEventProcessor, fixes #1986 (#2176)
* Implemented InventoryEventProcessor, fixes #1986
Event processors can now be registered and unregistered at will. Entity inventory/armor change events are now handled by event processors instead of the inventories themselves, which allows enabling/disabling the calling of these events at will.
This now avoids stupid things happening when initializing inventory contents, since the callers for those events are now registered _after_ the contents are initialized.
2018-06-09 17:37:10 +01:00
8e5aca70b4 Entity: Avoid using close() during initEntity()
this simply conceals bugs and will cause astonishing behaviour.
2018-06-09 17:06:15 +01:00
85136b7b4a Entity: Attach to level & chunk after initEntity() call, not before
this avoids leaving garbage entities attached to chunks when exceptions are thrown during initEntity().
2018-06-09 16:59:22 +01:00
47742d74c8 Player: Drop load queue on level switch
This ensures that the player doesn't request bad chunks if it was teleported from an invalid level.
2018-06-09 16:21:41 +01:00
ca54c8d78e Merge branch 'master' of https://github.com/pmmp/pocketmine-mp 2018-06-09 16:21:01 +01:00
601811f0f8 Player: Account for the possibility of Level being null in switchLevel()
the Entity base also accounts for this, and assuming that this is automatically valid is causing lots of crashes. I am not sure of the circumstances under which this is suddenly becoming null, but this shouldn't assume that the level is valid nonetheless.
2018-06-09 16:20:51 +01:00
aeb551b317 Remove double use of spl_object_hash (#2226) 2018-06-09 14:15:50 +01:00
37b445f210 Updated Math dependency 2018-06-09 13:05:25 +01:00
d04991feb6 Level: Avoid chunk sending bugs caused by duplicate chunks with wrong coordinates
If the same chunk is set into multiple different places in the world, the chunk's position is no longer able to be relied on, because it will have the position of the last place it was set. This results in chunks not getting sent correctly when the same chunk is set in multiple places.

This avoids the bug by using known valid coordinates (using chunk hashes) to establish the real coordinates, and also adds an assert to notify developers should they unintentionally set a duplicate chunk by mistake.
2018-06-09 11:25:45 +01:00
c327b3d2c4 AsyncPool: be less dependent on Server in the code
The goal is to remove the Server things from here completely.
2018-06-08 20:08:23 +01:00
af69418a55 PlainBiome: reduce maximum elevation 2018-06-08 13:04:45 +01:00
8cd311bcb4 GroundCover: don't replace liquid with can-be-flowed-into blocks
fixes snow layers generating underwater
2018-06-08 11:15:19 +01:00
78ec3937bf BiomeSelector: drastically simplified implementation and made more robust
- Doesn't need to be pre-populated with biomes prior to calculating the heatmap - now population of biomes is entirely dependent on the lookup function, improving consistency
- Uses an abstract class method for lookup instead of callback (use anonymous class instead)
- Faster because the heatmap is directly populated with biomes instead of biome IDs, removing an unnecessary lookup.
2018-06-08 10:19:08 +01:00
4e3e807741 Biome: Added UnknownBiome class to avoid astonishing behaviour on unknown biomes 2018-06-08 10:19:08 +01:00