Commit Graph

43 Commits

Author SHA1 Message Date
81ced66bd0 BlockIdentifier: variant parameter of constructor is now mandatory 2021-04-16 20:14:29 +01:00
06f20234f7 Scrub unused imports 2021-03-26 22:56:09 +00:00
e80c1a0ce9 Split Mushroom Stem away from other mushroom variants
mushroom stem (and all-sided stem) are unique blocks, which don't drop anything and which don't stack with other shroom variants when block-picked.
They also get mapped to the same block when placed, and there's no distinction between red mushroom stem and brown mushroom stem.
2021-02-07 22:02:50 +00:00
7c1f0ecb8b Fixed getAxis()/setAxis() not being seen by static analysers for some blocks
when using VanillaBlocks::CHISELED_QUARTZ(), VanillaBlocks::PURPUR_PILLAR() or VanillaBlocks::QUARTZ_PILLAR(), static analysis was unable to detect getAxis() and setAxis(), because these blocks were implemented using anonymous classes.
2021-02-06 20:39:23 +00:00
9887138ac1 Get rid of anonymous classes for infested stone 2021-02-06 20:30:25 +00:00
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
a9faed7171 [ci skip] update BlockFactory TODOs 2020-11-16 18:23:01 +00:00
1eee24f1fa Implemented coral blocks
there are some complications with coral plants due to the fact we're stuck with R12 worlds right now - and also coral fans are a major pain to implement due to how messed up the metadata is.
2020-11-16 18:05:39 +00:00
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
06efad94b6 Separated metadata handling from PillarRotationTrait 2020-11-14 16:21:50 +00:00
518a7827a6 BlockFactory: make slab registration slightly less awful to look at 2020-11-03 19:28:32 +00:00
792f38f474 Carpet and Wool now have dynamic colours 2020-10-15 14:45:28 +01:00
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00
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
d3a3a41d2b Revert back to separated floor/wall sign
the conditionally useless properties are problematic.
2020-10-04 17:52:23 +01:00
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
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
14c156b162 Added ChemicalHeat block stub 2020-10-01 14:46:14 +01:00
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
205617f29e Untether LightUpdate and children from BlockFactory 2020-09-08 18:14:35 +01:00
bf401421fa Implemented bamboo (#3762) 2020-08-16 20:39:51 +01:00
6920deac2c BlockFactory: regenerated TODO lists 2020-08-15 19:47:38 +01:00
ff2a3baa8e Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
2020-08-07 21:07:58 +01:00
213afa42dd BlockFactory: make registerElements() a bit less wide 2020-07-19 13:09:48 +01:00
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
d4f6dc8179 BlockFactory: make color block registration slightly less painful to look at 2020-07-11 10:50:02 +01:00
68c408268c Separate dye colour ID management from DyeColor enum 2020-07-05 19:04:22 +01:00
bf5da596f7 Get rid of WALL metadata mapping 2020-07-05 18:27:10 +01:00
79d8bf898a Moved glazed-terracotta ID-mapping table to BlockLegacyIdHelper 2020-07-05 18:20:41 +01:00
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
7e6adc41f0 Merge 1.16 support into PM4 (with changes) 2020-06-26 22:21:09 +01:00
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
ac5cf2443e convert TileFactory to singleton 2020-04-26 01:11:30 +01:00
5cc03775d3 added a SingletonTrait to reduce code duplication 2020-04-24 00:31:55 +01:00
13d784cd0c Convert BlockFactory to singleton 2020-04-23 23:45:13 +01:00
fd675449e9 BlockFactory: fill blastResistance with float(0)
technically there wasn't anything wrong with this code, but it caused the type inference to report incompatibility, and I can't be bothered to report a PHPStan bug.
2020-02-07 22:06:34 +00:00
347b94b284 Merge branch 'stable' 2020-02-07 20:18:17 +00:00
fb1126797a Merge branch 'stable' 2020-02-07 18:13:55 +00:00
055b13a6cf strip extra blank lines (php-cs-fixer) 2020-01-22 15:14:10 +00:00
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
6a4ae4cb94 remove position parameters from BlockFactory::get() and BlockFactory::fromFullBlock() 2019-08-24 17:19:27 +01:00
591d35889e make use of EnumTrait->id() 2019-08-17 16:37:36 +01:00
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00