Commit Graph

13 Commits

Author SHA1 Message Date
7f81507ea1 Add Releasable interface (#3664)
closes #3301
2020-06-30 21:09:10 +01:00
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +01:00
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
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
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
899da1b7f7 Merge commit '42e14f749'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/Player.php
#	src/pocketmine/item/Bow.php
#	src/world/World.php
2020-06-03 12:31:17 +01:00
81dff6d4c5 Merge branch 'next-minor' 2020-05-19 21:32:44 +01:00
5b82bd4fad Merge commit 'a67d2ae978ecae234c3e46b5ac0f8f0dc99e85a7'
# Conflicts:
#	resources/vanilla
#	src/pocketmine/item/Bow.php
2020-05-19 21:15:56 +01:00
7d9df6af6f Convert EntityFactory to singleton 2020-04-24 22:43:02 +01:00
86e051b7bf Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3' 2020-04-18 17:33:05 +01:00
2d4a32fc77 first look at separating Entity and Location 2019-08-19 17:20:34 +01:00
1cd955c216 Entity: added getEyePos() 2019-08-02 17:29:32 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00