commit
417350db2d
184 changed files with 3649 additions and 2636 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -32,3 +32,4 @@ output/
|
|||
*.getBlock("log")
|
||||
Convert.class
|
||||
ModelPart.class
|
||||
libs/
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
# Better End
|
||||
|
||||
Better End Mod for Fabric, MC 1.17.1
|
||||
Better End Mod for Fabric, MC 1.18
|
||||
|
||||
Importing:
|
||||
|
||||
* Clone repo
|
||||
* Edit gradle.properties if necessary
|
||||
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
||||
* Run command line in folder: gradlew genSources idea (or eclipse)
|
||||
* Import project to IDE
|
||||
|
||||
Building:
|
||||
|
|
18
build.gradle
18
build.gradle
|
@ -7,12 +7,12 @@ buildscript {
|
|||
plugins {
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||
id 'fabric-loom' version "${loom_version}"
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_16
|
||||
targetCompatibility = JavaVersion.VERSION_16
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
|
@ -25,15 +25,23 @@ repositories {
|
|||
maven { url 'https://maven.blamejared.com' }
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://maven.terraformersmc.com/releases' }
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/betterend.accesswidener")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings minecraft.officialMojangMappings()
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
|
||||
// useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
|
||||
println "Using local BCLib: ${local_bclib}"
|
||||
if (local_bclib){
|
||||
implementation( project(path:":BCLib", configuration: 'dev') )
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.17.1
|
||||
yarn_mappings=6
|
||||
loader_version=0.12.4
|
||||
minecraft_version=1.18.1
|
||||
fabric_version = 0.44.0+1.18
|
||||
loader_version=0.12.12
|
||||
|
||||
#Loom
|
||||
loom_version=0.10-SNAPSHOT
|
||||
|
||||
# Mod Properties
|
||||
mod_version=0.12.5
|
||||
mod_version=1.0.0
|
||||
maven_group=ru.betterend
|
||||
archives_base_name=better-end
|
||||
|
||||
|
@ -14,7 +19,6 @@ archives_base_name=better-end
|
|||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
|
||||
patchouli_version = 55-FABRIC-SNAPSHOT
|
||||
fabric_version = 0.42.1+1.17
|
||||
bclib_version = 0.5.4
|
||||
rei_version = 6.0.264-alpha
|
||||
bclib_version = 1.2.0
|
||||
rei_version = 7.0.343
|
||||
canvas_version = 1.0.+
|
||||
|
|
|
@ -11,10 +11,10 @@ pluginManagement {
|
|||
// #### Custom Settings ####
|
||||
|
||||
//Change the next line to disable local BCLib loading
|
||||
def allowLocalLibUse = false
|
||||
def allowLocalLibUse = true
|
||||
|
||||
//When true, the local BCLib is also used in commandline builds
|
||||
def allowLocalLibInConsoleMode = false
|
||||
def allowLocalLibInConsoleMode = true
|
||||
|
||||
//The path were to look for the local BCLib
|
||||
def BCLibPath = '../BCLib'
|
||||
|
|
|
@ -3,7 +3,9 @@ package ru.betterend;
|
|||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import ru.bclib.api.WorldDataAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.util.Logger;
|
||||
import ru.betterend.api.BetterEndPlugin;
|
||||
import ru.betterend.config.Configs;
|
||||
|
@ -28,7 +30,6 @@ import ru.betterend.util.BonemealPlants;
|
|||
import ru.betterend.util.LootTableUtil;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
import ru.betterend.world.generator.TerrainGenerator;
|
||||
import ru.betterend.world.surface.SurfaceBuilders;
|
||||
|
||||
public class BetterEnd implements ModInitializer {
|
||||
public static final String MOD_ID = "betterend";
|
||||
|
@ -43,7 +44,6 @@ public class BetterEnd implements ModInitializer {
|
|||
EndBlockEntities.register();
|
||||
EndFeatures.register();
|
||||
EndEntities.register();
|
||||
SurfaceBuilders.register();
|
||||
EndBiomes.register();
|
||||
EndTags.register();
|
||||
EndEnchantments.register();
|
||||
|
@ -63,12 +63,20 @@ public class BetterEnd implements ModInitializer {
|
|||
Configs.saveConfigs();
|
||||
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
ru.bclib.world.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock() > 250000L);
|
||||
ru.bclib.world.generator.GeneratorOptions.setFarEndBiomes(GeneratorOptions.getIslandDistBlock());
|
||||
ru.bclib.world.generator.GeneratorOptions.setEndLandFunction((pos) -> TerrainGenerator.isLand(pos.x, pos.y));
|
||||
}
|
||||
}
|
||||
|
||||
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
|
||||
if (!biomeID.equals(Biomes.THE_VOID.location())) {
|
||||
EndStructures.addBiomeStructures(biomeID, biome);
|
||||
EndFeatures.addBiomeFeatures(biomeID, biome);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
public static ResourceLocation makeID(String path) {
|
||||
return new ResourceLocation(MOD_ID, path);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class DragonTreeSaplingBlock extends PottableFeatureSapling {
|
||||
public DragonTreeSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.DRAGON_TREE.getFeature();
|
||||
super((state)->EndFeatures.DRAGON_TREE.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -88,7 +88,7 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
|
|||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.PedestalBlock;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class EndPedestal extends PedestalBlock {
|
||||
|
@ -19,16 +19,12 @@ public class EndPedestal extends PedestalBlock {
|
|||
protected Map<String, String> createTexturesMap() {
|
||||
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
|
||||
String name = blockId.getPath();
|
||||
return new HashMap<String, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
put("%mod%", BetterEnd.MOD_ID);
|
||||
put("%top%", name + "_polished");
|
||||
put("%base%", name + "_polished");
|
||||
put("%pillar%", name + "_pillar_side");
|
||||
put("%bottom%", name + "_polished");
|
||||
}
|
||||
};
|
||||
Map<String, String> textures = Maps.newHashMap();
|
||||
textures.put("%mod%", BetterEnd.MOD_ID);
|
||||
textures.put("%top%", name + "_polished");
|
||||
textures.put("%base%", name + "_polished");
|
||||
textures.put("%pillar%", name + "_pillar_side");
|
||||
textures.put("%bottom%", name + "_polished");
|
||||
return textures;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class HelixTreeSaplingBlock extends PottableFeatureSapling {
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.HELIX_TREE.getFeature();
|
||||
public HelixTreeSaplingBlock() {
|
||||
super((state)->EndFeatures.HELIX_TREE.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -90,7 +90,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
return Blocks.WATER.defaultBlockState();
|
||||
}
|
||||
else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) {
|
||||
world.getBlockTicks().scheduleTick(pos, this, 20);
|
||||
world.scheduleTick(pos, this, 20);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
|
|||
BlockPos up = pos.above();
|
||||
if (world.getBlockState(up).is(Blocks.WATER)) {
|
||||
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.VENT_BUBBLE_COLUMN);
|
||||
world.getBlockTicks().scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
|
||||
world.scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class LacugroveSaplingBlock extends PottableFeatureSapling {
|
||||
public LacugroveSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.LACUGROVE.getFeature();
|
||||
super((state)->EndFeatures.LACUGROVE.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class LucerniaSaplingBlock extends PottableFeatureSapling {
|
||||
public LucerniaSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.LUCERNIA.getFeature();
|
||||
super((state)->EndFeatures.LUCERNIA.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,18 +4,27 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
public class LumecornSeedBlock extends EndPlantWithAgeBlock {
|
||||
|
||||
@Override
|
||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||
EndFeatures.LUMECORN.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
|
||||
((Feature<NoneFeatureConfiguration>) (EndFeatures.LUMECORN.getFeature())).place(new FeaturePlaceContext<>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
random,
|
||||
pos,
|
||||
(NoneFeatureConfiguration) null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
|
||||
import net.minecraft.tags.Tag.Named;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
|
@ -9,14 +10,18 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.blocks.BaseBlock;
|
||||
import ru.bclib.interfaces.TagProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class MossyGlowshroomCapBlock extends BaseBlock {
|
||||
import java.util.List;
|
||||
|
||||
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
|
||||
public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION;
|
||||
|
||||
public MossyGlowshroomCapBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD));
|
||||
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false));
|
||||
}
|
||||
|
||||
|
@ -31,4 +36,9 @@ public class MossyGlowshroomCapBlock extends BaseBlock {
|
|||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
builder.add(TRANSITION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTags(List<Named<Block>> blockTags, List<Named<Item>> itemTags) {
|
||||
blockTags.add(TagAPI.MINEABLE_AXE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling {
|
||||
public MossyGlowshroomSaplingBlock() {
|
||||
super(7);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.MOSSY_GLOWSHROOM.getFeature();
|
||||
super(7, (state)->EndFeatures.MOSSY_GLOWSHROOM.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -115,9 +115,9 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
|
|||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||
world.getBlockTicks().scheduleTick(pos, this, 2);
|
||||
world.scheduleTick(pos, this, 2);
|
||||
if (state.getValue(WATERLOGGED)) {
|
||||
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
}
|
||||
Direction dir = state.getValue(FACING);
|
||||
BlockState downState = world.getBlockState(pos.relative(dir.getOpposite()));
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class PythadendronSaplingBlock extends PottableFeatureSapling {
|
||||
public PythadendronSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.PYTHADENDRON_TREE.getFeature();
|
||||
super((state)->EndFeatures.PYTHADENDRON_TREE.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,7 +7,9 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
@ -16,6 +18,7 @@ import ru.betterend.blocks.basis.EndPlantBlock;
|
|||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
public class SmallAmaranitaBlock extends EndPlantBlock {
|
||||
|
@ -30,8 +33,8 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
BlockPos bigPos = growBig(world, pos);
|
||||
if (bigPos != null) {
|
||||
if (EndFeatures.GIGANTIC_AMARANITA.getFeature()
|
||||
.place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) {
|
||||
if (((Feature<NoneFeatureConfiguration>)EndFeatures.GIGANTIC_AMARANITA.getFeature())
|
||||
.place(new FeaturePlaceContext<>(Optional.empty(), world, null, random, bigPos, null))) {
|
||||
replaceMushroom(world, bigPos);
|
||||
replaceMushroom(world, bigPos.south());
|
||||
replaceMushroom(world, bigPos.east());
|
||||
|
@ -39,7 +42,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
}
|
||||
return;
|
||||
}
|
||||
EndFeatures.LARGE_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
|
||||
((Feature<NoneFeatureConfiguration>)EndFeatures.LARGE_AMARANITA.getFeature()).place( new FeaturePlaceContext<>(Optional.empty(), world, null, random, pos, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,9 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.BonemealableBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
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 net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
@ -37,6 +39,7 @@ import ru.betterend.registry.EndFeatures;
|
|||
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant {
|
||||
|
@ -101,7 +104,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
|||
@Override
|
||||
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
|
||||
EndFeatures.JELLYSHROOM.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null));
|
||||
((Feature<NoneFeatureConfiguration>)EndFeatures.JELLYSHROOM.getFeature()).place(new FeaturePlaceContext<>(Optional.empty(), world, null, random, pos, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
||||
public class TenaneaSaplingBlock extends PottableFeatureSapling {
|
||||
public TenaneaSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.TENANEA.getFeature();
|
||||
super((state)->EndFeatures.TENANEA.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.bclib.client.render.BCLRenderLayer;
|
||||
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -12,13 +11,7 @@ import ru.betterend.registry.EndFeatures;
|
|||
|
||||
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling {
|
||||
public UmbrellaTreeSaplingBlock() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Feature<?> getFeature() {
|
||||
return EndFeatures.UMBRELLA_TREE.getFeature();
|
||||
super((state)-> EndFeatures.UMBRELLA_TREE.getFeature());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,7 +76,7 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
|
|||
BlockPos up = pos.above();
|
||||
if (world.getBlockState(up).is(Blocks.WATER)) {
|
||||
BlocksHelper.setWithoutUpdate(world, up, this);
|
||||
world.getBlockTicks().scheduleTick(up, this, 5);
|
||||
world.scheduleTick(up, this, 5);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
|
|
|
@ -101,7 +101,7 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg
|
|||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
Boolean water = state.getValue(WATERLOGGED);
|
||||
if (water) {
|
||||
world.getLiquidTicks().scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world));
|
||||
}
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return water ? Blocks.WATER.defaultBlockState() : Blocks.AIR.defaultBlockState();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
@ -23,8 +24,6 @@ import net.minecraft.world.level.LevelAccessor;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
|
@ -45,17 +44,14 @@ import ru.betterend.blocks.InfusionPedestal;
|
|||
import ru.betterend.blocks.entities.InfusionPedestalEntity;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import ru.betterend.client.models.Patterns;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.rituals.InfusionRitual;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.ToIntFunction;
|
||||
|
||||
@SuppressWarnings({"deprecation"})
|
||||
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
||||
public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE;
|
||||
public static final BooleanProperty HAS_ITEM = EndBlockProperties.HAS_ITEM;
|
||||
|
@ -68,37 +64,18 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
private static final VoxelShape SHAPE_COLUMN_TOP;
|
||||
private static final VoxelShape SHAPE_BOTTOM;
|
||||
|
||||
/**
|
||||
* Register new Pedestal block with Better End mod id.
|
||||
*
|
||||
* @param name pedestal name
|
||||
* @param source source block
|
||||
* @return new Pedestal block with Better End id.
|
||||
*/
|
||||
public static Block registerPedestal(String name, Block source) {
|
||||
return EndBlocks.registerBlock(name, new PedestalBlock(source));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register new Pedestal block with specified mod id.
|
||||
*
|
||||
* @param id pedestal id
|
||||
* @param source source block
|
||||
* @return new Pedestal block with specified id.
|
||||
*/
|
||||
public static Block registerPedestal(ResourceLocation id, Block source) {
|
||||
return EndBlocks.registerBlock(id, new PedestalBlock(source));
|
||||
}
|
||||
|
||||
protected final Block parent;
|
||||
protected float height = 1.0F;
|
||||
|
||||
public PedestalBlock(Block parent) {
|
||||
super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState())));
|
||||
this.registerDefaultState(stateDefinition.any()
|
||||
this.registerDefaultState(
|
||||
stateDefinition
|
||||
.any()
|
||||
.setValue(STATE, PedestalState.DEFAULT)
|
||||
.setValue(HAS_ITEM, false)
|
||||
.setValue(HAS_LIGHT, false));
|
||||
.setValue(HAS_LIGHT, false)
|
||||
);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
@ -118,28 +95,29 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
if (world.isClientSide || !state.is(this)) return InteractionResult.CONSUME;
|
||||
if (!isPlaceable(state)) {
|
||||
@SuppressWarnings("deprecation")
|
||||
public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
if (!state.is(this) || !isPlaceable(state)) {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||
if (blockEntity instanceof PedestalBlockEntity) {
|
||||
PedestalBlockEntity pedestal = (PedestalBlockEntity) blockEntity;
|
||||
if (pedestal.isEmpty()) {
|
||||
ItemStack itemStack = player.getItemInHand(hand);
|
||||
if (itemStack.isEmpty()) return InteractionResult.CONSUME;
|
||||
pedestal.setItem(0, itemStack);
|
||||
checkRitual(world, pos);
|
||||
return InteractionResult.SUCCESS;
|
||||
level.blockEntityChanged(pos);
|
||||
checkRitual(level, pos);
|
||||
return InteractionResult.sidedSuccess(level.isClientSide());
|
||||
}
|
||||
else {
|
||||
ItemStack itemStack = pedestal.getItem(0);
|
||||
if (player.addItem(itemStack)) {
|
||||
pedestal.removeItemNoUpdate(0);
|
||||
checkRitual(world, pos);
|
||||
return InteractionResult.SUCCESS;
|
||||
level.blockEntityChanged(pos);
|
||||
checkRitual(level, pos);
|
||||
return InteractionResult.sidedSuccess(level.isClientSide());
|
||||
}
|
||||
return InteractionResult.FAIL;
|
||||
}
|
||||
|
@ -207,7 +185,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||
BlockState updated = getUpdatedState(state, direction, newState, world, pos, posFrom);
|
||||
if (!updated.is(this)) return updated;
|
||||
|
@ -344,7 +322,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
if (state.is(this)) {
|
||||
switch (state.getValue(STATE)) {
|
||||
|
@ -386,13 +364,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean hasAnalogOutputSignal(BlockState state) {
|
||||
return state.getBlock() instanceof PedestalBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
|
||||
return state.getValue(HAS_ITEM) ? 15 : 0;
|
||||
}
|
||||
|
@ -446,17 +424,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
protected Map<String, String> createTexturesMap() {
|
||||
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
|
||||
String name = blockId.getPath();
|
||||
return new HashMap<String, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
put("%mod%", blockId.getNamespace());
|
||||
put("%top%", name + "_top");
|
||||
put("%base%", name + "_base");
|
||||
put("%pillar%", name + "_pillar");
|
||||
put("%bottom%", name + "_bottom");
|
||||
}
|
||||
};
|
||||
Map<String, String> textures = Maps.newHashMap();
|
||||
textures.put("%mod%", blockId.getNamespace());
|
||||
textures.put("%top%", name + "_top");
|
||||
textures.put("%base%", name + "_base");
|
||||
textures.put("%pillar%", name + "_pillar");
|
||||
textures.put("%bottom%", name + "_bottom");
|
||||
return textures;
|
||||
}
|
||||
|
||||
static {
|
||||
|
@ -478,9 +452,9 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
|
|||
SHAPE_BOTTOM = Shapes.or(basin, SHAPE_PILLAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
/*@Override
|
||||
@Nullable
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
|
||||
return level.isClientSide() ? PedestalBlockEntity::tick : null;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.bclib.blocks.FeatureSaplingBlock;
|
||||
import ru.betterend.interfaces.PottablePlant;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
|
||||
public PottableFeatureSapling() {
|
||||
super();
|
||||
public PottableFeatureSapling(Function<BlockState, Feature<?>> featureSupplier) {
|
||||
super(featureSupplier);
|
||||
}
|
||||
|
||||
public PottableFeatureSapling(int light) {
|
||||
super(light);
|
||||
public PottableFeatureSapling(int light, Function<BlockState, Feature<?>> featureSupplier) {
|
||||
super(light, featureSupplier);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -429,8 +429,9 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag tag) {
|
||||
super.save(tag);
|
||||
public void saveAdditional(CompoundTag tag) {
|
||||
super.saveAdditional(tag);
|
||||
|
||||
tag.putShort("BurnTime", (short) burnTime);
|
||||
tag.putShort("FuelTime", (short) fuelTime);
|
||||
tag.putShort("SmeltTime", (short) smeltTime);
|
||||
|
@ -439,8 +440,6 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
|
|||
CompoundTag usedRecipes = new CompoundTag();
|
||||
recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer));
|
||||
tag.put("RecipesUsed", usedRecipes);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||
|
|
|
@ -35,11 +35,11 @@ public class EternalPedestalEntity extends PedestalBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag tag) {
|
||||
public void saveAdditional(CompoundTag tag) {
|
||||
if (hasRitual()) {
|
||||
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
||||
}
|
||||
return super.save(tag);
|
||||
super.saveAdditional(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,11 +40,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag tag) {
|
||||
public void saveAdditional(CompoundTag tag) {
|
||||
if (hasRitual()) {
|
||||
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
||||
}
|
||||
return super.save(tag);
|
||||
super.saveAdditional(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -62,7 +62,7 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
|||
if (blockEntity.hasRitual()) {
|
||||
blockEntity.linkedRitual.tick();
|
||||
}
|
||||
PedestalBlockEntity.tick(level, blockPos, blockState, blockEntity);
|
||||
//PedestalBlockEntity.tick(level, blockPos, blockState, blockEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package ru.betterend.blocks.entities;
|
||||
|
||||
import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
@ -14,12 +13,9 @@ import ru.betterend.blocks.basis.PedestalBlock;
|
|||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class PedestalBlockEntity extends BlockEntity implements Container, BlockEntityClientSerializable {
|
||||
public class PedestalBlockEntity extends BlockEntity implements Container {
|
||||
private ItemStack activeItem = ItemStack.EMPTY;
|
||||
|
||||
private final int maxAge = 314;
|
||||
private int age;
|
||||
|
||||
public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
this(EndBlockEntities.PEDESTAL, blockPos, blockState);
|
||||
}
|
||||
|
@ -28,12 +24,17 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
|||
super(blockEntityType, blockPos, blockState);
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
protected void toTag(CompoundTag tag) {
|
||||
if (activeItem != ItemStack.EMPTY) {
|
||||
tag.put("active_item", activeItem.save(new CompoundTag()));
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxAge() {
|
||||
return maxAge;
|
||||
protected void fromTag(CompoundTag tag) {
|
||||
if (tag.contains("active_item")) {
|
||||
CompoundTag itemTag = tag.getCompound("active_item");
|
||||
activeItem = ItemStack.of(itemTag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -98,7 +99,6 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
|||
super.setChanged();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
return true;
|
||||
|
@ -111,38 +111,18 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
|
|||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag save(CompoundTag tag) {
|
||||
tag.put("active_item", activeItem.save(new CompoundTag()));
|
||||
return super.save(tag);
|
||||
protected void saveAdditional(CompoundTag tag) {
|
||||
super.saveAdditional(tag);
|
||||
toTag(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromClientTag(CompoundTag tag) {
|
||||
fromTag(tag);
|
||||
public ClientboundBlockEntityDataPacket getUpdatePacket() {
|
||||
return ClientboundBlockEntityDataPacket.create(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag toClientTag(CompoundTag tag) {
|
||||
return save(tag);
|
||||
}
|
||||
|
||||
protected void fromTag(CompoundTag tag) {
|
||||
if (tag.contains("active_item")) {
|
||||
CompoundTag itemTag = tag.getCompound("active_item");
|
||||
activeItem = ItemStack.of(itemTag);
|
||||
}
|
||||
}
|
||||
|
||||
public static <T extends BlockEntity> void tick(Level level, BlockPos blockPos, BlockState blockState, T uncastedEntity) {
|
||||
clientTick(level, blockPos, blockState, (PedestalBlockEntity) uncastedEntity);
|
||||
}
|
||||
|
||||
private static void clientTick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) {
|
||||
if (!blockEntity.isEmpty()) {
|
||||
blockEntity.age++;
|
||||
if (blockEntity.age > blockEntity.maxAge) {
|
||||
blockEntity.age = 0;
|
||||
}
|
||||
}
|
||||
public CompoundTag getUpdateTag() {
|
||||
return this.saveWithoutMetadata();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import ru.bclib.util.MHelper;
|
|||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.AuroraCrystalBlock;
|
||||
|
||||
// TODO make crystals bright
|
||||
public class EternalCrystalRenderer {
|
||||
private static final RenderType RENDER_LAYER;
|
||||
private static final ModelPart[] SHARDS;
|
||||
|
@ -116,7 +117,7 @@ public class EternalCrystalRenderer {
|
|||
}
|
||||
|
||||
static {
|
||||
RENDER_LAYER = RenderType.beaconBeam(BetterEnd.makeID("textures/entity/eternal_crystal.png"), true);
|
||||
RENDER_LAYER = RenderType.itemEntityTranslucentCull(BetterEnd.makeID("textures/entity/eternal_crystal.png"));
|
||||
SHARDS = new ModelPart[4];
|
||||
|
||||
ModelPart root = getTexturedModelData().bakeRoot();
|
||||
|
|
|
@ -24,7 +24,6 @@ import ru.betterend.registry.EndItems;
|
|||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class PedestalItemRenderer<T extends PedestalBlockEntity> implements BlockEntityRenderer<T> {
|
||||
|
||||
public PedestalItemRenderer(BlockEntityRendererProvider.Context ctx) {
|
||||
super();
|
||||
}
|
||||
|
@ -41,7 +40,6 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
|||
|
||||
matrices.pushPose();
|
||||
Minecraft minecraft = Minecraft.getInstance();
|
||||
//TODO: check i=0
|
||||
BakedModel model = minecraft.getItemRenderer().getModel(activeItem, world, null, 0);
|
||||
Vector3f translate = model.getTransforms().ground.translation;
|
||||
PedestalBlock pedestal = (PedestalBlock) state.getBlock();
|
||||
|
@ -52,28 +50,17 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
|||
else {
|
||||
matrices.scale(1.25F, 1.25F, 1.25F);
|
||||
}
|
||||
int age = blockEntity.getAge();
|
||||
int age = (int) (minecraft.level.getGameTime() % 314);
|
||||
if (state.is(EndBlocks.ETERNAL_PEDESTAL) && state.getValue(EternalPedestal.ACTIVATED)) {
|
||||
float[] colors = EternalCrystalRenderer.colors(age);
|
||||
int y = blockEntity.getBlockPos().getY();
|
||||
|
||||
BeamRenderer.renderLightBeam(
|
||||
matrices,
|
||||
vertexConsumers,
|
||||
age,
|
||||
tickDelta,
|
||||
-y,
|
||||
1024 - y,
|
||||
colors,
|
||||
0.25F,
|
||||
0.13F,
|
||||
0.16F
|
||||
);
|
||||
float altitude = Mth.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F;
|
||||
BeamRenderer.renderLightBeam(matrices, vertexConsumers, age, tickDelta, -y, 1024 - y, colors, 0.25F, 0.13F, 0.16F);
|
||||
float altitude = Mth.sin((age + tickDelta) / 10.0F) * 0.1F + 0.1F;
|
||||
matrices.translate(0.0D, altitude, 0.0D);
|
||||
}
|
||||
if (activeItem.getItem() == Items.END_CRYSTAL) {
|
||||
EndCrystalRenderer.render(age, blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light);
|
||||
EndCrystalRenderer.render(age, 314, tickDelta, matrices, vertexConsumers, light);
|
||||
}
|
||||
else if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
|
||||
EternalCrystalRenderer.render(age, tickDelta, matrices, vertexConsumers, light);
|
||||
|
@ -81,16 +68,7 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
|
|||
else {
|
||||
float rotation = (age + tickDelta) / 25.0F + 6.0F;
|
||||
matrices.mulPose(Vector3f.YP.rotation(rotation));
|
||||
minecraft.getItemRenderer()
|
||||
.render(activeItem,
|
||||
ItemTransforms.TransformType.GROUND,
|
||||
false,
|
||||
matrices,
|
||||
vertexConsumers,
|
||||
light,
|
||||
overlay,
|
||||
model
|
||||
);
|
||||
minecraft.getItemRenderer().render(activeItem, ItemTransforms.TransformType.GROUND, false, matrices, vertexConsumers, light, overlay, model);
|
||||
}
|
||||
matrices.popPose();
|
||||
}
|
||||
|
|
|
@ -150,7 +150,7 @@ public class MetalMaterial {
|
|||
final int level = material.getLevel();
|
||||
|
||||
rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null;
|
||||
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(rawOre, 1, 3, 1)) : null;
|
||||
ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(()->rawOre, 1, 3, 1)) : null;
|
||||
alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null;
|
||||
if (hasOre) {
|
||||
TagAPI.addTag(alloyingOre, ore, rawOre);
|
||||
|
|
|
@ -26,7 +26,7 @@ import net.minecraft.world.entity.player.Player;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import net.minecraft.world.item.enchantment.Enchantments;
|
|||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ import net.minecraft.world.level.Level;
|
|||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.ServerLevelAccessor;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
|
|
|
@ -4,9 +4,9 @@ import net.minecraft.core.MappedRegistry;
|
|||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.integration.modmenu.ModIntegration;
|
||||
import ru.bclib.world.features.BCLFeature;
|
||||
|
||||
public class EnderscapeIntegration extends ModIntegration {
|
||||
|
@ -36,7 +36,9 @@ public class EnderscapeIntegration extends ModIntegration {
|
|||
|
||||
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
|
||||
if (!biomeID.getNamespace().equals("enderscape")) {
|
||||
BiomeAPI.addBiomeFeatures(biome, scatteredShadowQuartzOre, voidNebuliteOre, nebuliteOre);
|
||||
BiomeAPI.addBiomeFeature(biome, scatteredShadowQuartzOre);
|
||||
BiomeAPI.addBiomeFeature(biome, voidNebuliteOre);
|
||||
BiomeAPI.addBiomeFeature(biome, nebuliteOre);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package ru.betterend.integration;
|
|||
|
||||
import com.google.common.collect.Maps;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.integration.modmenu.ModIntegration;
|
||||
import ru.bclib.util.ColorUtil;
|
||||
import ru.betterend.blocks.HydraluxPetalColoredBlock;
|
||||
import ru.betterend.complexmaterials.ColoredMaterial;
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import ru.bclib.api.ModIntegrationAPI;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.integration.modmenu.ModIntegration;
|
||||
import ru.bclib.recipes.GridRecipe;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.config.Configs;
|
||||
|
|
|
@ -3,7 +3,7 @@ package ru.betterend.integration;
|
|||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.world.item.Item;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.integration.modmenu.ModIntegration;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class NourishIntegration extends ModIntegration {
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package ru.betterend.integration.byg;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.integration.modmenu.ModIntegration;
|
||||
import ru.betterend.integration.EndBiomeIntegration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.byg.biomes.BYGBiomes;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
|
||||
public class BYGIntegration extends ModIntegration implements EndBiomeIntegration {
|
||||
public BYGIntegration() {
|
||||
|
@ -15,61 +10,17 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
|
|||
|
||||
@Override
|
||||
public void init() {
|
||||
Block block = Integrations.BYG.getBlock("ivis_phylium");
|
||||
/*Block block = Integrations.BYG.getBlock("ivis_phylium");
|
||||
if (block != null) {
|
||||
TagAPI.addTags(block, TagAPI.BLOCK_END_GROUND, TagAPI.BLOCK_GEN_TERRAIN);
|
||||
}
|
||||
BYGBlocks.register();
|
||||
BYGFeatures.register();
|
||||
BYGBiomes.register();
|
||||
BYGBiomes.register();*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBiomes() {
|
||||
BYGBiomes.addBiomes();
|
||||
|
||||
//Class<?> biomeClass = this.getClass("corgiaoc.byg.common.world.biome.BYGEndBiome");
|
||||
//List<Object> biomes = this.getStaticFieldValue(biomeClass, "BYG_END_BIOMES");
|
||||
|
||||
/*if (biomes != null && biomeClass != null) {
|
||||
biomes.forEach((obj) -> {
|
||||
Biome biome = this.getAndExecuteRuntime(biomeClass, obj, "getBiome");
|
||||
if (biome != null) {
|
||||
ResourceLocation biomeID = BuiltinRegistries.BIOME.getKey(biome);
|
||||
BCLBiome endBiome = BiomeAPI.getBiome(biomeID);
|
||||
Biome edge = this.getAndExecuteRuntime(biomeClass, obj, "getEdge");
|
||||
if (edge != null) {
|
||||
ResourceLocation edgeID = BuiltinRegistries.BIOME.getKey(edge);
|
||||
EndBiomes.LAND_BIOMES.removeMutableBiome(edgeID);
|
||||
EndBiomes.VOID_BIOMES.removeMutableBiome(edgeID);
|
||||
BCLBiome edgeBiome = BiomeAPI.getBiome(edgeID);
|
||||
endBiome.setEdge(edgeBiome);
|
||||
}
|
||||
else {
|
||||
Boolean isVoid = this.getAndExecuteRuntime(biomeClass, obj, "isVoid");
|
||||
if (isVoid != null && isVoid.booleanValue()) {
|
||||
EndBiomes.LAND_BIOMES.removeMutableBiome(biomeID);
|
||||
EndBiomes.VOID_BIOMES.addBiomeMutable(endBiome);
|
||||
}
|
||||
ShufflingList<ResourceLocation> subBiomes = this.getAndExecuteRuntime(
|
||||
biomeClass,
|
||||
obj,
|
||||
"getHills"
|
||||
);
|
||||
if (subBiomes != null) {
|
||||
subBiomes.stream().collect(Collectors.toList()).forEach((id) -> {
|
||||
BCLBiome subBiome = BiomeAPI.getBiome(id);
|
||||
EndBiomes.LAND_BIOMES.removeMutableBiome(id);
|
||||
EndBiomes.VOID_BIOMES.removeMutableBiome(id);
|
||||
if (!endBiome.containsSubBiome(subBiome)) {
|
||||
EndBiomes.SUBBIOMES.add(subBiome);
|
||||
endBiome.addSubBiome(subBiome);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}*/
|
||||
//BYGBiomes.addBiomes();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ru.betterend.integration.byg.biomes;
|
||||
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
@ -11,7 +12,7 @@ public class BYGBiomes {
|
|||
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
|
||||
|
||||
public static void register() {
|
||||
System.out.println("Registered " + OLD_BULBIS_GARDENS);
|
||||
BetterEnd.LOGGER.info("Registered " + OLD_BULBIS_GARDENS);
|
||||
}
|
||||
|
||||
public static void addBiomes() {
|
||||
|
|
|
@ -2,14 +2,15 @@ package ru.betterend.integration.byg.biomes;
|
|||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
@ -17,53 +18,67 @@ import ru.betterend.world.biome.EndBiome;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
public class NightshadeRedwoods extends EndBiome {
|
||||
public class NightshadeRedwoods extends EndBiome.Config {
|
||||
public NightshadeRedwoods() {
|
||||
super(makeDef());
|
||||
super("nightshade_redwoods");
|
||||
}
|
||||
|
||||
private static BCLBiomeDef makeDef() {
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||
|
||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47)
|
||||
.setFogDensity(1.5F)
|
||||
.setWaterAndFogColor(55, 70, 186)
|
||||
.setFoliageColor(122, 17, 155)
|
||||
.setParticles(
|
||||
builder.fogColor(140, 108, 47)
|
||||
.fogDensity(1.5F)
|
||||
.waterAndFogColor(55, 70, 186)
|
||||
.foliageColor(122, 17, 155)
|
||||
.particles(
|
||||
ParticleTypes.REVERSE_PORTAL,
|
||||
0.002F
|
||||
)
|
||||
.setSurface(biome.getGenerationSettings()
|
||||
.getSurfaceBuilder()
|
||||
.get())
|
||||
.setGrassColor(48, 13, 89)
|
||||
.setPlantsColor(200, 125, 9)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
|
||||
//TODO: 1.18 surface rules
|
||||
// .setSurface(biome.getGenerationSettings()
|
||||
// .getSurfaceBuilder()
|
||||
// .get())
|
||||
.grassColor(48, 13, 89)
|
||||
.plantsColor(200, 125, 9)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
||||
.feature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
||||
.feature(BYGFeatures.NIGHTSHADE_MOSS);
|
||||
|
||||
if (BCLib.isClient()) {
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
||||
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent();
|
||||
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
|
||||
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent()
|
||||
.get();
|
||||
SoundEvent music = effects.getBackgroundMusic()
|
||||
.get()
|
||||
.getEvent();
|
||||
SoundEvent additions = effects.getAmbientAdditionsSettings()
|
||||
.get()
|
||||
.getSoundEvent();
|
||||
SoundEvent mood = effects.getAmbientMoodSettings()
|
||||
.get()
|
||||
.getSoundEvent();
|
||||
builder.loop(loop)
|
||||
.music(music)
|
||||
.additions(additions)
|
||||
.mood(mood);
|
||||
}
|
||||
biome.getGenerationSettings().features().forEach((list) -> {
|
||||
biome.getGenerationSettings()
|
||||
.features()
|
||||
.forEach((list) -> {
|
||||
list.forEach((feature) -> {
|
||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature.get());
|
||||
builder.feature(Decoration.VEGETAL_DECORATION, feature.get());
|
||||
});
|
||||
});
|
||||
|
||||
for (MobCategory group : MobCategory.values()) {
|
||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
||||
List<SpawnerData> list = biome.getMobSettings()
|
||||
.getMobs(group)
|
||||
.unwrap();
|
||||
list.forEach((entry) -> {
|
||||
def.addMobSpawn(entry);
|
||||
builder.spawn((EntityType<? extends Mob>) entry.type, 1, entry.minCount, entry.maxCount);
|
||||
});
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,19 +3,19 @@ package ru.betterend.integration.byg.biomes;
|
|||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.data.worldgen.Features;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
|
@ -25,83 +25,93 @@ import ru.betterend.world.biome.EndBiome;
|
|||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class FeaturesAccesor extends Features {
|
||||
static ConfiguredDecorator<?> shadowHEIGHTMAP_SQUARE;
|
||||
|
||||
static {
|
||||
shadowHEIGHTMAP_SQUARE = Decorators.HEIGHTMAP_SQUARE;
|
||||
}
|
||||
}
|
||||
|
||||
public class OldBulbisGardens extends EndBiome {
|
||||
public class OldBulbisGardens extends EndBiome.Config {
|
||||
public OldBulbisGardens() {
|
||||
super(makeDef());
|
||||
super("old_bulbis_gardens");
|
||||
}
|
||||
|
||||
private static BCLBiomeDef makeDef() {
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
|
||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||
|
||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207)
|
||||
.setFogDensity(1.8F)
|
||||
.setWaterAndFogColor(40, 0, 56)
|
||||
.setFoliageColor(122, 17, 155)
|
||||
.setParticles(
|
||||
// Block origin = biome.getGenerationSettings()
|
||||
// .getSurfaceBuilderConfig()
|
||||
// .getTopMaterial()
|
||||
// .getBlock();
|
||||
builder.fogColor(215, 132, 207)
|
||||
.fogDensity(1.8F)
|
||||
.waterAndFogColor(40, 0, 56)
|
||||
.foliageColor(122, 17, 155)
|
||||
.particles(
|
||||
ParticleTypes.REVERSE_PORTAL,
|
||||
0.002F
|
||||
)
|
||||
.setSurface(ivis, origin)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
|
||||
//TODO: 1.18 surface rules
|
||||
//.surface(ivis, origin)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(BYGFeatures.OLD_BULBIS_TREE);
|
||||
|
||||
if (BCLib.isClient()) {
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
||||
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent();
|
||||
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
|
||||
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent()
|
||||
.get();
|
||||
SoundEvent music = effects.getBackgroundMusic()
|
||||
.get()
|
||||
.getEvent();
|
||||
SoundEvent additions = effects.getAmbientAdditionsSettings()
|
||||
.get()
|
||||
.getSoundEvent();
|
||||
SoundEvent mood = effects.getAmbientMoodSettings()
|
||||
.get()
|
||||
.getSoundEvent();
|
||||
builder.loop(loop)
|
||||
.music(music)
|
||||
.additions(additions)
|
||||
.mood(mood);
|
||||
}
|
||||
|
||||
for (MobCategory group : MobCategory.values()) {
|
||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
||||
List<SpawnerData> list = biome.getMobSettings()
|
||||
.getMobs(group)
|
||||
.unwrap();
|
||||
list.forEach((entry) -> {
|
||||
def.addMobSpawn(entry);
|
||||
builder.spawn((EntityType<? extends Mob>) entry.type, 1, entry.minCount, entry.maxCount);
|
||||
});
|
||||
}
|
||||
|
||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> features = biome.getGenerationSettings().features();
|
||||
List<Supplier<ConfiguredFeature<?, ?>>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
|
||||
List<List<Supplier<PlacedFeature>>> features = biome.getGenerationSettings()
|
||||
.features();
|
||||
List<Supplier<PlacedFeature>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
|
||||
if (vegetal.size() > 2) {
|
||||
Supplier<ConfiguredFeature<?, ?>> getter;
|
||||
Supplier<PlacedFeature> getter;
|
||||
// Trees (first two features)
|
||||
// I couldn't process them with conditions, so that's why they are hardcoded (paulevs)
|
||||
for (int i = 0; i < 2; i++) {
|
||||
getter = vegetal.get(i);
|
||||
ConfiguredFeature<?, ?> feature = getter.get();
|
||||
PlacedFeature feature = getter.get();
|
||||
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
|
||||
feature = Registry.register(
|
||||
BuiltinRegistries.CONFIGURED_FEATURE,
|
||||
BuiltinRegistries.PLACED_FEATURE,
|
||||
id,
|
||||
feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
|
||||
//TODO: 1.18 Check if this is correct
|
||||
feature//.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
|
||||
);
|
||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
|
||||
builder.feature(Decoration.VEGETAL_DECORATION, feature);
|
||||
}
|
||||
// Grasses and other features
|
||||
for (int i = 2; i < vegetal.size(); i++) {
|
||||
getter = vegetal.get(i);
|
||||
ConfiguredFeature<?, ?> feature = getter.get();
|
||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
|
||||
PlacedFeature feature = getter.get();
|
||||
builder.feature(Decoration.VEGETAL_DECORATION, feature);
|
||||
}
|
||||
}
|
||||
|
||||
def.addFeature(EndFeatures.PURPLE_POLYPORE)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
||||
.addFeature(BYGFeatures.IVIS_VINE)
|
||||
.addFeature(BYGFeatures.IVIS_SPROUT);
|
||||
|
||||
return def;
|
||||
builder.feature(EndFeatures.PURPLE_POLYPORE)
|
||||
.feature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||
.feature(BYGFeatures.IVIS_MOSS)
|
||||
.feature(BYGFeatures.IVIS_VINE)
|
||||
.feature(BYGFeatures.IVIS_SPROUT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
||||
import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
|
||||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
|
@ -20,7 +20,7 @@ import ru.betterend.registry.EndBlocks;
|
|||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingDisplay> {
|
||||
public class REIAlloyingCategory implements DisplayCategory<REIAlloyingDisplay> {
|
||||
private final EntryStack ICON;
|
||||
|
||||
REIAlloyingCategory(EntryStack icon) {
|
||||
|
@ -82,7 +82,8 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
|||
return widgets;
|
||||
}
|
||||
|
||||
@Override
|
||||
//TODO: 1.18 REI find replacement
|
||||
//@Override
|
||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display, IntList redSlots) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||
matrices.pushPose();
|
||||
|
|
|
@ -7,7 +7,7 @@ import me.shedaniel.math.Point;
|
|||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
||||
import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
|
||||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
|
@ -25,7 +25,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay> {
|
||||
public class REIAnvilCategory implements DisplayCategory<REIAnvilDisplay> {
|
||||
private final EntryStack<?>[] ANVILS;
|
||||
|
||||
REIAnvilCategory(EntryStack<?>[] anvils) {
|
||||
|
@ -86,7 +86,8 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
|||
return widgets;
|
||||
}
|
||||
|
||||
@Override
|
||||
//TODO: 1.18 REI, find replacement
|
||||
//@Override
|
||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display, IntList redSlots) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||
matrices.pushPose();
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package ru.betterend.integration.rei;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import me.shedaniel.math.Point;
|
||||
import me.shedaniel.math.Rectangle;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widget;
|
||||
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
|
||||
import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
||||
import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
|
||||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
|
@ -21,7 +19,7 @@ import ru.betterend.registry.EndBlocks;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionDisplay> {
|
||||
public class REIInfusionCategory implements DisplayCategory<REIInfusionDisplay> {
|
||||
|
||||
private final static ResourceLocation BACKGROUND = BetterEnd.makeID("textures/gui/rei_infusion.png");
|
||||
private final EntryStack ICON;
|
||||
|
@ -109,7 +107,4 @@ public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionD
|
|||
public int getDisplayHeight() {
|
||||
return 104;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIInfusionDisplay display, IntList redSlots) {}
|
||||
}
|
||||
|
|
|
@ -5,12 +5,10 @@ import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
|
|||
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
|
||||
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
|
||||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
import me.shedaniel.rei.api.common.util.EntryIngredients;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import me.shedaniel.rei.plugin.common.DefaultPlugin;
|
||||
import net.fabricmc.fabric.impl.content.registry.FuelRegistryImpl;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
|
@ -24,7 +22,6 @@ import ru.betterend.recipe.builders.AlloyingRecipe;
|
|||
import ru.betterend.recipe.builders.InfusionRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -55,12 +52,13 @@ public class REIPlugin implements REIClientPlugin {
|
|||
registry.registerRecipeFiller(AnvilRecipe.class, AnvilRecipe.TYPE, REIAnvilDisplay::new);
|
||||
registry.registerRecipeFiller(InfusionRecipe.class, InfusionRecipe.TYPE, REIInfusionDisplay::new);
|
||||
|
||||
FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
|
||||
if (time >= 2000) {
|
||||
final List<EntryIngredient> list = Collections.singletonList(EntryIngredients.of(item));
|
||||
registry.add(new REIAlloyingFuelDisplay(list, time));
|
||||
}
|
||||
});
|
||||
//TODO: 1.18 REI fix this
|
||||
// FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
|
||||
// if (time >= 2000) {
|
||||
// final List<EntryIngredient> list = Collections.singletonList(EntryIngredients.of(item));
|
||||
// registry.add(new REIAlloyingFuelDisplay(list, time));
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package ru.betterend.interfaces;
|
||||
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public interface StructureFeaturesAccessor {
|
||||
ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> getEndCity();
|
||||
}
|
5
src/main/java/ru/betterend/interfaces/TargetChecker.java
Normal file
5
src/main/java/ru/betterend/interfaces/TargetChecker.java
Normal file
|
@ -0,0 +1,5 @@
|
|||
package ru.betterend.interfaces;
|
||||
|
||||
public interface TargetChecker {
|
||||
boolean isTarget();
|
||||
}
|
|
@ -15,7 +15,6 @@ import ru.bclib.items.ModelProviderItem;
|
|||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.util.LangUtil;
|
||||
import vazkii.patchouli.api.PatchouliAPI;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -33,7 +32,8 @@ public class GuideBookItem extends ModelProviderItem {
|
|||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
|
||||
if (!world.isClientSide && user instanceof ServerPlayer) {
|
||||
PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
//TODO: reanable Patchouli once it is available for 1.18
|
||||
//PatchouliAPI.get().openBookGUI((ServerPlayer) user, BOOK_ID);
|
||||
return InteractionResultHolder.success(user.getItemInHand(hand));
|
||||
}
|
||||
return InteractionResultHolder.consume(user.getItemInHand(hand));
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.betterend.client.ClientOptions;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
|
@ -90,7 +90,8 @@ public abstract class MusicTrackerMixin {
|
|||
}
|
||||
|
||||
private boolean be_shouldChangeSound(Music musicSound) {
|
||||
return currentMusic != null && !musicSound.getEvent()
|
||||
return currentMusic != null && !musicSound
|
||||
.getEvent()
|
||||
.getLocation()
|
||||
.equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic();
|
||||
}
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.biome.BiomeGenerationSettings;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
@Mixin(BiomeGenerationSettings.class)
|
||||
public interface BiomeGenerationSettingsAccessor {
|
||||
@Accessor("features")
|
||||
@Deprecated(forRemoval = true)
|
||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> be_getFeatures();
|
||||
|
||||
@Accessor("features")
|
||||
@Deprecated(forRemoval = true)
|
||||
void be_setFeatures(List<List<Supplier<ConfiguredFeature<?, ?>>>> features);
|
||||
|
||||
@Accessor("structureStarts")
|
||||
@Deprecated(forRemoval = true)
|
||||
List<Supplier<ConfiguredStructureFeature<?, ?>>> be_getStructures();
|
||||
|
||||
@Accessor("structureStarts")
|
||||
@Deprecated(forRemoval = true)
|
||||
void be_setStructures(List<Supplier<ConfiguredStructureFeature<?, ?>>> structures);
|
||||
}
|
|
@ -2,12 +2,13 @@ package ru.betterend.mixin.common;
|
|||
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.LevelHeightAccessor;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.WorldgenRandom;
|
||||
import net.minecraft.world.level.levelgen.XoroshiroRandomSource;
|
||||
import net.minecraft.world.level.levelgen.feature.EndCityFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.structure.pieces.PieceGenerator;
|
||||
import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -15,22 +16,28 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(EndCityFeature.class)
|
||||
public class EndCityFeatureMixin {
|
||||
@Inject(method = "isFeatureChunk", at = @At("HEAD"), cancellable = true)
|
||||
private void be_isFeatureChunk(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, WorldgenRandom chunkRandom, ChunkPos pos, Biome biome, ChunkPos chunkPos, NoneFeatureConfiguration defaultFeatureConfig, LevelHeightAccessor levelHeightAccessor, CallbackInfoReturnable<Boolean> info) {
|
||||
@Inject(method = "pieceGeneratorSupplier", at = @At("HEAD"), cancellable = true)
|
||||
private static void be_isFeatureChunk(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context, CallbackInfoReturnable<Optional<PieceGenerator<NoneFeatureConfiguration>>> info) {
|
||||
final ChunkPos pos = context.chunkPos();
|
||||
final ChunkGenerator chunkGenerator = context.chunkGenerator();
|
||||
final LevelHeightAccessor levelHeightAccessor = context.heightAccessor();
|
||||
Random chunkRandom = new WorldgenRandom(new XoroshiroRandomSource(pos.x, pos.z));
|
||||
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
int chance = GeneratorOptions.getEndCityFailChance();
|
||||
if (chance == 0) {
|
||||
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60);
|
||||
if (chance == 0 || chunkRandom.nextInt(chance) == 0) {
|
||||
if (!(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60)){
|
||||
info.cancel();
|
||||
info.setReturnValue(Optional.empty());
|
||||
}
|
||||
else if (chunkRandom.nextInt(chance) == 0) {
|
||||
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60);
|
||||
info.cancel();
|
||||
}
|
||||
else {
|
||||
info.setReturnValue(false);
|
||||
info.setReturnValue(Optional.empty());
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import ru.bclib.util.StructureHelper;
|
|||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(EndPodiumFeature.class)
|
||||
|
@ -56,7 +57,8 @@ public class EndPodiumFeatureMixin {
|
|||
private FeaturePlaceContext<NoneFeatureConfiguration> be_setPosOnGround(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) {
|
||||
WorldGenLevel world = featurePlaceContext.level();
|
||||
BlockPos pos = be_updatePortalPos(world);
|
||||
return new FeaturePlaceContext<>(
|
||||
return new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
featurePlaceContext.chunkGenerator(),
|
||||
featurePlaceContext.random(),
|
||||
|
|
|
@ -66,8 +66,6 @@ public abstract class EntityMixin implements TeleportingEntity {
|
|||
entity.getXRot()
|
||||
);
|
||||
entity.setDeltaMovement(teleportTarget.speed);
|
||||
//TODO: check if this works as intended in 1.17
|
||||
|
||||
destination.addDuringTeleport(entity);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.StructureSettings;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
import ru.betterend.world.generator.TerrainGenerator;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Mixin(NoiseBasedChunkGenerator.class)
|
||||
public abstract class NoiseBasedChunkGeneratorMixin extends ChunkGenerator {
|
||||
@Final
|
||||
@Shadow
|
||||
protected Supplier<NoiseGeneratorSettings> settings;
|
||||
|
||||
public NoiseBasedChunkGeneratorMixin(BiomeSource populationSource, BiomeSource biomeSource, StructureSettings structuresConfig, long worldSeed) {
|
||||
super(populationSource, biomeSource, structuresConfig, worldSeed);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/level/biome/BiomeSource;Lnet/minecraft/world/level/biome/BiomeSource;JLjava/util/function/Supplier;)V", at = @At("TAIL"))
|
||||
private void beOnInit(BiomeSource populationSource, BiomeSource biomeSource, long seed, Supplier<NoiseGeneratorSettings> settings, CallbackInfo info) {
|
||||
TerrainGenerator.initNoise(seed);
|
||||
}
|
||||
|
||||
@Inject(method = "fillNoiseColumn([DIIII)V", at = @At("HEAD"), cancellable = true, allow = 2)
|
||||
private void be_fillNoiseColumn(double[] buffer, int x, int z, int k, int l, CallbackInfo info) {
|
||||
if (GeneratorOptions.useNewGenerator() && settings.get().stable(NoiseGeneratorSettings.END)) {
|
||||
TerrainGenerator.fillTerrainDensity(buffer, x, z, getBiomeSource());
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.levelgen.NoiseChunk;
|
||||
import net.minecraft.world.level.levelgen.NoiseSettings;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(NoiseChunk.class)
|
||||
public interface NoiseChunkAccessor {
|
||||
@Accessor("noiseSettings")
|
||||
NoiseSettings bnv_getNoiseSettings();
|
||||
|
||||
@Accessor("cellCountXZ")
|
||||
int bnv_getCellCountXZ();
|
||||
|
||||
@Accessor("cellCountY")
|
||||
int bnv_getCellCountY();
|
||||
|
||||
@Accessor("firstCellZ")
|
||||
int bnv_getFirstCellZ();
|
||||
|
||||
@Accessor("cellNoiseMinY")
|
||||
int bnv_getCellNoiseMinY();
|
||||
}
|
28
src/main/java/ru/betterend/mixin/common/NoiseChunkMixin.java
Normal file
28
src/main/java/ru/betterend/mixin/common/NoiseChunkMixin.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.levelgen.Aquifer;
|
||||
import net.minecraft.world.level.levelgen.NoiseChunk;
|
||||
import net.minecraft.world.level.levelgen.NoiseChunk.NoiseFiller;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.NoiseSampler;
|
||||
import net.minecraft.world.level.levelgen.blending.Blender;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import ru.betterend.interfaces.TargetChecker;
|
||||
|
||||
@Mixin(NoiseChunk.class)
|
||||
public class NoiseChunkMixin implements TargetChecker {
|
||||
private boolean be_isEndGenerator;
|
||||
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void be_onNoiseChunkInit(int i, int j, int k, NoiseSampler noiseSampler, int l, int m, NoiseFiller noiseFiller, NoiseGeneratorSettings noiseGeneratorSettings, Aquifer.FluidPicker fluidPicker, Blender blender, CallbackInfo info) {
|
||||
be_isEndGenerator = noiseGeneratorSettings.stable(NoiseGeneratorSettings.END);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTarget() {
|
||||
return be_isEndGenerator;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.world.level.levelgen.NoiseChunk;
|
||||
import net.minecraft.world.level.levelgen.NoiseSettings;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import ru.betterend.interfaces.TargetChecker;
|
||||
import ru.betterend.world.generator.TerrainGenerator;
|
||||
|
||||
@Mixin(NoiseChunk.NoiseInterpolator.class)
|
||||
public class NoiseInterpolatorMixin {
|
||||
@Final
|
||||
@Shadow(aliases = "this$0")
|
||||
private NoiseChunk this$0;
|
||||
|
||||
@Inject(method = "fillSlice", at = @At("HEAD"), cancellable = true)
|
||||
private void be_fillSlice(double[][] data, int x, CallbackInfo info) {
|
||||
if (!TargetChecker.class.cast(this$0).isTarget()) {
|
||||
return;
|
||||
}
|
||||
|
||||
info.cancel();
|
||||
|
||||
NoiseChunkAccessor accessor = NoiseChunkAccessor.class.cast(this$0);
|
||||
NoiseSettings noiseSettings = accessor.bnv_getNoiseSettings();
|
||||
|
||||
final int sizeY = noiseSettings.getCellHeight();
|
||||
final int sizeXZ = noiseSettings.getCellWidth();
|
||||
//final int cellsY = accessor.bnv_getCellCountY() + 1;
|
||||
final int cellsXZ = accessor.bnv_getCellCountXZ() + 1;
|
||||
final int firstCellZ = accessor.bnv_getFirstCellZ();
|
||||
//final int cellNoiseMinY = accessor.bnv_getCellNoiseMinY();
|
||||
|
||||
x *= sizeXZ;
|
||||
|
||||
for (int cellXZ = 0; cellXZ < cellsXZ; ++cellXZ) {
|
||||
int z = (firstCellZ + cellXZ) * sizeXZ;
|
||||
TerrainGenerator.fillTerrainDensity(data[cellXZ], x, z, sizeXZ, sizeY);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
@ -14,7 +13,7 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.dimension.DimensionType;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess;
|
||||
import net.minecraft.world.level.storage.ServerLevelData;
|
||||
import net.minecraft.world.level.storage.WritableLevelData;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
@ -23,11 +22,11 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
import ru.betterend.world.generator.TerrainGenerator;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
@ -35,21 +34,29 @@ import java.util.function.Supplier;
|
|||
|
||||
@Mixin(ServerLevel.class)
|
||||
public abstract class ServerLevelMixin extends Level {
|
||||
private static String be_lastWorld = null;
|
||||
//private static String be_lastWorld = null;
|
||||
|
||||
protected ServerLevelMixin(WritableLevelData writableLevelData, ResourceKey<Level> resourceKey, DimensionType dimensionType, Supplier<ProfilerFiller> supplier, boolean bl, boolean bl2, long l) {
|
||||
super(writableLevelData, resourceKey, dimensionType, supplier, bl, bl2, l);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
|
||||
if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) {
|
||||
return;
|
||||
}
|
||||
// @Inject(method = "<init>*", at = @At("TAIL"))
|
||||
// private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
|
||||
// if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// be_lastWorld = session.getLevelId();
|
||||
// //ServerLevel world = ServerLevel.class.cast(this);
|
||||
// //EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY));
|
||||
// }
|
||||
|
||||
be_lastWorld = session.getLevelId();
|
||||
ServerLevel world = ServerLevel.class.cast(this);
|
||||
EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY));
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void be_onServerWorldInit(MinecraftServer minecraftServer, Executor executor, LevelStorageAccess levelStorageAccess, ServerLevelData serverLevelData, ResourceKey<Level> resourceKey, DimensionType dimensionType, ChunkProgressListener chunkProgressListener, ChunkGenerator chunkGenerator, boolean bl, long seed, List<CustomSpawner> list, boolean bl2, CallbackInfo ci) {
|
||||
ServerLevel level = ServerLevel.class.cast(this);
|
||||
if (level.dimension() == Level.END) {
|
||||
TerrainGenerator.initNoise(seed, chunkGenerator.getBiomeSource(), chunkGenerator.climateSampler());
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true)
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.StructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import ru.betterend.interfaces.StructureFeaturesAccessor;
|
||||
|
||||
@Mixin(StructureFeatures.class)
|
||||
public class StructureFeaturesMixin implements StructureFeaturesAccessor {
|
||||
@Shadow @Final private static ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> END_CITY;
|
||||
|
||||
public ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> getEndCity(){
|
||||
return END_CITY;
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package ru.betterend.mixin.common;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.WorldGenRegion;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
@ -14,13 +15,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
public class WorldGenRegionMixin {
|
||||
@Final
|
||||
@Shadow
|
||||
private ChunkPos center;
|
||||
private ChunkAccess center;
|
||||
|
||||
@Inject(method = "ensureCanWrite", at = @At("HEAD"), cancellable = true)
|
||||
private void be_alterBlockCheck(BlockPos blockPos, CallbackInfoReturnable<Boolean> info) {
|
||||
ChunkPos cPos = center.getPos();
|
||||
int x = blockPos.getX() >> 4;
|
||||
int z = blockPos.getZ() >> 4;
|
||||
WorldGenRegion region = (WorldGenRegion) (Object) this;
|
||||
info.setReturnValue(Math.abs(x - center.x) < 2 && Math.abs(z - center.z) < 2);
|
||||
info.setReturnValue(Math.abs(x - cPos.x) < 2 && Math.abs(z - cPos.z) < 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,14 @@ package ru.betterend.registry;
|
|||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.LifeCycleAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.bclib.world.generator.BiomeMap;
|
||||
import ru.bclib.world.generator.BiomePicker;
|
||||
import ru.bclib.world.generator.map.hex.HexBiomeMap;
|
||||
import ru.betterend.config.Configs;
|
||||
import ru.betterend.util.FeaturesHelper;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.biome.air.BiomeIceStarfield;
|
||||
import ru.betterend.world.biome.cave.EmptyAuroraCaveBiome;
|
||||
|
@ -41,7 +42,8 @@ import ru.betterend.world.generator.GeneratorOptions;
|
|||
|
||||
public class EndBiomes {
|
||||
public static final BiomePicker CAVE_BIOMES = new BiomePicker();
|
||||
private static BiomeMap caveBiomeMap;
|
||||
private static HexBiomeMap caveBiomeMap;
|
||||
private static long lastSeed;
|
||||
|
||||
// Better End Land
|
||||
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.LAND);
|
||||
|
@ -74,25 +76,29 @@ public class EndBiomes {
|
|||
public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
|
||||
public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome());
|
||||
|
||||
public static void register() {}
|
||||
public static void register() {
|
||||
LifeCycleAPI.onLevelLoad(EndBiomes::onWorldLoad);
|
||||
}
|
||||
|
||||
public static void onWorldLoad(long seed, Registry<Biome> registry) {
|
||||
private static void onWorldLoad(ServerLevel level, long seed, Registry<Biome> registry) {
|
||||
CAVE_BIOMES.getBiomes().forEach(biome -> biome.updateActualBiomes(registry));
|
||||
CAVE_BIOMES.rebuild();
|
||||
if (caveBiomeMap == null || caveBiomeMap.getSeed() != seed) {
|
||||
caveBiomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES);
|
||||
if (caveBiomeMap == null || lastSeed != seed) {
|
||||
caveBiomeMap = new HexBiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES);
|
||||
lastSeed = seed;
|
||||
}
|
||||
FeaturesHelper.addFeatures(registry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put existing {@link EndBiome} as a sub-biome into selected parent.
|
||||
*
|
||||
* @param biome - {@link EndBiome} instance
|
||||
* @param biomeConfig - {@link EndBiome.Config} instance
|
||||
* @param parent - {@link EndBiome} to be linked with
|
||||
* @return registered {@link EndBiome}
|
||||
*/
|
||||
public static EndBiome registerSubBiome(EndBiome biome, EndBiome parent) {
|
||||
public static EndBiome registerSubBiome(EndBiome.Config biomeConfig, EndBiome parent) {
|
||||
final EndBiome biome = EndBiome.create(biomeConfig);
|
||||
|
||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||
BiomeAPI.registerSubBiome(parent, biome);
|
||||
}
|
||||
|
@ -102,11 +108,12 @@ public class EndBiomes {
|
|||
/**
|
||||
* Registers {@link EndBiome} and adds it into worldgen.
|
||||
*
|
||||
* @param biome - {@link EndBiome} instance
|
||||
* @param biomeConfig - {@link EndBiome.Config} instance
|
||||
* @param type - {@link BiomeType}
|
||||
* @return registered {@link EndBiome}
|
||||
*/
|
||||
public static EndBiome registerBiome(EndBiome biome, BiomeType type) {
|
||||
public static EndBiome registerBiome(EndBiome.Config biomeConfig, BiomeType type) {
|
||||
final EndBiome biome = EndBiome.create(biomeConfig);
|
||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||
if (type == BiomeType.LAND) {
|
||||
BiomeAPI.registerEndLandBiome(biome);
|
||||
|
@ -121,10 +128,11 @@ public class EndBiomes {
|
|||
/**
|
||||
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
|
||||
*
|
||||
* @param biome - {@link EndBiome} instance
|
||||
* @param biomeConfig - {@link EndBiome.Config} instance
|
||||
* @return registered {@link EndBiome}
|
||||
*/
|
||||
public static EndBiome registerSubBiomeIntegration(EndBiome biome) {
|
||||
public static EndBiome registerSubBiomeIntegration(EndBiome.Config biomeConfig) {
|
||||
EndBiome biome = EndBiome.create(biomeConfig);
|
||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||
BiomeAPI.registerBiome(biome);
|
||||
}
|
||||
|
@ -146,7 +154,8 @@ public class EndBiomes {
|
|||
}
|
||||
}
|
||||
|
||||
public static EndCaveBiome registerCaveBiome(EndCaveBiome biome) {
|
||||
public static EndCaveBiome registerCaveBiome(EndCaveBiome.Config biomeConfig) {
|
||||
final EndCaveBiome biome = EndCaveBiome.create(biomeConfig);
|
||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||
BiomeAPI.registerBiome(biome);
|
||||
CAVE_BIOMES.addBiome(biome);
|
||||
|
@ -155,6 +164,6 @@ public class EndBiomes {
|
|||
}
|
||||
|
||||
public static EndCaveBiome getCaveBiome(int x, int z) {
|
||||
return (EndCaveBiome) caveBiomeMap.getBiome(x, z);
|
||||
return (EndCaveBiome) caveBiomeMap.getBiome(x, 5, z);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -429,8 +429,8 @@ public class EndBlocks {
|
|||
public static final Block SILK_MOTH_HIVE = registerBlock("silk_moth_hive", new SilkMothHiveBlock());
|
||||
|
||||
// Ores //
|
||||
public static final Block ENDER_ORE = registerBlock("ender_ore", new BaseOreBlock(EndItems.ENDER_SHARD, 1, 3, 5));
|
||||
public static final Block AMBER_ORE = registerBlock("amber_ore", new BaseOreBlock(EndItems.RAW_AMBER, 1, 2, 4));
|
||||
public static final Block ENDER_ORE = registerBlock("ender_ore", new BaseOreBlock(()->EndItems.ENDER_SHARD, 1, 3, 5));
|
||||
public static final Block AMBER_ORE = registerBlock("amber_ore", new BaseOreBlock(()->EndItems.RAW_AMBER, 1, 2, 4));
|
||||
|
||||
// Materials //
|
||||
public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal(
|
||||
|
|
|
@ -1,29 +1,42 @@
|
|||
package ru.betterend.registry;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.VerticalAnchor;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.CountConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.placement.FeatureDecorator;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import net.minecraft.world.level.levelgen.placement.CountPlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.api.features.BCLCommonFeatures;
|
||||
import ru.bclib.api.features.BCLFeatureBuilder;
|
||||
import ru.bclib.util.JsonFactory;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.bclib.world.features.BCLFeature;
|
||||
import ru.bclib.world.features.DefaultFeature;
|
||||
import ru.bclib.world.features.ListFeature.StructureInfo;
|
||||
import ru.bclib.world.features.NBTStructureFeature.TerrainMerge;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.complexmaterials.StoneMaterial;
|
||||
import ru.betterend.config.Configs;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
import ru.betterend.world.biome.land.UmbraValleyBiome;
|
||||
import ru.betterend.world.features.BiomeIslandFeature;
|
||||
import ru.betterend.world.features.BlueVineFeature;
|
||||
import ru.betterend.world.features.BuildingListFeature;
|
||||
import ru.betterend.world.features.CavePumpkinFeature;
|
||||
import ru.betterend.world.features.CharniaFeature;
|
||||
import ru.betterend.world.features.CrashedShipFeature;
|
||||
|
@ -81,29 +94,27 @@ import ru.betterend.world.features.trees.MossyGlowshroomFeature;
|
|||
import ru.betterend.world.features.trees.PythadendronTreeFeature;
|
||||
import ru.betterend.world.features.trees.TenaneaFeature;
|
||||
import ru.betterend.world.features.trees.UmbrellaTreeFeature;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
import ru.betterend.world.surface.UmbraSurfaceBuilder;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class EndFeatures {
|
||||
// Trees //
|
||||
public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 3);
|
||||
public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree", new PythadendronTreeFeature(), 2);
|
||||
public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 2);
|
||||
public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree", new PythadendronTreeFeature(), 1);
|
||||
public static final BCLFeature LACUGROVE = redisterVegetation("lacugrove", new LacugroveFeature(), 4);
|
||||
public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 3);
|
||||
public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 3);
|
||||
public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 2);
|
||||
public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 4);
|
||||
public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 3);
|
||||
public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 2);
|
||||
public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 2);
|
||||
public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 1);
|
||||
public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 2);
|
||||
public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 2);
|
||||
public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita", new GiganticAmaranitaFeature(), 1);
|
||||
public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3);
|
||||
|
||||
// Bushes //
|
||||
public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.getBark()), 4);
|
||||
public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.getBark()), 15);
|
||||
public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 10);
|
||||
public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.getBark()), 3);
|
||||
public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.getBark()), 5);
|
||||
public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 6);
|
||||
public static final BCLFeature LUMECORN = redisterVegetation("lumecorn", new Lumecorn(), 5);
|
||||
public static final BCLFeature LARGE_AMARANITA = redisterVegetation("large_amaranita", new LargeAmaranitaFeature(), 5);
|
||||
public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.getBark()), 10);
|
||||
|
@ -111,23 +122,23 @@ public class EndFeatures {
|
|||
public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2);
|
||||
|
||||
// Plants //
|
||||
public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5);
|
||||
public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5);
|
||||
public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 3);
|
||||
public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 3);
|
||||
public static final BCLFeature BLUE_VINE = redisterVegetation("blue_vine", new BlueVineFeature(), 1);
|
||||
public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 5);
|
||||
public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 3);
|
||||
public static final BCLFeature CRYSTAL_GRASS = redisterVegetation("crystal_grass", new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), 5);
|
||||
public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant", new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), 9);
|
||||
public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant", new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), 5);
|
||||
public static final BCLFeature MURKWEED = redisterVegetation("murkweed", new SinglePlantFeature(EndBlocks.MURKWEED, 3), 2);
|
||||
public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass", new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), 2);
|
||||
public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass", new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), 1);
|
||||
public static final BCLFeature SHADOW_BERRY = redisterVegetation("shadow_berry", new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2), 1);
|
||||
public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), 20);
|
||||
public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), 10);
|
||||
public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 9);
|
||||
public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 3);
|
||||
public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), 10);
|
||||
public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), 8);
|
||||
public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 7);
|
||||
public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 2);
|
||||
public static final BCLFeature GLOW_PILLAR = redisterVegetation("glow_pillar", new GlowPillarFeature(), 1);
|
||||
public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 5);
|
||||
public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 8);
|
||||
public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 4);
|
||||
public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 3);
|
||||
public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 6);
|
||||
public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 2);
|
||||
public static final BCLFeature BLOSSOM_BERRY = redisterVegetation("blossom_berry", new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), 2);
|
||||
public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation("blooming_cooksonia", new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), 5);
|
||||
public static final BCLFeature SALTEAGO = redisterVegetation("salteago", new SinglePlantFeature(EndBlocks.SALTEAGO, 5), 5);
|
||||
|
@ -144,7 +155,7 @@ public class EndFeatures {
|
|||
public static final BCLFeature GLOBULAGUS = redisterVegetation("globulagus", new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), 6);
|
||||
public static final BCLFeature CLAWFERN = redisterVegetation("clawfern", new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), 5);
|
||||
public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation("bolux_mushroom", new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM, 5, 5), 2);
|
||||
public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 5), 1);
|
||||
public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 3, 5), 1);
|
||||
public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root", new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), 1);
|
||||
//public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1);
|
||||
public static final BCLFeature INFLEXIA = redisterVegetation("inflexia", new SinglePlantFeature(EndBlocks.INFLEXIA, 7, false, 3), 16);
|
||||
|
@ -152,8 +163,8 @@ public class EndFeatures {
|
|||
|
||||
// Vines //
|
||||
public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
|
||||
public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 3);
|
||||
public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5);
|
||||
public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 1);
|
||||
public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 3);
|
||||
public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine", new VineFeature(EndBlocks.JUNGLE_VINE, 24), 5);
|
||||
|
||||
// Ceil plants
|
||||
|
@ -197,7 +208,7 @@ public class EndFeatures {
|
|||
public static final BCLFeature CHARNIA_GREEN = redisterVegetation("charnia_green", new CharniaFeature(EndBlocks.CHARNIA_GREEN), 10);
|
||||
public static final BCLFeature MENGER_SPONGE = redisterVegetation("menger_sponge", new MengerSpongeFeature(5), 1);
|
||||
public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED),2);
|
||||
public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured(BetterEnd.makeID("overworld_island"), Decoration.RAW_GENERATION, new BiomeIslandFeature());
|
||||
public static final BCLFeature BIOME_ISLAND = BCLFeatureBuilder.start(BetterEnd.makeID("overworld_island"), new BiomeIslandFeature()).decoration(Decoration.RAW_GENERATION).build();
|
||||
public static final BCLFeature FLAMAEA = redisterVegetation("flamaea", new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), 20);
|
||||
|
||||
// Terrain //
|
||||
|
@ -206,11 +217,11 @@ public class EndFeatures {
|
|||
public static final BCLFeature END_LAKE_RARE = registerLake("end_lake_rare", new EndLakeFeature(), 40);
|
||||
public static final BCLFeature DESERT_LAKE = registerLake("desert_lake", new DesertLakeFeature(), 8);
|
||||
public static final BCLFeature ROUND_CAVE = registerRawGen("round_cave", new RoundCaveFeature(), 2);
|
||||
public static final BCLFeature SPIRE = registerRawGen("spire", new SpireFeature(), 2);
|
||||
public static final BCLFeature SPIRE = registerRawGen("spire", new SpireFeature(), 4);
|
||||
public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8);
|
||||
public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8);
|
||||
public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8);
|
||||
public static final BCLFeature SULPHURIC_CAVE = BCLFeature.makeCountFeature(BetterEnd.makeID("sulphuric_cave"), Decoration.RAW_GENERATION, new SulphuricCaveFeature(), 2);
|
||||
public static final BCLFeature SULPHURIC_CAVE = BCLCommonFeatures.makeCountFeature(BetterEnd.makeID("sulphuric_cave"), Decoration.RAW_GENERATION, new SulphuricCaveFeature(), 2);
|
||||
public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
|
||||
public static final BCLFeature ICE_STAR_SMALL = registerRawGen("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8);
|
||||
public static final BCLFeature SURFACE_VENT = registerChanced("surface_vent", new SurfaceVentFeature(), 4);
|
||||
|
@ -218,21 +229,18 @@ public class EndFeatures {
|
|||
public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced("obsidian_pillar_basement", new ObsidianPillarBasementFeature(), 8);
|
||||
public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder", new ObsidianBoulderFeature(), 10);
|
||||
public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20);
|
||||
public static final BCLFeature TUNEL_CAVE = BCLFeature.makeChunkFeature(BetterEnd.makeID("tunel_cave"), Decoration.RAW_GENERATION, new TunelCaveFeature());
|
||||
public static final BCLFeature UMBRALITH_ARCH = registerChanced(
|
||||
"umbralith_arch",
|
||||
new ArchFeature(
|
||||
public static final BCLFeature TUNEL_CAVE = BCLCommonFeatures.makeChunkFeature(BetterEnd.makeID("tunel_cave"), Decoration.RAW_GENERATION, new TunelCaveFeature());
|
||||
public static final BCLFeature UMBRALITH_ARCH = registerChanced("umbralith_arch", new ArchFeature(
|
||||
EndBlocks.UMBRALITH.stone,
|
||||
UmbraSurfaceBuilder::getSurfaceState
|
||||
),
|
||||
10);
|
||||
pos -> UmbraValleyBiome.getSurface(pos.getX(), pos.getZ()).defaultBlockState()
|
||||
), 10);
|
||||
public static final BCLFeature THIN_UMBRALITH_ARCH = registerChanced("thin_umbralith_arch", new ThinArchFeature(EndBlocks.UMBRALITH.stone), 15);
|
||||
|
||||
// Ores //
|
||||
public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8, 5, 128);
|
||||
public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4, 5, 128);
|
||||
public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 24, 6, 5, 128);
|
||||
public static final BCLFeature DRAGON_BONE_BLOCK_ORE = registerOre("dragon_bone_ore", EndBlocks.DRAGON_BONE_BLOCK, 24, 8, 5, 128);
|
||||
public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8);
|
||||
public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4);
|
||||
public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 60, 6);
|
||||
public static final BCLFeature DRAGON_BONE_BLOCK_ORE = registerOre("dragon_bone_ore", EndBlocks.DRAGON_BONE_BLOCK, 24, 8);
|
||||
public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer", EndBlocks.VIOLECITE, 15, 16, 128, 8);
|
||||
public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer", EndBlocks.FLAVOLITE, 12, 16, 128, 6);
|
||||
|
||||
|
@ -274,30 +282,29 @@ public class EndFeatures {
|
|||
public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature();
|
||||
|
||||
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
|
||||
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
|
||||
ResourceLocation id = BetterEnd.makeID(name);
|
||||
return BCLFeatureBuilder.start(id, feature).countLayersMax(density).onlyInBiome().build();
|
||||
}
|
||||
|
||||
private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
|
||||
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
|
||||
}
|
||||
|
||||
private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
|
||||
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.LAKES, feature, chance);
|
||||
}
|
||||
|
||||
private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.SURFACE_STRUCTURES, feature, chance);
|
||||
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.SURFACE_STRUCTURES, feature, chance);
|
||||
}
|
||||
|
||||
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int minY, int maxY) {
|
||||
return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, Blocks.END_STONE, veins, veinSize, minY, maxY);
|
||||
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize) {
|
||||
return BCLCommonFeatures.makeOreFeature(BetterEnd.makeID(name), blockOre, Blocks.END_STONE, veins, veinSize, 0, HeightRangePlacement.uniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(128)), false);
|
||||
}
|
||||
|
||||
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
|
||||
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
|
||||
ConfiguredFeature<?, ?> configured = layer
|
||||
.configured(FeatureConfiguration.NONE)
|
||||
.decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count)));
|
||||
PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
|
||||
return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
|
||||
}
|
||||
|
||||
|
@ -305,75 +312,81 @@ public class EndFeatures {
|
|||
return registerLayer(name, material.stone, radius, minY, maxY, count);
|
||||
}
|
||||
|
||||
public static void registerBiomeFeatures(ResourceLocation id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
|
||||
public static void addBiomeFeatures(ResourceLocation id, Biome biome) {
|
||||
BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
|
||||
BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
|
||||
BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
|
||||
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
|
||||
|
||||
BCLBiome bclbiome = BiomeAPI.getBiome(id);
|
||||
BCLFeature feature = getBiomeStructures(bclbiome);
|
||||
if (feature != null) {
|
||||
BiomeAPI.addBiomeFeature(biome, feature);
|
||||
}
|
||||
|
||||
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GeneratorOptions.removeChorusFromVanillaBiomes()) {
|
||||
if (id.getNamespace().equals("minecraft")) {
|
||||
String path = id.getPath();
|
||||
if (path.equals("end_highlands") || path.equals("end_midlands") || path.equals("small_end_islands")) {
|
||||
int pos = GenerationStep.Decoration.VEGETAL_DECORATION.ordinal();
|
||||
if (pos < features.size()) {
|
||||
List<Supplier<ConfiguredFeature<?, ?>>> list = features.get(pos);
|
||||
// If only chorus plants are enabled
|
||||
if (list.size() == 1) {
|
||||
features.get(pos).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addFeature(FLAVOLITE_LAYER, features);
|
||||
addFeature(THALLASIUM_ORE, features);
|
||||
addFeature(ENDER_ORE, features);
|
||||
addFeature(CRASHED_SHIP, features);
|
||||
|
||||
BCLBiome bclbiome = BiomeAPI.getBiome(id);
|
||||
boolean hasCaves = bclbiome.getCustomData("has_caves", true) && !(bclbiome instanceof EndCaveBiome);
|
||||
if (hasCaves && !BiomeAPI.END_VOID_BIOME_PICKER.containsImmutable(id)) {
|
||||
if (Configs.BIOME_CONFIG.getBoolean(id, "hasCaves", true)) {
|
||||
addFeature(ROUND_CAVE, features);
|
||||
addFeature(TUNEL_CAVE, features);
|
||||
BiomeAPI.addBiomeFeature(biome, ROUND_CAVE);
|
||||
BiomeAPI.addBiomeFeature(biome, TUNEL_CAVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature();
|
||||
if (feature != null) {
|
||||
addFeature(feature, features);
|
||||
}
|
||||
private static BCLFeature getBiomeStructures(BCLBiome biome) {
|
||||
String ns = biome.getID().getNamespace();
|
||||
String nm = biome.getID().getPath();
|
||||
ResourceLocation id = new ResourceLocation(ns, nm + "_structures");
|
||||
|
||||
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
|
||||
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
|
||||
Feature<?> feature = Registry.FEATURE.get(id);
|
||||
return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
|
||||
}
|
||||
|
||||
public static void addDefaultFeatures(BCLBiomeDef def) {
|
||||
def.addFeature(FLAVOLITE_LAYER);
|
||||
def.addFeature(THALLASIUM_ORE);
|
||||
def.addFeature(ENDER_ORE);
|
||||
def.addFeature(CRASHED_SHIP);
|
||||
|
||||
if (def.getID().getPath().endsWith("_cave")) {
|
||||
return;
|
||||
String path = "/data/" + ns + "/structures/biome/" + nm + "/";
|
||||
InputStream inputstream = EndFeatures.class.getResourceAsStream(path + "structures.json");
|
||||
if (inputstream != null) {
|
||||
JsonObject obj = JsonFactory.getJsonObject(inputstream);
|
||||
JsonArray structures = obj.getAsJsonArray("structures");
|
||||
if (structures != null) {
|
||||
List<StructureInfo> list = Lists.newArrayList();
|
||||
structures.forEach((entry) -> {
|
||||
JsonObject e = entry.getAsJsonObject();
|
||||
String structure = path + e.get("nbt").getAsString() + ".nbt";
|
||||
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
|
||||
int offsetY = e.get("offsetY").getAsInt();
|
||||
list.add(new StructureInfo(structure, offsetY, terrainMerge));
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
return BCLCommonFeatures.makeChancedFeature(
|
||||
new ResourceLocation(ns, nm + "_structures"),
|
||||
Decoration.SURFACE_STRUCTURES,
|
||||
new BuildingListFeature(list, Blocks.END_STONE.defaultBlockState()),
|
||||
10
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
boolean hasCaves = def.getCustomData("has_caves", true);
|
||||
hasCaves = Configs.BIOME_CONFIG.getBoolean(def.getID(), "hasCaves", hasCaves);
|
||||
public static BCLBiomeBuilder addDefaultFeatures(BCLBiomeBuilder builder, boolean hasCaves) {
|
||||
builder.feature(FLAVOLITE_LAYER);
|
||||
builder.feature(THALLASIUM_ORE);
|
||||
builder.feature(ENDER_ORE);
|
||||
builder.feature(CRASHED_SHIP);
|
||||
|
||||
if (hasCaves) {
|
||||
def.addFeature(ROUND_CAVE);
|
||||
def.addFeature(TUNEL_CAVE);
|
||||
}
|
||||
builder.feature(ROUND_CAVE);
|
||||
builder.feature(TUNEL_CAVE);
|
||||
}
|
||||
|
||||
private static void addFeature(BCLFeature feature, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
|
||||
int index = feature.getFeatureStep().ordinal();
|
||||
if (features.size() > index) {
|
||||
features.get(index).add(() -> feature.getFeatureConfigured());
|
||||
}
|
||||
else {
|
||||
List<Supplier<ConfiguredFeature<?, ?>>> newFeature = Lists.newArrayList();
|
||||
newFeature.add(() -> feature.getFeatureConfigured());
|
||||
features.add(newFeature);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static void register() {}
|
||||
|
|
|
@ -4,8 +4,8 @@ import net.minecraft.core.Registry;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.world.structures.BCLStructureFeature;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.world.structures.features.EternalPortalStructure;
|
||||
|
@ -22,22 +22,21 @@ import ru.betterend.world.structures.piece.NBTPiece;
|
|||
import ru.betterend.world.structures.piece.PaintedMountainPiece;
|
||||
import ru.betterend.world.structures.piece.VoxelPiece;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class EndStructures {
|
||||
public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new);
|
||||
public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new);
|
||||
public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new);
|
||||
public static final StructurePieceType LAKE_PIECE = register("lake_piece", LakePiece::new);
|
||||
public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register(
|
||||
"painted_mountain_piece",
|
||||
PaintedMountainPiece::new
|
||||
);
|
||||
public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece", PaintedMountainPiece::new);
|
||||
public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new);
|
||||
|
||||
public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID(
|
||||
"giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
|
||||
public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(
|
||||
BetterEnd.makeID("giant_mossy_glowshroom"),
|
||||
new GiantMossyGlowshroomStructure(),
|
||||
Decoration.SURFACE_STRUCTURES,
|
||||
16,
|
||||
8
|
||||
);
|
||||
public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature(
|
||||
BetterEnd.makeID("megalake"),
|
||||
new MegaLakeStructure(),
|
||||
|
@ -59,8 +58,13 @@ public class EndStructures {
|
|||
3,
|
||||
2
|
||||
);
|
||||
public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID(
|
||||
"painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2);
|
||||
public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(
|
||||
BetterEnd.makeID("painted_mountain"),
|
||||
new PaintedMountainStructure(),
|
||||
Decoration.RAW_GENERATION,
|
||||
3,
|
||||
2
|
||||
);
|
||||
public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature(
|
||||
BetterEnd.makeID("eternal_portal"),
|
||||
new EternalPortalStructure(),
|
||||
|
@ -76,22 +80,15 @@ public class EndStructures {
|
|||
8
|
||||
);
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
public static void register() {}
|
||||
|
||||
private static StructurePieceType register(String id, StructurePieceType pieceType) {
|
||||
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
|
||||
}
|
||||
|
||||
public static void registerBiomeStructures(ResourceLocation id, Biome biome, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
|
||||
if (!id.getPath().contains("mountain") && !id.getPath().contains("lake")) {
|
||||
addStructure(ETERNAL_PORTAL, structures);
|
||||
public static void addBiomeStructures(ResourceLocation biomeID, Biome biome) {
|
||||
if (!biomeID.getPath().contains("mountain") && !biomeID.getPath().contains("lake")) {
|
||||
BiomeAPI.addBiomeStructure(BiomeAPI.getBiomeKey(biome), ETERNAL_PORTAL);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addStructure(BCLStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
|
||||
structures.add(() -> {
|
||||
return feature.getFeatureConfigured();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,12 +13,10 @@ import net.minecraft.world.food.FoodProperties;
|
|||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome.BiomeCategory;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.BonemealAPI;
|
||||
import ru.bclib.api.ComposterAPI;
|
||||
|
@ -133,8 +131,9 @@ public class EndTags {
|
|||
TagAPI.addTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
|
||||
}
|
||||
|
||||
// TODO make getter for biome top blocks
|
||||
public static void addTerrainTags(Registry<Biome> biomeRegistry) {
|
||||
biomeRegistry.forEach((biome) -> {
|
||||
/*biomeRegistry.forEach((biome) -> {
|
||||
if (biome.getBiomeCategory() == BiomeCategory.THEEND) {
|
||||
SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig();
|
||||
Block under = config.getUnderMaterial().getBlock();
|
||||
|
@ -143,6 +142,6 @@ public class EndTags {
|
|||
TagAPI.addTag(TagAPI.BLOCK_END_GROUND, surface);
|
||||
}
|
||||
});
|
||||
TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);
|
||||
TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.core.Registry;
|
|||
import net.minecraft.core.particles.BlockParticleOption;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.worldgen.Features;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -442,7 +441,7 @@ public class EternalRitual {
|
|||
}
|
||||
}
|
||||
if (targetWorld.dimension() == Level.END) {
|
||||
Features.END_ISLAND.place(
|
||||
net.minecraft.data.worldgen.features.EndFeatures.END_ISLAND.place(
|
||||
targetWorld,
|
||||
targetWorld.getChunkSource().getGenerator(),
|
||||
new Random(basePos.asLong()),
|
||||
|
@ -450,10 +449,10 @@ public class EternalRitual {
|
|||
);
|
||||
}
|
||||
else if (targetWorld.dimension() == Level.OVERWORLD) {
|
||||
basePos.setY(targetWorld.getChunk(basePos)
|
||||
.getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1);
|
||||
basePos.setY(targetWorld.getChunk(basePos).getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1);
|
||||
}
|
||||
EndFeatures.BIOME_ISLAND.getFeatureConfigured()
|
||||
EndFeatures.BIOME_ISLAND
|
||||
.getPlacedFeature()
|
||||
.place(targetWorld,
|
||||
targetWorld.getChunkSource().getGenerator(),
|
||||
new Random(basePos.asLong()),
|
||||
|
|
|
@ -75,7 +75,7 @@ public class BlockFixer {
|
|||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
if (level.isEmptyBlock(POS.relative(dir))) {
|
||||
try {
|
||||
level.getLiquidTicks().scheduleTick(POS, state.getFluidState().getType(), 0);
|
||||
level.scheduleTick(POS, state.getFluidState().getType(), 0);
|
||||
}
|
||||
catch (Exception e) {}
|
||||
break;
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.betterend.config.Configs;
|
||||
import ru.betterend.mixin.common.BiomeGenerationSettingsAccessor;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class FeaturesHelper {
|
||||
public static void addFeatures(Registry<Biome> biomeRegistry) {
|
||||
biomeRegistry.forEach((biome) -> {
|
||||
ResourceLocation key = biomeRegistry.getKey(biome);
|
||||
if (BiomeAPI.isEndBiome(key)) {
|
||||
BiomeGenerationSettingsAccessor accessor = (BiomeGenerationSettingsAccessor) biome.getGenerationSettings();
|
||||
List<Supplier<ConfiguredStructureFeature<?, ?>>> structures = Lists.newArrayList(accessor.be_getStructures());
|
||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> preFeatures = accessor.be_getFeatures();
|
||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> features = new ArrayList<>(preFeatures.size());
|
||||
preFeatures.forEach((list) -> features.add(Lists.newArrayList(list)));
|
||||
|
||||
EndFeatures.registerBiomeFeatures(key, biome, features);
|
||||
EndStructures.registerBiomeStructures(key, biome, structures);
|
||||
|
||||
accessor.be_setFeatures(features);
|
||||
accessor.be_setStructures(structures);
|
||||
}
|
||||
});
|
||||
Configs.BIOME_CONFIG.saveChanges();
|
||||
}
|
||||
}
|
|
@ -1,35 +1,154 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
|
||||
import net.fabricmc.fabric.api.loot.v1.FabricLootSupplierBuilder;
|
||||
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.complexmaterials.WoodenComplexMaterial;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
|
||||
public class LootTableUtil {
|
||||
private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure");
|
||||
private static final ResourceLocation COMMON = BetterEnd.makeID("chests/common");
|
||||
private static final ResourceLocation FOGGY_MUSHROOMLAND = BetterEnd.makeID("chests/foggy_mushroomland");
|
||||
private static final ResourceLocation CHORUS_FOREST = BetterEnd.makeID("chests/chorus_forest");
|
||||
private static final ResourceLocation SHADOW_FOREST = BetterEnd.makeID("chests/shadow_forest");
|
||||
private static final ResourceLocation LANTERN_WOODS = BetterEnd.makeID("chests/lantern_woods");
|
||||
private static final ResourceLocation UMBRELLA_JUNGLE = BetterEnd.makeID("chests/umbrella_jungle");
|
||||
|
||||
public static void init() {
|
||||
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, supplier, setter) -> {
|
||||
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, table, setter) -> {
|
||||
if (END_CITY_TREASURE_ID.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(0, 5));
|
||||
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.5f).build());
|
||||
builder.setRolls(ConstantValue.exactly(1));
|
||||
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.2f).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build());
|
||||
supplier.withPool(builder);
|
||||
table.withPool(builder);
|
||||
|
||||
builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(0, 5));
|
||||
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.1f).build());
|
||||
builder.setRolls(UniformGenerator.between(0, 3));
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_GRASPING_AT_STARS).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA).build());
|
||||
supplier.withPool(builder);
|
||||
table.withPool(builder);
|
||||
}
|
||||
else if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||
addCommonItems(table);
|
||||
if (FOGGY_MUSHROOMLAND.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.MOSSY_GLOWSHROOM.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.MOSSY_GLOWSHROOM_SAPLING).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.BLUE_VINE_SEED).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
else if (CHORUS_FOREST.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.PYTHADENDRON.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.PYTHADENDRON_SAPLING).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.CHORUS_MUSHROOM).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
else if (SHADOW_FOREST.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.DRAGON_TREE.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.DRAGON_TREE_SAPLING).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.SHADOW_BERRY).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.SHADOW_BERRY_RAW).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
else if (LANTERN_WOODS.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.LUCERNIA.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.LUCERNIA_SAPLING).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.BOLUX_MUSHROOM).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
else if (UMBRELLA_JUNGLE.equals(id)) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.UMBRELLA_TREE.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.UMBRELLA_TREE_SAPLING).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.SMALL_JELLYSHROOM).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static ResourceLocation getTable(Biome biome) {
|
||||
BCLBiome bclBiome = BiomeAPI.getBiome(biome);
|
||||
if (bclBiome == EndBiomes.FOGGY_MUSHROOMLAND) {
|
||||
return FOGGY_MUSHROOMLAND;
|
||||
}
|
||||
else if (bclBiome == EndBiomes.CHORUS_FOREST) {
|
||||
return CHORUS_FOREST;
|
||||
}
|
||||
else if (bclBiome == EndBiomes.SHADOW_FOREST) {
|
||||
return SHADOW_FOREST;
|
||||
}
|
||||
else if (bclBiome == EndBiomes.LANTERN_WOODS) {
|
||||
return LANTERN_WOODS;
|
||||
}
|
||||
else if (bclBiome == EndBiomes.UMBRELLA_JUNGLE) {
|
||||
return UMBRELLA_JUNGLE;
|
||||
}
|
||||
return COMMON;
|
||||
}
|
||||
|
||||
private static void addCommonItems(FabricLootSupplierBuilder table) {
|
||||
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(0, 2));
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_GRASPING_AT_STARS).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA).build());
|
||||
table.withPool(builder);
|
||||
|
||||
builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(4, 8));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.ingot).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.rawOre).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Items.ENDER_PEARL).build());
|
||||
table.withPool(builder);
|
||||
|
||||
builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(2, 4));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.TERMINITE.ingot).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.ENDER_SHARD).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.AURORA_CRYSTAL).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.axe).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.pickaxe).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.hoe).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.sword).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.shovel).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Items.ENDER_EYE).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Blocks.OBSIDIAN).build());
|
||||
table.withPool(builder);
|
||||
|
||||
builder = FabricLootPoolBuilder.builder();
|
||||
builder.setRolls(UniformGenerator.between(0, 4));
|
||||
builder.withEntry(LootItem.lootTableItem(EndBlocks.FLAVOLITE_RUNED).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.AETERNIUM_INGOT).build());
|
||||
builder.withEntry(LootItem.lootTableItem(EndItems.AMBER_GEM).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Items.END_CRYSTAL).build());
|
||||
builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build());
|
||||
table.withPool(builder);
|
||||
}
|
||||
}
|
||||
|
|
276
src/main/java/ru/betterend/util/StructureErode.java
Normal file
276
src/main/java/ru/betterend/util/StructureErode.java
Normal file
|
@ -0,0 +1,276 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.util.BlocksHelper;
|
||||
import ru.bclib.util.MHelper;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
public class StructureErode {
|
||||
private static final Direction[] DIR = BlocksHelper.makeHorizontal();
|
||||
|
||||
public static void erode(WorldGenLevel world, BoundingBox bounds, int iterations, Random random) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
boolean canDestruct = true;
|
||||
for (int i = 0; i < iterations; i++) {
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
boolean ignore = ignore(state, world, mut);
|
||||
if (canDestruct && BlocksHelper.isInvulnerable(
|
||||
state,
|
||||
world,
|
||||
mut
|
||||
) && random.nextInt(8) == 0 && world.isEmptyBlock(mut.below(2))) {
|
||||
int r = MHelper.randRange(1, 4, random);
|
||||
int cx = mut.getX();
|
||||
int cy = mut.getY();
|
||||
int cz = mut.getZ();
|
||||
int x1 = cx - r;
|
||||
int y1 = cy - r;
|
||||
int z1 = cz - r;
|
||||
int x2 = cx + r;
|
||||
int y2 = cy + r;
|
||||
int z2 = cz + r;
|
||||
for (int px = x1; px <= x2; px++) {
|
||||
int dx = px - cx;
|
||||
dx *= dx;
|
||||
mut.setX(px);
|
||||
for (int py = y1; py <= y2; py++) {
|
||||
int dy = py - cy;
|
||||
dy *= dy;
|
||||
mut.setY(py);
|
||||
for (int pz = z1; pz <= z2; pz++) {
|
||||
int dz = pz - cz;
|
||||
dz *= dz;
|
||||
mut.setZ(pz);
|
||||
if (dx + dy + dz <= r && BlocksHelper.isInvulnerable(
|
||||
world.getBlockState(mut),
|
||||
world,
|
||||
mut
|
||||
)) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mut.setX(cx);
|
||||
mut.setY(cy);
|
||||
mut.setZ(cz);
|
||||
canDestruct = false;
|
||||
continue;
|
||||
}
|
||||
else if (ignore) {
|
||||
continue;
|
||||
}
|
||||
if (!state.isAir() && random.nextBoolean()) {
|
||||
MHelper.shuffle(DIR, random);
|
||||
for (Direction dir : DIR) {
|
||||
if (world.isEmptyBlock(mut.relative(dir)) && world.isEmptyBlock(mut.below()
|
||||
.relative(dir))) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
mut.move(dir).move(Direction.DOWN);
|
||||
for (int py = mut.getY(); y >= bounds.minY() - 10; y--) {
|
||||
mut.setY(py - 1);
|
||||
if (!world.isEmptyBlock(mut)) {
|
||||
mut.setY(py);
|
||||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (random.nextInt(8) == 0 && !BlocksHelper.isInvulnerable(
|
||||
world.getBlockState(mut.above()),
|
||||
world,
|
||||
mut
|
||||
)) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!ignore(state, world, mut) && world.isEmptyBlock(mut.below())) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
for (int py = mut.getY(); py >= bounds.minY() - 10; py--) {
|
||||
mut.setY(py - 1);
|
||||
if (!world.isEmptyBlock(mut)) {
|
||||
mut.setY(py);
|
||||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void erodeIntense(WorldGenLevel world, BoundingBox bounds, Random random) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
MutableBlockPos mut2 = new MutableBlockPos();
|
||||
int minY = bounds.minY() - 10;
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!ignore(state, world, mut)) {
|
||||
if (random.nextInt(6) == 0) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
if (random.nextBoolean()) {
|
||||
int px = MHelper.floor(random.nextGaussian() * 2 + x + 0.5);
|
||||
int pz = MHelper.floor(random.nextGaussian() * 2 + z + 0.5);
|
||||
mut2.set(px, y, pz);
|
||||
while (world.getBlockState(mut2).getMaterial().isReplaceable() && mut2.getY() > minY) {
|
||||
mut2.setY(mut2.getY() - 1);
|
||||
}
|
||||
if (!world.getBlockState(mut2).isAir() && state.canSurvive(world, mut2)) {
|
||||
mut2.setY(mut2.getY() + 1);
|
||||
BlocksHelper.setWithoutUpdate(world, mut2, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (random.nextInt(8) == 0) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drop(world, bounds);
|
||||
}
|
||||
|
||||
private static void drop(WorldGenLevel world, BoundingBox bounds) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
|
||||
Set<BlockPos> blocks = Sets.newHashSet();
|
||||
Set<BlockPos> edge = Sets.newHashSet();
|
||||
Set<BlockPos> add = Sets.newHashSet();
|
||||
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
for (int y = bounds.minY(); y <= bounds.maxY(); y++) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!ignore(state, world, mut) && isTerrainNear(world, mut)) {
|
||||
edge.add(mut.immutable());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (edge.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (!edge.isEmpty()) {
|
||||
for (BlockPos center : edge) {
|
||||
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||
BlockState state = world.getBlockState(center);
|
||||
if (state.isCollisionShapeFullBlock(world, center)) {
|
||||
mut.set(center).move(dir);
|
||||
if (bounds.isInside(mut)) {
|
||||
state = world.getBlockState(mut);
|
||||
if (!ignore(state, world, mut) && !blocks.contains(mut)) {
|
||||
add.add(mut.immutable());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
blocks.addAll(edge);
|
||||
edge.clear();
|
||||
edge.addAll(add);
|
||||
add.clear();
|
||||
}
|
||||
|
||||
int minY = bounds.minY() - 10;
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
for (int y = bounds.minY(); y <= bounds.maxY(); y++) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!ignore(state, world, mut) && !blocks.contains(mut)) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
|
||||
while (world.getBlockState(mut).getMaterial().isReplaceable() && mut.getY() > minY) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
}
|
||||
if (mut.getY() > minY) {
|
||||
mut.setY(mut.getY() + 1);
|
||||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) {
|
||||
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(BlockTags.NYLIUM)) {
|
||||
return true;
|
||||
}
|
||||
return !state.getMaterial().equals(Material.STONE) || BlocksHelper.isInvulnerable(state, world, pos);
|
||||
}
|
||||
|
||||
private static boolean isTerrainNear(WorldGenLevel world, BlockPos pos) {
|
||||
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||
if (world.getBlockState(pos.relative(dir)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void cover(WorldGenLevel world, BoundingBox bounds, Random random, BlockState defaultBlock) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
|
||||
mut.setX(x);
|
||||
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
|
||||
mut.setZ(z);
|
||||
BlockState top = BiomeAPI.findTopMaterial(world.getBiome(mut)).orElse(defaultBlock);
|
||||
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
|
||||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (state.is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, top);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +1,177 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.api.surface.SurfaceRuleBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.interfaces.StructureFeaturesAccessor;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
|
||||
public class EndBiome extends BCLBiome {
|
||||
public EndBiome(BCLBiomeDef def) {
|
||||
super(updateDef(def));
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
|
||||
public static class DefaultSurfaceMaterialProvider implements SurfaceMaterialProvider{
|
||||
public static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState();
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return getUnderMaterial();
|
||||
}
|
||||
|
||||
public EndBiome(ResourceLocation id, Biome biome, float fogDensity, float genChance, boolean hasCaves) {
|
||||
super(id, biome, fogDensity, genChance);
|
||||
this.addCustomData("has_caves", hasCaves);
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return getTopMaterial();
|
||||
}
|
||||
|
||||
private static BCLBiomeDef updateDef(BCLBiomeDef def) {
|
||||
EndFeatures.addDefaultFeatures(def);
|
||||
return def;
|
||||
@Override
|
||||
public BlockState getUnderMaterial() {
|
||||
return END_STONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateFloorRule(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() {
|
||||
SurfaceRuleBuilder builder = SurfaceRuleBuilder.start();
|
||||
|
||||
if (generateFloorRule() && getTopMaterial()!=getUnderMaterial()){
|
||||
if (getTopMaterial()!=getAltTopMaterial()){
|
||||
builder.floor(getTopMaterial());
|
||||
} else {
|
||||
builder.chancedFloor(getTopMaterial(), getAltTopMaterial());
|
||||
}
|
||||
}
|
||||
return builder.filler(getUnderMaterial());
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class Config {
|
||||
public static final SurfaceMaterialProvider DEFAULT_MATERIAL = new DefaultSurfaceMaterialProvider();
|
||||
|
||||
protected static final StructureFeaturesAccessor VANILLA_FEATURES = (StructureFeaturesAccessor)new StructureFeatures();
|
||||
protected static final SurfaceRules.RuleSource END_STONE = SurfaceRules.state(DefaultSurfaceMaterialProvider.END_STONE);
|
||||
protected static final SurfaceRules.RuleSource END_MOSS = SurfaceRules.state(EndBlocks.END_MOSS.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource ENDSTONE_DUST = SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource END_MYCELIUM = SurfaceRules.state(EndBlocks.END_MYCELIUM.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource FLAVOLITE =SurfaceRules.state(EndBlocks.FLAVOLITE.stone.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource SULPHURIC_ROCK =SurfaceRules.state(EndBlocks.SULPHURIC_ROCK.stone.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource BRIMSTONE =SurfaceRules.state(EndBlocks.BRIMSTONE.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource PALLIDIUM_FULL =SurfaceRules.state(EndBlocks.PALLIDIUM_FULL.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource PALLIDIUM_HEAVY =SurfaceRules.state(EndBlocks.PALLIDIUM_HEAVY.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource PALLIDIUM_THIN =SurfaceRules.state(EndBlocks.PALLIDIUM_THIN.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource PALLIDIUM_TINY =SurfaceRules.state(EndBlocks.PALLIDIUM_TINY.defaultBlockState());
|
||||
protected static final SurfaceRules.RuleSource UMBRALITH =SurfaceRules.state(EndBlocks.UMBRALITH.stone.defaultBlockState());
|
||||
|
||||
public final ResourceLocation ID;
|
||||
|
||||
protected Config(String name) {
|
||||
this.ID = BetterEnd.makeID(name);
|
||||
}
|
||||
|
||||
protected abstract void addCustomBuildData(BCLBiomeBuilder builder);
|
||||
|
||||
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier(){
|
||||
return EndBiome::new;
|
||||
}
|
||||
|
||||
protected boolean hasCaves(){
|
||||
return true;
|
||||
}
|
||||
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return DEFAULT_MATERIAL;
|
||||
}
|
||||
}
|
||||
|
||||
public EndBiome(ResourceLocation biomeID, Biome biome) {
|
||||
super(biomeID, biome);
|
||||
}
|
||||
|
||||
public static EndBiome create(Config biomeConfig){
|
||||
BCLBiomeBuilder builder = BCLBiomeBuilder
|
||||
.start(biomeConfig.ID)
|
||||
.category(Biome.BiomeCategory.THEEND)
|
||||
.music(SoundEvents.MUSIC_END)
|
||||
.waterColor(4159204)
|
||||
.waterFogColor(329011)
|
||||
.fogColor(0xA080A0)
|
||||
.skyColor(0)
|
||||
.mood(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.temperature(0.5f)
|
||||
.wetness(0.5f)
|
||||
.precipitation(Biome.Precipitation.NONE)
|
||||
.surface(biomeConfig.surfaceMaterial().surface().build());
|
||||
|
||||
biomeConfig.addCustomBuildData(builder);
|
||||
EndFeatures.addDefaultFeatures(builder, biomeConfig.hasCaves());
|
||||
|
||||
|
||||
EndBiome biome = builder.build(biomeConfig.getSupplier());
|
||||
biome.addCustomData("has_caves", biomeConfig.hasCaves());
|
||||
biome.setSurfaceMaterial(biomeConfig.surfaceMaterial());
|
||||
|
||||
return biome;
|
||||
}
|
||||
|
||||
|
||||
private SurfaceMaterialProvider surfMatProv = Config.DEFAULT_MATERIAL;
|
||||
private void setSurfaceMaterial(SurfaceMaterialProvider prov) {
|
||||
surfMatProv = prov;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return surfMatProv.getTopMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getUnderMaterial() {
|
||||
return surfMatProv.getUnderMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return surfMatProv.getAltTopMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateFloorRule() { return surfMatProv.generateFloorRule(); }
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() { return surfMatProv.surface(); }
|
||||
|
||||
public static BlockState findTopMaterial(BCLBiome biome){
|
||||
return BiomeAPI.findTopMaterial(biome).orElse(EndBiome.Config.DEFAULT_MATERIAL.getTopMaterial());
|
||||
}
|
||||
|
||||
public static BlockState findTopMaterial(Biome biome){
|
||||
return findTopMaterial(BiomeAPI.getBiome(biome));
|
||||
}
|
||||
|
||||
public static BlockState findTopMaterial(WorldGenLevel world, BlockPos pos){
|
||||
return findTopMaterial(BiomeAPI.getBiome(world.getBiome(pos)));
|
||||
}
|
||||
|
||||
public static BlockState findUnderMaterial(BCLBiome biome){
|
||||
return BiomeAPI.findUnderMaterial(biome).orElse(EndBiome.Config.DEFAULT_MATERIAL.getUnderMaterial());
|
||||
}
|
||||
|
||||
public static BlockState findUnderMaterial(WorldGenLevel world, BlockPos pos){
|
||||
return findUnderMaterial(BiomeAPI.getBiome(world.getBiome(pos)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,33 @@
|
|||
package ru.betterend.world.biome.air;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class BiomeIceStarfield extends EndBiome {
|
||||
public class BiomeIceStarfield extends EndBiome.Config {
|
||||
public BiomeIceStarfield() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false)
|
||||
.addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured())
|
||||
.setFogColor(224, 245, 254)
|
||||
.setTemperature(0F)
|
||||
.setFogDensity(2.2F)
|
||||
.setFoliageColor(193, 244, 244)
|
||||
.setGenChance(0.25F)
|
||||
.setParticles(EndParticles.SNOWFLAKE, 0.002F)
|
||||
.addFeature(EndFeatures.ICE_STAR)
|
||||
.addFeature(EndFeatures.ICE_STAR_SMALL)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 20, 1, 4));
|
||||
super("ice_starfield");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasCaves() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder.structure(EndStructures.GIANT_ICE_STAR.getFeatureConfigured())
|
||||
.fogColor(224, 245, 254)
|
||||
.temperature(0F)
|
||||
.fogDensity(2.2F)
|
||||
.foliageColor(193, 244, 244)
|
||||
.genChance(0.25F)
|
||||
.particles(EndParticles.SNOWFLAKE, 0.002F)
|
||||
.feature(EndFeatures.ICE_STAR)
|
||||
.feature(EndFeatures.ICE_STAR_SMALL)
|
||||
.spawn(EntityType.ENDERMAN, 20, 1, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class EmptyAuroraCaveBiome extends EndCaveBiome {
|
||||
public EmptyAuroraCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(108, 25, 46)
|
||||
.setWaterAndFogColor(186, 77, 237)
|
||||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F));
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class EmptyAuroraCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
|
||||
|
||||
|
@ -28,3 +28,23 @@ public class EmptyAuroraCaveBiome extends EndCaveBiome {
|
|||
return 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
public EmptyAuroraCaveBiome() {
|
||||
super("empty_aurora_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogColor(150, 30, 68)
|
||||
.fogDensity(2.0F)
|
||||
.plantsColor(108, 25, 46)
|
||||
.waterAndFogColor(186, 77, 237)
|
||||
.particles(EndParticles.GLOWING_SPHERE, 0.001F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return EmptyAuroraCaveBiome.Biome::new;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class EmptyEndCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
public class EmptyEndCaveBiome extends EndCaveBiome {
|
||||
public EmptyEndCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("empty_end_cave")).setFogDensity(2.0F));
|
||||
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
|
||||
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
|
||||
}
|
||||
|
@ -21,3 +26,19 @@ public class EmptyEndCaveBiome extends EndCaveBiome {
|
|||
return 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
public EmptyEndCaveBiome() {
|
||||
super("empty_end_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogDensity(2.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return Biome::new;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class EmptySmaragdantCaveBiome extends EndCaveBiome {
|
||||
public EmptySmaragdantCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(0, 131, 145)
|
||||
.setWaterAndFogColor(31, 167, 212)
|
||||
.setParticles(EndParticles.SMARAGDANT, 0.001F));
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
|
||||
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
|
||||
|
@ -29,3 +29,23 @@ public class EmptySmaragdantCaveBiome extends EndCaveBiome {
|
|||
return 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
public EmptySmaragdantCaveBiome() {
|
||||
super("empty_smaragdant_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogColor(0, 253, 182)
|
||||
.fogDensity(2.0F)
|
||||
.plantsColor(0, 131, 145)
|
||||
.waterAndFogColor(31, 167, 212)
|
||||
.particles(EndParticles.SMARAGDANT, 0.001F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return EmptySmaragdantCaveBiome.Biome::new;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome.BiomeCategory;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.bclib.api.BiomeAPI;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.util.WeightedList;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.bclib.world.features.BCLFeature;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
|
@ -14,24 +17,44 @@ import ru.betterend.world.biome.EndBiome;
|
|||
import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class EndCaveBiome extends EndBiome {
|
||||
public static abstract class Config extends EndBiome.Config {
|
||||
protected Config(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
BCLFeature feature = BCLFeature.makeChunkFeature(
|
||||
BetterEnd.makeID(ID.getPath() + "_cave_populator"),
|
||||
GenerationStep.Decoration.RAW_GENERATION,
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(ID))
|
||||
);
|
||||
|
||||
builder.category(BiomeCategory.NONE)
|
||||
.feature(feature)
|
||||
.music(EndSounds.MUSIC_CAVES)
|
||||
.loop(EndSounds.AMBIENT_CAVES);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasCaves() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier() {
|
||||
return EndCaveBiome::new;
|
||||
}
|
||||
}
|
||||
|
||||
private WeightedList<Feature<?>> floorFeatures = new WeightedList<Feature<?>>();
|
||||
private WeightedList<Feature<?>> ceilFeatures = new WeightedList<Feature<?>>();
|
||||
|
||||
public EndCaveBiome(BCLBiomeDef definition) {
|
||||
super(makeDef(definition));
|
||||
}
|
||||
|
||||
private static BCLBiomeDef makeDef(BCLBiomeDef definition) {
|
||||
BCLFeature feature = BCLFeature.makeChunkFeature(
|
||||
BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"),
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID()))
|
||||
);
|
||||
definition.setCategory(BiomeCategory.NONE).addFeature(feature);
|
||||
definition.setMusic(EndSounds.MUSIC_CAVES);
|
||||
definition.setLoop(EndSounds.AMBIENT_CAVES);
|
||||
return definition;
|
||||
public EndCaveBiome(ResourceLocation biomeID, Biome biome) {
|
||||
super(biomeID, biome);
|
||||
}
|
||||
|
||||
public void addFloorFeature(Feature<?> feature, float weight) {
|
||||
|
@ -65,4 +88,8 @@ public class EndCaveBiome extends EndBiome {
|
|||
public BlockState getWall(BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static EndCaveBiome create(EndBiome.Config biomeConfig){
|
||||
return (EndCaveBiome) EndBiome.create(biomeConfig);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class JadeCaveBiome extends EndCaveBiome {
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class JadeCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode());
|
||||
private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode());
|
||||
private static final BlockState[] JADE = new BlockState[3];
|
||||
|
||||
public JadeCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112)
|
||||
.setFogDensity(2.0F)
|
||||
.setWaterAndFogColor(95, 223, 255));
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
|
||||
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
|
||||
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState();
|
||||
|
@ -30,3 +33,21 @@ public class JadeCaveBiome extends EndCaveBiome {
|
|||
return JADE[index];
|
||||
}
|
||||
}
|
||||
|
||||
public JadeCaveBiome() {
|
||||
super("jade_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogColor(118, 150, 112)
|
||||
.fogDensity(2.0F)
|
||||
.waterAndFogColor(95, 223, 255);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return JadeCaveBiome.Biome::new;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.blocks.BlockProperties;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class LushAuroraCaveBiome extends EndCaveBiome {
|
||||
public LushAuroraCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(108, 25, 46)
|
||||
.setWaterAndFogColor(186, 77, 237)
|
||||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.setSurface(EndBlocks.CAVE_MOSS));
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class LushAuroraCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
|
||||
this.addFloorFeature(EndFeatures.CAVE_BUSH, 5);
|
||||
|
@ -46,3 +46,34 @@ public class LushAuroraCaveBiome extends EndCaveBiome {
|
|||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP);
|
||||
}
|
||||
}
|
||||
|
||||
public LushAuroraCaveBiome() {
|
||||
super("lush_aurora_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogColor(150, 30, 68)
|
||||
.fogDensity(2.0F)
|
||||
.plantsColor(108, 25, 46)
|
||||
.waterAndFogColor(186, 77, 237)
|
||||
.particles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return LushAuroraCaveBiome.Biome::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.CAVE_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
package ru.betterend.world.biome.cave;
|
||||
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class LushSmaragdantCaveBiome extends EndCaveBiome {
|
||||
public LushSmaragdantCaveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(0, 131, 145)
|
||||
.setWaterAndFogColor(31, 167, 212)
|
||||
.setParticles(EndParticles.SMARAGDANT, 0.001F)
|
||||
.setSurface(EndBlocks.CAVE_MOSS));
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public class LushSmaragdantCaveBiome extends EndCaveBiome.Config {
|
||||
public static class Biome extends EndCaveBiome {
|
||||
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
|
||||
super(biomeID, biome);
|
||||
|
||||
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
|
||||
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
|
||||
|
@ -31,3 +32,33 @@ public class LushSmaragdantCaveBiome extends EndCaveBiome {
|
|||
return 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
public LushSmaragdantCaveBiome() {
|
||||
super("lush_smaragdant_cave");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
super.addCustomBuildData(builder);
|
||||
builder.fogColor(0, 253, 182)
|
||||
.fogDensity(2.0F)
|
||||
.plantsColor(0, 131, 145)
|
||||
.waterAndFogColor(31, 167, 212)
|
||||
.particles(EndParticles.SMARAGDANT, 0.001F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
|
||||
return LushSmaragdantCaveBiome.Biome::new;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.CAVE_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
@ -11,30 +11,44 @@ import ru.betterend.registry.EndParticles;
|
|||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class AmberLandBiome extends EndBiome {
|
||||
public class AmberLandBiome extends EndBiome.Config {
|
||||
public AmberLandBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("amber_land"))
|
||||
.setFogColor(255, 184, 71)
|
||||
.setFogDensity(2.0F)
|
||||
.setPlantsColor(219, 115, 38)
|
||||
.setWaterAndFogColor(145, 108, 72)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setLoop(EndSounds.AMBIENT_AMBER_LAND)
|
||||
.setParticles(EndParticles.AMBER_SPHERE, 0.001F)
|
||||
.setSurface(EndBlocks.AMBER_MOSS)
|
||||
.addFeature(EndFeatures.AMBER_ORE)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(EndFeatures.HELIX_TREE)
|
||||
.addFeature(EndFeatures.LANCELEAF)
|
||||
.addFeature(EndFeatures.GLOW_PILLAR)
|
||||
.addFeature(EndFeatures.AMBER_GRASS)
|
||||
.addFeature(EndFeatures.AMBER_ROOT)
|
||||
.addFeature(EndFeatures.BULB_MOSS)
|
||||
.addFeature(EndFeatures.BULB_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.CHARNIA_ORANGE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)
|
||||
.addMobSpawn(EndEntities.END_SLIME, 30, 1, 2));
|
||||
super("amber_land");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(255, 184, 71)
|
||||
.fogDensity(2.0F)
|
||||
.plantsColor(219, 115, 38)
|
||||
.waterAndFogColor(145, 108, 72)
|
||||
.music(EndSounds.MUSIC_FOREST)
|
||||
.loop(EndSounds.AMBIENT_AMBER_LAND)
|
||||
.particles(EndParticles.AMBER_SPHERE, 0.001F)
|
||||
.feature(EndFeatures.AMBER_ORE)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(EndFeatures.HELIX_TREE)
|
||||
.feature(EndFeatures.LANCELEAF)
|
||||
.feature(EndFeatures.GLOW_PILLAR)
|
||||
.feature(EndFeatures.AMBER_GRASS)
|
||||
.feature(EndFeatures.AMBER_ROOT)
|
||||
.feature(EndFeatures.BULB_MOSS)
|
||||
.feature(EndFeatures.BULB_MOSS_WOOD)
|
||||
.feature(EndFeatures.CHARNIA_ORANGE)
|
||||
.feature(EndFeatures.CHARNIA_RED)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 4)
|
||||
.spawn(EndEntities.END_SLIME, 30, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.AMBER_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,55 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class BlossomingSpiresBiome extends EndBiome {
|
||||
public class BlossomingSpiresBiome extends EndBiome.Config {
|
||||
public BlossomingSpiresBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires"))
|
||||
.addCustomData("has_caves", false)
|
||||
.setFogColor(241, 146, 229)
|
||||
.setFogDensity(1.7F)
|
||||
.setPlantsColor(122, 45, 122)
|
||||
.setSurface(EndBlocks.PINK_MOSS)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
|
||||
.addFeature(EndFeatures.SPIRE)
|
||||
.addFeature(EndFeatures.FLOATING_SPIRE)
|
||||
.addFeature(EndFeatures.TENANEA)
|
||||
.addFeature(EndFeatures.TENANEA_BUSH)
|
||||
.addFeature(EndFeatures.BULB_VINE)
|
||||
.addFeature(EndFeatures.BUSHY_GRASS)
|
||||
.addFeature(EndFeatures.BUSHY_GRASS_WG)
|
||||
.addFeature(EndFeatures.BLOSSOM_BERRY)
|
||||
.addFeature(EndFeatures.TWISTED_MOSS)
|
||||
.addFeature(EndFeatures.TWISTED_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.SILK_MOTH_NEST)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)
|
||||
.addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2));
|
||||
super("blossoming_spires");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasCaves() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(241, 146, 229)
|
||||
.fogDensity(1.7F)
|
||||
.plantsColor(122, 45, 122)
|
||||
.music(EndSounds.MUSIC_FOREST)
|
||||
.loop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
|
||||
.feature(EndFeatures.SPIRE)
|
||||
.feature(EndFeatures.FLOATING_SPIRE)
|
||||
.feature(EndFeatures.TENANEA)
|
||||
.feature(EndFeatures.TENANEA_BUSH)
|
||||
.feature(EndFeatures.BULB_VINE)
|
||||
.feature(EndFeatures.BUSHY_GRASS)
|
||||
.feature(EndFeatures.BUSHY_GRASS_WG)
|
||||
.feature(EndFeatures.BLOSSOM_BERRY)
|
||||
.feature(EndFeatures.TWISTED_MOSS)
|
||||
.feature(EndFeatures.TWISTED_MOSS_WOOD)
|
||||
.feature(EndFeatures.SILK_MOTH_NEST)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 4)
|
||||
.spawn(EndEntities.SILK_MOTH, 5, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.PINK_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,57 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.worldgen.Features;
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.data.worldgen.placement.EndPlacements;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class ChorusForestBiome extends EndBiome {
|
||||
public class ChorusForestBiome extends EndBiome.Config {
|
||||
public ChorusForestBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest"))
|
||||
.setFogColor(87, 26, 87)
|
||||
.setFogDensity(1.5F)
|
||||
.setPlantsColor(122, 45, 122)
|
||||
.setWaterAndFogColor(73, 30, 73)
|
||||
.setSurface(EndBlocks.CHORUS_NYLIUM)
|
||||
.setParticles(ParticleTypes.PORTAL, 0.01F)
|
||||
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
|
||||
.setMusic(EndSounds.MUSIC_DARK)
|
||||
.addFeature(EndFeatures.VIOLECITE_LAYER)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(EndFeatures.PYTHADENDRON_TREE)
|
||||
.addFeature(EndFeatures.PYTHADENDRON_BUSH)
|
||||
.addFeature(EndFeatures.PURPLE_POLYPORE)
|
||||
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT)
|
||||
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT)
|
||||
.addFeature(EndFeatures.CHORUS_GRASS)
|
||||
.addFeature(EndFeatures.CHORUS_MUSHROOM)
|
||||
.addFeature(EndFeatures.TAIL_MOSS)
|
||||
.addFeature(EndFeatures.TAIL_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.CHARNIA_PURPLE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
|
||||
super("chorus_forest");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(87, 26, 87)
|
||||
.fogDensity(1.5F)
|
||||
.plantsColor(122, 45, 122)
|
||||
.waterAndFogColor(73, 30, 73)
|
||||
.particles(ParticleTypes.PORTAL, 0.01F)
|
||||
.loop(EndSounds.AMBIENT_CHORUS_FOREST)
|
||||
.music(EndSounds.MUSIC_DARK)
|
||||
.feature(EndFeatures.VIOLECITE_LAYER)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(EndFeatures.PYTHADENDRON_TREE)
|
||||
.feature(EndFeatures.PYTHADENDRON_BUSH)
|
||||
.feature(EndFeatures.PURPLE_POLYPORE)
|
||||
.feature(Decoration.VEGETAL_DECORATION, EndPlacements.CHORUS_PLANT)
|
||||
.feature(EndFeatures.CHORUS_GRASS)
|
||||
.feature(EndFeatures.CHORUS_MUSHROOM)
|
||||
.feature(EndFeatures.TAIL_MOSS)
|
||||
.feature(EndFeatures.TAIL_MOSS_WOOD)
|
||||
.feature(EndFeatures.CHARNIA_PURPLE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.CHORUS_NYLIUM.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,37 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class CrystalMountainsBiome extends EndBiome {
|
||||
public class CrystalMountainsBiome extends EndBiome.Config {
|
||||
public CrystalMountainsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains"))
|
||||
.addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured())
|
||||
.setPlantsColor(255, 133, 211)
|
||||
.setSurface(EndBlocks.CRYSTAL_MOSS)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.addFeature(EndFeatures.ROUND_CAVE)
|
||||
.addFeature(EndFeatures.CRYSTAL_GRASS)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("crystal_mountains");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.structure(EndStructures.MOUNTAIN.getFeatureConfigured())
|
||||
.plantsColor(255, 133, 211)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.feature(EndFeatures.CRYSTAL_GRASS)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.CRYSTAL_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,50 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class DragonGraveyardsBiome extends EndBiome {
|
||||
public class DragonGraveyardsBiome extends EndBiome.Config {
|
||||
public DragonGraveyardsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards"))
|
||||
.setGenChance(0.1F)
|
||||
.setFogColor(244, 46, 79)
|
||||
.setFogDensity(1.3F)
|
||||
.setParticles(EndParticles.FIREFLY, 0.0007F)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
|
||||
.setSurface(EndBlocks.SANGNUM)
|
||||
.setWaterAndFogColor(203, 59, 167)
|
||||
.setPlantsColor(244, 46, 79)
|
||||
.addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
|
||||
.addFeature(EndFeatures.DRAGON_BONE_BLOCK_ORE)
|
||||
.addFeature(EndFeatures.FALLEN_PILLAR)
|
||||
.addFeature(EndFeatures.OBSIDIAN_BOULDER)
|
||||
.addFeature(EndFeatures.GIGANTIC_AMARANITA)
|
||||
.addFeature(EndFeatures.LARGE_AMARANITA)
|
||||
.addFeature(EndFeatures.SMALL_AMARANITA)
|
||||
.addFeature(EndFeatures.GLOBULAGUS)
|
||||
.addFeature(EndFeatures.CLAWFERN)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("dragon_graveyards");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.genChance(0.1f)
|
||||
.fogColor(244, 46, 79)
|
||||
.fogDensity(1.3F)
|
||||
.particles(EndParticles.FIREFLY, 0.0007F)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
|
||||
.waterAndFogColor(203, 59, 167)
|
||||
.plantsColor(244, 46, 79)
|
||||
.feature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
|
||||
.feature(EndFeatures.DRAGON_BONE_BLOCK_ORE)
|
||||
.feature(EndFeatures.FALLEN_PILLAR)
|
||||
.feature(EndFeatures.OBSIDIAN_BOULDER)
|
||||
.feature(EndFeatures.GIGANTIC_AMARANITA)
|
||||
.feature(EndFeatures.LARGE_AMARANITA)
|
||||
.feature(EndFeatures.SMALL_AMARANITA)
|
||||
.feature(EndFeatures.GLOBULAGUS)
|
||||
.feature(EndFeatures.CLAWFERN)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.SANGNUM.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,43 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class DryShrublandBiome extends EndBiome {
|
||||
public class DryShrublandBiome extends EndBiome.Config {
|
||||
public DryShrublandBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland"))
|
||||
.setFogColor(132, 35, 13)
|
||||
.setFogDensity(1.2F)
|
||||
.setWaterAndFogColor(113, 88, 53)
|
||||
.setPlantsColor(237, 122, 66)
|
||||
.setSurface(EndBlocks.RUTISCUS)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.addFeature(EndFeatures.LUCERNIA_BUSH_RARE)
|
||||
.addFeature(EndFeatures.ORANGO)
|
||||
.addFeature(EndFeatures.AERIDIUM)
|
||||
.addFeature(EndFeatures.LUTEBUS)
|
||||
.addFeature(EndFeatures.LAMELLARIUM)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("dry_shrubland");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(132, 35, 13)
|
||||
.fogDensity(1.2F)
|
||||
.waterAndFogColor(113, 88, 53)
|
||||
.plantsColor(237, 122, 66)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.feature(EndFeatures.LUCERNIA_BUSH_RARE)
|
||||
.feature(EndFeatures.ORANGO)
|
||||
.feature(EndFeatures.AERIDIUM)
|
||||
.feature(EndFeatures.LUTEBUS)
|
||||
.feature(EndFeatures.LAMELLARIUM)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.RUTISCUS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,26 +1,54 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import net.minecraft.world.level.levelgen.placement.CaveSurface;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.surface.SurfaceRuleBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class DustWastelandsBiome extends EndBiome {
|
||||
public class DustWastelandsBiome extends EndBiome.Config {
|
||||
public DustWastelandsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands"))
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
.setWaterAndFogColor(192, 180, 131)
|
||||
.setSurface(EndBlocks.ENDSTONE_DUST)
|
||||
.setDepth(1.5F)
|
||||
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("dust_wastelands");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(226, 239, 168)
|
||||
.fogDensity(2)
|
||||
.waterAndFogColor(192, 180, 131)
|
||||
.terrainHeight(1.5F)
|
||||
.particles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() {
|
||||
return super
|
||||
.surface()
|
||||
.ceil(Blocks.END_STONE.defaultBlockState())
|
||||
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
|
||||
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
|
||||
));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
@ -12,38 +12,58 @@ import ru.betterend.registry.EndSounds;
|
|||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class FoggyMushroomlandBiome extends EndBiome {
|
||||
public class FoggyMushroomlandBiome extends EndBiome.Config {
|
||||
public FoggyMushroomlandBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland"))
|
||||
.addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM
|
||||
.getFeatureConfigured())
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(41, 122, 173)
|
||||
.setFogDensity(3)
|
||||
.setWaterAndFogColor(119, 227, 250)
|
||||
.setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM)
|
||||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.addFeature(EndFeatures.END_LAKE)
|
||||
.addFeature(EndFeatures.MOSSY_GLOWSHROOM)
|
||||
.addFeature(EndFeatures.BLUE_VINE)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS)
|
||||
.addFeature(EndFeatures.DENSE_VINE)
|
||||
//.addFeature(EndFeatures.PEARLBERRY)
|
||||
.addFeature(EndFeatures.CYAN_MOSS)
|
||||
.addFeature(EndFeatures.CYAN_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.END_LILY)
|
||||
.addFeature(EndFeatures.BUBBLE_CORAL)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5)
|
||||
.addMobSpawn(EndEntities.END_FISH, 20, 2, 5)
|
||||
.addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8)
|
||||
.addMobSpawn(EndEntities.END_SLIME, 10, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
|
||||
super("foggy_mushroomland");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.structure(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured())
|
||||
.plantsColor(73, 210, 209)
|
||||
.fogColor(41, 122, 173)
|
||||
.fogDensity(3)
|
||||
.waterAndFogColor(119, 227, 250)
|
||||
.particles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.loop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||
.music(EndSounds.MUSIC_FOREST)
|
||||
.feature(EndFeatures.END_LAKE)
|
||||
.feature(EndFeatures.MOSSY_GLOWSHROOM)
|
||||
.feature(EndFeatures.BLUE_VINE)
|
||||
.feature(EndFeatures.UMBRELLA_MOSS)
|
||||
.feature(EndFeatures.CREEPING_MOSS)
|
||||
.feature(EndFeatures.DENSE_VINE)
|
||||
//.feature(EndFeatures.PEARLBERRY)
|
||||
.feature(EndFeatures.CYAN_MOSS)
|
||||
.feature(EndFeatures.CYAN_MOSS_WOOD)
|
||||
.feature(EndFeatures.END_LILY)
|
||||
.feature(EndFeatures.BUBBLE_CORAL)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EndEntities.DRAGONFLY, 80, 2, 5)
|
||||
.spawn(EndEntities.END_FISH, 20, 2, 5)
|
||||
.spawn(EndEntities.CUBOZOA, 10, 3, 8)
|
||||
.spawn(EndEntities.END_SLIME, 10, 1, 2)
|
||||
.spawn(EntityType.ENDERMAN, 10, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.END_MOSS.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return EndBlocks.END_MYCELIUM.defaultBlockState();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,54 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class GlowingGrasslandsBiome extends EndBiome {
|
||||
public class GlowingGrasslandsBiome extends EndBiome.Config {
|
||||
public GlowingGrasslandsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands"))
|
||||
.setFogColor(99, 228, 247)
|
||||
.setFogDensity(1.3F)
|
||||
.setParticles(EndParticles.FIREFLY, 0.001F)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
|
||||
.setSurface(EndBlocks.END_MOSS)
|
||||
.setWaterAndFogColor(92, 250, 230)
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(EndFeatures.LUMECORN)
|
||||
.addFeature(EndFeatures.BLOOMING_COOKSONIA)
|
||||
.addFeature(EndFeatures.SALTEAGO)
|
||||
.addFeature(EndFeatures.VAIOLUSH_FERN)
|
||||
.addFeature(EndFeatures.FRACTURN)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS_RARE)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS_RARE)
|
||||
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_GREEN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("glowing_grasslands");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(99, 228, 247)
|
||||
.fogDensity(1.3F)
|
||||
.particles(EndParticles.FIREFLY, 0.001F)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
|
||||
.waterAndFogColor(92, 250, 230)
|
||||
.plantsColor(73, 210, 209)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(EndFeatures.LUMECORN)
|
||||
.feature(EndFeatures.BLOOMING_COOKSONIA)
|
||||
.feature(EndFeatures.SALTEAGO)
|
||||
.feature(EndFeatures.VAIOLUSH_FERN)
|
||||
.feature(EndFeatures.FRACTURN)
|
||||
.feature(EndFeatures.UMBRELLA_MOSS_RARE)
|
||||
.feature(EndFeatures.CREEPING_MOSS_RARE)
|
||||
.feature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_GREEN)
|
||||
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.END_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,54 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class LanternWoodsBiome extends EndBiome {
|
||||
public class LanternWoodsBiome extends EndBiome.Config {
|
||||
public LanternWoodsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods"))
|
||||
.setFogColor(189, 82, 70)
|
||||
.setFogDensity(1.1F)
|
||||
.setWaterAndFogColor(171, 234, 226)
|
||||
.setPlantsColor(254, 85, 57)
|
||||
.setSurface(EndBlocks.RUTISCUS)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.addFeature(EndFeatures.END_LAKE_NORMAL)
|
||||
.addFeature(EndFeatures.FLAMAEA)
|
||||
.addFeature(EndFeatures.LUCERNIA)
|
||||
.addFeature(EndFeatures.LUCERNIA_BUSH)
|
||||
.addFeature(EndFeatures.FILALUX)
|
||||
.addFeature(EndFeatures.AERIDIUM)
|
||||
.addFeature(EndFeatures.LAMELLARIUM)
|
||||
.addFeature(EndFeatures.BOLUX_MUSHROOM)
|
||||
.addFeature(EndFeatures.AURANT_POLYPORE)
|
||||
.addFeature(EndFeatures.POND_ANEMONE)
|
||||
.addFeature(EndFeatures.CHARNIA_ORANGE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED)
|
||||
.addFeature(EndFeatures.RUSCUS)
|
||||
.addFeature(EndFeatures.RUSCUS_WOOD)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("lantern_woods");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(189, 82, 70)
|
||||
.fogDensity(1.1F)
|
||||
.waterAndFogColor(171, 234, 226)
|
||||
.plantsColor(254, 85, 57)
|
||||
.music(EndSounds.MUSIC_FOREST)
|
||||
.particles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.feature(EndFeatures.END_LAKE_NORMAL)
|
||||
.feature(EndFeatures.FLAMAEA)
|
||||
.feature(EndFeatures.LUCERNIA)
|
||||
.feature(EndFeatures.LUCERNIA_BUSH)
|
||||
.feature(EndFeatures.FILALUX)
|
||||
.feature(EndFeatures.AERIDIUM)
|
||||
.feature(EndFeatures.LAMELLARIUM)
|
||||
.feature(EndFeatures.BOLUX_MUSHROOM)
|
||||
.feature(EndFeatures.AURANT_POLYPORE)
|
||||
.feature(EndFeatures.POND_ANEMONE)
|
||||
.feature(EndFeatures.CHARNIA_ORANGE)
|
||||
.feature(EndFeatures.CHARNIA_RED)
|
||||
.feature(EndFeatures.RUSCUS)
|
||||
.feature(EndFeatures.RUSCUS_WOOD)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.RUTISCUS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
@ -10,33 +11,52 @@ import ru.betterend.registry.EndSounds;
|
|||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class MegalakeBiome extends EndBiome {
|
||||
public class MegalakeBiome extends EndBiome.Config {
|
||||
public MegalakeBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("megalake"))
|
||||
.addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured())
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(178, 209, 248)
|
||||
.setWaterAndFogColor(96, 163, 255)
|
||||
.setFogDensity(1.75F)
|
||||
.setMusic(EndSounds.MUSIC_WATER)
|
||||
.setLoop(EndSounds.AMBIENT_MEGALAKE)
|
||||
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST)
|
||||
.setDepth(0F)
|
||||
.addFeature(EndFeatures.END_LOTUS)
|
||||
.addFeature(EndFeatures.END_LOTUS_LEAF)
|
||||
.addFeature(EndFeatures.BUBBLE_CORAL_RARE)
|
||||
.addFeature(EndFeatures.END_LILY_RARE)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS)
|
||||
//.addFeature(EndFeatures.PEARLBERRY)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addFeature(EndFeatures.MENGER_SPONGE)
|
||||
.addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3)
|
||||
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8)
|
||||
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
|
||||
super("megalake");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.structure(EndStructures.MEGALAKE.getFeatureConfigured())
|
||||
.plantsColor(73, 210, 209)
|
||||
.fogColor(178, 209, 248)
|
||||
.waterAndFogColor(96, 163, 255)
|
||||
.fogDensity(1.75F)
|
||||
.music(EndSounds.MUSIC_WATER)
|
||||
.loop(EndSounds.AMBIENT_MEGALAKE)
|
||||
.terrainHeight(0F)
|
||||
.feature(EndFeatures.END_LOTUS)
|
||||
.feature(EndFeatures.END_LOTUS_LEAF)
|
||||
.feature(EndFeatures.BUBBLE_CORAL_RARE)
|
||||
.feature(EndFeatures.END_LILY_RARE)
|
||||
.feature(EndFeatures.UMBRELLA_MOSS)
|
||||
.feature(EndFeatures.CREEPING_MOSS)
|
||||
//.feature(EndFeatures.PEARLBERRY)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.feature(EndFeatures.MENGER_SPONGE)
|
||||
.spawn(EndEntities.DRAGONFLY, 50, 1, 3)
|
||||
.spawn(EndEntities.END_FISH, 50, 3, 8)
|
||||
.spawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.spawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.spawn(EntityType.ENDERMAN, 10, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.END_MOSS.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
|
@ -11,35 +12,49 @@ import ru.betterend.registry.EndSounds;
|
|||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class MegalakeGroveBiome extends EndBiome {
|
||||
public class MegalakeGroveBiome extends EndBiome.Config {
|
||||
public MegalakeGroveBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove"))
|
||||
.addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
|
||||
.setPlantsColor(73, 210, 209)
|
||||
.setFogColor(178, 209, 248)
|
||||
.setWaterAndFogColor(96, 163, 255)
|
||||
.setFogDensity(2.0F)
|
||||
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.setMusic(EndSounds.MUSIC_WATER)
|
||||
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE)
|
||||
.setSurface(EndBlocks.END_MOSS)
|
||||
.setDepth(0F)
|
||||
.addFeature(EndFeatures.LACUGROVE)
|
||||
.addFeature(EndFeatures.END_LOTUS)
|
||||
.addFeature(EndFeatures.END_LOTUS_LEAF)
|
||||
.addFeature(EndFeatures.BUBBLE_CORAL_RARE)
|
||||
.addFeature(EndFeatures.END_LILY_RARE)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
//.addFeature(EndFeatures.PEARLBERRY)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addFeature(EndFeatures.MENGER_SPONGE)
|
||||
.addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3)
|
||||
.addMobSpawn(EndEntities.END_FISH, 20, 3, 8)
|
||||
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
|
||||
super("megalake_grove");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.structure(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
|
||||
.plantsColor(73, 210, 209)
|
||||
.fogColor(178, 209, 248)
|
||||
.waterAndFogColor(96, 163, 255)
|
||||
.fogDensity(2.0F)
|
||||
.particles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||
.music(EndSounds.MUSIC_WATER)
|
||||
.loop(EndSounds.AMBIENT_MEGALAKE_GROVE)
|
||||
.terrainHeight(0F)
|
||||
.feature(EndFeatures.LACUGROVE)
|
||||
.feature(EndFeatures.END_LOTUS)
|
||||
.feature(EndFeatures.END_LOTUS_LEAF)
|
||||
.feature(EndFeatures.BUBBLE_CORAL_RARE)
|
||||
.feature(EndFeatures.END_LILY_RARE)
|
||||
.feature(EndFeatures.UMBRELLA_MOSS)
|
||||
//.feature(EndFeatures.PEARLBERRY)
|
||||
.feature(EndFeatures.CREEPING_MOSS)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.feature(EndFeatures.MENGER_SPONGE)
|
||||
.spawn(EndEntities.DRAGONFLY, 20, 1, 3)
|
||||
.spawn(EndEntities.END_FISH, 20, 3, 8)
|
||||
.spawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.spawn(EndEntities.END_SLIME, 5, 1, 2)
|
||||
.spawn(EntityType.ENDERMAN, 10, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.END_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,80 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
|
||||
import net.minecraft.world.level.levelgen.placement.CaveSurface;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.surface.SurfaceRuleBuilder;
|
||||
import ru.bclib.api.surface.rules.SwitchRuleSource;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.surface.SplitNoiseCondition;
|
||||
|
||||
public class NeonOasisBiome extends EndBiome {
|
||||
import java.util.List;
|
||||
|
||||
public class NeonOasisBiome extends EndBiome.Config {
|
||||
public NeonOasisBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis"))
|
||||
.setGenChance(0.5F)
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
.setWaterAndFogColor(106, 238, 215)
|
||||
.setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS)
|
||||
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.addFeature(EndFeatures.DESERT_LAKE)
|
||||
.addFeature(EndFeatures.NEON_CACTUS)
|
||||
.addFeature(EndFeatures.UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.CREEPING_MOSS)
|
||||
.addFeature(EndFeatures.CHARNIA_GREEN)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_RED)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("neon_oasis");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.genChance(0.5F)
|
||||
.fogColor(226, 239, 168)
|
||||
.fogDensity(2)
|
||||
.waterAndFogColor(106, 238, 215)
|
||||
.particles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.feature(EndFeatures.DESERT_LAKE)
|
||||
.feature(EndFeatures.NEON_CACTUS)
|
||||
.feature(EndFeatures.UMBRELLA_MOSS)
|
||||
.feature(EndFeatures.CREEPING_MOSS)
|
||||
.feature(EndFeatures.CHARNIA_GREEN)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_RED)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return EndBlocks.END_MOSS.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() {
|
||||
RuleSource surfaceBlockRule = new SwitchRuleSource(
|
||||
new SplitNoiseCondition(),
|
||||
List.of(
|
||||
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState()),
|
||||
SurfaceRules.state(EndBlocks.END_MOSS.defaultBlockState())
|
||||
)
|
||||
);
|
||||
return super
|
||||
.surface()
|
||||
.ceil(Blocks.END_STONE.defaultBlockState())
|
||||
.rule(1, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
|
||||
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
|
||||
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
|
||||
));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,24 +2,39 @@ package ru.betterend.world.biome.land;
|
|||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class PaintedMountainsBiome extends EndBiome {
|
||||
public class PaintedMountainsBiome extends EndBiome.Config {
|
||||
public PaintedMountainsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains"))
|
||||
.addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
|
||||
.setFogColor(226, 239, 168)
|
||||
.setFogDensity(2)
|
||||
.setWaterAndFogColor(192, 180, 131)
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.setSurface(EndBlocks.ENDSTONE_DUST)
|
||||
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("painted_mountains");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.structure(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
|
||||
.fogColor(226, 239, 168)
|
||||
.fogDensity(2)
|
||||
.waterAndFogColor(192, 180, 131)
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
|
||||
.particles(ParticleTypes.WHITE_ASH, 0.01F)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,58 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class ShadowForestBiome extends EndBiome {
|
||||
public class ShadowForestBiome extends EndBiome.Config {
|
||||
public ShadowForestBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest"))
|
||||
.setFogColor(0, 0, 0)
|
||||
.setFogDensity(2.5F)
|
||||
.setPlantsColor(45, 45, 45)
|
||||
.setWaterAndFogColor(42, 45, 80)
|
||||
.setSurface(EndBlocks.SHADOW_GRASS)
|
||||
.setParticles(ParticleTypes.MYCELIUM, 0.01F)
|
||||
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
|
||||
.setMusic(EndSounds.MUSIC_DARK)
|
||||
.addFeature(EndFeatures.VIOLECITE_LAYER)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(EndFeatures.DRAGON_TREE)
|
||||
.addFeature(EndFeatures.DRAGON_TREE_BUSH)
|
||||
.addFeature(EndFeatures.SHADOW_PLANT)
|
||||
.addFeature(EndFeatures.MURKWEED)
|
||||
.addFeature(EndFeatures.NEEDLEGRASS)
|
||||
.addFeature(EndFeatures.SHADOW_BERRY)
|
||||
.addFeature(EndFeatures.TWISTED_VINE)
|
||||
.addFeature(EndFeatures.PURPLE_POLYPORE)
|
||||
.addFeature(EndFeatures.TAIL_MOSS)
|
||||
.addFeature(EndFeatures.TAIL_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.CHARNIA_PURPLE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 40, 1, 4)
|
||||
.addMobSpawn(EntityType.PHANTOM, 1, 1, 2));
|
||||
super("shadow_forest");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(0, 0, 0)
|
||||
.fogDensity(2.5F)
|
||||
.plantsColor(45, 45, 45)
|
||||
.waterAndFogColor(42, 45, 80)
|
||||
.particles(ParticleTypes.MYCELIUM, 0.01F)
|
||||
.loop(EndSounds.AMBIENT_CHORUS_FOREST)
|
||||
.music(EndSounds.MUSIC_DARK)
|
||||
.feature(EndFeatures.VIOLECITE_LAYER)
|
||||
.feature(EndFeatures.END_LAKE_RARE)
|
||||
.feature(EndFeatures.DRAGON_TREE)
|
||||
.feature(EndFeatures.DRAGON_TREE_BUSH)
|
||||
.feature(EndFeatures.SHADOW_PLANT)
|
||||
.feature(EndFeatures.MURKWEED)
|
||||
.feature(EndFeatures.NEEDLEGRASS)
|
||||
.feature(EndFeatures.SHADOW_BERRY)
|
||||
.feature(EndFeatures.TWISTED_VINE)
|
||||
.feature(EndFeatures.PURPLE_POLYPORE)
|
||||
.feature(EndFeatures.TAIL_MOSS)
|
||||
.feature(EndFeatures.TAIL_MOSS_WOOD)
|
||||
.feature(EndFeatures.CHARNIA_PURPLE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
|
||||
.spawn(EntityType.ENDERMAN, 40, 1, 4)
|
||||
.spawn(EntityType.PHANTOM, 1, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.SHADOW_GRASS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +1,93 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
|
||||
import net.minecraft.world.level.levelgen.placement.CaveSurface;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.surface.SurfaceRuleBuilder;
|
||||
import ru.bclib.api.surface.rules.SwitchRuleSource;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndEntities;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.surface.SurfaceBuilders;
|
||||
import ru.betterend.world.surface.SulphuricSurfaceNoiseCondition;
|
||||
|
||||
public class SulphurSpringsBiome extends EndBiome {
|
||||
import java.util.List;
|
||||
|
||||
public class SulphurSpringsBiome extends EndBiome.Config {
|
||||
public SulphurSpringsBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs"))
|
||||
.addCustomData("has_caves", false)
|
||||
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
||||
.setMusic(EndSounds.MUSIC_OPENSPACE)
|
||||
.setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
|
||||
.setWaterColor(25, 90, 157)
|
||||
.setWaterFogColor(30, 65, 61)
|
||||
.setFogColor(207, 194, 62)
|
||||
.setFogDensity(1.5F)
|
||||
.setDepth(0F)
|
||||
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F)
|
||||
.addFeature(EndFeatures.GEYSER)
|
||||
.addFeature(EndFeatures.SURFACE_VENT)
|
||||
.addFeature(EndFeatures.SULPHURIC_LAKE)
|
||||
.addFeature(EndFeatures.SULPHURIC_CAVE)
|
||||
.addFeature(EndFeatures.HYDRALUX)
|
||||
.addFeature(EndFeatures.CHARNIA_GREEN)
|
||||
.addFeature(EndFeatures.CHARNIA_ORANGE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8)
|
||||
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
|
||||
super("sulphur_springs");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasCaves() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.music(EndSounds.MUSIC_OPENSPACE)
|
||||
.loop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
|
||||
.waterColor(25, 90, 157)
|
||||
.waterFogColor(30, 65, 61)
|
||||
.fogColor(207, 194, 62)
|
||||
.fogDensity(1.5F)
|
||||
.terrainHeight(0F)
|
||||
.particles(EndParticles.SULPHUR_PARTICLE, 0.001F)
|
||||
.feature(EndFeatures.GEYSER)
|
||||
.feature(EndFeatures.SURFACE_VENT)
|
||||
.feature(EndFeatures.SULPHURIC_LAKE)
|
||||
.feature(EndFeatures.SULPHURIC_CAVE)
|
||||
.feature(EndFeatures.HYDRALUX)
|
||||
.feature(EndFeatures.CHARNIA_GREEN)
|
||||
.feature(EndFeatures.CHARNIA_ORANGE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.spawn(EndEntities.END_FISH, 50, 3, 8)
|
||||
.spawn(EndEntities.CUBOZOA, 50, 3, 8)
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.FLAVOLITE.stone.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return Blocks.END_STONE.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateFloorRule() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() {
|
||||
RuleSource surfaceBlockRule = new SwitchRuleSource(
|
||||
new SulphuricSurfaceNoiseCondition(),
|
||||
List.of(
|
||||
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
|
||||
SurfaceRules.state(surfaceMaterial().getTopMaterial()),
|
||||
SULPHURIC_ROCK,
|
||||
BRIMSTONE
|
||||
)
|
||||
);
|
||||
return super
|
||||
.surface()
|
||||
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
|
||||
.rule(2, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR), surfaceBlockRule));
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,92 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.api.surface.SurfaceRuleBuilder;
|
||||
import ru.bclib.api.surface.rules.SwitchRuleSource;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.surface.SurfaceBuilders;
|
||||
import ru.betterend.world.surface.UmbraSurfaceNoiseCondition;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UmbraValleyBiome extends EndBiome.Config {
|
||||
private static final Block[] SURFACE_BLOCKS = new Block[] {
|
||||
EndBlocks.PALLIDIUM_FULL,
|
||||
EndBlocks.PALLIDIUM_HEAVY,
|
||||
EndBlocks.PALLIDIUM_THIN,
|
||||
EndBlocks.PALLIDIUM_TINY,
|
||||
EndBlocks.UMBRALITH.stone
|
||||
};
|
||||
|
||||
public class UmbraValleyBiome extends EndBiome {
|
||||
public UmbraValleyBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("umbra_valley"))
|
||||
.setFogColor(100, 100, 100)
|
||||
.setPlantsColor(172, 189, 190)
|
||||
.setWaterAndFogColor(69, 104, 134)
|
||||
.setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
|
||||
.setParticles(EndParticles.AMBER_SPHERE, 0.0001F)
|
||||
.setLoop(EndSounds.UMBRA_VALLEY)
|
||||
.setMusic(EndSounds.MUSIC_DARK)
|
||||
.addFeature(EndFeatures.UMBRALITH_ARCH)
|
||||
.addFeature(EndFeatures.THIN_UMBRALITH_ARCH)
|
||||
.addFeature(EndFeatures.INFLEXIA)
|
||||
.addFeature(EndFeatures.FLAMMALIX)
|
||||
);
|
||||
super("umbra_valley");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(100, 100, 100)
|
||||
.plantsColor(172, 189, 190)
|
||||
.waterAndFogColor(69, 104, 134)
|
||||
.particles(EndParticles.AMBER_SPHERE, 0.0001F)
|
||||
.loop(EndSounds.UMBRA_VALLEY)
|
||||
.music(EndSounds.MUSIC_DARK)
|
||||
.feature(EndFeatures.UMBRALITH_ARCH)
|
||||
.feature(EndFeatures.THIN_UMBRALITH_ARCH)
|
||||
.feature(EndFeatures.INFLEXIA)
|
||||
.feature(EndFeatures.FLAMMALIX);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.UMBRALITH.stone.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getUnderMaterial() {
|
||||
return EndBlocks.UMBRALITH.stone.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getAltTopMaterial() {
|
||||
return EndBlocks.PALLIDIUM_FULL.defaultBlockState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generateFloorRule() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurfaceRuleBuilder surface() {
|
||||
return super.surface()
|
||||
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
|
||||
new SwitchRuleSource(
|
||||
new UmbraSurfaceNoiseCondition(),
|
||||
List.of(
|
||||
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
|
||||
PALLIDIUM_HEAVY,
|
||||
PALLIDIUM_THIN,
|
||||
PALLIDIUM_TINY,
|
||||
SurfaceRules.state(surfaceMaterial().getTopMaterial())
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static Block getSurface(int x, int z) {
|
||||
return SURFACE_BLOCKS[UmbraSurfaceNoiseCondition.getDepth(x, z)];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +1,58 @@
|
|||
package ru.betterend.world.biome.land;
|
||||
|
||||
import net.minecraft.data.worldgen.StructureFeatures;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
import ru.betterend.BetterEnd;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||
import ru.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndParticles;
|
||||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class UmbrellaJungleBiome extends EndBiome {
|
||||
public class UmbrellaJungleBiome extends EndBiome.Config {
|
||||
public UmbrellaJungleBiome() {
|
||||
super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle"))
|
||||
.setFogColor(87, 223, 221)
|
||||
.setWaterAndFogColor(119, 198, 253)
|
||||
.setFoliageColor(27, 183, 194)
|
||||
.setFogDensity(2.3F)
|
||||
.setParticles(EndParticles.JUNGLE_SPORE, 0.001F)
|
||||
.setMusic(EndSounds.MUSIC_FOREST)
|
||||
.setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE)
|
||||
.setSurface(EndBlocks.JUNGLE_MOSS)
|
||||
.addFeature(EndFeatures.END_LAKE)
|
||||
.addFeature(EndFeatures.UMBRELLA_TREE)
|
||||
.addFeature(EndFeatures.JELLYSHROOM)
|
||||
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS)
|
||||
.addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR)
|
||||
.addFeature(EndFeatures.JUNGLE_GRASS)
|
||||
.addFeature(EndFeatures.CYAN_MOSS)
|
||||
.addFeature(EndFeatures.CYAN_MOSS_WOOD)
|
||||
.addFeature(EndFeatures.JUNGLE_FERN_WOOD)
|
||||
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL)
|
||||
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD)
|
||||
.addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL)
|
||||
.addFeature(EndFeatures.JUNGLE_VINE)
|
||||
.addFeature(EndFeatures.CHARNIA_CYAN)
|
||||
.addFeature(EndFeatures.CHARNIA_GREEN)
|
||||
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.addFeature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.addStructureFeature(StructureFeatures.END_CITY)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
|
||||
super("umbrella_jungle");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
builder
|
||||
.fogColor(87, 223, 221)
|
||||
.waterAndFogColor(119, 198, 253)
|
||||
.foliageColor(27, 183, 194)
|
||||
.fogDensity(2.3F)
|
||||
.particles(EndParticles.JUNGLE_SPORE, 0.001F)
|
||||
.music(EndSounds.MUSIC_FOREST)
|
||||
.loop(EndSounds.AMBIENT_UMBRELLA_JUNGLE)
|
||||
.feature(EndFeatures.END_LAKE)
|
||||
.feature(EndFeatures.UMBRELLA_TREE)
|
||||
.feature(EndFeatures.JELLYSHROOM)
|
||||
.feature(EndFeatures.TWISTED_UMBRELLA_MOSS)
|
||||
.feature(EndFeatures.SMALL_JELLYSHROOM_FLOOR)
|
||||
.feature(EndFeatures.JUNGLE_GRASS)
|
||||
.feature(EndFeatures.CYAN_MOSS)
|
||||
.feature(EndFeatures.CYAN_MOSS_WOOD)
|
||||
.feature(EndFeatures.JUNGLE_FERN_WOOD)
|
||||
.feature(EndFeatures.SMALL_JELLYSHROOM_WALL)
|
||||
.feature(EndFeatures.SMALL_JELLYSHROOM_WOOD)
|
||||
.feature(EndFeatures.SMALL_JELLYSHROOM_CEIL)
|
||||
.feature(EndFeatures.JUNGLE_VINE)
|
||||
.feature(EndFeatures.CHARNIA_CYAN)
|
||||
.feature(EndFeatures.CHARNIA_GREEN)
|
||||
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
|
||||
.feature(EndFeatures.CHARNIA_RED_RARE)
|
||||
.structure(VANILLA_FEATURES.getEndCity())
|
||||
.spawn(EntityType.ENDERMAN, 50, 1, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SurfaceMaterialProvider surfaceMaterial() {
|
||||
return new EndBiome.DefaultSurfaceMaterialProvider() {
|
||||
@Override
|
||||
public BlockState getTopMaterial() {
|
||||
return EndBlocks.JUNGLE_MOSS.defaultBlockState();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue