Commit Graph

8741 Commits

Author SHA1 Message Date
c3063ccc44 Remove useless CustomInventory class 2018-11-29 14:40:15 +00:00
650a2eee4b Tile: remove unused import 2018-11-27 20:04:47 +00:00
5024713291 Fixed population artifacts always generating in the bottom subchunk, closes #2538 2018-11-26 14:29:06 +00:00
20f0e344d6 Merge branch 'release/3.4' 2018-11-26 14:02:59 +00:00
08ec021f78 Merge branch 'release/3.3' into release/3.4 2018-11-26 14:02:32 +00:00
545ec9c881 Updated PreProcessor submodule 2018-11-26 14:02:23 +00:00
328ee40d5d Bring back support for all-sided logs, properly this time 2018-11-25 19:52:45 +00:00
c809365c39 Make RedstoneRail class abstract 2018-11-25 19:22:00 +00:00
8fe3f6ef1b Player now drops the contents of temporary inventories
these inventories are just glorified crafting tables.
2018-11-25 17:13:35 +00:00
a9a647855b Remove useless Recipe interface 2018-11-25 17:08:09 +00:00
2ef91f6e2e Merge branch 'release/3.4' 2018-11-25 16:36:46 +00:00
b0060caaf7 Config: don't catch-all in save() 2018-11-25 16:35:59 +00:00
d0e2cdb54c Tile: remove server field
it would be nice to get rid of the server dependency entirely... perhaps craftingmanager should be a singleton? it's contextless after all...
2018-11-25 15:58:24 +00:00
d8ea8fa0f0 Use Block objects more instead of legacy ID/meta crap 2018-11-25 14:55:12 +00:00
7399e9036a Block: add method isSameState() to allow black-box comparison of blockstates 2018-11-25 14:53:57 +00:00
4698c723bd Merge branch 'release/3.4' 2018-11-25 14:36:20 +00:00
c90d1faa81 Merge remote-tracking branch 'origin/release/3.3' into release/3.4 2018-11-25 14:35:45 +00:00
d5a1961e6b Force minimum uptime to be >= 120 seconds if a crash occurs (#2534)
This is an incremental improvement over 4a6841a5a4. This change works better because it also reduces disk spam of crashdumps.

This will now sleep if the server uptime was less than 120 seconds before crashing. If unattended, this will clamp down on automated crashdump spam. If attended, the user can simply press CTRL+C to abort the process and skip the delay.
2018-11-25 14:35:35 +00:00
7ddcd2941b More AxisAlignedBB::one() usages 2018-11-24 19:49:15 +00:00
fcd81ada04 Make Thin use dynamic state properties 2018-11-24 19:44:32 +00:00
0fec58730b Level: fixed recursion bug when reading dynamic states
calculating dynamic states in some cases requires getting properties from neighbouring blocks, but getting these blocks also causes their dynamic states to be calculated, leading to a bouncing recursion.
This change allows retrieving blocks without calculating dynamic state information, if the call was generated by calculating dynamic state information.
Since these blocks are incomplete, they should not be cached and are only used to allow another adjacent block to complete its state. It is therefore not possible for a block's dynamic states to depend on another block's dynamic states.

This recursion bug was observable by running /gc and walking into a door, which would cause the server to freeze and crash.
2018-11-24 19:44:31 +00:00
d426d18b77 Add dynamic shape property for stairs 2018-11-24 19:44:31 +00:00
1170b66fd5 Automate creation of tiles when they are used to store block properties 2018-11-24 19:44:31 +00:00
3f3bdaeba5 Use dynamic state detection to localize stateinfo stored in tiles (hack) 2018-11-24 19:43:02 +00:00
3af293f024 Added a mechanism for blocks to detect dynamic state properties from surroundings 2018-11-24 19:43:02 +00:00
b2201c8c59 Further cleanup to general AABB handling 2018-11-24 19:17:03 +00:00
d5ae4ad141 Sync Math dependency 2018-11-24 18:34:49 +00:00
101de7adda Update Math dependency, obliterate some nasty code from Block 2018-11-23 19:41:52 +00:00
4c848bb4c1 docs fixes 2018-11-22 17:07:36 +00:00
8b350808ef Fixed merge error 2018-11-22 16:56:44 +00:00
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
507d47a6f5 Merge branch 'release/3.4' 2018-11-22 16:49:30 +00:00
449dda83fb Merge branch 'release/3.3' into release/3.4 2018-11-22 16:48:57 +00:00
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
a4e81674c3 Merge branch 'release/3.4' 2018-11-17 18:13:03 +00:00
cdf7e28251 shut up PhpStorm 2018-11-17 18:12:48 +00:00
f7ba4f553c Merge branch 'release/3.4' 2018-11-17 16:30:19 +00:00
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
e67b1a20de Merge remote-tracking branch 'origin/release/3.4' 2018-11-17 14:47:35 +00:00
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
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
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
ddef7bb09b Merge branch 'master' of https://github.com/pmmp/pocketmine-mp 2018-11-13 18:31:34 +00:00
3fb8029dff Merge branch 'release/3.4' 2018-11-13 18:25:03 +00:00
554c029fbd Merge branch 'release/3.3' into release/3.4 2018-11-13 18:24:08 +00:00
e018311e73 Make start script errors a bit more noob-friendly 2018-11-13 18:23:54 +00:00
3c86944a7c Item: make addEnchantment(), removeEnchantment() and removeEnchantments() fluent (#2523) 2018-11-13 16:48:13 +00:00
45caec874e Merge branch 'release/3.4' 2018-11-12 22:18:28 +00:00
de50f02076 Merge branch 'release/3.3' into release/3.4 2018-11-12 22:07:22 +00:00
71d02e5870 Improve dev build error messages 2018-11-12 22:07:14 +00:00