mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Merge remote-tracking branch 'origin/stable'
This commit is contained in:
commit
5872b2fe23
@ -142,7 +142,7 @@ class TaskScheduler{
|
||||
continue;
|
||||
}
|
||||
$task->run();
|
||||
if($task->isRepeating()){
|
||||
if(!$task->isCancelled() && $task->isRepeating()){
|
||||
$task->setNextRun($this->currentTick + $task->getPeriod());
|
||||
$this->queue->insert($task, $this->currentTick + $task->getPeriod());
|
||||
}else{
|
||||
|
@ -136,4 +136,13 @@ class ItemTest extends TestCase{
|
||||
$this->item->removeEnchantment(VanillaEnchantments::FIRE_ASPECT(), 2);
|
||||
self::assertFalse($this->item->hasEnchantment(VanillaEnchantments::FIRE_ASPECT()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests that when all enchantments are removed from an item, the "ench" tag is removed as well
|
||||
*/
|
||||
public function testRemoveAllEnchantmentsNBT() : void{
|
||||
$this->item->addEnchantment(new EnchantmentInstance(VanillaEnchantments::SHARPNESS(), 1));
|
||||
$this->item->removeEnchantment(VanillaEnchantments::SHARPNESS());
|
||||
self::assertNull($this->item->getNamedTag()->getTag(Item::TAG_ENCH));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user