Commit Graph

103 Commits

Author SHA1 Message Date
2a3e6dcf00 Rename BlockIds -> BlockLegacyIds 2019-03-23 19:46:31 +00:00
79ef8e0803 Replace all legacy blockID references with BlockIds:: 2019-03-23 19:44:33 +00:00
f84d7ad70d sync block TODOs 2019-03-23 19:21:11 +00:00
6efdac63d0 added new Wood block 2019-03-23 19:18:25 +00:00
06a37cc462 Fixed "wood" collision
why the fuck Mojang...
2019-03-23 19:08:17 +00:00
1e096a408a Cram Nether Portal
again, this is here for the state handling and the implementation is unfinished.
2019-03-23 18:38:14 +00:00
74e134136d Make Infested Stone blocks known
this is not remotely a complete implementation, it's just here to make PM aware of these states so that world conversion can be handled correctly. A full implementation will come later.

Any blocks added in this fashion should be marked with a //TODO so future maintainers can find which blocks need work.
2019-03-23 18:28:29 +00:00
a8fa8572e1 partial sea pickle implementation 2019-03-23 18:11:27 +00:00
905cb7544a hack in different wood sign types 2019-03-23 15:44:28 +00:00
2966e87aae BlockFactory: Regenerate TODO list 2019-03-21 14:33:56 +00:00
7f4b76aa86 Implemented blue ice 2019-03-12 19:38:03 +00:00
48427290c9 Regenerated BlockFactory TODOs 2019-03-10 19:53:55 +00:00
437750785f Implemented barrier block 2019-03-10 19:53:55 +00:00
c2a069afd3 Implemented a bunch of new wood blocks 2019-03-10 19:53:24 +00:00
8f1bc5d497 Flatten wall_banner and wall_sign into single blocks (#2798)
This comes with some problems, but the problems are more bearable than the previous code.
2019-03-08 16:37:26 +00:00
943906cc6b Partial comparator implementation
this supports placement, toggling compare/subtract mode, simple stuff. No redstone functionality yet.
This is needed for blockstate mapping in blockfactory.
2019-02-28 19:26:47 +00:00
9ad0ea85c7 Rename two misleadingly-named functions 2019-02-27 12:59:12 +00:00
53af7f5da8 Implemented dragon egg 2019-02-26 15:35:37 +00:00
2d51622b12 Implemented frosted ice 2019-02-26 15:34:48 +00:00
fb378d9091 BlockFactory: fixed auto complete 2019-02-24 18:41:12 +00:00
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
6edd4fd9c7 BlockFactory: added getAllKnownStates() 2019-02-24 13:40:59 +00:00
899081e1b9 Level: fixed randomTickBlocks, also delete some useless code
the randomTickBlocks thing is populated with state IDs anyway, not variants...
2019-02-24 13:10:45 +00:00
369a1e1472 Tripwire: fixed block picking 2019-02-24 12:41:44 +00:00
a5c260352d Infect remaining places with PHP 7.1 nullable typehints 2019-02-22 12:16:45 +00:00
2bfcd25848 Fixed typo in Repeater name 2019-02-21 18:41:04 -05:00
28d01025b0 Improve consistency of handling coloured and wooden blocks
this is ugly, but less ugly than the earlier version.
2019-02-21 12:13:21 +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
2c8a065b94 Standardise SNAKE_CASE for surrogate enums 2019-02-20 11:14:07 +00:00
88c4b836f0 Make factory register methods less verbose 2019-02-20 10:24:44 +00:00
f351a86653 Flatten double slabs into Slab pseudo-variant 2019-02-19 11:14:06 +00:00
6f4cec6465 add some blocks introduced in 1.9 2019-02-18 20:01:50 +00:00
b8adfd6948 edu: implement coloured and underwater torches 2019-02-18 11:37:57 +00:00
cd733c658b Implement hard glass & hard glass pane 2019-02-18 10:50:29 +00:00
00b92eaa40 BlockFactory: Sort entries lexicographically ascending 2019-02-17 19:44:48 +00:00
1496eefb8b Regenerated TODOs for item and b,locks
this sucks because it doesn't tell us anything about things that are meta values of other things (like dyes), but it's enough to start with.
2019-02-12 19:15:19 +00:00
59b62eaeba Merge branch '3.6' 2019-02-12 16:59:06 +00:00
372545e47e Merge branch '3.5' into 3.6 2019-02-12 16:56:53 +00:00
8913b48700 "Implement" info-update and reserved6 2019-02-12 16:56:12 +00:00
6ee4a0e090 Implement invisible bedrock to fix placement issues
I don't know why this wasn't done a long time ago, but here it is.
2019-02-12 16:41:23 +00:00
7b3993730a Block: Replace Color and WoodType magic numbers with type-safe objects
this provides automatic type safety without the need for magic number value checking everywhere.
2019-02-12 13:52:59 +00:00
0c89159cf2 Merge branch '3.6' 2019-02-09 19:22:00 +00:00
b8703d5dff Protocol changes for 1.9.0 2019-02-07 21:56:42 +00:00
adc1069ed2 Merge branch '3.5' 2019-01-04 23:28:44 +00:00
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
78a80a6958 Tighten validity checks for block metadata
This filters out over 200 invalid states which were previously considered just fine, including zero-width cakes, buttons with broken facing values, furnace/chest with crazy values, and more.
2018-12-28 14:33:09 +00:00
c53d3c28fb Register a couple of simple missing redstone blocks 2018-12-05 19:11:54 +00:00
281d8fd813 Redstone torch is lit by default 2018-12-05 15:07:18 +00:00