Commit Graph

34 Commits

Author SHA1 Message Date
79ef8e0803 Replace all legacy blockID references with BlockIds:: 2019-03-23 19:44:33 +00:00
a5c260352d Infect remaining places with PHP 7.1 nullable typehints 2019-02-22 12:16:45 +00:00
89fce7712a Block: Clean up internal constructor inconsistencies
I don't dare look how big this commit is or how many bugs it introduced...
2019-02-20 19:21:51 +00:00
7170d9009d Enchantment: more static getters, firehose magic numbers
This is similar in nature to 646fea5a4e.

On a side note: Migrating this way is a pain in the ass due to lack of types. What the heck is int supposed to mean?!?!?!?! At least if we wanted to go _back_ to magic numbers, it would be easy to locate everything with an Enchantment typehint...
2019-02-20 13:45:50 +00:00
d83f024a1f Merge branch '3.5' 2019-01-05 09:27:16 +00:00
254281cd5e Ice: don't create water for creative players, fixes #2622 2019-01-05 09:26:35 +00:00
75f364fcf2 Level: Remove obsolete \$direct parameter from setBlock()
this parameter was previously used to send blocks with a different set of flags, immediately, to players. However, the flags have been demonstrated useless and the direct sending is pointless now since packets are buffered now per session, so we might as well take advantage of the batched block update sending.
2018-09-27 16:15:07 +01:00
56d9943b0d Nuke Block->meta, split into variant and state properties, lots of cleanup
This is a major change to the way block metadata is handled within the PM core. This separates variant metadata (which really ought to be part of the ID) from state metadata, and in a couple of cases flattens separate states of blocks together.

The result of this is that invalid variants can be much more easily detected, and additionally state handling is much cleaner since meta is only needed at the serialize layer instead of throughout the code.
2018-09-21 19:28:10 +01:00
f7f06c993d Make block constructors not write to this->meta directly 2018-09-16 14:10:40 +01:00
86eee429bb Block: Split onUpdate() into several functions, removed Level::BLOCK_UPDATE_* constants
This allows the removal of lots of ugly code, and also exposes lots of similarities with how this update type was handled. This can be further improved in the future to more generically handle cases.

I realized in the process of changing this, that it might actually be simpler to treat to treat scheduled updates and neighbour updates as one and the same. They use the same mechanism for being saved on chunks (TileTicks),
and doing that would make updating only require one queue instead of two.

RedstoneOre: use onActivate() to trigger glowing
this is not technically correct behaviour, but this preserves the current behaviour.
2018-03-13 17:29:46 +00:00
8d7c65585c Enchantment: Implement Silk Touch (#1912) 2018-01-14 13:37:27 +00:00
4f8e4f0522 Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
56f1a6ba37 Block: Migrated all trivial drops code to getDropsForCompatibleTool()
getDrops() should now be overridden only for special cases. There are some non-trivial overrides left that are going to need some extra work to clean up.
2017-12-13 12:49:58 +00:00
55d0684565 Move block-breaking tool-type constants to a BlockToolType interface 2017-12-12 13:45:52 +00:00
ebda6ec19b Cleaned up random-block-ticking registration 2017-08-25 11:47:38 +01:00
d6266d19b6 Added correct friction factor for ice & packed-ice 2017-08-23 18:38:09 +01:00
b8ade18888 Fixed double plants and beds sometimes dropping in creative 2017-08-21 19:25:04 +01:00
02f42eba48 Move block registration to its own class 2017-08-20 18:05:01 +01:00
0e24596aed Changed block construction calls to Block::get() 2017-08-19 13:46:17 +01:00
d8f0dd6db8 Changed Block->getDrops() to return Item[] 2017-08-18 11:21:33 +01:00
83af4dcd59 Block API typehints 2017-08-17 13:50:19 +01:00
b6fe231bc1 Added melting for ice and snow layers 2017-07-30 17:27:28 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
61d354a4ea Block constructor mass-replace to fix #963 and related issues 2017-06-05 10:02:27 +01:00
dab73d8950 Implemented sky light generation-time population and updating, obsolete and close #160 2017-04-18 13:05:01 +01:00
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
0380e9009a Added block break tool type, fixed falling sand, fixed duplicated jungle leaves 2015-07-27 20:31:55 +02:00
26c9eed82e Added all block hardness 2015-07-27 20:31:55 +02:00
747f7685e7 Fix formatting issues due to bad IDE settings 2014-12-07 16:30:04 +01:00
a0d4bff385 Block creating and property handling rewrite, part1 2014-12-07 01:53:27 +01:00
ac4b4b08fd Fixed Level::setBlock() old calls 2014-09-05 11:00:13 +02:00
6cbd39de9b Added Inventory interfaces and types, updated long array() to [] 2014-05-22 18:59:16 +02:00
c1546aac9c Updated Position to use Weak / strong references for Level objects 2014-05-22 04:14:06 +02:00
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00