197 Commits

Author SHA1 Message Date
Dylan K. Taylor
bd8dd48dee
Assign new IDs to every block 2022-05-27 18:07:31 +01:00
Dylan K. Taylor
68491be847
Merge branch 'next-major' into modern-world-support 2022-05-20 11:21:35 +01:00
ipad54
1e59679ec2
Implemented Stonecutter (#4732) 2022-05-17 16:01:03 +01:00
Dylan K. Taylor
d922f003f6
Fixed consistency check 2022-05-12 20:39:03 +01:00
Dylan K. Taylor
3c5300556a
Fixed tests 2022-03-23 15:27:57 +00:00
Dylan K. Taylor
334c9daa6a
BlockFactory: change property cache arrays to use regular arrays instead of SplFixedArray
this does come at a performance cost, but is necessary for metadata expansion.

we finally concede that this is not going to happen without BC breaks, however small they might be ...
2022-03-23 15:22:57 +00:00
Dylan K. Taylor
c2d3b23449
fixed BlockFactory consistency test - remapped states are no longer returned by getAllKnownStates() 2022-02-07 18:04:02 +00:00
Dylan K. Taylor
7a0f62ce5a
Merge branch 'next-minor' into modern-world-support 2022-02-07 17:23:19 +00:00
Dylan K. Taylor
e9dd9df0a0
Merge remote-tracking branch 'origin/stable' into staging/4.1 2022-02-07 17:22:18 +00:00
Dylan K. Taylor
032b15efe0
fix BlockFactory consistency check 2022-02-07 15:49:32 +00:00
Dylan K. Taylor
40e46dbca2
Fixed tests 2022-02-01 04:08:28 +00:00
Dylan K. Taylor
42d07c74d7
added missing redstone power flag logic 2022-01-15 22:19:47 +00:00
ipad54
1366c49f1f
Implemented Lectern (#4708)
Co-authored-by: Covered123 <58715544+JavierLeon9966@users.noreply.github.com>
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
2022-01-15 21:21:29 +00:00
Dylan K. Taylor
8b73549355
Use JSON_THROW_ON_ERROR for json_encode() and json_decode() 2021-12-08 19:14:07 +00:00
Dylan K. Taylor
52f0c4f3ed
Removed dodgy test using invalid block metadata 2021-11-27 22:51:14 +00:00
Dylan K. Taylor
e2815eed60
BlockFactory: remap a bunch more invalid states 2021-11-27 20:07:58 +00:00
Dylan K. Taylor
1bc7869f6e
Added remapping for almost 4000 invalid blockstates
when a block has sole ownership of an ID, the state bitmask can be ignored and we can just claim the whole metadata range for that single block.
This fixes a large number of issues with unknown blocks on older worlds where world editors did not remove the metadata, although update blocks will currently still appear on initial chunk send due to lack of AOT conversion (TODO).
2021-11-26 01:58:52 +00:00
IceCruelStuff
49c1e4c06e
Implement fletching table (#4501) 2021-10-12 21:21:05 +01:00
Dylan K. Taylor
df3b112877
Implemented slime blocks 2021-09-05 20:46:59 +01:00
Dylan T
27e0ecf7ee
Implemented Blast Furnace and Smoker (#4362) 2021-08-12 23:27:05 +01:00
Angel
309bed414f
Implemented sweet berries (#4164)
this doesn't implement the server-side logic for the "stickiness" (slowdown) because we don't have the system needed for it yet.
It also doesn't have parity with vanilla on the damage.
2021-07-19 20:01:33 +01:00
Dylan K. Taylor
71df15b4cc
Removed FlowerPot update_bit hack 2021-07-19 17:39:35 +01:00
Dylan K. Taylor
5874ce582a
Implemented bells 2021-07-19 17:00:56 +01:00
Aericio
fc090e238d
Add Shulker Boxes (#3678)
this implementation is working, although incomplete:

- The shulker close sound should not be played until the end of the shulker closing animation, which takes approximately 1 second.
- An open shulker box has a different collision box than a closed one - it should be +0.5 in whichever direction the shulker is facing. (During the animation, the bounding box also dynamically changes size - you can see this in vanilla by shooting an arrow into the top of an open shulkerbox facing UP, and then closing it - the arrow will fall and collide with the lid multiple times.

However, resolving both of these issues requires significant internal changes which are beyond the scope of this PR.
2021-07-10 19:48:38 +01:00
Dylan K. Taylor
4e731f61af
BlockFactory: Remap double slab IDs with 0x8 bit set to their base DOUBLE state, instead of BOTTOM
this was causing problems with slabs in converted Java worlds, where the
0x8 bit means 'smooth', instead of 'double'. In MCPE it has no effect.

Since Slab doesn't retain the high/low flag for DOUBLE type slabs, this
caused BlockFactory to assume that those states were invalid, and
remapped them to their base state instead.

The following changes resulted in the consistency check:

Remap changed for 43:8 (44:0 (Smooth Stone Slab) -> 43:0 (Smooth Stone Slab))
Remap changed for 43:9 (44:1 (Sandstone Slab) -> 43:1 (Sandstone Slab))
Remap changed for 43:10 (44:2 (Fake Wooden Slab) -> 43:2 (Fake Wooden Slab))
Remap changed for 43:11 (44:3 (Cobblestone Slab) -> 43:3 (Cobblestone Slab))
Remap changed for 43:12 (44:4 (Brick Slab) -> 43:4 (Brick Slab))
Remap changed for 43:13 (44:5 (Stone Brick Slab) -> 43:5 (Stone Brick Slab))
Remap changed for 43:14 (44:6 (Quartz Slab) -> 43:6 (Quartz Slab))
Remap changed for 43:15 (44:7 (Nether Brick Slab) -> 43:7 (Nether Brick Slab))
Remap changed for 157:8 (158:0 (Oak Slab) -> 157:0 (Oak Slab))
Remap changed for 157:9 (158:1 (Spruce Slab) -> 157:1 (Spruce Slab))
Remap changed for 157:10 (158:2 (Birch Slab) -> 157:2 (Birch Slab))
Remap changed for 157:11 (158:3 (Jungle Slab) -> 157:3 (Jungle Slab))
Remap changed for 157:12 (158:4 (Acacia Slab) -> 157:4 (Acacia Slab))
Remap changed for 157:13 (158:5 (Dark Oak Slab) -> 157:5 (Dark Oak Slab))
Remap changed for 181:8 (182:0 (Red Sandstone Slab) -> 181:0 (Red Sandstone Slab))
Remap changed for 181:9 (182:1 (Purpur Slab) -> 181:1 (Purpur Slab))
Remap changed for 181:10 (182:2 (Prismarine Slab) -> 181:2 (Prismarine Slab))
Remap changed for 181:11 (182:3 (Dark Prismarine Slab) -> 181:3 (Dark Prismarine Slab))
Remap changed for 181:12 (182:4 (Prismarine Bricks Slab) -> 181:4 (Prismarine Bricks Slab))
Remap changed for 181:13 (182:5 (Mossy Cobblestone Slab) -> 181:5 (Mossy Cobblestone Slab))
Remap changed for 181:14 (182:6 (Smooth Sandstone Slab) -> 181:6 (Smooth Sandstone Slab))
Remap changed for 181:15 (182:7 (Red Nether Brick Slab) -> 181:7 (Red Nether Brick Slab))
Remap changed for 422:8 (417:0 (End Stone Brick Slab) -> 422:0 (End Stone Brick Slab))
Remap changed for 422:9 (417:1 (Smooth Red Sandstone Slab) -> 422:1 (Smooth Red Sandstone Slab))
Remap changed for 422:10 (417:2 (Polished Andesite Slab) -> 422:2 (Polished Andesite Slab))
Remap changed for 422:11 (417:3 (Andesite Slab) -> 422:3 (Andesite Slab))
Remap changed for 422:12 (417:4 (Diorite Slab) -> 422:4 (Diorite Slab))
Remap changed for 422:13 (417:5 (Polished Diorite Slab) -> 422:5 (Polished Diorite Slab))
Remap changed for 422:14 (417:6 (Granite Slab) -> 422:6 (Granite Slab))
Remap changed for 422:15 (417:7 (Polished Granite Slab) -> 422:7 (Polished Granite Slab))
Remap changed for 423:8 (421:0 (Mossy Stone Brick Slab) -> 423:0 (Mossy Stone Brick Slab))
Remap changed for 423:9 (421:1 (Smooth Quartz Slab) -> 423:1 (Smooth Quartz Slab))
Remap changed for 423:10 (421:2 (Stone Slab) -> 423:2 (Stone Slab))
Remap changed for 423:11 (421:3 (Cut Sandstone Slab) -> 423:3 (Cut Sandstone Slab))
Remap changed for 423:12 (421:4 (Cut Red Sandstone Slab) -> 423:4 (Cut Red Sandstone Slab))
2021-07-08 20:37:19 +01:00
Dylan K. Taylor
e43bca95bf
Fixed build 2021-06-26 17:40:43 +01:00
Dylan K. Taylor
2a6009f8bf
Check consistency of block remaps 2021-06-21 20:45:30 +01:00
Dylan K. Taylor
61c59be299
Replace hardcoded block metadata shifts and masks with constants
we might want to make these bigger than 4 bits in the future.
2021-06-16 12:48:09 +01:00
Dylan K. Taylor
f655d262be
Added stripped all-sided-log variants
again, these should be dynamic; but right now it's not possible.
2021-05-22 12:43:07 +01:00
Dylan K. Taylor
24405b63c1
Coarse is now a state of Dirt, instead of a separate block 2021-05-21 21:36:49 +01:00
Dylan K. Taylor
df260034cd
BlockFactory: Fill default state for all variants covered by bitmask when mismatch occurs 2021-05-21 21:12:34 +01:00
Dylan K. Taylor
af678f985d
All types of coral now have fully dynamic types 2021-05-19 22:49:44 +01:00
Dylan K. Taylor
e8cb49f7ae
php-cs-fixer fixing php-cs-fixer's own mess 2021-05-05 11:25:11 +01:00
Dylan K. Taylor
726978b8f1
Migrate all coloured blocks (except glazed terracotta) to dynamic colours 2021-04-29 20:11:03 +01:00
Dylan K. Taylor
593a8ac529
Added Loom blocks
these don't support doing patterns yet, but their inventories work.
2021-04-29 19:51:09 +01:00
Dylan K. Taylor
2eb05a2420
Updated block factory consistency check 2021-04-27 21:00:22 +01:00
Dylan K. Taylor
a32eb4ebc3
Implemented coral and coral fans
this implementation is very rough due to having to hack around lots more MCPE bullshit, and currently doesn't allow dynamic coral types; but it's there. We'll clean this up after 1.13 migration is done.
2021-04-17 02:04:10 +01:00
Dylan K. Taylor
81ced66bd0
BlockIdentifier: variant parameter of constructor is now mandatory 2021-04-16 20:14:29 +01:00
Dylan K. Taylor
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
Dylan K. Taylor
fd2ebd84b4
Recognize underwater TNT 2021-02-06 23:37:05 +00:00
Dylan K. Taylor
ae75d73f48
Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
Dylan K. Taylor
870d237260 BlockFactory::get() second parameter is now mandatory 2020-11-18 00:50:01 +00:00
Dylan K. Taylor
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
Aericio
b2765f32e9 Implemented Barrels, closes #3672 2020-11-16 17:26:07 +00:00
Dylan K. Taylor
be1da07ee5 tests: phpdoc cleanup 2020-11-01 14:23:44 +00:00
Dylan K. Taylor
d6d9dde0b2 imports cleanup 2020-11-01 14:23:21 +00:00
Dylan K. Taylor
73a8c90bee Merge remote-tracking branch 'origin/stable'
# Conflicts:
#	resources/vanilla
#	src/world/Explosion.php
#	tests/phpunit/item/ItemTest.php
#	tests/phpunit/world/format/io/region/RegionLoaderTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMainLoggerTest.php
#	tests/plugins/TesterPlugin/src/pmmp/TesterPlugin/tests/AsyncTaskMemoryLeakTest.php
2020-11-01 14:21:47 +00:00
Dylan K. Taylor
500fd2d842 tests: strip useless phpdoc 2020-10-26 15:59:17 +00:00
Dylan K. Taylor
792f38f474 Carpet and Wool now have dynamic colours 2020-10-15 14:45:28 +01:00
Dylan K. Taylor
0ef0848c44 Concrete and ConcretePowder colour is now dynamic 2020-10-15 14:30:07 +01:00