diff --git a/src/block/VanillaBlocks.php b/src/block/VanillaBlocks.php index 618b0b277d3..577396815be 100644 --- a/src/block/VanillaBlocks.php +++ b/src/block/VanillaBlocks.php @@ -937,7 +937,7 @@ public function getBreakTime(Item $item) : float{ $nyliumBreakInfo = BreakInfo::pickaxe(0.4); self::register("crimson_nylium", new NetherNylium(new BID(Ids::CRIMSON_NYLIUM), "Crimson Nylium", new Info($nyliumBreakInfo, [Tags::NYLIUM]))); - self::register("warped_nylium", new NetherNylium(new BID(Ids::WARPED_NYLIUM), "Warped Nylium", new Info($nyliumBreakInfo), [Tags::NYLIUM])); + self::register("warped_nylium", new NetherNylium(new BID(Ids::WARPED_NYLIUM), "Warped Nylium", new Info($nyliumBreakInfo, [Tags::NYLIUM]))); self::register("gravel", new Gravel(new BID(Ids::GRAVEL), "Gravel", new Info(BreakInfo::shovel(0.6)))); diff --git a/src/world/generator/object/NetherGrass.php b/src/world/generator/object/NetherGrass.php index 36cb829ff7a..d1cb4ccc110 100644 --- a/src/world/generator/object/NetherGrass.php +++ b/src/world/generator/object/NetherGrass.php @@ -32,17 +32,17 @@ class NetherGrass{ public static function growGrass(ChunkManager $world, Vector3 $pos, Random $random, int $count = 8, int $radius = 5) : void{ - $nyliumType = $world->getBlockAt($pos->x, $pos->y, $pos->z)->getTypeId(); + $nyliumType = $world->getBlockAt((int) $pos->x, (int) $pos->y, (int) $pos->z)->getTypeId(); $blocksToGrow = []; //Todo: Add more blocks to grow on nether nylium if ($nyliumType === BlockTypeIds::WARPED_NYLIUM) { $blocksToGrow = [ + VanillaBlocks::CRIMSON_ROOTS(), // Rare VanillaBlocks::WARPED_ROOTS(), //VanillaBlocks::NETHER_SPROUTS(), //VanillaBlocks::WARPED_FUNGUS(), - VanillaBlocks::CRIMSON_ROOTS(), // Rare //VanillaBlocks::CRIMSON_FUNGUS() // Rare ]; } elseif ($nyliumType === BlockTypeIds::CRIMSON_NYLIUM) { @@ -55,17 +55,17 @@ public static function growGrass(ChunkManager $world, Vector3 $pos, Random $rand $blocksCount = count($blocksToGrow) - 1; for ($c = 0; $c < $count; ++$c) { - $x = $random->nextRange($pos->x - $radius, $pos->x + $radius); - $z = $random->nextRange($pos->z - $radius, $pos->z + $radius); - $blockBelow = $world->getBlockAt($x, $pos->y, $z); - if ($world->getBlockAt($x, $pos->y + 1, $z)->getTypeId() === BlockTypeIds::AIR && $blockBelow->getTypeId() !== BlockTypeIds::AIR) { + $x = $random->nextRange((int) ($pos->x - $radius), (int) ($pos->x + $radius)); + $z = $random->nextRange((int) ($pos->z - $radius), (int) ($pos->z + $radius)); + $blockBelow = $world->getBlockAt($x, (int) $pos->y, $z); + if ($world->getBlockAt($x, (int) ($pos->y + 1), $z)->getTypeId() === BlockTypeIds::AIR && $blockBelow->getTypeId() !== BlockTypeIds::AIR) { $blockToGrow = $blocksToGrow[$random->nextRange(0, $blocksCount)]; if ($blockToGrow === VanillaBlocks::CRIMSON_ROOTS()) { if ($random->nextFloat() < 0.1) { // 10% chance for rare blocks - $world->setBlockAt($x, $pos->y + 1, $z, $blockToGrow); + $world->setBlockAt($x, (int) ($pos->y + 1), $z, $blockToGrow); } } else { - $world->setBlockAt($x, $pos->y + 1, $z, $blockToGrow); + $world->setBlockAt($x, (int) ($pos->y + 1), $z, $blockToGrow); } } }