Merge branch 'next-major' into modern-world-support

This commit is contained in:
Dylan K. Taylor
2022-06-01 15:34:26 +01:00
9 changed files with 28 additions and 28 deletions

View File

@@ -348,7 +348,7 @@ abstract class Liquid extends Transparent{
$ev = new BlockSpreadEvent($block, $this, $new);
$ev->call();
if(!$ev->isCancelled()){
if($block->getId() > 0){
if($block->getId() !== BlockLegacyIds::AIR){
$this->position->getWorld()->useBreakOn($block->position);
}

View File

@@ -775,7 +775,7 @@ abstract class Living extends Entity{
$id = $block->getId();
if($transparent === null){
if($id !== 0){
if($id !== BlockLegacyIds::AIR){
break;
}
}else{

View File

@@ -682,7 +682,7 @@ class Item implements \JsonSerializable{
*/
public static function nbtDeserialize(CompoundTag $tag) : Item{
if($tag->getTag("id") === null || $tag->getTag("Count") === null){
return ItemFactory::getInstance()->get(0);
return VanillaItems::AIR();
}
$count = Binary::unsignByte($tag->getByte("Count"));

View File

@@ -126,7 +126,7 @@ class TypeConverter{
public function recipeIngredientToCoreItemStack(RecipeIngredient $ingredient) : Item{
if($ingredient->getId() === 0){
return ItemFactory::getInstance()->get(ItemIds::AIR, 0, 0);
return VanillaItems::AIR();
}
[$id, $meta] = ItemTranslator::getInstance()->fromNetworkIdWithWildcardHandling($ingredient->getId(), $ingredient->getMeta());
return ItemFactory::getInstance()->get($id, $meta, $ingredient->getCount());