Commit Graph

43 Commits

Author SHA1 Message Date
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
a44203a3d4 Separate BannerPatternLayer from BannerPatternType 2021-04-28 12:47:42 +01:00
Dylan K. Taylor
8a3df1212a Added a trait for blocks which face opposite their placing player 2021-04-27 21:28:26 +01:00
Dylan K. Taylor
f204d6b3dd Make a trait for blocks which share the same horizontal facing metadata logic 2021-04-27 20:59:20 +01:00
Dylan K. Taylor
49438d360d RegistryUtils: generate ordered doc comments
this makes things easier to find, especially in the large ones like VanillaBlocks.
2021-03-22 16:16:28 +00:00
Dylan K. Taylor
90161f24e3 Added script to update registry/enum docblocks 2021-03-22 16:00:09 +00:00
Dylan K. Taylor
48ef8771cd Added AnalogRedstoneSignalEmitterTrait 2021-02-06 18:33:14 +00:00
Dylan K. Taylor
4fc3bc53f7 Clean up hierarchy of rails
detector rail has fundamentally different functionality than activator and powered rails, so it's misleading to present the same APIs for both.
detector rail's 'powered' state is better referred to as 'activated', since it means the detector rail is actually _producing_ power, and not _receiving_ power.
2021-02-05 22:00:17 +00:00
Dylan K. Taylor
563336cdc9 CoralType: remove unused magicNumber stuff 2020-11-16 18:12:38 +00:00
Dylan K. Taylor
4ade7b6225 added CoralType enum 2020-11-14 16:24:13 +00:00
Dylan K. Taylor
06efad94b6 Separated metadata handling from PillarRotationTrait 2020-11-14 16:21:50 +00:00
Dylan K. Taylor
32929925aa Block: added a bunch of state manipulation APIs 2020-11-03 19:13:32 +00:00
Dylan K. Taylor
bcedbc364b BlockDataSerializer: added methods to read/write coral facing 2020-11-03 18:41:12 +00:00
Dylan K. Taylor
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00
Dylan K. Taylor
dfee8b7fa5 Added SignLikeRotationTrait 2020-10-04 21:09:45 +01:00
Dylan K. Taylor
7f9c4355f0 Revert back to floor/wall banner variants
this code largely duplicates the same code in FloorSign/WallSign and needs to be de-duplicated.
2020-10-04 19:05:43 +01:00
Dylan K. Taylor
ec7c5fd669 Added a BrewingStandSlot enum 2020-09-26 17:20:02 +01:00
Dylan K. Taylor
6054104ecb drop a few more useless static variables
phpstan is better able to understand constant literals, since it knows their types will never change.
2020-09-05 18:43:22 +01:00
Dylan K. Taylor
ddc5694b70 remove file accidentally committed in 0b05fd1987 2020-08-17 20:25:30 +01:00
Jack Honour
ff2a3baa8e Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
2020-08-07 21:07:58 +01:00
Dylan K. Taylor
2545897fc2 HorizontalFacingTrait: use a cheaper check for horizontal facing 2020-08-06 14:53:51 +01:00
Dylan K. Taylor
2b044195a5 Update for pocketmine/math Axis refactor 2020-08-06 14:38:54 +01:00
Dylan K. Taylor
56ae3d01da block: added HorizontalFacingTrait and AnyFacingTrait
these are primarily intended for deduplication of code and ability to cross-reference. Don't expect this API to remain the same.
2020-08-05 21:17:37 +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
670ad9eb9d Position: rename getWorldNonNull() to getWorld(), remove original getWorld() 2020-06-29 21:19:46 +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 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
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
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
7d9df6af6f Convert EntityFactory to singleton 2020-04-24 22:43:02 +01:00
Dylan K. Taylor
86e051b7bf Merge commit 'a2543ff80d2906bccda1a4e2fdbd9d8e7d147fb3' 2020-04-18 17:33:05 +01:00
Dylan K. Taylor
356ed5f1de DyeColor: fix PHP 7.2 compatibility 2020-02-01 20:50:16 +00:00
Dylan K. Taylor
9c33ea8dd1 EnumTrait: use a better method to initialize enums
this method is simpler, and is also safe at the native type level.
Coincidentally, it also eliminates 30 PHPStan false-positives.
2020-02-01 20:33:30 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
eba246eab3 SignText: provide typeinfo for checkLineIndex 2020-01-11 22:39:42 +00:00
Dylan K. Taylor
53ab860db5 first shot making Block not extend Position
this makes some stuff a lot less pretty, but this seems to be the bare minimum necessary to do this task. It can be enhanced later.
2019-08-05 16:44:09 +01:00
Dylan K. Taylor
135a2f520c add some UTF-8 validation 2019-08-01 19:51:31 +01:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00