Fixed place-Methods (Pt. II)

This commit is contained in:
Frank Bauer 2021-06-24 15:24:14 +02:00
parent a82f30b95d
commit 05f59b4856
18 changed files with 99 additions and 44 deletions

View file

@ -54,7 +54,7 @@ public class NightshadeRedwoods extends EndBiome {
});
for (MobCategory group: MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings().getMobs(group);
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
list.forEach((entry) -> {
def.addMobSpawn(entry);
});

View file

@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI;
@ -21,8 +22,11 @@ import ru.betterend.integration.Integrations;
public class BigEtherTreeFeature extends DefaultFeature {
@Override
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
Random random = featureConfig.random();
BlockPos pos = featureConfig.origin();
WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
return false;
BlockState log = Integrations.BYG.getDefaultState("ether_log");