Add feature to limbo
Changes to be committed: modified: src/main/java/org/dimdev/dimdoors/world/ModBiomes.java modified: src/main/java/org/dimdev/dimdoors/world/ModDimensions.java modified: src/main/java/org/dimdev/dimdoors/world/feature/gateway/Gateway.java modified: src/main/java/org/dimdev/dimdoors/world/feature/gateway/LimboGateway.java
This commit is contained in:
parent
3374b34e7a
commit
88210b1965
4 changed files with 13 additions and 9 deletions
|
@ -4,6 +4,7 @@ import org.dimdev.dimdoors.block.ModBlocks;
|
|||
import org.dimdev.dimdoors.entity.ModEntityTypes;
|
||||
import org.dimdev.dimdoors.mixin.BuiltinBiomesAccessor;
|
||||
import org.dimdev.dimdoors.sound.ModSoundEvents;
|
||||
import org.dimdev.dimdoors.world.feature.ModFeatures;
|
||||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
|
@ -16,6 +17,7 @@ import net.minecraft.world.biome.Biome;
|
|||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.GenerationSettings;
|
||||
import net.minecraft.world.biome.SpawnSettings;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;
|
||||
import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig;
|
||||
|
||||
|
@ -34,10 +36,10 @@ public final class ModBiomes {
|
|||
Registry.register(BuiltinRegistries.BIOME, PERSONAL_WHITE_VOID_KEY.getValue(), PERSONAL_WHITE_VOID_BIOME);
|
||||
Registry.register(BuiltinRegistries.BIOME, PUBLIC_BLACK_VOID_KEY.getValue(), PUBLIC_BLACK_VOID_BIOME);
|
||||
Registry.register(BuiltinRegistries.BIOME, DUNGEON_DANGEROUS_BLACK_VOID_KEY.getValue(), DUNGEON_DANGEROUS_BLACK_VOID_BIOME);
|
||||
// BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(LIMBO_BIOME), LIMBO_KEY);
|
||||
// BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(PERSONAL_WHITE_VOID_BIOME), PERSONAL_WHITE_VOID_KEY);
|
||||
// BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(PUBLIC_BLACK_VOID_BIOME), PUBLIC_BLACK_VOID_KEY);
|
||||
// BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(DUNGEON_DANGEROUS_BLACK_VOID_BIOME), DUNGEON_DANGEROUS_BLACK_VOID_KEY);
|
||||
BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(LIMBO_BIOME), LIMBO_KEY);
|
||||
BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(PERSONAL_WHITE_VOID_BIOME), PERSONAL_WHITE_VOID_KEY);
|
||||
BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(PUBLIC_BLACK_VOID_BIOME), PUBLIC_BLACK_VOID_KEY);
|
||||
BuiltinBiomesAccessor.getIdMap().put(BuiltinRegistries.BIOME.getRawId(DUNGEON_DANGEROUS_BLACK_VOID_BIOME), DUNGEON_DANGEROUS_BLACK_VOID_KEY);
|
||||
}
|
||||
|
||||
private static BiomeEffects createEffect(boolean white) {
|
||||
|
@ -76,6 +78,7 @@ public final class ModBiomes {
|
|||
.grassColor(0)
|
||||
.build())
|
||||
.generationSettings(new GenerationSettings.Builder()
|
||||
.feature(GenerationStep.Feature.SURFACE_STRUCTURES, ModFeatures.LIMBO_GATEWAY_CONFIGURED_FEATURE)
|
||||
.surfaceBuilder(SurfaceBuilder.NETHER.method_30478(new TernarySurfaceConfig(ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState())))
|
||||
.build())
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
|
|
|
@ -61,10 +61,14 @@ public final class ModDimensions {
|
|||
return type == PERSONAL || type == PUBLIC || type == DUNGEON;
|
||||
}
|
||||
|
||||
public static boolean isLimboDimension(StructureWorldAccess world) {
|
||||
public static boolean isLimbo(StructureWorldAccess world) {
|
||||
return world.getDimension() == LIMBO_TYPE || world == LIMBO_DIMENSION;
|
||||
}
|
||||
|
||||
public static boolean isLimboDimension(World world) {
|
||||
return world.getRegistryKey() == LIMBO || world.getDimension() == LIMBO_TYPE || world == LIMBO_DIMENSION;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
|
||||
ModDimensions.LIMBO_TYPE = server.getRegistryManager().getDimensionTypes().get(LIMBO_TYPE_KEY);
|
||||
|
|
|
@ -2,13 +2,10 @@ package org.dimdev.dimdoors.world.feature.gateway;
|
|||
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
public interface Gateway {
|
||||
|
|
|
@ -39,7 +39,7 @@ public enum LimboGateway implements Gateway {
|
|||
|
||||
@Override
|
||||
public boolean isLocationValid(StructureWorldAccess world, BlockPos pos) {
|
||||
return ModDimensions.isLimboDimension(world);
|
||||
return ModDimensions.isLimbo(world);
|
||||
}
|
||||
|
||||
private void placePortal(StructureWorldAccess world, BlockPos pos, Direction facing) {
|
||||
|
|
Loading…
Reference in a new issue