Commit Graph

46 Commits

Author SHA1 Message Date
5325ecee37 Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
94d98fb5c4 Migrate all but two remaining legacy enums to native PHP 8.1 enums 2023-09-07 19:32:45 +01:00
c9bb4335a1 Item: added getStateId(), removed state data from public API
state data was only used for indexing stuff along with state ID anyway, so it makes more sense to lock it away in here instead.
2023-05-16 14:14:18 +01:00
015c668885 Change confusing 'type data' and 'state data' terminology for blocks and items
For blocks, we now use 'block-item state' and 'block-only state', which should be much clearer for people implementing custom stuff.
'block-item state', as the name suggests, sticks to the item when the block is acquired as an item.
'block-only state' applies only to the block and is discarded when the block is acquired as an item.

'type data' for items was also renamed, since 'type' is too ambiguous to be anything but super confusing.
2023-05-16 14:07:29 +01:00
a0346fb6d3 Merge branch 'minor-next' into major-next 2023-04-26 14:29:32 +01:00
f86fde064d CraftingManager: fixed uninitialized field
I'm having deja vu about this ...
2023-04-24 12:34:34 +01:00
453ad997e9 Merge branch 'item-stack-request' into item-stack-request-pm5 2023-03-20 22:05:12 +00:00
4864444440 Added CraftingManager::getCraftingRecipeFromIndex() 2023-03-19 22:14:23 +00:00
dace20ad1f Merge branch 'item-stack-request' into item-stack-request-pm5 2023-03-14 22:34:47 +00:00
c2918709a3 Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +00:00
2e9a3f9160 Working crafting :woohoo: 2023-01-04 22:29:29 +00:00
fc63c54116 CraftingManager: more detailed type information for shapelessRecipes and shapedRecipes 2023-01-04 00:32:26 +00:00
4d79aced07 Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
99996b62d6 Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
68cbe46600 Exterminate legacy item IDs 2022-07-05 15:12:55 +01:00
9f0b32e748 Updated creative and crafting data to 1.19 2022-07-04 20:28:07 +01:00
cab56b0479 fix PHPStan 2022-06-29 17:18:44 +01:00
5e4e5147d9 Remove ItemFactory involvement from brewing
this involves a very nasty hack for potion container change, but for the time being it can't be helped.
2022-06-29 16:11:15 +01:00
55cb68e5b5 Burn meta wildcards from Item, allow more dynamic recipe inputs
this was an obstacle for getting rid of legacy item IDs.
2022-06-27 13:33:26 +01:00
aa9f8781ff Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
083a35f970 Modernize property type declarations 2022-06-04 18:16:32 +01:00
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
b402df8b91 Modernize property declarations in pocketmine\crafting namespace 2022-04-25 13:15:48 +01:00
e0da99a973 feat: Implement Brewing (#4413)
The following API constants have been added:
- tile\BrewingStand::BREW_TIME_TICKS
The following public API methods have been added:
- utils\BrewingStandSlot->getSlotNumber() : int
- CraftingManager->getPotionTypeRecipes() : array<string, array<string, PotionTypeRecipe>>
- CraftingManager->getPotionContainerChangeRecipes() : array<int, array<string, PotionContainerChangeRecipe>>
- CraftingManager->registerPotionTypeRecipe(PotionTypeRecipe $recipe) : void
- CraftingManager->registerPotionContainerChangeRecipe(PotionContainerChangeRecipe $recipe) : void
The following classes have been added:
- BrewingRecipe
- PotionTypeRecipe
- PotionContainerChangeRecipe
- BrewItemEvent
- BrewingFuelUseEvent
- PotionFinishBrewingSound
2022-01-22 16:54:58 +00:00
dee2062b1b CraftingManager: Reduce footprint of recipe keys
this was using json before, which is horribly inefficient.
This saved about 200 KB of memory on initial startup (which isn't much, but for more complex recipes, it might have been significantly worse.
2021-08-29 15:49:18 +01:00
27e0ecf7ee Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
7ba573db77 Added API method Item::canStackWith() 2021-06-29 19:52:52 +01:00
7b2c6c5ceb Avoid more $this refs on long-life closures 2021-05-06 14:27:56 +01:00
c61f66d973 Removed ext-ds dependency 2021-02-11 15:40:37 +00:00
0d9561c93f Removed crafting data cache from CraftingManager 2020-11-12 21:30:59 +00:00
c4d35d52e8 Do not store a pre-compressed cache for crafting data
this reduces bandwidth efficiency because it can't be compressed with everything else this way. If we want to cache stuff sent during the login sequence, it's better to stuff a bunch of stuff into a batch (e.g. crafting, creative, actor ids, biome defs) and pre-compress that as one big package instead.
2020-11-11 18:20:03 +00:00
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
017afead3b extract FurnaceRecipeManager unit from CraftingManager
I'd like to have this directly provided to Furnace, but I don't know how to short of making into a singleton. Since I want to have per-furnace recipe managers (e.g. for stuff like blast furnace vs regular furnace etc), a singleton isn't really an option.
2020-06-03 18:59:59 +01:00
b7cf4f01f9 remove utils\UUID, switch to pocketmine/uuid package 2020-05-11 10:46:48 +01:00
8093a94e5d do not hardcode data deserialization into CraftingManager 2020-04-28 18:56:27 +01:00
f9a587d40e imports cleanup 2020-04-28 17:27:38 +01:00
3be9548b1e net: compressors are now fully dynamic (or at least the potential to be)
the compressor used by RakLibInterface when opening a session is still
hardcoded, but that's because we have no way to select the correct
compressor at that point in the login sequence, since we aren't
propagating the protocol information up from RakLib right now.
2020-04-28 16:21:18 +01:00
d9e4783b24 start making network compressors dynamic
this will facilitate future multi version support where compression types are different between versions
2020-04-28 14:47:01 +01:00
a97cafd4f6 moving serializers into protocol namespace 2020-04-27 13:54:39 +01:00
18d48869a0 the great airgapping of recipes and itemstacks 2020-04-23 14:11:48 +01:00
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
09b24d3c32 Merge commit '4c36ca58e2710c8fd03eec1f50a885fb97fd9b68'
# Conflicts:
#	resources/vanilla
2020-01-31 19:19:06 +00:00
9492325eef Merge branch 'stable' 2020-01-29 20:01:30 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
d3d7709ead Merge branch 'next-minor' 2019-12-03 11:55:45 +00:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00