Commit Graph

667 Commits

Author SHA1 Message Date
af678f985d All types of coral now have fully dynamic types 2021-05-19 22:49:44 +01:00
80e4da85df Fixed PHPStan build 2021-05-12 12:12:29 +01:00
4c4db1836f Merge remote-tracking branch 'origin/stable' 2021-05-11 19:28:09 +01:00
e648f1c91e Remove unnecessary script copy 2021-05-10 17:55:52 +01:00
5116e11cea Only install the stuff we need to run PHP, not to build it 2021-05-10 17:55:52 +01:00
f909557529 Cleaned up implementations for EnderChestInventory/DoubleChestInventory
previously, these were forced to extend BaseInventory because of the amount of crap in Inventory's interface.
This meant that these inventories had their own slots storage, which would be _mostly_ unused because these inventories aren't real inventories, but rather just delegates.
This lead to a variety of bugs in the past, such as certain API methods on BaseInventory not working correctly for DoubleChestInventory in particular.

Now, BaseInventory just implements the functional part of the inventory implementation, leaving the storage system up to the implementation.
A SimpleInventory class is provided with a simple SplFixedArray storage backing, which is used by most inventories.
EnderChestInventory and DoubleChestInventory now extend BaseInventory directly, and implement custom methods for dealing with their delegates.
2021-05-09 20:51:16 +01:00
624495f4d3 Added a generic Promise type
I anticipate increasing demand for promises, and since all the libraries I could find suck, we'll stick to our own impl for now.
2021-05-08 15:57:30 +01:00
33eb97da97 Remove dead PHPStan pattern 2021-05-08 15:53:55 +01:00
6384b6602c phpstorm you piece of shit 2021-05-07 23:55:49 +01:00
73420819f6 Clean PHPStan baselines 2021-05-05 14:51:39 +01:00
652de2632a Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
e8cb49f7ae php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
b8645f5c15 Clean up EnderChestInventory implementation
now, EnderChestInventory is just a temporary window, much like anvil/enchanting windows. It provides a gateway to the player's PlayerEnderInventory.

This removes one of the remaining obstacles to disallowing null World in Position constructor.
2021-05-02 14:26:27 +01:00
129ca7fee0 Silence a PHPStan bug
I'm not able to reproduce this one on the playground, but it still shows up even when disabling certain phpdocs...
2021-05-02 13:55:32 +01:00
726978b8f1 Migrate all coloured blocks (except glazed terracotta) to dynamic colours 2021-04-29 20:11:03 +01:00
593a8ac529 Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
b33bf1f433 Unfuck banners ... 2021-04-28 18:44:21 +01:00
d5e5a81cff Don't explode when data contains invalid dye colour IDs 2021-04-28 13:39:03 +01:00
2eb05a2420 Updated block factory consistency check 2021-04-27 21:00:22 +01:00
127b57048c Allow plugins to use PSR-4 namespace mapping (#4188)
* Allow plugins to use PSR-4 namespace mapping
this is a reduced implementation which serves the 99% use case without being horribly breakable.

Plugins may now specify a `src-namespace-prefix`, which should be set to the namespace of the classes in `src`.
If the old system is used, `src-namespace-prefix` can be omitted, or set to an empty string.

Examples:
- If `src-namespace-prefix` is `dktapps\test`, `dktapps\test\Main` will be searched for in `src/Main.php`, instead of `src/dktapps/test/Main.php`.

* Migrate TesterPlugin to PSR-4
2021-04-23 19:34:46 +01:00
4e0bc6c98e Scrub PHPStan baselines 2021-04-19 16:18:22 +01:00
73f913e279 Modernize TesterPlugin 2021-04-19 14:16:05 +01:00
9c1b4fd1cd Added CancelTaskException (#4186) 2021-04-19 13:41:51 +01:00
5872b2fe23 Merge remote-tracking branch 'origin/stable' 2021-04-19 13:32:15 +01:00
09a2402f01 Fixed precondition on double chunk send being useless
this is messy, but necessary for now.
2021-04-19 00:50:43 +01:00
d19c21e2e1 Updated PHPStan baseline 2021-04-19 00:38:27 +01:00
8d1a1628de Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
53ebe4f9f9 World: added getHighestAdjacentFullLightAt() 2021-04-18 20:20:08 +01:00
a32eb4ebc3 Implemented coral and coral fans
this implementation is very rough due to having to hack around lots more MCPE bullshit, and currently doesn't allow dynamic coral types; but it's there. We'll clean this up after 1.13 migration is done.
2021-04-17 02:04:10 +01:00
9abdcd8ee5 shut 2021-04-16 21:45:22 +01:00
01c3668375 ItemFactory: Check the bounds of durability, instead of trying to catch exceptions 2021-04-16 21:30:48 +01:00
81ced66bd0 BlockIdentifier: variant parameter of constructor is now mandatory 2021-04-16 20:14:29 +01:00
5d83f4670a RegionLoader: Switch to using named constructors
this makes the code more self-descriptive, and also helps to detect potential bugs.
2021-04-15 21:57:23 +01:00
32c4a165cf Removed RegionLoader::open()
this is nothing but a source of bugs.
2021-04-15 15:38:18 +01:00
0312b62c8a DataPacket no longer keeps its own serializer
since a while ago, we're anyway just discarding the internal buffer anyway when the packet is repeatedly encoded, so this doesn't serve any advantage anymore.
We do need a system to be able to reuse encoded packet buffers, but right now we're not reusing them anyway.
2021-04-09 15:37:58 +01:00
7aa336f5e4 Remove dead baseline 2021-04-07 19:44:00 +01:00
7578bca006 Merge tag '3.18.2' 2021-04-07 19:41:57 +01:00
e22b6ff566 Revert "Revert "Backport InventoryTransactionPacket impl from PM4""
This reverts commit c7cdaeae85.
2021-04-07 18:42:07 +01:00
21378b7f27 Regenerate PHPStan baselines
this should be the last time we get baselines randomly rearranging themselves on changes ...
2021-04-03 22:36:15 +01:00
Ali
3b3fb5e662 fix ItemFrames (#4101)
removing items from item frames was broken due to behavioural changes in 1.16.210.
2021-03-28 18:53:46 +01:00
06f20234f7 Scrub unused imports 2021-03-26 22:56:09 +00:00
0d775f8731 Require ext-chunkutils2 at ^0.2.0 2021-03-23 22:23:17 +00:00
9ee80357b0 phpstan baselines cleanup 2021-03-23 15:24:20 +00:00
ad048f0b7f Merge remote-tracking branch 'origin/stable' 2021-03-23 15:17:10 +00:00
c7cdaeae85 Revert "Backport InventoryTransactionPacket impl from PM4"
This reverts commit cb06be615a.

we can't push this to stable because it would break plugins without any
way to know (no protocol or API change).

At most, this should have been wrapped into a protocol change.
2021-03-22 21:21:11 +00:00
cb06be615a Backport InventoryTransactionPacket impl from PM4
this version is far better, and we're going to need it to deal with the PlayerAuthInputPacket bullshit.
2021-03-19 22:16:30 +00:00
0d3c11699c Clean up PHPStan baselines 2021-03-19 22:14:07 +00:00
b3c6c11b20 BulkCurlTask now accepts a closure callback for onCompletion
this requires much less boilerplate code than an anonymous class.
2021-03-16 23:56:14 +00:00
6d622c4020 Merge branch 'stable' 2021-03-14 23:32:09 +00:00
cbc8576d4a Implement UPnP support without dotNET (#3378)
UPnP forwarding is now available on all supported platforms.
com_dotnet is no longer required for UPnP forwarding to work.

Closes #3216 .
2021-03-14 22:50:33 +00:00