Tweaked limbo biome

Changes to be committed:
	modified:   src/main/java/org/dimdev/dimdoors/DimensionalDoorsInitializer.java
	deleted:    src/main/java/org/dimdev/dimdoors/item/ModItemGroups.java
	modified:   src/main/java/org/dimdev/dimdoors/item/ModItems.java
	modified:   src/main/java/org/dimdev/dimdoors/item/RiftConfigurationToolItem.java
	modified:   src/main/java/org/dimdev/dimdoors/util/BlankBiomeBuilder.java
	modified:   src/main/java/org/dimdev/dimdoors/world/ModBiomes.java
	deleted:    src/main/java/org/dimdev/dimdoors/world/ModFeatures.java
This commit is contained in:
SD 2020-08-16 14:02:27 +05:30
parent f353b89a17
commit 7294ed49ea
No known key found for this signature in database
GPG key ID: E36B57EE08544BC5
7 changed files with 29 additions and 103 deletions

View file

@ -21,7 +21,6 @@ import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.sound.ModSoundEvents;
import org.dimdev.dimdoors.world.ModBiomes;
import org.dimdev.dimdoors.world.ModDimensions;
import org.dimdev.dimdoors.world.ModFeatures;
import net.minecraft.util.Identifier;
@ -38,7 +37,6 @@ public class DimensionalDoorsInitializer implements ModInitializer {
ModDimensions.init();
ModEntityTypes.init();
ModBiomes.init();
ModFeatures.init();
ModBlockEntityTypes.init();
ModCommands.init();
ModSoundEvents.init();

View file

@ -1,14 +0,0 @@
package org.dimdev.dimdoors.item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
public final class ModItemGroups {
public static final ItemGroup DIMENSIONAL_DOORS = FabricItemGroupBuilder
.create(new Identifier("dimdoors", "dimensional_doors"))
.icon(() -> new ItemStack(ModItems.IRON_DIMENSIONAL_DOOR))
.build();
}

View file

@ -21,15 +21,22 @@ import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
import net.minecraft.item.BucketItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import static org.dimdev.dimdoors.item.ModItemGroups.DIMENSIONAL_DOORS;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
@SuppressWarnings("unused")
public final class ModItems {
public static final ItemGroup DIMENSIONAL_DOORS = FabricItemGroupBuilder
.create(new Identifier("dimdoors", "dimensional_doors"))
.icon(() -> new ItemStack(ModItems.IRON_DIMENSIONAL_DOOR))
.build();
public static final Item QUARTZ_DOOR = register(ModBlocks.QUARTZ_DOOR);
public static final Item QUARTZ_DIMENSIONAL_DOOR = register(new DimensionalDoorItem(
ModBlocks.QUARTZ_DIMENSIONAL_DOOR,

View file

@ -28,7 +28,7 @@ public class RiftConfigurationToolItem extends Item {
public static final String ID = "rift_configuration_tool";
RiftConfigurationToolItem() {
super(new Item.Settings().group(ModItemGroups.DIMENSIONAL_DOORS).maxCount(1).maxDamage(16));
super(new Item.Settings().group(ModItems.DIMENSIONAL_DOORS).maxCount(1).maxDamage(16));
}
@Override

View file

@ -17,7 +17,17 @@ public class BlankBiomeBuilder extends Biome.Builder {
public BlankBiomeBuilder(boolean white, boolean dangerous) {
this.white = white;
this.dangerous = dangerous;
this.generationSettings(null).precipitation(null).category(null).depth(0).temperatureModifier(null).downfall(0).effects(null).scale(0).temperature(0).temperatureModifier(null);
this.generationSettings(new GenerationSettings.Builder().surfaceBuilder(SurfaceBuilder.DEFAULT.method_30478(new TernarySurfaceConfig(Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.VOID_AIR.getDefaultState()))).build())
.precipitation(Biome.Precipitation.NONE)
.category(Biome.Category.NONE)
.depth(0)
.temperatureModifier(Biome.TemperatureModifier.NONE)
.downfall(0)
.effects(this.createEffect(this.white))
.scale(0)
.temperature(0.8f)
.temperatureModifier(null)
.spawnSettings(new SpawnSettings.Builder().build());
}
private BiomeEffects createEffect(boolean white) {
@ -30,54 +40,4 @@ public class BlankBiomeBuilder extends Biome.Builder {
if (white) builder.loopSound(ModSoundEvents.WHITE_VOID);
return builder.build();
}
@Override
public BlankBiomeBuilder generationSettings(GenerationSettings generationSettings) {
return (BlankBiomeBuilder) super.generationSettings(new GenerationSettings.Builder().surfaceBuilder(SurfaceBuilder.DEFAULT.method_30478(new TernarySurfaceConfig(Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), Blocks.VOID_AIR.getDefaultState()))).build());
}
@Override
public BlankBiomeBuilder precipitation(Biome.Precipitation precipitation) {
return (BlankBiomeBuilder) super.precipitation(Biome.Precipitation.NONE);
}
@Override
public BlankBiomeBuilder category(Biome.Category category) {
return (BlankBiomeBuilder) super.category(Biome.Category.NONE);
}
@Override
public BlankBiomeBuilder scale(float scale) {
return (BlankBiomeBuilder) super.scale(0);
}
@Override
public BlankBiomeBuilder depth(float depth) {
return (BlankBiomeBuilder) super.depth(0);
}
@Override
public BlankBiomeBuilder downfall(float downfall) {
return (BlankBiomeBuilder) super.downfall(0);
}
@Override
public BlankBiomeBuilder temperature(float temperature) {
return (BlankBiomeBuilder) super.temperature(0.8f);
}
@Override
public BlankBiomeBuilder effects(BiomeEffects effects) {
return (BlankBiomeBuilder) super.effects(this.createEffect(this.white));
}
@Override
public BlankBiomeBuilder temperatureModifier(Biome.TemperatureModifier temperatureModifier) {
return (BlankBiomeBuilder) super.temperatureModifier(Biome.TemperatureModifier.NONE);
}
@Override
public BlankBiomeBuilder spawnSettings(SpawnSettings spawnSettings) {
return (BlankBiomeBuilder) super.spawnSettings(spawnSettings);
}
}

View file

@ -15,9 +15,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.ConfiguredSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilder.DefaultSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig;
public final class ModBiomes {
@ -35,10 +33,10 @@ public final class ModBiomes {
for (Biome ignored : BuiltinRegistries.BIOME) {
id++;
}
BuiltinBiomesAccessor.invokeRegister(id, LIMBO_KEY, LIMBO_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 1, PERSONAL_WHITE_VOID_KEY, WHITE_VOID_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 2, PUBLIC_BLACK_VOID_KEY, BLACK_VOID_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 3, DUNGEON_DANGEROUS_BLACK_VOID_KEY, DANGEROUS_BLACK_VOID_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 1, LIMBO_KEY, LIMBO_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 2, PERSONAL_WHITE_VOID_KEY, WHITE_VOID_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 3, PUBLIC_BLACK_VOID_KEY, BLACK_VOID_BIOME);
BuiltinBiomesAccessor.invokeRegister(id + 4, DUNGEON_DANGEROUS_BLACK_VOID_KEY, DANGEROUS_BLACK_VOID_BIOME);
}
static {
@ -46,9 +44,9 @@ public final class ModBiomes {
PUBLIC_BLACK_VOID_KEY = RegistryKey.of(Registry.BIOME_KEY, new Identifier("dimdoors:black_void"));
DUNGEON_DANGEROUS_BLACK_VOID_KEY = RegistryKey.of(Registry.BIOME_KEY, new Identifier("dimdoors:dangerous_black_void"));
LIMBO_KEY = RegistryKey.of(Registry.BIOME_KEY, new Identifier("dimdoors", "limbo"));
WHITE_VOID_BIOME = new BlankBiomeBuilder(true, false).spawnSettings(new SpawnSettings.Builder().build()).build();
BLACK_VOID_BIOME = new BlankBiomeBuilder(false, false).spawnSettings(new SpawnSettings.Builder().build()).build();
DANGEROUS_BLACK_VOID_BIOME = new BlankBiomeBuilder(false, true).spawnSettings(new SpawnSettings.Builder().build()).build();
WHITE_VOID_BIOME = new BlankBiomeBuilder(true, false).build();
BLACK_VOID_BIOME = new BlankBiomeBuilder(false, false).build();
DANGEROUS_BLACK_VOID_BIOME = new BlankBiomeBuilder(false, true).build();
LIMBO_BIOME = new Biome.Builder()
.category(Biome.Category.NONE)
.depth(0.1f)
@ -64,7 +62,7 @@ public final class ModBiomes {
.grassColor(0)
.build())
.generationSettings(new GenerationSettings.Builder()
.surfaceBuilder(new ConfiguredSurfaceBuilder<>(new DefaultSurfaceBuilder(TernarySurfaceConfig.CODEC), new TernarySurfaceConfig(ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState())))
.surfaceBuilder(SurfaceBuilder.DEFAULT.method_30478(new TernarySurfaceConfig(ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.UNRAVELLED_FABRIC.getDefaultState(), ModBlocks.ETERNAL_FLUID.getDefaultState())))
.build())
.precipitation(Biome.Precipitation.NONE)
.scale(0.9f)

View file

@ -1,23 +0,0 @@
package org.dimdev.dimdoors.world;
import org.dimdev.dimdoors.block.ModBlocks;
import net.minecraft.block.Blocks;
import net.minecraft.structure.rule.BlockMatchRuleTest;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
public final class ModFeatures {
public static final ConfiguredFeature<?, ?> LIMBO_BEDROCK_FLUID_ORE = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("dimdoors", "limbo_bedrock_fluid_ore"), Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(Blocks.BEDROCK), ModBlocks.ETERNAL_FLUID.getDefaultState(), 6)).decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 5, 7))));
public static final ConfiguredFeature<?, ?> LIMBO_FABRIC_FLUID_ORE = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("dimdoors", "limbo_fabric_fluid_ore"), Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.ETERNAL_FLUID.getDefaultState(), 6)).decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(0, 11, 9))));
public static void init() {
//just loads the class
}
}