Merge remote-tracking branch 'origin/stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2022-01-27 00:40:34 +00:00
commit a7bdef69e2
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
5 changed files with 29 additions and 17 deletions

View File

@ -1620,3 +1620,10 @@ Released 21st January 2022.
- Fixed ender pearls teleporting players when thrown by a player directly against a wall when cancelling `ProjectileLaunchEvent`.
- Fixed collision box of brewing stand.
- Fixed break times and tool types of bamboo, nether wart blocks, infested stone and leaves.
# 4.0.8
Released 25th January 2022.
## Fixes
- Fixed ender chest not dropping itself when mined with a Silk Touch pickaxe.
- The correct amount of fall damage is now taken when falling from a height onto hay bales.

View File

@ -41,7 +41,7 @@
"pocketmine/classloader": "^0.2.0",
"pocketmine/color": "^0.2.0",
"pocketmine/errorhandler": "^0.6.0",
"pocketmine/locale-data": "~2.3.0",
"pocketmine/locale-data": "~2.4.2",
"pocketmine/log": "^0.4.0",
"pocketmine/log-pthreads": "^0.4.0",
"pocketmine/math": "^0.4.0",

26
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "292d4bf59374d46e1ae84272f0abd522",
"content-hash": "9aa2f11ba68d00423732973554fafb20",
"packages": [
{
"name": "adhocore/json-comment",
@ -536,16 +536,16 @@
},
{
"name": "pocketmine/locale-data",
"version": "2.3.33",
"version": "2.4.3",
"source": {
"type": "git",
"url": "https://github.com/pmmp/Language.git",
"reference": "44998ca9c055f872a33e59cd4d2736d081ba84b5"
"reference": "4d0b081f1a79407e087968ea76aaf330db6ea2b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pmmp/Language/zipball/44998ca9c055f872a33e59cd4d2736d081ba84b5",
"reference": "44998ca9c055f872a33e59cd4d2736d081ba84b5",
"url": "https://api.github.com/repos/pmmp/Language/zipball/4d0b081f1a79407e087968ea76aaf330db6ea2b5",
"reference": "4d0b081f1a79407e087968ea76aaf330db6ea2b5",
"shasum": ""
},
"type": "library",
@ -553,9 +553,9 @@
"description": "Language resources used by PocketMine-MP",
"support": {
"issues": "https://github.com/pmmp/Language/issues",
"source": "https://github.com/pmmp/Language/tree/2.3.33"
"source": "https://github.com/pmmp/Language/tree/2.4.3"
},
"time": "2022-01-16T22:08:04+00:00"
"time": "2022-01-25T23:18:24+00:00"
},
{
"name": "pocketmine/log",
@ -2389,16 +2389,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.5.12",
"version": "9.5.13",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "93d4bf4c37aec6384bb9e5d390d9049a463a7256"
"reference": "597cb647654ede35e43b137926dfdfef0fb11743"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/93d4bf4c37aec6384bb9e5d390d9049a463a7256",
"reference": "93d4bf4c37aec6384bb9e5d390d9049a463a7256",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743",
"reference": "597cb647654ede35e43b137926dfdfef0fb11743",
"shasum": ""
},
"require": {
@ -2476,7 +2476,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.12"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13"
},
"funding": [
{
@ -2488,7 +2488,7 @@
"type": "github"
}
],
"time": "2022-01-21T05:54:47+00:00"
"time": "2022-01-24T07:33:35+00:00"
},
{
"name": "sebastian/cli-parser",

View File

@ -39,6 +39,9 @@ class Cobweb extends Flowable{
}
public function getDropsForCompatibleTool(Item $item) : array{
if(($item->getBlockToolType() & BlockToolType::SHEARS) !== 0){
return [$this->asItem()];
}
return [
VanillaItems::STRING()
];

View File

@ -971,6 +971,8 @@ class World implements ChunkManager{
public function createBlockUpdatePackets(array $blocks) : array{
$packets = [];
$blockMapping = RuntimeBlockMapping::getInstance();
foreach($blocks as $b){
if(!($b instanceof Vector3)){
throw new \TypeError("Expected Vector3 in blocks array, got " . (is_object($b) ? get_class($b) : gettype($b)));
@ -980,7 +982,7 @@ class World implements ChunkManager{
$blockPosition = BlockPosition::fromVector3($b);
$packets[] = UpdateBlockPacket::create(
$blockPosition,
RuntimeBlockMapping::getInstance()->toRuntimeId($fullBlock->getFullId()),
$blockMapping->toRuntimeId($fullBlock->getFullId()),
UpdateBlockPacket::FLAG_NETWORK,
UpdateBlockPacket::DATA_LAYER_NORMAL
);
@ -1129,6 +1131,7 @@ class World implements ChunkManager{
$entity->onRandomUpdate();
}
$blockFactory = BlockFactory::getInstance();
foreach($chunk->getSubChunks() as $Y => $subChunk){
if(!$subChunk->isEmptyFast()){
$k = 0;
@ -1145,8 +1148,7 @@ class World implements ChunkManager{
$state = $subChunk->getFullBlock($x, $y, $z);
if(isset($this->randomTickBlocks[$state])){
/** @var Block $block */
$block = BlockFactory::getInstance()->fromFullBlock($state);
$block = $blockFactory->fromFullBlock($state);
$block->position($this, $chunkX * Chunk::EDGE_LENGTH + $x, ($Y << SubChunk::COORD_BIT_SIZE) + $y, $chunkZ * Chunk::EDGE_LENGTH + $z);
$block->onRandomTick();
}