Dylan K. Taylor
b96565faa4
Drop some obviously useless static function variables
...
these are better suited as constant literals.
2020-09-05 18:39:47 +01:00
Dylan K. Taylor
0aee39027e
Merge branch 'stable' into master
...
# Conflicts:
# composer.lock
# resources/vanilla
# src/entity/Living.php
# src/pocketmine/Player.php
# src/pocketmine/VersionInfo.php
# src/pocketmine/block/Potato.php
# src/pocketmine/block/Sugarcane.php
# src/pocketmine/entity/Entity.php
# src/pocketmine/item/Item.php
# src/pocketmine/level/format/Chunk.php
# src/pocketmine/level/format/io/leveldb/LevelDB.php
# src/world/generator/GeneratorRegisterTask.php
# tests/phpstan/configs/check-explicit-mixed-baseline.neon
# tests/phpstan/configs/l7-baseline.neon
# tests/phpstan/configs/l8-baseline.neon
# tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
# tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
# tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskPublishProgressRaceTest.php
2020-09-04 01:43:52 +01:00
Dylan K. Taylor
1ed36573a1
BlockLegacyMetadata: added some coral constants
2020-08-21 17:46:44 +01:00
Dylan K. Taylor
ddc5694b70
remove file accidentally committed in 0b05fd198733ac5d4eebf4cfa720c63a9efa070b
2020-08-17 20:25:30 +01:00
Dylan T
bf401421fa
Implemented bamboo ( #3762 )
2020-08-16 20:39:51 +01:00
Dylan K. Taylor
6920deac2c
BlockFactory: regenerated TODO lists
2020-08-15 19:47:38 +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
7399e6944e
Consistent fluency for block property setters
2020-08-06 13:46:08 +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
060c300d50
Bed::setOccupied() no longer sets itself into the world
...
setting itself into the world is very annoying when trying to simply set up a blockstate.
2020-08-05 20:59:59 +01:00
Dylan K. Taylor
764f92c456
BlockLegacyIdHelper: fixed a mistake in exception message
2020-08-03 23:59:06 +01:00
Dylan K. Taylor
977f9ec497
Merge branch 'stable'
...
# Conflicts:
# composer.lock
# resources/vanilla
# src/VersionInfo.php
# src/pocketmine/block/Podzol.php
2020-07-21 11:57:24 +01:00
Dylan K. Taylor
213afa42dd
BlockFactory: make registerElements() a bit less wide
2020-07-19 13:09:48 +01:00
Dylan K. Taylor
915d63a2e8
Button: rename powered property to pressed
2020-07-17 14:54:51 +01:00
Dylan K. Taylor
b09b619a30
updated VanillaBlocks
2020-07-17 14:23:32 +01:00
Dylan K. Taylor
2226efd7a0
added base data handling for Lab Table, Compound Creator, Element Constructor and Material Reducer
...
these also have a blockentity which needs to be implemented as well.
2020-07-11 17:44:50 +01:00
Dylan K. Taylor
d4f6dc8179
BlockFactory: make color block registration slightly less painful to look at
2020-07-11 10:50:02 +01:00
Dylan K. Taylor
62815f6c9b
Furnace: get rid of entirely unnecessary ItemFactory usage
2020-07-10 21:38:29 +01:00
Dylan K. Taylor
279abb871d
Remove all usages of CompoundTag->hasTag()
...
in pretty much every case, these usages really wanted to read the tag's contents anyway, which can be combined with a getTag() and instanceof call for more concise and static analysis friendly code.
In the few cases where the tag contents wasn't needed, it still wanted to check the type, which, again, can be done in a more static analysis friendly way by just using getTag() and instanceof.
2020-07-10 21:01:43 +01:00
Frago9876543210
c1a815a458
Sign (block): added setText() ( #3100 )
2020-07-09 13:43:42 +01:00
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