Commit Graph

19 Commits

Author SHA1 Message Date
0f7f5362b8 Revert "Block: Get rid of state bitmasks"
This reverts commit b7b05e729e.

Apparently this was premature, because we still need these things to deal with default state remapping.
2019-02-24 18:30:18 +00:00
b7b05e729e Block: Get rid of state bitmasks
This story dates back to the days when getVariantBitmask() was introduced. The purpose of this function was to allow the variant info to be extracted from the metadata, for use with item drops. This was later changed to state bitmask for reasons I don't clearly recall.
In the great 4.0 refactor, we now store variant magic numbers separately, so we don't need any generic bitmask to split up variant and state information anymore. Variant is now only ever serialized and never deserialized. The same thing goes for blockIDs. States are read from the world by matching the full stateID against a table of prefilled known blocks, so the variant doesn't need to be deserialized - only the state does, and the state metadata readers already do bit fuckery by themselves and don't need this mask - notice how little actual changes were required to get rid of this?
2019-02-24 14:42:53 +00:00
635fb5dde4 Clean up ID flattening hacks 2019-02-21 10:38:29 +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
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
c721503b7a Merge branch 'release/3.3' 2018-09-18 12:22:32 +01:00
0e2bbc44db Fixed drops and item picking of Brewing Stand 2018-09-18 12:22:12 +01:00
f7f06c993d Make block constructors not write to this->meta directly 2018-09-16 14:10:40 +01: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
6e30d23254 Added missing properties for several blocks 2017-12-13 16:28:21 +00:00
55d0684565 Move block-breaking tool-type constants to a BlockToolType interface 2017-12-12 13:45:52 +00:00
41c6cb6f97 Added Block->getVariantBitmask(0 to cut down on getDrops() boilerplate, fixed several blocks incorrectly retaining meta when broken 2017-08-18 19:49:28 +01:00
83af4dcd59 Block API typehints 2017-08-17 13:50:19 +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
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
6fc435da0e Imports rearrangement 2016-10-03 00:43:46 +08:00
2a4f85107d Less duplication, more consistency 2016-09-28 13:59:53 +01:00
2ddc4455c5 Added some blocks and items 2015-11-29 01:46:35 +01:00