8912 Commits

Author SHA1 Message Date
Dylan K. Taylor
8b350808ef Fixed merge error 2018-11-22 16:56:44 +00:00
Dylan K. Taylor
98efd27543 Remove ability to set blockID and blockdata independently
This was the cause of many inconsistency and broken world bugs. In the future (once we switch to paletted chunks) this won't be possible anyway. For now, some temporary API is provided to allow modifying chunkdata directly, but it is required that **both** must be provided.
2018-11-22 16:53:22 +00:00
Dylan K. Taylor
507d47a6f5 Merge branch 'release/3.4' 2018-11-22 16:49:30 +00:00
Dylan K. Taylor
449dda83fb Merge branch 'release/3.3' into release/3.4 2018-11-22 16:48:57 +00:00
Dylan K. Taylor
6bc79149c3 SubChunk: Fixed $changed not getting set in setBlock() when only block data changed
it was comparing a string and an int. This now compares the integer values first.
2018-11-22 16:47:25 +00:00
Dylan K. Taylor
a4e81674c3 Merge branch 'release/3.4' 2018-11-17 18:13:03 +00:00
Dylan K. Taylor
cdf7e28251 shut up PhpStorm 2018-11-17 18:12:48 +00:00
Dylan K. Taylor
f7ba4f553c Merge branch 'release/3.4' 2018-11-17 16:30:19 +00:00
Dylan K. Taylor
a02f422d85 SubChunk: Fixed constant redefinition on worker threads when autoloading
this happens when workers inherit constants but not classes.
2018-11-17 16:29:53 +00:00
Dylan K. Taylor
e67b1a20de Merge remote-tracking branch 'origin/release/3.4' 2018-11-17 14:47:35 +00:00
Dylan T
f8bfbc107d
Reduce chunk memory usage by 20-60% by exploiting PHP copy-on-write behaviour (#2527)
This takes advantage of two key behaviours of PHP:
1. Assigning a string does not copy the string
2. Changing an offset in a string causes the string to be copied.

These two factors combined, along with the fact that blocklight and skylight arrays are usually all-zeros, allow us to produce a significant memory usage reduction of loaded chunks.
A freshly generated PM world with 3,332 chunks loaded drops from 310MB to 200MB memory usage with these changes applied.
2018-11-17 14:46:05 +00:00
Dylan K. Taylor
20dad95755 Liquid: don't try to flow out of the world, close #2510
this fix is only required for master, although it could be backported.
2018-11-14 17:48:14 +00:00
Dylan T
5d7feaaf21
Remove EventExecutor, event handlers now use closures (#2525)
This cleans up some cargo-cult code poorly copied from Bukkit, which has negative performance effects and also makes internal event handling more complex than necessary.

## API changes
- Removed `EventExecutor` and `MethodEventExecutor`.
- A listener is no longer required for an event handler to be registered. Closure objects can now be used directly provided that they meet the conditions for registration.
- `PluginManager->registerEvent()` signature has changed: the `Listener` and `EventExecutor` parameters have been removed and a `\Closure $handler` has been added in its place.
- `RegisteredListener` now requires a `Closure` parameter instead of `Listener, EventExecutor`.

## Behavioural changes
These changes reduce the execution complexity involved with calling an event handler. Since event calls can happen in hot paths, this may have visible positive effects on performance.

Initial testing reveals a performance improvement of ~15% per event handler call compared to the old method.
2018-11-13 21:04:47 +00:00
Dylan K. Taylor
ddef7bb09b Merge branch 'master' of https://github.com/pmmp/pocketmine-mp 2018-11-13 18:31:34 +00:00
Dylan K. Taylor
3fb8029dff Merge branch 'release/3.4' 2018-11-13 18:25:03 +00:00
Dylan K. Taylor
554c029fbd Merge branch 'release/3.3' into release/3.4 2018-11-13 18:24:08 +00:00
Dylan K. Taylor
e018311e73 Make start script errors a bit more noob-friendly 2018-11-13 18:23:54 +00:00
Twisted
3c86944a7c Item: make addEnchantment(), removeEnchantment() and removeEnchantments() fluent (#2523) 2018-11-13 16:48:13 +00:00
Dylan K. Taylor
45caec874e Merge branch 'release/3.4' 2018-11-12 22:18:28 +00:00
Dylan K. Taylor
de50f02076 Merge branch 'release/3.3' into release/3.4 2018-11-12 22:07:22 +00:00
Dylan K. Taylor
71d02e5870 Improve dev build error messages 2018-11-12 22:07:14 +00:00
Dylan K. Taylor
3031128520 Merge branch 'release/3.4' 2018-11-11 19:52:05 +00:00
Dylan K. Taylor
46d9475568 Use Utils::getNiceClosureName() in PluginManager 2018-11-11 19:50:07 +00:00
Dylan K. Taylor
788b278fc3 Utils: fixed handling of non-anonymous closure functions 2018-11-11 19:43:00 +00:00
Dylan K. Taylor
e16171e37e Merge branch 'release/3.4' 2018-11-11 12:39:01 +00:00
Dylan K. Taylor
2e4143f57e Merge branch 'release/3.3' into release/3.4 2018-11-11 12:38:53 +00:00
Dylan K. Taylor
d312aef1ac 3.3.3 is next 2018-11-11 11:58:51 +00:00
Dylan K. Taylor
200de3fe84 Release 3.3.2 3.3.2 2018-11-11 11:58:25 +00:00
Dylan K. Taylor
f560a6efea Merge tag '3.2.7' into release/3.3 2018-11-11 11:24:23 +00:00
Dylan K. Taylor
7ecd7fd13f Release 3.2.7 3.2.7 2018-11-11 11:23:20 +00:00
Dylan K. Taylor
95bf3ab7a8 Merge branch 'release/3.4' 2018-11-11 11:15:54 +00:00
Dylan K. Taylor
5284ad0346 Merge branch 'release/3.3' into release/3.4 2018-11-11 11:15:46 +00:00
Dylan K. Taylor
b893645a81 Merge branch 'release/3.2' into release/3.3 2018-11-11 11:15:39 +00:00
Dylan K. Taylor
b19b3134ad PluginManager: reduce unnecessary indentation 2018-11-11 11:15:27 +00:00
Dylan K. Taylor
2965109484 Merge branch 'release/3.4' 2018-11-10 22:37:17 +00:00
Dylan K. Taylor
7cf36f460b Merge branch 'release/3.3' into release/3.4 2018-11-10 22:37:08 +00:00
Dylan K. Taylor
243f86b0a0 Merge branch 'release/3.2' into release/3.3 2018-11-10 22:37:02 +00:00
Dylan K. Taylor
9156cbc269 PluginManager: Make registerEvents() check order more logical
Prioritize validating that the function is actually a handler, before trying to parse its doc comment.
2018-11-10 22:36:46 +00:00
Dylan K. Taylor
3a6af3327f Encapsulate plugin.yml commands handling inside PluginBase, removed CommandExecutor requirement from Plugin interface
This removes the need for custom Plugin implementations to implement onCommand().

In the future it's planned to remove plugin.yml commands completely and have them registered similarly to how events are handled.
2018-11-09 19:50:52 +00:00
Dylan K. Taylor
8b9ec5dde3 Merge branch 'release/3.4' 2018-11-07 22:11:27 +00:00
Dylan K. Taylor
a5f776af2f Merge branch 'release/3.3' into release/3.4 2018-11-07 22:11:13 +00:00
Dylan K. Taylor
43fe6a1934 Merge branch 'release/3.2' into release/3.3 2018-11-07 20:02:28 +00:00
Dylan K. Taylor
342a74ffcb Level: Collect garbage from chunk internals in doChunkGarbageCollection() 2018-11-07 20:01:07 +00:00
Dylan K. Taylor
0b03e3c95b Update dependencies, fix travis failure 2018-11-05 21:20:42 +00:00
Dylan K. Taylor
67a5f3f557 Register MainLogger as SPL global, remove hard MainLogger dependency from many areas, break a bunch of cyclic dependencies 2018-11-05 19:01:59 +00:00
Dylan K. Taylor
ed8569a3f4 Remove Collectable class, fix memory leak on AsyncTask fatal error 2018-11-05 17:26:22 +00:00
Dylan K. Taylor
c201a0e909 Move language submodule to resources/
again, this isn't source code.
2018-11-05 09:49:21 +00:00
Dylan K. Taylor
ce7718f0d1 Move resources/ directory out of src/
this isn't source code and as such doesn't belong in here.
2018-11-05 09:46:43 +00:00
Dylan K. Taylor
2a5ab1f397 Merge branch 'release/3.4' 2018-11-04 23:33:10 +00:00
Dylan K. Taylor
3d2701e775 Merge branch 'release/3.3' into release/3.4 2018-11-04 23:32:56 +00:00