Dylan K. Taylor
909f3f39de
Block: get rid of getRuntimeId()
...
the runtime ID mapping should be non-global in case of multiple protocols.
2020-07-06 11:18:29 +01:00
Dylan K. Taylor
68c408268c
Separate dye colour ID management from DyeColor enum
2020-07-05 19:04:22 +01:00
Dylan K. Taylor
bf5da596f7
Get rid of WALL metadata mapping
2020-07-05 18:27:10 +01:00
Dylan K. Taylor
79d8bf898a
Moved glazed-terracotta ID-mapping table to BlockLegacyIdHelper
2020-07-05 18:20:41 +01:00
Dylan K. Taylor
eddb2b7fdd
Moved some legacyID mapping code to a separate BlockLegacyIdHelper
...
this makes the code more reusable and will facilitate getting rid of legacy IDs from within the core code.
2020-07-05 16:52:42 +01:00
Dylan K. Taylor
2219f61ea0
BlockLegacyMetadata: added constants for chemistry table variants
2020-07-05 11:13:29 +01:00
Dylan K. Taylor
740ed2013f
Merge commit '57b6451e1'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/block/Ladder.php
2020-07-04 22:22:22 +01:00
Dylan K. Taylor
2cd67aed72
Block: fixed crash on block factory clone
2020-06-29 22:40:35 +01:00
Dylan K. Taylor
da3f0752a6
Block: make getAllSides() and getHorizontalSides() use underlying Vector3 generators
2020-06-29 22:13:07 +01:00
Dylan K. Taylor
670ad9eb9d
Position: rename getWorldNonNull() to getWorld(), remove original getWorld()
2020-06-29 21:19:46 +01:00
Dylan K. Taylor
fc22fd80d8
Eradicate remaining usages of Position->getWorld()
2020-06-29 21:03:55 +01:00
Dylan K. Taylor
43ae1a5cb4
Block: make getAllSides() and getHorizontalSides() return generators
2020-06-29 20:54:51 +01:00
Dylan K. Taylor
e61a08a56b
Make SignText immutable
2020-06-29 20:18:10 +01:00
Dylan K. Taylor
42f543b405
SignText: fixed crash when fetching lines of text if not all lines were provided to the constructor
2020-06-29 19:35:38 +01:00
Dylan K. Taylor
0b05fd1987
added missing file
2020-06-29 18:54:47 +01:00
Dylan T
d585081c22
Separate consumable item interfaces from general consumable interfaces ( #3595 )
...
I wonder if there's a way to generalise item consuming beyond just eating/drinking. Stuff like lava bucket in a furnace needs the same kind of "leftover" logic.
2020-06-28 17:53:03 +01:00
Dylan K. Taylor
01d221b794
imports cleanup
2020-06-28 17:50:49 +01:00
Dylan K. Taylor
f1048aeaa3
Block: rework addVelocityToEntity() to avoid vector3 mutation
2020-06-27 21:38:24 +01:00
Dylan K. Taylor
7e391a8123
Tile: use phpstan-friendly way to pass block NBT
...
fixes 1 level 8 error
2020-06-27 13:09:05 +01:00
Dylan K. Taylor
9484220bd5
ContainerTrait: use a static-analysis-friendly way to read NBT, fixes 4 phpstan level 8 errors
2020-06-27 13:09:05 +01:00
Dylan K. Taylor
f039a077cd
ItemFrame: fixed a phpstan level 8 error
2020-06-27 13:09:05 +01:00
Dylan K. Taylor
7e6adc41f0
Merge 1.16 support into PM4 (with changes)
2020-06-26 22:21:09 +01:00
Dylan K. Taylor
1ef6e5e17b
TileFactory now only manages loading tiles from NBT, not direct creation
...
my objective is to make this use proper constructors like entities, but there's a couple of obstacles to get around first.
2020-06-21 00:47:02 +01:00
Dylan K. Taylor
42637f97c6
Liquid: eliminate some unnecessary Vector3 field mutations
2020-06-20 21:32:24 +01:00
Dylan K. Taylor
4b528aa637
NBT is no longer needed to create an entity
...
it's still able to be provided, but shouldn't be needed in the majority of cases (constructor args and/or API methods should be sufficient).
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
1205432c34
Extract mandatory parameters into constructor parameters
...
the goal is obviously to ditch NBT entirely here, but there's more work to be done before that becomes possible.
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
6a26c0bebf
EntityFactory now exclusively handles loading data from disk
...
this commit removes the ability to replace centrally registered entity classes in favour of using constructors directly.
In future commits I may introduce a dedicated factory interface which allows an _actual_ factory pattern (e.g. factory->createArrow(world, pos, shooter, isCritical) with proper static analysability) but for now it's peripheral to my intended objective.
The purpose of this change is to facilitate untangling of NBT from entity constructors so that they can be properly created without using NBT at all, and instead use nice APIs.
Spawn eggs now support arbitrary entity creation functions like EntityFactory does, allowing much more flexibility in what can be passed to an entity's constructor (e.g. a Plugin reference can be injected by use()ing it in a closure or via traditional DI.
2020-06-19 10:51:27 +01:00
Dylan K. Taylor
921aa091e0
Merge commit '04191ec44a00dd058f5d7e9e315d451e44285494'
...
# Conflicts:
# resources/vanilla
# tests/phpstan/configs/l7-baseline.neon
2020-06-17 20:40:12 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
e250553670
Merge commit '3f2455f09'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/block/SnowLayer.php
2020-06-03 12:43:36 +01:00
Dylan K. Taylor
d7ae86b30c
Merge commit '9d26a224a'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/block/DoublePlant.php
2020-06-03 12:35:59 +01:00
Dylan K. Taylor
0a730db030
Merge commit '4199c3796f4c6d8da0eccba64fe4cd9812acadeb'
...
# Conflicts:
# resources/vanilla
# src/pocketmine/block/Water.php
2020-05-31 14:46:51 +01:00
Dylan K. Taylor
ec8ee29291
moving sneak & sprint properties to Living
2020-05-21 19:55:58 +01:00
Dylan K. Taylor
f93bc0739c
Force types of RegistryTrait usages to shut PHPStan up
...
we need generic traits to solve this problem properly.
2020-05-21 19:12:48 +01:00
Dylan K. Taylor
8e2b9b686b
Block: Invert default behaviour of silk touch (more logical)
...
Now, blocks do not respond to silk touch unless specifically opted into. Since this always involves custom drops in one way or another, it's easy enough to figure out which blocks need to be marked for silk touch - anything that overrides getDrops, getDropsForCompatibleTool or getSilkTouchDrops is a block which _might_ need to be flagged. Using these criteria to reduce the number of blocks needing to be checked, I was able to manually invert the behaviour as needed.
This fixes reoccurring bugs with blocks erroneously dropping themselves whenever new blocks are added and someone forgot to set that flag, granting players access to internal blocks with strange behaviour.
2020-05-21 13:02:36 +01:00
Dylan K. Taylor
72f59eca3c
Slab: ignore silk touch on breaking tools, closes #2794
2020-05-21 11:46:43 +01:00
Dylan K. Taylor
8ec2ba79de
Unhackify Registry member cloning, fixes #3519
2020-05-21 11:38:02 +01:00
Dylan K. Taylor
3f1f135a59
remove a couple more Position->getWorld() usages
2020-05-19 21:38:51 +01:00
Dylan K. Taylor
337addf1de
Eradicate remaining usages of public Position->world field
...
and as an added bonus, ditch a bunch of extra phpstan errors
2020-05-19 19:14:56 +01:00
Dylan K. Taylor
8a8b1b0b97
Remove Position->setWorld()
2020-05-19 18:33:16 +01:00
Dylan K. Taylor
86db3af896
remove utils\Color, use new pocketmine/color class
...
we're so close to separating protocol from core !!!
2020-05-14 20:38:08 +01:00
Dylan K. Taylor
4437756987
Inventory: reduce API duplication by using a Set for viewers
2020-05-14 14:13:28 +01:00
Dylan K. Taylor
6b037d6a4c
RuntimeBlockMapping: these IDs are not static any more
2020-05-11 12:40:55 +01:00
Dylan K. Taylor
81f982a8d9
remove hardcoded legacy entity type ID mapping, load from resources instead
2020-05-04 13:47:39 +01:00
Dylan K. Taylor
0eec536f97
Spawnable: remove unused field
2020-05-04 13:10:23 +01:00
Dylan K. Taylor
a73c54bdd0
making tile spawn compound cache use CacheableNbt instead of strings
2020-05-04 12:35:13 +01:00
Dylan K. Taylor
6f38031121
Liquid: do not schedule delayed blockupdate when hardening occurs on nearby blockupdate
...
fix #3390
fix #3392
2020-04-30 09:35:55 +01:00
Dylan K. Taylor
a97cafd4f6
moving serializers into protocol namespace
2020-04-27 13:54:39 +01:00
Dylan K. Taylor
ac5cf2443e
convert TileFactory to singleton
2020-04-26 01:11:30 +01:00
Dylan K. Taylor
6dd31cc3f5
break cycle between block and inventory packages
2020-04-24 23:53:49 +01:00