mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 23:44:17 +00:00
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
This commit is contained in:
commit
73a8c90bee
@ -210,11 +210,11 @@ abstract class BaseInventory implements Inventory{
|
||||
for($i = 0, $size = $this->getSize(); $i < $size; ++$i){
|
||||
$slot = $this->getItem($i);
|
||||
if($item->equals($slot)){
|
||||
if(($diff = $slot->getMaxStackSize() - $slot->getCount()) > 0){
|
||||
if(($diff = min($slot->getMaxStackSize(), $item->getMaxStackSize()) - $slot->getCount()) > 0){
|
||||
$count -= $diff;
|
||||
}
|
||||
}elseif($slot->isNull()){
|
||||
$count -= $this->getMaxStackSize();
|
||||
$count -= min($this->getMaxStackSize(), $item->getMaxStackSize());
|
||||
}
|
||||
|
||||
if($count <= 0){
|
||||
|
@ -157,7 +157,6 @@ class Explosion{
|
||||
* and creating sounds and particles.
|
||||
*/
|
||||
public function explodeB() : bool{
|
||||
$send = [];
|
||||
$updateBlocks = [];
|
||||
|
||||
$source = (new Vector3($this->source->x, $this->source->y, $this->source->z))->floor();
|
||||
@ -250,7 +249,6 @@ class Explosion{
|
||||
$updateBlocks[$index] = true;
|
||||
}
|
||||
}
|
||||
$send[] = $pos->subtractVector($source);
|
||||
}
|
||||
|
||||
$this->world->addParticle($source, new HugeExplodeSeedParticle());
|
||||
|
@ -116,8 +116,6 @@ class BlockTest extends TestCase{
|
||||
|
||||
/**
|
||||
* @dataProvider blockGetProvider
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
*/
|
||||
public function testBlockGet(int $id, int $meta) : void{
|
||||
$block = $this->blockFactory->get($id, $meta);
|
||||
|
@ -57,7 +57,6 @@ class StupidJsonDecodeTest extends TestCase{
|
||||
/**
|
||||
* @dataProvider stupidJsonDecodeProvider
|
||||
*
|
||||
* @param string $brokenJson
|
||||
* @param mixed $expect
|
||||
*
|
||||
* @throws \ReflectionException
|
||||
|
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\utils;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use function yaml_parse;
|
||||
|
||||
class ConfigTest extends TestCase{
|
||||
|
||||
@ -61,7 +62,6 @@ class ConfigTest extends TestCase{
|
||||
/**
|
||||
* @dataProvider fixYamlIndexesProvider
|
||||
*
|
||||
* @param string $test
|
||||
* @param mixed[] $expected
|
||||
*/
|
||||
public function testFixYamlIndexes(string $test, array $expected) : void{
|
||||
|
@ -51,7 +51,6 @@ class UtilsTest extends TestCase{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $docComment
|
||||
* @dataProvider parseDocCommentNewlineProvider
|
||||
*/
|
||||
public function testParseDocCommentNewlines(string $docComment) : void{
|
||||
|
@ -82,8 +82,6 @@ class RegionLoaderTest extends TestCase{
|
||||
|
||||
/**
|
||||
* @dataProvider outOfBoundsCoordsProvider
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @throws ChunkException
|
||||
* @throws \InvalidArgumentException
|
||||
@ -110,9 +108,6 @@ class RegionLoaderTest extends TestCase{
|
||||
/**
|
||||
* @dataProvider outOfBoundsCoordsProvider
|
||||
*
|
||||
* @param int $x
|
||||
* @param int $z
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \pocketmine\world\format\io\exception\CorruptedChunkException
|
||||
*/
|
||||
|
@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\world\format\io\region;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use function sprintf;
|
||||
|
||||
class RegionLocationTableEntryTest extends TestCase{
|
||||
|
||||
|
@ -26,6 +26,7 @@ namespace pmmp\TesterPlugin;
|
||||
use pocketmine\event\Listener;
|
||||
use pocketmine\event\server\CommandEvent;
|
||||
use pocketmine\plugin\PluginBase;
|
||||
use function array_shift;
|
||||
|
||||
class Main extends PluginBase implements Listener{
|
||||
|
||||
|
@ -23,6 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace pmmp\TesterPlugin;
|
||||
|
||||
use function time;
|
||||
|
||||
abstract class Test{
|
||||
const RESULT_WAITING = -1;
|
||||
const RESULT_OK = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user