Dylan K. Taylor
7ef794d725
imports cleanup
2020-10-04 18:22:07 +01:00
Dylan K. Taylor
d3a3a41d2b
Revert back to separated floor/wall sign
...
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
Dylan K. Taylor
e6bf7278fc
Sign: remove obsolete clone hook
...
this is no longer required because SignText is not mutable anymore.
2020-10-04 17:24:40 +01:00
Dylan K. Taylor
388a19ef5d
Persistent block metadata may now have mutable parts
...
Not allowing this makes stuff like anvil damage, colour, wood type, live/dead bit, wet/dry etc all too much hassle to deal with.
Naturally I want to get rid of this shit altogether, but first it's necessary to construct a new system that we can shift into before all this bullshit can be addressed fully, so for now we have to work within the bounds of the old system.
This change will permit dynamic colours for concrete/concrete powder etc, dynamic wood types where the wood type isn't embedded in the legacy ID, and so forth. Allowing full flexibility requires either more old system hacks or completing the migration to a new system which doesn't have these limitations. I prefer to do the latter, but this change will make it somewhat easier to do.
2020-10-04 11:40:05 +01:00
Dylan K. Taylor
5807a385cc
Added stub classes for Beacon
...
this doesn't do anything yet, it's intended solely to prevent further loss of data.
2020-10-02 00:59:53 +01:00
Dylan K. Taylor
84feec954f
BlockLegacyMetadata: Added constants for mushroom block variants
2020-10-01 21:41:46 +01:00
Dylan K. Taylor
14c156b162
Added ChemicalHeat block stub
2020-10-01 14:46:14 +01:00
Dylan K. Taylor
12087c9850
Wall: use facing as value as well as key in connections
2020-09-26 17:41:00 +01:00
Dylan K. Taylor
9e3ff21aea
Wall: remove unused import
2020-09-26 17:26:54 +01:00
Dylan K. Taylor
ec7c5fd669
Added a BrewingStandSlot enum
2020-09-26 17:20:02 +01:00
Dylan K. Taylor
7b02cc3efd
Implemented #3836 : Replace setCancelled() in events with cancel() and uncancel()
...
The motivation for this is to prevent passing a dynamic argument to cancellation, which in almost all cases is a bug in user code. This same mistake also appears in a few places in the PM core (as seen in this commit), but in those cases the mistakes were mostly harmless since they were taking place before the event was actually called.
closes #3836
2020-09-26 14:31:56 +01:00
Dylan K. Taylor
8e12693494
Entity: Invalid blocksAround cache when something happens during onEntityInside()
...
this fixes TNT spawning multiple entities when lit by flaming arrows.
The problem here is a bit more complex (entities aren't immediately notified when local block updates happen, so they cache stuff that becomes unusable). The simplest option would be to just lose the cache, but that would have some impacts on performance.
Barring a rethink of the block updating mechanism, this solution seems usable for now.
2020-09-25 16:35:59 +01:00
Dylan K. Taylor
c7070788f9
Rename and repurpose Block->diffusesSkyLight to blocksDirectSkyLight
...
this new form allows skipping some useless checks during sky light calculation and also allows getting rid of the last hard dependency on core Block classes.
We're getting real close to native light now.
2020-09-08 22:40:05 +01:00
Dylan K. Taylor
205617f29e
Untether LightUpdate and children from BlockFactory
2020-09-08 18:14:35 +01:00
Dylan K. Taylor
f45316d2d6
Leaves: fixed phpstan type doc error
...
for some reason this isn't reported unless bleeding edge is enabled.
2020-09-06 16:12:24 +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
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