Commit Graph

672 Commits

Author SHA1 Message Date
Dylan K. Taylor
e5dd5a5745 NetworkSession: Fixed missing nullable declarations
phpstan doesn't report these because .. reasons .. @ondrejmirtes this is causing bugs to go unfound :(
I'm aware of the irony that I just silenced the bugs that were exposed by this commit .. that's an architectural problem for another day
2021-06-13 22:24:12 +01:00
Dylan K. Taylor
0402e7e697 Separate CommandReader impl from CommandReaderThread 2021-05-29 23:41:11 +01:00
Dylan K. Taylor
f655d262be Added stripped all-sided-log variants
again, these should be dynamic; but right now it's not possible.
2021-05-22 12:43:07 +01:00
Dylan K. Taylor
24405b63c1 Coarse is now a state of Dirt, instead of a separate block 2021-05-21 21:36:49 +01:00
Dylan K. Taylor
df260034cd BlockFactory: Fill default state for all variants covered by bitmask when mismatch occurs 2021-05-21 21:12:34 +01:00
Dylan K. Taylor
af678f985d All types of coral now have fully dynamic types 2021-05-19 22:49:44 +01:00
Dylan K. Taylor
80e4da85df Fixed PHPStan build 2021-05-12 12:12:29 +01:00
Dylan K. Taylor
4c4db1836f Merge remote-tracking branch 'origin/stable' 2021-05-11 19:28:09 +01:00
Dylan K. Taylor
e648f1c91e Remove unnecessary script copy 2021-05-10 17:55:52 +01:00
Dylan K. Taylor
5116e11cea Only install the stuff we need to run PHP, not to build it 2021-05-10 17:55:52 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
33eb97da97 Remove dead PHPStan pattern 2021-05-08 15:53:55 +01:00
Dylan K. Taylor
6384b6602c phpstorm you piece of shit 2021-05-07 23:55:49 +01:00
Dylan K. Taylor
73420819f6 Clean PHPStan baselines 2021-05-05 14:51:39 +01:00
Dylan K. Taylor
652de2632a Rough OffHand implementation
this doesn't do stuff like taking arrows from offhand yet.
2021-05-05 14:46:51 +01:00
Dylan K. Taylor
e8cb49f7ae php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
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
Dylan K. Taylor
726978b8f1 Migrate all coloured blocks (except glazed terracotta) to dynamic colours 2021-04-29 20:11:03 +01:00
Dylan K. Taylor
593a8ac529 Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
Dylan K. Taylor
b33bf1f433 Unfuck banners ... 2021-04-28 18:44:21 +01:00
Dylan K. Taylor
d5e5a81cff Don't explode when data contains invalid dye colour IDs 2021-04-28 13:39:03 +01:00
Dylan K. Taylor
2eb05a2420 Updated block factory consistency check 2021-04-27 21:00:22 +01:00
Dylan T
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
Dylan K. Taylor
4e0bc6c98e Scrub PHPStan baselines 2021-04-19 16:18:22 +01:00
Dylan K. Taylor
73f913e279 Modernize TesterPlugin 2021-04-19 14:16:05 +01:00
Covered123
9c1b4fd1cd Added CancelTaskException (#4186) 2021-04-19 13:41:51 +01:00
Dylan K. Taylor
5872b2fe23 Merge remote-tracking branch 'origin/stable' 2021-04-19 13:32:15 +01:00
Dylan K. Taylor
09a2402f01 Fixed precondition on double chunk send being useless
this is messy, but necessary for now.
2021-04-19 00:50:43 +01:00
Dylan K. Taylor
d19c21e2e1 Updated PHPStan baseline 2021-04-19 00:38:27 +01:00
TheNewHEROBRINEX
8d1a1628de Item: Remove "ench" tag when all enchantments are removed from an item (#4184)
fixes #4144
2021-04-18 20:56:07 +01:00
Dylan K. Taylor
53ebe4f9f9 World: added getHighestAdjacentFullLightAt() 2021-04-18 20:20:08 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
9abdcd8ee5 shut 2021-04-16 21:45:22 +01:00
Dylan K. Taylor
01c3668375 ItemFactory: Check the bounds of durability, instead of trying to catch exceptions 2021-04-16 21:30:48 +01:00
Dylan K. Taylor
81ced66bd0 BlockIdentifier: variant parameter of constructor is now mandatory 2021-04-16 20:14:29 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
32c4a165cf Removed RegionLoader::open()
this is nothing but a source of bugs.
2021-04-15 15:38:18 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
7aa336f5e4 Remove dead baseline 2021-04-07 19:44:00 +01:00
Dylan K. Taylor
7578bca006 Merge tag '3.18.2' 2021-04-07 19:41:57 +01:00
Dylan K. Taylor
e22b6ff566 Revert "Revert "Backport InventoryTransactionPacket impl from PM4""
This reverts commit c7cdaeae85.
2021-04-07 18:42:07 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
06f20234f7 Scrub unused imports 2021-03-26 22:56:09 +00:00
Dylan K. Taylor
0d775f8731 Require ext-chunkutils2 at ^0.2.0 2021-03-23 22:23:17 +00:00
Dylan K. Taylor
9ee80357b0 phpstan baselines cleanup 2021-03-23 15:24:20 +00:00
Dylan K. Taylor
ad048f0b7f Merge remote-tracking branch 'origin/stable' 2021-03-23 15:17:10 +00:00
Dylan K. Taylor
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