Merge branch '1.18' of github.com:paulevsGitch/BetterEnd into 1.18

This commit is contained in:
Frank 2021-12-21 16:59:58 +01:00
commit 1c43af9025
139 changed files with 2872 additions and 2388 deletions

View file

@ -2,13 +2,13 @@
# Better End # Better End
Better End Mod for Fabric, MC 1.17.1 Better End Mod for Fabric, MC 1.18
Importing: Importing:
* Clone repo * Clone repo
* Edit gradle.properties if necessary * 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 * Import project to IDE
Building: Building:

View file

@ -25,6 +25,11 @@ repositories {
maven { url 'https://maven.blamejared.com' } maven { url 'https://maven.blamejared.com' }
maven { url "https://maven.shedaniel.me/" } maven { url "https://maven.shedaniel.me/" }
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url 'https://maven.terraformersmc.com/releases' }
}
loom {
accessWidenerPath = file("src/main/resources/betterend.accesswidener")
} }
dependencies { dependencies {
@ -33,7 +38,7 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_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}" println "Using local BCLib: ${local_bclib}"
if (local_bclib){ if (local_bclib){
implementation( project(path:":BCLib", configuration: 'dev') ) implementation( project(path:":BCLib", configuration: 'dev') )

View file

@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.18 minecraft_version=1.18.1
yarn_mappings=6 fabric_version = 0.44.0+1.18
loader_version=0.12.8 loader_version=0.12.12
#Loom #Loom
loom_version=0.10-SNAPSHOT loom_version=0.10-SNAPSHOT
@ -19,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 # 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 patchouli_version = 55-FABRIC-SNAPSHOT
fabric_version = 0.44.0+1.18 bclib_version = 1.1.4
bclib_version = 1.0.1
rei_version = 7.0.343 rei_version = 7.0.343
canvas_version = 1.0.+ canvas_version = 1.0.+

View file

@ -11,10 +11,10 @@ pluginManagement {
// #### Custom Settings #### // #### Custom Settings ####
//Change the next line to disable local BCLib loading //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 //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 //The path were to look for the local BCLib
def BCLibPath = '../BCLib' def BCLibPath = '../BCLib'

View file

@ -3,7 +3,9 @@ package ru.betterend;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biomes;
import ru.bclib.api.WorldDataAPI; import ru.bclib.api.WorldDataAPI;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.Logger; import ru.bclib.util.Logger;
import ru.betterend.api.BetterEndPlugin; import ru.betterend.api.BetterEndPlugin;
import ru.betterend.config.Configs; import ru.betterend.config.Configs;
@ -28,13 +30,12 @@ import ru.betterend.util.BonemealPlants;
import ru.betterend.util.LootTableUtil; import ru.betterend.util.LootTableUtil;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
import ru.betterend.world.generator.TerrainGenerator; import ru.betterend.world.generator.TerrainGenerator;
import ru.betterend.world.surface.SurfaceBuilders;
public class BetterEnd implements ModInitializer { public class BetterEnd implements ModInitializer {
public static final String MOD_ID = "betterend"; public static final String MOD_ID = "betterend";
public static final Logger LOGGER = new Logger(MOD_ID); public static final Logger LOGGER = new Logger(MOD_ID);
public static final boolean RUNS_FALL_FLYING_LIB = FabricLoader.getInstance().getModContainer("fallflyinglib").isPresent(); public static final boolean RUNS_FALL_FLYING_LIB = FabricLoader.getInstance().getModContainer("fallflyinglib").isPresent();
@Override @Override
public void onInitialize() { public void onInitialize() {
WorldDataAPI.registerModCache(MOD_ID); WorldDataAPI.registerModCache(MOD_ID);
@ -43,7 +44,6 @@ public class BetterEnd implements ModInitializer {
EndBlockEntities.register(); EndBlockEntities.register();
EndFeatures.register(); EndFeatures.register();
EndEntities.register(); EndEntities.register();
SurfaceBuilders.register();
EndBiomes.register(); EndBiomes.register();
EndTags.register(); EndTags.register();
EndEnchantments.register(); EndEnchantments.register();
@ -61,14 +61,22 @@ public class BetterEnd implements ModInitializer {
FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register); FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
Integrations.init(); Integrations.init();
Configs.saveConfigs(); Configs.saveConfigs();
if (GeneratorOptions.useNewGenerator()) { 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)); 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) { public static ResourceLocation makeID(String path) {
return new ResourceLocation(MOD_ID, path); return new ResourceLocation(MOD_ID, path);
} }
} }

View file

@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class DragonTreeSaplingBlock extends PottableFeatureSapling { public class DragonTreeSaplingBlock extends PottableFeatureSapling {
public DragonTreeSaplingBlock() { public DragonTreeSaplingBlock() {
super(); super((state)->EndFeatures.DRAGON_TREE.getFeature());
}
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.DRAGON_TREE.getFeature();
} }
@Override @Override

View file

@ -88,7 +88,7 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
if (state.getValue(WATERLOGGED)) { 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; return state;
} }

View file

@ -4,18 +4,15 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class HelixTreeSaplingBlock extends PottableFeatureSapling { public class HelixTreeSaplingBlock extends PottableFeatureSapling {
@Override public HelixTreeSaplingBlock() {
@SuppressWarnings("deprecation") super((state)->EndFeatures.HELIX_TREE.getFeature());
protected Feature<?> getFeature() {
return EndFeatures.HELIX_TREE.getFeature();
} }
@Override @Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS); return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS);

View file

@ -90,7 +90,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
return Blocks.WATER.defaultBlockState(); return Blocks.WATER.defaultBlockState();
} }
else if (state.getValue(WATERLOGGED) && facing == Direction.UP && neighborState.is(Blocks.WATER)) { 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; return state;
} }
@ -118,7 +118,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo
BlockPos up = pos.above(); BlockPos up = pos.above();
if (world.getBlockState(up).is(Blocks.WATER)) { if (world.getBlockState(up).is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.VENT_BUBBLE_COLUMN); 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);
} }
} }

View file

@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class LacugroveSaplingBlock extends PottableFeatureSapling { public class LacugroveSaplingBlock extends PottableFeatureSapling {
public LacugroveSaplingBlock() { public LacugroveSaplingBlock() {
super(); super((state)->EndFeatures.LACUGROVE.getFeature());
}
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.LACUGROVE.getFeature();
} }
@Override @Override

View file

@ -4,22 +4,15 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class LucerniaSaplingBlock extends PottableFeatureSapling { public class LucerniaSaplingBlock extends PottableFeatureSapling {
public LucerniaSaplingBlock() { public LucerniaSaplingBlock() {
super(); super((state)->EndFeatures.LUCERNIA.getFeature());
} }
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.LUCERNIA.getFeature();
}
@Override @Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS); return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS);

View file

@ -4,25 +4,34 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState; 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.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock; import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import java.util.Optional;
import java.util.Random; import java.util.Random;
public class LumecornSeedBlock extends EndPlantWithAgeBlock { public class LumecornSeedBlock extends EndPlantWithAgeBlock {
@Override @Override
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { 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 @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(EndBlocks.END_MOSS); return state.is(EndBlocks.END_MOSS);
} }
@Override @Override
public BlockBehaviour.OffsetType getOffsetType() { public BlockBehaviour.OffsetType getOffsetType() {
return BlockBehaviour.OffsetType.NONE; return BlockBehaviour.OffsetType.NONE;

View file

@ -4,22 +4,15 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling { public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling {
public MossyGlowshroomSaplingBlock() { public MossyGlowshroomSaplingBlock() {
super(7); super(7, (state)->EndFeatures.MOSSY_GLOWSHROOM.getFeature());
} }
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.MOSSY_GLOWSHROOM.getFeature();
}
@Override @Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()) return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below())

View file

@ -115,9 +115,9 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
@Override @Override
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { 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)) { 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); Direction dir = state.getValue(FACING);
BlockState downState = world.getBlockState(pos.relative(dir.getOpposite())); BlockState downState = world.getBlockState(pos.relative(dir.getOpposite()));

View file

@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class PythadendronSaplingBlock extends PottableFeatureSapling { public class PythadendronSaplingBlock extends PottableFeatureSapling {
public PythadendronSaplingBlock() { public PythadendronSaplingBlock() {
super(); super((state)->EndFeatures.PYTHADENDRON_TREE.getFeature());
}
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.PYTHADENDRON_TREE.getFeature();
} }
@Override @Override

View file

@ -7,7 +7,9 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; 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.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; 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.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import java.util.Optional;
import java.util.Random; import java.util.Random;
public class SmallAmaranitaBlock extends EndPlantBlock { 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) { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
BlockPos bigPos = growBig(world, pos); BlockPos bigPos = growBig(world, pos);
if (bigPos != null) { if (bigPos != null) {
if (EndFeatures.GIGANTIC_AMARANITA.getFeature() if (((Feature<NoneFeatureConfiguration>)EndFeatures.GIGANTIC_AMARANITA.getFeature())
.place(new FeaturePlaceContext<>(world, null, random, bigPos, null))) { .place(new FeaturePlaceContext<>(Optional.empty(), world, null, random, bigPos, null))) {
replaceMushroom(world, bigPos); replaceMushroom(world, bigPos);
replaceMushroom(world, bigPos.south()); replaceMushroom(world, bigPos.south());
replaceMushroom(world, bigPos.east()); replaceMushroom(world, bigPos.east());
@ -39,7 +42,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
} }
return; 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 @Override

View file

@ -20,7 +20,9 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BonemealableBlock; import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; 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.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; 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.EnumMap;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.Random; import java.util.Random;
public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant { public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant {
@ -101,7 +104,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
@Override @Override
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR); 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 @Override

View file

@ -4,20 +4,13 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; 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.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
public class TenaneaSaplingBlock extends PottableFeatureSapling { public class TenaneaSaplingBlock extends PottableFeatureSapling {
public TenaneaSaplingBlock() { public TenaneaSaplingBlock() {
super(); super((state)->EndFeatures.TENANEA.getFeature());
}
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.TENANEA.getFeature();
} }
@Override @Override

View file

@ -4,7 +4,6 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.Feature;
import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BCLRenderLayer;
import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.blocks.basis.PottableFeatureSapling;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
@ -12,15 +11,9 @@ import ru.betterend.registry.EndFeatures;
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling { public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling {
public UmbrellaTreeSaplingBlock() { public UmbrellaTreeSaplingBlock() {
super(); super((state)-> EndFeatures.UMBRELLA_TREE.getFeature());
} }
@Override
@SuppressWarnings("deprecation")
protected Feature<?> getFeature() {
return EndFeatures.UMBRELLA_TREE.getFeature();
}
@Override @Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
return world.getBlockState(pos.below()).is(EndBlocks.JUNGLE_MOSS); return world.getBlockState(pos.below()).is(EndBlocks.JUNGLE_MOSS);

View file

@ -76,7 +76,7 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
BlockPos up = pos.above(); BlockPos up = pos.above();
if (world.getBlockState(up).is(Blocks.WATER)) { if (world.getBlockState(up).is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, up, this); BlocksHelper.setWithoutUpdate(world, up, this);
world.getBlockTicks().scheduleTick(up, this, 5); world.scheduleTick(up, this, 5);
} }
} }
return state; return state;

View file

@ -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) { public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
Boolean water = state.getValue(WATERLOGGED); Boolean water = state.getValue(WATERLOGGED);
if (water) { 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)) { if (!canSurvive(state, world, pos)) {
return water ? Blocks.WATER.defaultBlockState() : Blocks.AIR.defaultBlockState(); return water ? Blocks.WATER.defaultBlockState() : Blocks.AIR.defaultBlockState();

View file

@ -82,7 +82,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
/** /**
* Register new Pedestal block with specified mod id. * Register new Pedestal block with specified mod id.
* *
* @param id pedestal id * @param id pedestal id
* @param source source block * @param source source block
* @return new Pedestal block with specified id. * @return new Pedestal block with specified id.
*/ */

View file

@ -1,14 +1,18 @@
package ru.betterend.blocks.basis; 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.bclib.blocks.FeatureSaplingBlock;
import ru.betterend.interfaces.PottablePlant; import ru.betterend.interfaces.PottablePlant;
import java.util.function.Function;
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant { public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
public PottableFeatureSapling() { public PottableFeatureSapling(Function<BlockState, Feature<?>> featureSupplier) {
super(); super(featureSupplier);
} }
public PottableFeatureSapling(int light) { public PottableFeatureSapling(int light, Function<BlockState, Feature<?>> featureSupplier) {
super(light); super(light, featureSupplier);
} }
} }

View file

@ -429,8 +429,9 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
} }
@Override @Override
public CompoundTag save(CompoundTag tag) { public void saveAdditional(CompoundTag tag) {
super.save(tag); super.saveAdditional(tag);
tag.putShort("BurnTime", (short) burnTime); tag.putShort("BurnTime", (short) burnTime);
tag.putShort("FuelTime", (short) fuelTime); tag.putShort("FuelTime", (short) fuelTime);
tag.putShort("SmeltTime", (short) smeltTime); tag.putShort("SmeltTime", (short) smeltTime);
@ -439,8 +440,6 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme
CompoundTag usedRecipes = new CompoundTag(); CompoundTag usedRecipes = new CompoundTag();
recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer)); recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer));
tag.put("RecipesUsed", usedRecipes); tag.put("RecipesUsed", usedRecipes);
return tag;
} }
public boolean canPlaceItem(int slot, ItemStack stack) { public boolean canPlaceItem(int slot, ItemStack stack) {

View file

@ -35,11 +35,11 @@ public class EternalPedestalEntity extends PedestalBlockEntity {
} }
@Override @Override
public CompoundTag save(CompoundTag tag) { public void saveAdditional(CompoundTag tag) {
if (hasRitual()) { if (hasRitual()) {
tag.put("ritual", linkedRitual.toTag(new CompoundTag())); tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
} }
return super.save(tag); super.saveAdditional(tag);
} }
@Override @Override

View file

@ -40,11 +40,11 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
} }
@Override @Override
public CompoundTag save(CompoundTag tag) { public void saveAdditional(CompoundTag tag) {
if (hasRitual()) { if (hasRitual()) {
tag.put("ritual", linkedRitual.toTag(new CompoundTag())); tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
} }
return super.save(tag); super.saveAdditional(tag);
} }
@Override @Override

View file

@ -1,6 +1,6 @@
package ru.betterend.blocks.entities; package ru.betterend.blocks.entities;
import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable; //import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.Container; import net.minecraft.world.Container;
@ -14,7 +14,8 @@ import ru.betterend.blocks.basis.PedestalBlock;
import ru.betterend.registry.EndBlockEntities; import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class PedestalBlockEntity extends BlockEntity implements Container, BlockEntityClientSerializable { // TODO Fix client serialisation
public class PedestalBlockEntity extends BlockEntity implements Container/*, BlockEntityClientSerializable*/ {
private ItemStack activeItem = ItemStack.EMPTY; private ItemStack activeItem = ItemStack.EMPTY;
private final int maxAge = 314; private final int maxAge = 314;
@ -110,7 +111,7 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
fromTag(tag); fromTag(tag);
} }
@Override /*@Override
public CompoundTag save(CompoundTag tag) { public CompoundTag save(CompoundTag tag) {
tag.put("active_item", activeItem.save(new CompoundTag())); tag.put("active_item", activeItem.save(new CompoundTag()));
return super.save(tag); return super.save(tag);
@ -124,7 +125,7 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
@Override @Override
public CompoundTag toClientTag(CompoundTag tag) { public CompoundTag toClientTag(CompoundTag tag) {
return save(tag); return save(tag);
} }*/
protected void fromTag(CompoundTag tag) { protected void fromTag(CompoundTag tag) {
if (tag.contains("active_item")) { if (tag.contains("active_item")) {

View file

@ -48,452 +48,452 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class MetalMaterial { public class MetalMaterial {
public final Block ore; public final Block ore;
public final Block block; public final Block block;
public final Block tile; public final Block tile;
public final Block bars; public final Block bars;
public final Block pressurePlate; public final Block pressurePlate;
public final Block door; public final Block door;
public final Block trapdoor; public final Block trapdoor;
public final Block chain; public final Block chain;
public final Block stairs; public final Block stairs;
public final Block slab; public final Block slab;
public final Block chandelier; public final Block chandelier;
public final Block bulb_lantern; public final Block bulb_lantern;
public final ColoredMaterial bulb_lantern_colored; public final ColoredMaterial bulb_lantern_colored;
public final Block anvilBlock; public final Block anvilBlock;
public final Item rawOre; public final Item rawOre;
public final Item nugget; public final Item nugget;
public final Item ingot; public final Item ingot;
public final Item shovelHead; public final Item shovelHead;
public final Item pickaxeHead; public final Item pickaxeHead;
public final Item axeHead; public final Item axeHead;
public final Item hoeHead; public final Item hoeHead;
public final Item swordBlade; public final Item swordBlade;
public final Item swordHandle; public final Item swordHandle;
public final Item shovel; public final Item shovel;
public final Item sword; public final Item sword;
public final Item pickaxe; public final Item pickaxe;
public final Item axe; public final Item axe;
public final Item hoe; public final Item hoe;
public final Item hammer; public final Item hammer;
public final Item forgedPlate; public final Item forgedPlate;
public final Item helmet; public final Item helmet;
public final Item chestplate; public final Item chestplate;
public final Item leggings; public final Item leggings;
public final Item boots; public final Item boots;
public final Tag.Named<Item> alloyingOre; public final Tag.Named<Item> alloyingOre;
public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) { public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) {
return new MetalMaterial( return new MetalMaterial(
name, name,
true, true,
FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(color), FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(color),
EndItems.makeEndItemSettings(), EndItems.makeEndItemSettings(),
material, material,
armor armor
); );
} }
public static MetalMaterial makeNormal(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { public static MetalMaterial makeNormal(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) {
return new MetalMaterial( return new MetalMaterial(
name, name,
true, true,
FabricBlockSettings.copyOf(Blocks.IRON_BLOCK) FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)
.mapColor(color) .mapColor(color)
.hardness(hardness) .hardness(hardness)
.resistance(resistance), .resistance(resistance),
EndItems.makeEndItemSettings(), EndItems.makeEndItemSettings(),
material, material,
armor armor
); );
} }
public static MetalMaterial makeOreless(String name, MaterialColor color, Tier material, ArmorMaterial armor) { public static MetalMaterial makeOreless(String name, MaterialColor color, Tier material, ArmorMaterial armor) {
return new MetalMaterial( return new MetalMaterial(
name, name,
false, false,
FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(color), FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).mapColor(color),
EndItems.makeEndItemSettings(), EndItems.makeEndItemSettings(),
material, material,
armor armor
); );
} }
public static MetalMaterial makeOreless(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { public static MetalMaterial makeOreless(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) {
return new MetalMaterial( return new MetalMaterial(
name, name,
false, false,
FabricBlockSettings.copyOf(Blocks.IRON_BLOCK) FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)
.mapColor(color) .mapColor(color)
.hardness(hardness) .hardness(hardness)
.resistance(resistance), .resistance(resistance),
EndItems.makeEndItemSettings(), EndItems.makeEndItemSettings(),
material, material,
armor armor
); );
} }
private MetalMaterial(String name, boolean hasOre, FabricBlockSettings settings, Properties itemSettings, Tier material, ArmorMaterial armor) { private MetalMaterial(String name, boolean hasOre, FabricBlockSettings settings, Properties itemSettings, Tier material, ArmorMaterial armor) {
BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings) BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings)
.hardness(1) .hardness(1)
.resistance(1) .resistance(1)
.luminance(15) .luminance(15)
.sound(SoundType.LANTERN); .sound(SoundType.LANTERN);
final int level = material.getLevel(); final int level = material.getLevel();
rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null; 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; alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null;
if (hasOre) { if (hasOre) {
TagAPI.addTag(alloyingOre, ore, rawOre); TagAPI.addTag(alloyingOre, ore, rawOre);
} }
block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings)); block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings));
tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings)); tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings));
stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile));
slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(tile)); slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(tile));
door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block)); door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(block));
trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block)); trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(block));
bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block)); bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block));
chain = EndBlocks.registerBlock(name + "_chain", new BaseChainBlock(block.defaultMaterialColor())); chain = EndBlocks.registerBlock(name + "_chain", new BaseChainBlock(block.defaultMaterialColor()));
pressurePlate = EndBlocks.registerBlock(name + "_plate", new WoodenPressurePlateBlock(block)); pressurePlate = EndBlocks.registerBlock(name + "_plate", new WoodenPressurePlateBlock(block));
chandelier = EndBlocks.registerBlock(name + "_chandelier", new ChandelierBlock(block)); chandelier = EndBlocks.registerBlock(name + "_chandelier", new ChandelierBlock(block));
bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties)); bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties));
bulb_lantern_colored = new ColoredMaterial(BulbVineLanternColoredBlock::new, bulb_lantern, false); bulb_lantern_colored = new ColoredMaterial(BulbVineLanternColoredBlock::new, bulb_lantern, false);
nugget = EndItems.registerEndItem(name + "_nugget", new ModelProviderItem(itemSettings)); nugget = EndItems.registerEndItem(name + "_nugget", new ModelProviderItem(itemSettings));
ingot = EndItems.registerEndItem(name + "_ingot", new ModelProviderItem(itemSettings)); ingot = EndItems.registerEndItem(name + "_ingot", new ModelProviderItem(itemSettings));
shovelHead = EndItems.registerEndItem(name + "_shovel_head"); shovelHead = EndItems.registerEndItem(name + "_shovel_head");
pickaxeHead = EndItems.registerEndItem(name + "_pickaxe_head"); pickaxeHead = EndItems.registerEndItem(name + "_pickaxe_head");
axeHead = EndItems.registerEndItem(name + "_axe_head"); axeHead = EndItems.registerEndItem(name + "_axe_head");
hoeHead = EndItems.registerEndItem(name + "_hoe_head"); hoeHead = EndItems.registerEndItem(name + "_hoe_head");
swordBlade = EndItems.registerEndItem(name + "_sword_blade"); swordBlade = EndItems.registerEndItem(name + "_sword_blade");
swordHandle = EndItems.registerEndItem(name + "_sword_handle"); swordHandle = EndItems.registerEndItem(name + "_sword_handle");
shovel = EndItems.registerEndTool(name + "_shovel", new BaseShovelItem(material, 1.5F, -3.0F, itemSettings)); shovel = EndItems.registerEndTool(name + "_shovel", new BaseShovelItem(material, 1.5F, -3.0F, itemSettings));
sword = EndItems.registerEndTool(name + "_sword", new BaseSwordItem(material, 3, -2.4F, itemSettings)); sword = EndItems.registerEndTool(name + "_sword", new BaseSwordItem(material, 3, -2.4F, itemSettings));
pickaxe = EndItems.registerEndTool(name + "_pickaxe", new EndPickaxe(material, 1, -2.8F, itemSettings)); pickaxe = EndItems.registerEndTool(name + "_pickaxe", new EndPickaxe(material, 1, -2.8F, itemSettings));
axe = EndItems.registerEndTool(name + "_axe", new BaseAxeItem(material, 6.0F, -3.0F, itemSettings)); axe = EndItems.registerEndTool(name + "_axe", new BaseAxeItem(material, 6.0F, -3.0F, itemSettings));
hoe = EndItems.registerEndTool(name + "_hoe", new BaseHoeItem(material, -3, 0.0F, itemSettings)); hoe = EndItems.registerEndTool(name + "_hoe", new BaseHoeItem(material, -3, 0.0F, itemSettings));
hammer = EndItems.registerEndTool( hammer = EndItems.registerEndTool(
name + "_hammer", name + "_hammer",
new EndHammerItem(material, 5.0F, -3.2F, 0.3D, itemSettings) new EndHammerItem(material, 5.0F, -3.2F, 0.3D, itemSettings)
); );
forgedPlate = EndItems.registerEndItem(name + "_forged_plate"); forgedPlate = EndItems.registerEndItem(name + "_forged_plate");
helmet = EndItems.registerEndItem(name + "_helmet", new EndArmorItem(armor, EquipmentSlot.HEAD, itemSettings)); helmet = EndItems.registerEndItem(name + "_helmet", new EndArmorItem(armor, EquipmentSlot.HEAD, itemSettings));
chestplate = EndItems.registerEndItem( chestplate = EndItems.registerEndItem(
name + "_chestplate", name + "_chestplate",
new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings) new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings)
); );
leggings = EndItems.registerEndItem( leggings = EndItems.registerEndItem(
name + "_leggings", name + "_leggings",
new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings) new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings)
); );
boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, EquipmentSlot.FEET, itemSettings)); boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, EquipmentSlot.FEET, itemSettings));
anvilBlock = EndBlocks.registerBlock( anvilBlock = EndBlocks.registerBlock(
name + "_anvil", name + "_anvil",
new EndAnvilBlock(this, block.defaultMaterialColor(), level) new EndAnvilBlock(this, block.defaultMaterialColor(), level)
); );
if (hasOre) { if (hasOre) {
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_ore", ore, ingot) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_ore", ore, ingot)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_ingot") .setGroup("end_ingot")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_raw", rawOre, ingot) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_raw", rawOre, ingot)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_ingot") .setGroup("end_ingot")
.buildWithBlasting(); .buildWithBlasting();
AlloyingRecipe.Builder.create(name + "_ingot_alloy") AlloyingRecipe.Builder.create(name + "_ingot_alloy")
.setInput(alloyingOre, alloyingOre) .setInput(alloyingOre, alloyingOre)
.setOutput(ingot, 3) .setOutput(ingot, 3)
.setExpiriense(2.1F) .setExpiriense(2.1F)
.build(); .build();
} }
// Basic recipes // Basic recipes
GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot) GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', nugget) .addMaterial('#', nugget)
.setGroup("end_metal_ingots_nug") .setGroup("end_metal_ingots_nug")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget) GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .setList("#")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_nuggets_ing") .setGroup("end_metal_nuggets_ing")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block) GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "###", "###") .setShape("###", "###", "###")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_blocks") .setGroup("end_metal_blocks")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot) GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .setList("#")
.addMaterial('#', block) .addMaterial('#', block)
.setGroup("end_metal_ingots") .setGroup("end_metal_ingots")
.build(); .build();
// Block recipes // Block recipes
GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile) GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', block) .addMaterial('#', block)
.setGroup("end_metal_tiles") .setGroup("end_metal_tiles")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars) GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(16) .setOutputCount(16)
.setShape("###", "###") .setShape("###", "###")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_bars") .setGroup("end_metal_bars")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate) GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("##") .setShape("##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_plates") .setGroup("end_metal_plates")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door) GridRecipe.make(BetterEnd.MOD_ID, name + "_door", door)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(3) .setOutputCount(3)
.setShape("##", "##", "##") .setShape("##", "##", "##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_doors") .setGroup("end_metal_doors")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor) GridRecipe.make(BetterEnd.MOD_ID, name + "_trapdoor", trapdoor)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("##", "##") .setShape("##", "##")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.setGroup("end_metal_trapdoors") .setGroup("end_metal_trapdoors")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs) GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(4) .setOutputCount(4)
.setShape("# ", "## ", "###") .setShape("# ", "## ", "###")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.setGroup("end_metal_stairs") .setGroup("end_metal_stairs")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab) GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setOutputCount(6) .setOutputCount(6)
.setShape("###") .setShape("###")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.setGroup("end_metal_slabs") .setGroup("end_metal_slabs")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain) GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("N", "#", "N") .setShape("N", "#", "N")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.addMaterial('N', nugget) .addMaterial('N', nugget)
.setGroup("end_metal_chain") .setGroup("end_metal_chain")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock) GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", " I ", "III") .setShape("###", " I ", "III")
.addMaterial('#', block, tile) .addMaterial('#', block, tile)
.addMaterial('I', ingot) .addMaterial('I', ingot)
.setGroup("end_metal_anvil") .setGroup("end_metal_anvil")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern) GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("C", "I", "#") .setShape("C", "I", "#")
.addMaterial('C', chain) .addMaterial('C', chain)
.addMaterial('I', ingot) .addMaterial('I', ingot)
.addMaterial('#', EndItems.GLOWING_BULB) .addMaterial('#', EndItems.GLOWING_BULB)
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier) GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("I#I", " # ") .setShape("I#I", " # ")
.addMaterial('#', ingot) .addMaterial('#', ingot)
.addMaterial('I', EndItems.LUMECORN_ROD) .addMaterial('I', EndItems.LUMECORN_ROD)
.setGroup("end_metal_chandelier") .setGroup("end_metal_chandelier")
.build(); .build();
// Tools & armor into nuggets // Tools & armor into nuggets
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_axe_nugget", axe, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_axe_nugget", axe, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hoe_nugget", hoe, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hoe_nugget", hoe, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_pickaxe_nugget", pickaxe, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_pickaxe_nugget", pickaxe, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_sword_nugget", sword, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_sword_nugget", sword, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hammer_nugget", hammer, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hammer_nugget", hammer, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_helmet_nugget", helmet, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_helmet_nugget", helmet, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_chestplate_nugget", chestplate, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_chestplate_nugget", chestplate, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_leggings_nugget", leggings, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_leggings_nugget", leggings, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_boots_nugget", boots, nugget) FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_boots_nugget", boots, nugget)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setGroup("end_nugget") .setGroup("end_nugget")
.buildWithBlasting(); .buildWithBlasting();
// Tool parts from ingots // Tool parts from ingots
AnvilRecipe.create(name + "_shovel_head") AnvilRecipe.create(name + "_shovel_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setOutput(shovelHead) .setOutput(shovelHead)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
AnvilRecipe.create(name + "_pickaxe_head") AnvilRecipe.create(name + "_pickaxe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setInputCount(3) .setInputCount(3)
.setOutput(pickaxeHead) .setOutput(pickaxeHead)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
AnvilRecipe.create(name + "_axe_head") AnvilRecipe.create(name + "_axe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setInputCount(3) .setInputCount(3)
.setOutput(axeHead) .setOutput(axeHead)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
AnvilRecipe.create(name + "_hoe_head") AnvilRecipe.create(name + "_hoe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setInputCount(2) .setInputCount(2)
.setOutput(hoeHead) .setOutput(hoeHead)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
AnvilRecipe.create(name + "_sword_blade") AnvilRecipe.create(name + "_sword_blade")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setOutput(swordBlade) .setOutput(swordBlade)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
AnvilRecipe.create(name + "_forged_plate") AnvilRecipe.create(name + "_forged_plate")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(ingot) .setInput(ingot)
.setOutput(forgedPlate) .setOutput(forgedPlate)
.setAnvilLevel(level) .setAnvilLevel(level)
.setToolLevel(level) .setToolLevel(level)
.setDamage(level) .setDamage(level)
.build(); .build();
// Tools from parts // Tools from parts
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hammer") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hammer")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(hammer) .setResult(hammer)
.setBase(block) .setBase(block)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_axe") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_axe")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(axe) .setResult(axe)
.setBase(axeHead) .setBase(axeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_pickaxe") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_pickaxe")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(pickaxe) .setResult(pickaxe)
.setBase(pickaxeHead) .setBase(pickaxeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hoe") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hoe")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(hoe) .setResult(hoe)
.setBase(hoeHead) .setBase(hoeHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword_handle") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword_handle")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(swordHandle) .setResult(swordHandle)
.setBase(ingot) .setBase(ingot)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(sword) .setResult(sword)
.setBase(swordBlade) .setBase(swordBlade)
.setAddition(swordHandle) .setAddition(swordHandle)
.build(); .build();
SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_shovel") SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_shovel")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setResult(shovel) .setResult(shovel)
.setBase(shovelHead) .setBase(shovelHead)
.setAddition(Items.STICK) .setAddition(Items.STICK)
.build(); .build();
// Armor crafting // Armor crafting
GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet) GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #") .setShape("###", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_helmets") .setGroup("end_metal_helmets")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate) GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "###", "###") .setShape("# #", "###", "###")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_chestplates") .setGroup("end_metal_chestplates")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings) GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("###", "# #", "# #") .setShape("###", "# #", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_leggings") .setGroup("end_metal_leggings")
.build(); .build();
GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots) GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots)
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setShape("# #", "# #") .setShape("# #", "# #")
.addMaterial('#', forgedPlate) .addMaterial('#', forgedPlate)
.setGroup("end_metal_boots") .setGroup("end_metal_boots")
.build(); .build();
TagAPI.addTag(BlockTags.ANVIL, anvilBlock); TagAPI.addTag(BlockTags.ANVIL, anvilBlock);
TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, block); TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, block);
TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, ingot); TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, ingot);
TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, ore, bars); TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, ore, bars);
TagAPI.addTag(TagAPI.ITEM_HAMMERS, hammer); TagAPI.addTag(TagAPI.ITEM_HAMMERS, hammer);
} }
} }

View file

@ -26,7 +26,7 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor; 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.EndBiomes;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;

View file

@ -27,7 +27,7 @@ import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.block.Blocks; 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.EndBiomes;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;

View file

@ -33,8 +33,8 @@ import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.ServerLevelAccessor;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import ru.bclib.api.BiomeAPI;
import ru.bclib.api.TagAPI; import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.biomes.BCLBiome;

View file

@ -4,9 +4,9 @@ import net.minecraft.core.MappedRegistry;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import ru.bclib.api.BiomeAPI;
import ru.bclib.api.TagAPI; 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; import ru.bclib.world.features.BCLFeature;
public class EnderscapeIntegration extends ModIntegration { public class EnderscapeIntegration extends ModIntegration {
@ -36,7 +36,9 @@ public class EnderscapeIntegration extends ModIntegration {
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> { BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
if (!biomeID.getNamespace().equals("enderscape")) { if (!biomeID.getNamespace().equals("enderscape")) {
BiomeAPI.addBiomeFeatures(biome, scatteredShadowQuartzOre, voidNebuliteOre, nebuliteOre); BiomeAPI.addBiomeFeature(biome, scatteredShadowQuartzOre);
BiomeAPI.addBiomeFeature(biome, voidNebuliteOre);
BiomeAPI.addBiomeFeature(biome, nebuliteOre);
} }
}); });

View file

@ -2,7 +2,7 @@ package ru.betterend.integration;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import ru.bclib.integration.ModIntegration; import ru.bclib.integration.modmenu.ModIntegration;
import ru.bclib.util.ColorUtil; import ru.bclib.util.ColorUtil;
import ru.betterend.blocks.HydraluxPetalColoredBlock; import ru.betterend.blocks.HydraluxPetalColoredBlock;
import ru.betterend.complexmaterials.ColoredMaterial; import ru.betterend.complexmaterials.ColoredMaterial;

View file

@ -5,7 +5,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import ru.bclib.api.ModIntegrationAPI; import ru.bclib.api.ModIntegrationAPI;
import ru.bclib.integration.ModIntegration; import ru.bclib.integration.modmenu.ModIntegration;
import ru.bclib.recipes.GridRecipe; import ru.bclib.recipes.GridRecipe;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.config.Configs; import ru.betterend.config.Configs;

View file

@ -3,7 +3,7 @@ package ru.betterend.integration;
import net.minecraft.tags.Tag; import net.minecraft.tags.Tag;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import ru.bclib.api.TagAPI; import ru.bclib.api.TagAPI;
import ru.bclib.integration.ModIntegration; import ru.bclib.integration.modmenu.ModIntegration;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class NourishIntegration extends ModIntegration { public class NourishIntegration extends ModIntegration {

View file

@ -1,12 +1,7 @@
package ru.betterend.integration.byg; package ru.betterend.integration.byg;
import net.minecraft.world.level.block.Block; import ru.bclib.integration.modmenu.ModIntegration;
import ru.bclib.api.TagAPI;
import ru.bclib.integration.ModIntegration;
import ru.betterend.integration.EndBiomeIntegration; 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 class BYGIntegration extends ModIntegration implements EndBiomeIntegration {
public BYGIntegration() { public BYGIntegration() {
@ -15,61 +10,17 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
@Override @Override
public void init() { public void init() {
Block block = Integrations.BYG.getBlock("ivis_phylium"); /*Block block = Integrations.BYG.getBlock("ivis_phylium");
if (block != null) { if (block != null) {
TagAPI.addTags(block, TagAPI.BLOCK_END_GROUND, TagAPI.BLOCK_GEN_TERRAIN); TagAPI.addTags(block, TagAPI.BLOCK_END_GROUND, TagAPI.BLOCK_GEN_TERRAIN);
} }
BYGBlocks.register(); BYGBlocks.register();
BYGFeatures.register(); BYGFeatures.register();
BYGBiomes.register(); BYGBiomes.register();*/
} }
@Override @Override
public void addBiomes() { public void addBiomes() {
BYGBiomes.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);
}
});
}
}
}
});
}*/
} }
} }

View file

@ -1,5 +1,6 @@
package ru.betterend.integration.byg.biomes; package ru.betterend.integration.byg.biomes;
import ru.betterend.BetterEnd;
import ru.betterend.integration.Integrations; import ru.betterend.integration.Integrations;
import ru.betterend.registry.EndBiomes; import ru.betterend.registry.EndBiomes;
import ru.betterend.world.biome.EndBiome; 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 final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
public static void register() { public static void register() {
System.out.println("Registered " + OLD_BULBIS_GARDENS); BetterEnd.LOGGER.info("Registered " + OLD_BULBIS_GARDENS);
} }
public static void addBiomes() { public static void addBiomes() {

View file

@ -2,14 +2,15 @@ package ru.betterend.integration.byg.biomes;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvent; 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.entity.MobCategory;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeSpecialEffects; import net.minecraft.world.level.biome.BiomeSpecialEffects;
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData; import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import ru.bclib.BCLib; 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.Integrations;
import ru.betterend.integration.byg.features.BYGFeatures; import ru.betterend.integration.byg.features.BYGFeatures;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
@ -17,53 +18,67 @@ import ru.betterend.world.biome.EndBiome;
import java.util.List; import java.util.List;
public class NightshadeRedwoods extends EndBiome { public class NightshadeRedwoods extends EndBiome.Config {
public NightshadeRedwoods() { public NightshadeRedwoods() {
super(makeDef()); super("nightshade_redwoods");
} }
private static BCLBiomeDef makeDef() { @Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
Biome biome = Integrations.BYG.getBiome("nightshade_forest"); Biome biome = Integrations.BYG.getBiome("nightshade_forest");
BiomeSpecialEffects effects = biome.getSpecialEffects(); BiomeSpecialEffects effects = biome.getSpecialEffects();
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47) builder.fogColor(140, 108, 47)
.setFogDensity(1.5F) .fogDensity(1.5F)
.setWaterAndFogColor(55, 70, 186) .waterAndFogColor(55, 70, 186)
.setFoliageColor(122, 17, 155) .foliageColor(122, 17, 155)
.setParticles( .particles(
ParticleTypes.REVERSE_PORTAL, ParticleTypes.REVERSE_PORTAL,
0.002F 0.002F
) )
.setSurface(biome.getGenerationSettings() //TODO: 1.18 surface rules
.getSurfaceBuilder() // .setSurface(biome.getGenerationSettings()
.get()) // .getSurfaceBuilder()
.setGrassColor(48, 13, 89) // .get())
.setPlantsColor(200, 125, 9) .grassColor(48, 13, 89)
.addFeature(EndFeatures.END_LAKE_RARE) .plantsColor(200, 125, 9)
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD) .feature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS); .feature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
.feature(BYGFeatures.NIGHTSHADE_MOSS);
if (BCLib.isClient()) { if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); SoundEvent loop = effects.getAmbientLoopSoundEvent()
SoundEvent music = effects.getBackgroundMusic().get().getEvent(); .get();
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent(); SoundEvent music = effects.getBackgroundMusic()
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent(); .get()
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood); .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()
list.forEach((feature) -> { .features()
def.addFeature(Decoration.VEGETAL_DECORATION, feature.get()); .forEach((list) -> {
}); list.forEach((feature) -> {
}); builder.feature(Decoration.VEGETAL_DECORATION, feature.get());
});
});
for (MobCategory group : MobCategory.values()) { for (MobCategory group : MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap(); List<SpawnerData> list = biome.getMobSettings()
.getMobs(group)
.unwrap();
list.forEach((entry) -> { list.forEach((entry) -> {
def.addMobSpawn(entry); builder.spawn((EntityType<? extends Mob>) entry.type, 1, entry.minCount, entry.maxCount);
}); });
} }
return def;
} }
} }

View file

@ -3,19 +3,19 @@ package ru.betterend.integration.byg.biomes;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.BuiltinRegistries; import net.minecraft.data.BuiltinRegistries;
import net.minecraft.data.worldgen.Features;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent; 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.entity.MobCategory;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeSpecialEffects; import net.minecraft.world.level.biome.BiomeSpecialEffects;
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData; import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
import ru.bclib.BCLib; import ru.bclib.BCLib;
import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.integration.Integrations; import ru.betterend.integration.Integrations;
import ru.betterend.integration.byg.features.BYGFeatures; import ru.betterend.integration.byg.features.BYGFeatures;
@ -25,83 +25,93 @@ import ru.betterend.world.biome.EndBiome;
import java.util.List; import java.util.List;
import java.util.function.Supplier; 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() { 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"); Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
BiomeSpecialEffects effects = biome.getSpecialEffects(); BiomeSpecialEffects effects = biome.getSpecialEffects();
Block ivis = Integrations.BYG.getBlock("ivis_phylium"); Block ivis = Integrations.BYG.getBlock("ivis_phylium");
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock(); // Block origin = biome.getGenerationSettings()
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207) // .getSurfaceBuilderConfig()
.setFogDensity(1.8F) // .getTopMaterial()
.setWaterAndFogColor(40, 0, 56) // .getBlock();
.setFoliageColor(122, 17, 155) builder.fogColor(215, 132, 207)
.setParticles( .fogDensity(1.8F)
ParticleTypes.REVERSE_PORTAL, .waterAndFogColor(40, 0, 56)
0.002F .foliageColor(122, 17, 155)
) .particles(
.setSurface(ivis, origin) ParticleTypes.REVERSE_PORTAL,
.addFeature(EndFeatures.END_LAKE_RARE) 0.002F
.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()) { if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); SoundEvent loop = effects.getAmbientLoopSoundEvent()
SoundEvent music = effects.getBackgroundMusic().get().getEvent(); .get();
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent(); SoundEvent music = effects.getBackgroundMusic()
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent(); .get()
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood); .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()) { for (MobCategory group : MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap(); List<SpawnerData> list = biome.getMobSettings()
.getMobs(group)
.unwrap();
list.forEach((entry) -> { 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<List<Supplier<PlacedFeature>>> features = biome.getGenerationSettings()
List<Supplier<ConfiguredFeature<?, ?>>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal()); .features();
List<Supplier<PlacedFeature>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
if (vegetal.size() > 2) { if (vegetal.size() > 2) {
Supplier<ConfiguredFeature<?, ?>> getter; Supplier<PlacedFeature> getter;
// Trees (first two features) // Trees (first two features)
// I couldn't process them with conditions, so that's why they are hardcoded (paulevs) // I couldn't process them with conditions, so that's why they are hardcoded (paulevs)
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
getter = vegetal.get(i); getter = vegetal.get(i);
ConfiguredFeature<?, ?> feature = getter.get(); PlacedFeature feature = getter.get();
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i); ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
feature = Registry.register( feature = Registry.register(
BuiltinRegistries.CONFIGURED_FEATURE, BuiltinRegistries.PLACED_FEATURE,
id, 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 // Grasses and other features
for (int i = 2; i < vegetal.size(); i++) { for (int i = 2; i < vegetal.size(); i++) {
getter = vegetal.get(i); getter = vegetal.get(i);
ConfiguredFeature<?, ?> feature = getter.get(); PlacedFeature feature = getter.get();
def.addFeature(Decoration.VEGETAL_DECORATION, feature); builder.feature(Decoration.VEGETAL_DECORATION, feature);
} }
} }
def.addFeature(EndFeatures.PURPLE_POLYPORE) builder.feature(EndFeatures.PURPLE_POLYPORE)
.addFeature(BYGFeatures.IVIS_MOSS_WOOD) .feature(BYGFeatures.IVIS_MOSS_WOOD)
.addFeature(BYGFeatures.IVIS_MOSS) .feature(BYGFeatures.IVIS_MOSS)
.addFeature(BYGFeatures.IVIS_VINE) .feature(BYGFeatures.IVIS_VINE)
.addFeature(BYGFeatures.IVIS_SPROUT); .feature(BYGFeatures.IVIS_SPROUT);
return def;
} }
} }

View file

@ -7,7 +7,7 @@ import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle; import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Widget; import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets; 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.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.EntryStack;
@ -20,7 +20,7 @@ import ru.betterend.registry.EndBlocks;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.List; import java.util.List;
public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingDisplay> { public class REIAlloyingCategory implements DisplayCategory<REIAlloyingDisplay> {
private final EntryStack ICON; private final EntryStack ICON;
REIAlloyingCategory(EntryStack icon) { REIAlloyingCategory(EntryStack icon) {
@ -81,8 +81,9 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
.markOutput()); .markOutput());
return widgets; return widgets;
} }
@Override //TODO: 1.18 REI find replacement
//@Override
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display, IntList redSlots) { public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display, IntList redSlots) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27); Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
matrices.pushPose(); matrices.pushPose();

View file

@ -7,7 +7,7 @@ import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle; import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Widget; import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets; 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.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.EntryStack;
@ -25,7 +25,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay> { public class REIAnvilCategory implements DisplayCategory<REIAnvilDisplay> {
private final EntryStack<?>[] ANVILS; private final EntryStack<?>[] ANVILS;
REIAnvilCategory(EntryStack<?>[] anvils) { REIAnvilCategory(EntryStack<?>[] anvils) {
@ -85,8 +85,9 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
return widgets; return widgets;
} }
@Override //TODO: 1.18 REI, find replacement
//@Override
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display, IntList redSlots) { public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display, IntList redSlots) {
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27); Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
matrices.pushPose(); matrices.pushPose();

View file

@ -1,13 +1,11 @@
package ru.betterend.integration.rei; package ru.betterend.integration.rei;
import com.google.common.collect.Lists; 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.Point;
import me.shedaniel.math.Rectangle; import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Widget; import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets; 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.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.entry.EntryIngredient;
import me.shedaniel.rei.api.common.entry.EntryStack; import me.shedaniel.rei.api.common.entry.EntryStack;
@ -21,7 +19,7 @@ import ru.betterend.registry.EndBlocks;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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 static ResourceLocation BACKGROUND = BetterEnd.makeID("textures/gui/rei_infusion.png");
private final EntryStack ICON; private final EntryStack ICON;
@ -109,7 +107,4 @@ public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionD
public int getDisplayHeight() { public int getDisplayHeight() {
return 104; return 104;
} }
@Override
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIInfusionDisplay display, IntList redSlots) {}
} }

View file

@ -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.category.CategoryRegistry;
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
import me.shedaniel.rei.api.common.category.CategoryIdentifier; 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.entry.EntryStack;
import me.shedaniel.rei.api.common.util.EntryIngredients; import me.shedaniel.rei.api.common.util.EntryIngredients;
import me.shedaniel.rei.api.common.util.EntryStacks; import me.shedaniel.rei.api.common.util.EntryStacks;
import me.shedaniel.rei.plugin.common.DefaultPlugin; import me.shedaniel.rei.plugin.common.DefaultPlugin;
import net.fabricmc.fabric.impl.content.registry.FuelRegistryImpl;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.BlastingRecipe; 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.recipe.builders.InfusionRecipe;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -54,13 +51,14 @@ public class REIPlugin implements REIClientPlugin {
registry.registerRecipeFiller(BlastingRecipe.class, RecipeType.BLASTING, REIBlastingDisplay::new); registry.registerRecipeFiller(BlastingRecipe.class, RecipeType.BLASTING, REIBlastingDisplay::new);
registry.registerRecipeFiller(AnvilRecipe.class, AnvilRecipe.TYPE, REIAnvilDisplay::new); registry.registerRecipeFiller(AnvilRecipe.class, AnvilRecipe.TYPE, REIAnvilDisplay::new);
registry.registerRecipeFiller(InfusionRecipe.class, InfusionRecipe.TYPE, REIInfusionDisplay::new); registry.registerRecipeFiller(InfusionRecipe.class, InfusionRecipe.TYPE, REIInfusionDisplay::new);
FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> { //TODO: 1.18 REI fix this
if (time >= 2000) { // FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
final List<EntryIngredient> list = Collections.singletonList(EntryIngredients.of(item)); // if (time >= 2000) {
registry.add(new REIAlloyingFuelDisplay(list, time)); // final List<EntryIngredient> list = Collections.singletonList(EntryIngredients.of(item));
} // registry.add(new REIAlloyingFuelDisplay(list, time));
}); // }
// });
} }
@Override @Override

View file

@ -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>> getEND_CITY();
}

View file

@ -0,0 +1,5 @@
package ru.betterend.interfaces;
public interface TargetChecker {
boolean isTarget();
}

View file

@ -15,7 +15,6 @@ import ru.bclib.items.ModelProviderItem;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
import ru.betterend.util.LangUtil; import ru.betterend.util.LangUtil;
import vazkii.patchouli.api.PatchouliAPI;
import java.util.List; import java.util.List;
@ -33,7 +32,8 @@ public class GuideBookItem extends ModelProviderItem {
@Override @Override
public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) { public InteractionResultHolder<ItemStack> use(Level world, Player user, InteractionHand hand) {
if (!world.isClientSide && user instanceof ServerPlayer) { 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.success(user.getItemInHand(hand));
} }
return InteractionResultHolder.consume(user.getItemInHand(hand)); return InteractionResultHolder.consume(user.getItemInHand(hand));

View file

@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 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.client.ClientOptions;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
@ -90,9 +90,10 @@ public abstract class MusicTrackerMixin {
} }
private boolean be_shouldChangeSound(Music musicSound) { private boolean be_shouldChangeSound(Music musicSound) {
return currentMusic != null && !musicSound.getEvent() return currentMusic != null && !musicSound
.getLocation() .getEvent()
.equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic(); .getLocation()
.equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic();
} }
private boolean be_checkNullSound(Music musicSound) { private boolean be_checkNullSound(Music musicSound) {

View file

@ -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);
}

View file

@ -2,12 +2,13 @@ package ru.betterend.mixin.common;
import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor; 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.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.WorldgenRandom; 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.EndCityFeature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; 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.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; 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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
import java.util.Optional;
import java.util.Random;
@Mixin(EndCityFeature.class) @Mixin(EndCityFeature.class)
public class EndCityFeatureMixin { public class EndCityFeatureMixin {
@Inject(method = "isFeatureChunk", at = @At("HEAD"), cancellable = true) @Inject(method = "pieceGeneratorSupplier", 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) { 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()) { if (GeneratorOptions.useNewGenerator()) {
int chance = GeneratorOptions.getEndCityFailChance(); int chance = GeneratorOptions.getEndCityFailChance();
if (chance == 0) { if (chance == 0 || chunkRandom.nextInt(chance) == 0) {
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60); if (!(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60)){
info.cancel(); info.cancel();
} info.setReturnValue(Optional.empty());
else if (chunkRandom.nextInt(chance) == 0) { }
info.setReturnValue(getYPositionForFeature(pos, chunkGenerator, levelHeightAccessor) >= 60);
info.cancel();
} }
else { else {
info.setReturnValue(false); info.setReturnValue(Optional.empty());
info.cancel(); info.cancel();
} }
} }

View file

@ -23,6 +23,7 @@ import ru.bclib.util.StructureHelper;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
import java.util.Optional;
import java.util.Random; import java.util.Random;
@Mixin(EndPodiumFeature.class) @Mixin(EndPodiumFeature.class)
@ -56,7 +57,8 @@ public class EndPodiumFeatureMixin {
private FeaturePlaceContext<NoneFeatureConfiguration> be_setPosOnGround(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) { private FeaturePlaceContext<NoneFeatureConfiguration> be_setPosOnGround(FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext) {
WorldGenLevel world = featurePlaceContext.level(); WorldGenLevel world = featurePlaceContext.level();
BlockPos pos = be_updatePortalPos(world); BlockPos pos = be_updatePortalPos(world);
return new FeaturePlaceContext<>( return new FeaturePlaceContext<NoneFeatureConfiguration>(
Optional.empty(),
world, world,
featurePlaceContext.chunkGenerator(), featurePlaceContext.chunkGenerator(),
featurePlaceContext.random(), featurePlaceContext.random(),

View file

@ -66,8 +66,6 @@ public abstract class EntityMixin implements TeleportingEntity {
entity.getXRot() entity.getXRot()
); );
entity.setDeltaMovement(teleportTarget.speed); entity.setDeltaMovement(teleportTarget.speed);
//TODO: check if this works as intended in 1.17
destination.addDuringTeleport(entity); destination.addDuringTeleport(entity);
} }

View file

@ -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();
}
}
}

View file

@ -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();
}

View 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;
}
}

View file

@ -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);
}
}
}

View file

@ -1,7 +1,6 @@
package ru.betterend.mixin.common; package ru.betterend.mixin.common;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer; 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.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.DimensionType; 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.ServerLevelData;
import net.minecraft.world.level.storage.WritableLevelData; import net.minecraft.world.level.storage.WritableLevelData;
import org.spongepowered.asm.mixin.Mixin; 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.ModifyArg;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 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.BetterEnd;
import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
import ru.betterend.world.generator.TerrainGenerator;
import java.util.List; import java.util.List;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
@ -35,21 +34,29 @@ import java.util.function.Supplier;
@Mixin(ServerLevel.class) @Mixin(ServerLevel.class)
public abstract class ServerLevelMixin extends Level { 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) { 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); 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;
// }
//
// 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")) @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) { 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) {
if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) { ServerLevel level = ServerLevel.class.cast(this);
return; if (level.dimension() == Level.END) {
TerrainGenerator.initNoise(seed, chunkGenerator.getBiomeSource(), chunkGenerator.climateSampler());
} }
be_lastWorld = session.getLevelId();
ServerLevel world = ServerLevel.class.cast(this);
EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY));
} }
@Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true) @Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true)

View file

@ -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>> getEND_CITY(){
return END_CITY;
}
}

View file

@ -3,6 +3,7 @@ package ru.betterend.mixin.common;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.server.level.WorldGenRegion; import net.minecraft.server.level.WorldGenRegion;
import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.ChunkAccess;
import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@ -14,13 +15,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
public class WorldGenRegionMixin { public class WorldGenRegionMixin {
@Final @Final
@Shadow @Shadow
private ChunkPos center; private ChunkAccess center;
@Inject(method = "ensureCanWrite", at = @At("HEAD"), cancellable = true) @Inject(method = "ensureCanWrite", at = @At("HEAD"), cancellable = true)
private void be_alterBlockCheck(BlockPos blockPos, CallbackInfoReturnable<Boolean> info) { private void be_alterBlockCheck(BlockPos blockPos, CallbackInfoReturnable<Boolean> info) {
ChunkPos cPos = center.getPos();
int x = blockPos.getX() >> 4; int x = blockPos.getX() >> 4;
int z = blockPos.getZ() >> 4; int z = blockPos.getZ() >> 4;
WorldGenRegion region = (WorldGenRegion) (Object) this; 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);
} }
} }

View file

@ -7,78 +7,78 @@ import ru.betterend.item.material.EndToolMaterial;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class AnvilRecipes { public class AnvilRecipes {
public static void register() { public static void register() {
AnvilRecipe.create("ender_pearl_to_dust") AnvilRecipe.create("ender_pearl_to_dust")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(Items.ENDER_PEARL) .setInput(Items.ENDER_PEARL)
.setOutput(EndItems.ENDER_DUST) .setOutput(EndItems.ENDER_DUST)
.setToolLevel(4) .setToolLevel(4)
.setDamage(5) .setDamage(5)
.build(); .build();
AnvilRecipe.create("ender_shard_to_dust") AnvilRecipe.create("ender_shard_to_dust")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.ENDER_SHARD) .setInput(EndItems.ENDER_SHARD)
.setOutput(EndItems.ENDER_DUST) .setOutput(EndItems.ENDER_DUST)
.setToolLevel(0) .setToolLevel(0)
.setDamage(3) .setDamage(3)
.build(); .build();
int anvilLevel = EndToolMaterial.AETERNIUM.getLevel(); int anvilLevel = EndToolMaterial.AETERNIUM.getLevel();
AnvilRecipe.create("aeternium_axe_head") AnvilRecipe.create("aeternium_axe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_AXE_HEAD) .setOutput(EndItems.AETERNIUM_AXE_HEAD)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_pickaxe_head") AnvilRecipe.create("aeternium_pickaxe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_PICKAXE_HEAD) .setOutput(EndItems.AETERNIUM_PICKAXE_HEAD)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_shovel_head") AnvilRecipe.create("aeternium_shovel_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_SHOVEL_HEAD) .setOutput(EndItems.AETERNIUM_SHOVEL_HEAD)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_hoe_head") AnvilRecipe.create("aeternium_hoe_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_HOE_HEAD) .setOutput(EndItems.AETERNIUM_HOE_HEAD)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_hammer_head") AnvilRecipe.create("aeternium_hammer_head")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_HAMMER_HEAD) .setOutput(EndItems.AETERNIUM_HAMMER_HEAD)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(EndToolMaterial.THALLASIUM.getLevel()) .setToolLevel(EndToolMaterial.THALLASIUM.getLevel())
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_sword_blade") AnvilRecipe.create("aeternium_sword_blade")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_SWORD_BLADE) .setOutput(EndItems.AETERNIUM_SWORD_BLADE)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
AnvilRecipe.create("aeternium_forged_plate") AnvilRecipe.create("aeternium_forged_plate")
.checkConfig(Configs.RECIPE_CONFIG) .checkConfig(Configs.RECIPE_CONFIG)
.setInput(EndItems.AETERNIUM_INGOT) .setInput(EndItems.AETERNIUM_INGOT)
.setOutput(EndItems.AETERNIUM_FORGED_PLATE) .setOutput(EndItems.AETERNIUM_FORGED_PLATE)
.setAnvilLevel(anvilLevel) .setAnvilLevel(anvilLevel)
.setToolLevel(anvilLevel) .setToolLevel(anvilLevel)
.setDamage(6) .setDamage(6)
.build(); .build();
} }
} }

View file

@ -2,13 +2,14 @@ package ru.betterend.registry;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.biome.Biome; 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.biomes.BCLBiome;
import ru.bclib.world.generator.BiomeMap;
import ru.bclib.world.generator.BiomePicker; import ru.bclib.world.generator.BiomePicker;
import ru.bclib.world.generator.map.hex.HexBiomeMap;
import ru.betterend.config.Configs; import ru.betterend.config.Configs;
import ru.betterend.util.FeaturesHelper;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.biome.air.BiomeIceStarfield; import ru.betterend.world.biome.air.BiomeIceStarfield;
import ru.betterend.world.biome.cave.EmptyAuroraCaveBiome; import ru.betterend.world.biome.cave.EmptyAuroraCaveBiome;
@ -41,7 +42,8 @@ import ru.betterend.world.generator.GeneratorOptions;
public class EndBiomes { public class EndBiomes {
public static final BiomePicker CAVE_BIOMES = new BiomePicker(); public static final BiomePicker CAVE_BIOMES = new BiomePicker();
private static BiomeMap caveBiomeMap; private static HexBiomeMap caveBiomeMap;
private static long lastSeed;
// Better End Land // Better End Land
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.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 LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome()); 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.getBiomes().forEach(biome -> biome.updateActualBiomes(registry));
CAVE_BIOMES.rebuild(); CAVE_BIOMES.rebuild();
if (caveBiomeMap == null || caveBiomeMap.getSeed() != seed) { if (caveBiomeMap == null || lastSeed != seed) {
caveBiomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES); caveBiomeMap = new HexBiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES);
lastSeed = seed;
} }
FeaturesHelper.addFeatures(registry);
} }
/** /**
* Put existing {@link EndBiome} as a sub-biome into selected parent. * 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 * @param parent - {@link EndBiome} to be linked with
* @return registered {@link EndBiome} * @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)) { if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerSubBiome(parent, biome); BiomeAPI.registerSubBiome(parent, biome);
} }
@ -102,11 +108,12 @@ public class EndBiomes {
/** /**
* Registers {@link EndBiome} and adds it into worldgen. * Registers {@link EndBiome} and adds it into worldgen.
* *
* @param biome - {@link EndBiome} instance * @param biomeConfig - {@link EndBiome.Config} instance
* @param type - {@link BiomeType} * @param type - {@link BiomeType}
* @return registered {@link EndBiome} * @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 (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
if (type == BiomeType.LAND) { if (type == BiomeType.LAND) {
BiomeAPI.registerEndLandBiome(biome); BiomeAPI.registerEndLandBiome(biome);
@ -121,10 +128,11 @@ public class EndBiomes {
/** /**
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it. * 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} * @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)) { if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerBiome(biome); 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)) { if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerBiome(biome); BiomeAPI.registerBiome(biome);
CAVE_BIOMES.addBiome(biome); CAVE_BIOMES.addBiome(biome);
@ -155,6 +164,6 @@ public class EndBiomes {
} }
public static EndCaveBiome getCaveBiome(int x, int z) { public static EndCaveBiome getCaveBiome(int x, int z) {
return (EndCaveBiome) caveBiomeMap.getBiome(x, z); return (EndCaveBiome) caveBiomeMap.getBiome(x, 5, z);
} }
} }

View file

@ -429,8 +429,8 @@ public class EndBlocks {
public static final Block SILK_MOTH_HIVE = registerBlock("silk_moth_hive", new SilkMothHiveBlock()); public static final Block SILK_MOTH_HIVE = registerBlock("silk_moth_hive", new SilkMothHiveBlock());
// Ores // // Ores //
public static final Block ENDER_ORE = registerBlock("ender_ore", new BaseOreBlock(EndItems.ENDER_SHARD, 1, 3, 5)); 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 AMBER_ORE = registerBlock("amber_ore", new BaseOreBlock(()->EndItems.RAW_AMBER, 1, 2, 4));
// Materials // // Materials //
public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal( public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal(

View file

@ -1,21 +1,20 @@
package ru.betterend.registry; package ru.betterend.registry;
import com.google.common.collect.Lists;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature; 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.FeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.placement.FeatureDecorator; import net.minecraft.world.level.levelgen.placement.CountPlacement;
import ru.bclib.api.BiomeAPI; 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.world.biomes.BCLBiome; import ru.bclib.world.biomes.BCLBiome;
import ru.bclib.world.biomes.BCLBiomeDef;
import ru.bclib.world.features.BCLFeature; import ru.bclib.world.features.BCLFeature;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
@ -81,11 +80,6 @@ import ru.betterend.world.features.trees.MossyGlowshroomFeature;
import ru.betterend.world.features.trees.PythadendronTreeFeature; import ru.betterend.world.features.trees.PythadendronTreeFeature;
import ru.betterend.world.features.trees.TenaneaFeature; import ru.betterend.world.features.trees.TenaneaFeature;
import ru.betterend.world.features.trees.UmbrellaTreeFeature; import ru.betterend.world.features.trees.UmbrellaTreeFeature;
import ru.betterend.world.generator.GeneratorOptions;
import ru.betterend.world.surface.UmbraSurfaceBuilder;
import java.util.List;
import java.util.function.Supplier;
public class EndFeatures { public class EndFeatures {
// Trees // // Trees //
@ -223,7 +217,8 @@ public class EndFeatures {
"umbralith_arch", "umbralith_arch",
new ArchFeature( new ArchFeature(
EndBlocks.UMBRALITH.stone, EndBlocks.UMBRALITH.stone,
UmbraSurfaceBuilder::getSurfaceState //TODO: 1.18 this needs to change to a dynamic block
(pos)->Blocks.END_STONE.defaultBlockState() //UmbraSurfaceBuilder::getSurfaceState
), ),
10); 10);
public static final BCLFeature THIN_UMBRALITH_ARCH = registerChanced("thin_umbralith_arch", new ThinArchFeature(EndBlocks.UMBRALITH.stone), 15); public static final BCLFeature THIN_UMBRALITH_ARCH = registerChanced("thin_umbralith_arch", new ThinArchFeature(EndBlocks.UMBRALITH.stone), 15);
@ -295,9 +290,7 @@ public class EndFeatures {
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) { 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); OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
ConfiguredFeature<?, ?> configured = layer PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
.configured(FeatureConfiguration.NONE)
.decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count)));
return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured); return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
} }
@ -305,75 +298,46 @@ public class EndFeatures {
return registerLayer(name, material.stone, radius, minY, maxY, count); 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) {
if (id.getNamespace().equals(BetterEnd.MOD_ID)) { if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
return; return;
} }
if (GeneratorOptions.removeChorusFromVanillaBiomes()) { BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
if (id.getNamespace().equals("minecraft")) { BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
String path = id.getPath(); BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
if (path.equals("end_highlands") || path.equals("end_midlands") || path.equals("small_end_islands")) { BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
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); BCLBiome bclbiome = BiomeAPI.getBiome(id);
boolean hasCaves = bclbiome.getCustomData("has_caves", true) && !(bclbiome instanceof EndCaveBiome); boolean hasCaves = bclbiome.getCustomData("has_caves", true) && !(bclbiome instanceof EndCaveBiome);
if (hasCaves && !BiomeAPI.END_VOID_BIOME_PICKER.containsImmutable(id)) { if (hasCaves && !BiomeAPI.END_VOID_BIOME_PICKER.containsImmutable(id)) {
if (Configs.BIOME_CONFIG.getBoolean(id, "hasCaves", true)) { if (Configs.BIOME_CONFIG.getBoolean(id, "hasCaves", true)) {
addFeature(ROUND_CAVE, features); // TODO replace caves with carvers
addFeature(TUNEL_CAVE, features); BiomeAPI.addBiomeFeature(biome, ROUND_CAVE);
BiomeAPI.addBiomeFeature(biome, TUNEL_CAVE);
} }
} }
BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature(); // TODO restore biome structures
/*BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature();
if (feature != null) { if (feature != null) {
addFeature(feature, features); addFeature(feature, features);
} }*/
} }
public static void addDefaultFeatures(BCLBiomeDef def) { public static BCLBiomeBuilder addDefaultFeatures(BCLBiomeBuilder builder, boolean hasCaves) {
def.addFeature(FLAVOLITE_LAYER); builder.feature(FLAVOLITE_LAYER);
def.addFeature(THALLASIUM_ORE); builder.feature(THALLASIUM_ORE);
def.addFeature(ENDER_ORE); builder.feature(ENDER_ORE);
def.addFeature(CRASHED_SHIP); builder.feature(CRASHED_SHIP);
if (def.getID().getPath().endsWith("_cave")) { // TODO replace cave features with carvers
return;
}
boolean hasCaves = def.getCustomData("has_caves", true);
hasCaves = Configs.BIOME_CONFIG.getBoolean(def.getID(), "hasCaves", hasCaves);
if (hasCaves) { if (hasCaves) {
def.addFeature(ROUND_CAVE); builder.feature(ROUND_CAVE);
def.addFeature(TUNEL_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() {} public static void register() {}

View file

@ -4,8 +4,8 @@ import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; 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 net.minecraft.world.level.levelgen.feature.StructurePieceType;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.world.structures.BCLStructureFeature; import ru.bclib.world.structures.BCLStructureFeature;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.world.structures.features.EternalPortalStructure; 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.PaintedMountainPiece;
import ru.betterend.world.structures.piece.VoxelPiece; import ru.betterend.world.structures.piece.VoxelPiece;
import java.util.Collection;
import java.util.function.Supplier;
public class EndStructures { public class EndStructures {
public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new); 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 MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new);
public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::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 LAKE_PIECE = register("lake_piece", LakePiece::new);
public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register( public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece", PaintedMountainPiece::new);
"painted_mountain_piece",
PaintedMountainPiece::new
);
public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new); public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new);
public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID( public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(
"giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); BetterEnd.makeID("giant_mossy_glowshroom"),
new GiantMossyGlowshroomStructure(),
Decoration.SURFACE_STRUCTURES,
16,
8
);
public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature( public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature(
BetterEnd.makeID("megalake"), BetterEnd.makeID("megalake"),
new MegaLakeStructure(), new MegaLakeStructure(),
@ -59,8 +58,13 @@ public class EndStructures {
3, 3,
2 2
); );
public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID( public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(
"painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2); BetterEnd.makeID("painted_mountain"),
new PaintedMountainStructure(),
Decoration.RAW_GENERATION,
3,
2
);
public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature( public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature(
BetterEnd.makeID("eternal_portal"), BetterEnd.makeID("eternal_portal"),
new EternalPortalStructure(), new EternalPortalStructure(),
@ -76,22 +80,15 @@ public class EndStructures {
8 8
); );
public static void register() { public static void register() {}
}
private static StructurePieceType register(String id, StructurePieceType pieceType) { private static StructurePieceType register(String id, StructurePieceType pieceType) {
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType); return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
} }
public static void registerBiomeStructures(ResourceLocation id, Biome biome, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) { public static void addBiomeStructures(ResourceLocation biomeID, Biome biome) {
if (!id.getPath().contains("mountain") && !id.getPath().contains("lake")) { if (!biomeID.getPath().contains("mountain") && !biomeID.getPath().contains("lake")) {
addStructure(ETERNAL_PORTAL, structures); BiomeAPI.addBiomeStructure(BiomeAPI.getBiomeKey(biome), ETERNAL_PORTAL);
} }
} }
private static void addStructure(BCLStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
structures.add(() -> {
return feature.getFeatureConfigured();
});
}
} }

View file

@ -13,12 +13,10 @@ import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import net.minecraft.world.level.biome.Biome; 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.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock; import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties; 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 net.minecraft.world.level.material.Material;
import ru.bclib.api.BonemealAPI; import ru.bclib.api.BonemealAPI;
import ru.bclib.api.ComposterAPI; 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); 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) { public static void addTerrainTags(Registry<Biome> biomeRegistry) {
biomeRegistry.forEach((biome) -> { /*biomeRegistry.forEach((biome) -> {
if (biome.getBiomeCategory() == BiomeCategory.THEEND) { if (biome.getBiomeCategory() == BiomeCategory.THEEND) {
SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig(); SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig();
Block under = config.getUnderMaterial().getBlock(); Block under = config.getUnderMaterial().getBlock();
@ -143,6 +142,6 @@ public class EndTags {
TagAPI.addTag(TagAPI.BLOCK_END_GROUND, surface); TagAPI.addTag(TagAPI.BLOCK_END_GROUND, surface);
} }
}); });
TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround); TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/
} }
} }

View file

@ -8,7 +8,6 @@ import net.minecraft.core.Registry;
import net.minecraft.core.particles.BlockParticleOption; import net.minecraft.core.particles.BlockParticleOption;
import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.Features;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils; import net.minecraft.nbt.NbtUtils;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -441,7 +440,8 @@ public class EternalRitual {
direction = direction.getClockWise(); direction = direction.getClockWise();
} }
} }
if (targetWorld.dimension() == Level.END) { // TODO find island feature
/*if (targetWorld.dimension() == Level.END) {
Features.END_ISLAND.place( Features.END_ISLAND.place(
targetWorld, targetWorld,
targetWorld.getChunkSource().getGenerator(), targetWorld.getChunkSource().getGenerator(),
@ -449,16 +449,16 @@ public class EternalRitual {
basePos.below() basePos.below()
); );
} }
else if (targetWorld.dimension() == Level.OVERWORLD) { else */if (targetWorld.dimension() == Level.OVERWORLD) {
basePos.setY(targetWorld.getChunk(basePos) basePos.setY(targetWorld.getChunk(basePos).getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1);
.getHeight(Heightmap.Types.WORLD_SURFACE, basePos.getX(), basePos.getZ()) + 1);
} }
EndFeatures.BIOME_ISLAND.getFeatureConfigured() EndFeatures.BIOME_ISLAND
.place(targetWorld, .getPlacedFeature()
targetWorld.getChunkSource().getGenerator(), .place(targetWorld,
new Random(basePos.asLong()), targetWorld.getChunkSource().getGenerator(),
basePos.below() new Random(basePos.asLong()),
); basePos.below()
);
generatePortal(targetWorld, basePos, portalAxis, portalId); generatePortal(targetWorld, basePos, portalAxis, portalId);
return basePos.immutable(); return basePos.immutable();
} }
@ -694,9 +694,9 @@ public class EternalRitual {
} }
/** /**
* @param world World for search * @param world World for search
* @param checkPos Start search position * @param checkPos Start search position
* @param radius Search radius * @param radius Search radius
* @param searchBlock Target block * @param searchBlock Target block
* @param condition Predicate for test block states in the chunk section * @param condition Predicate for test block states in the chunk section
* @return Position of the first found block or null. * @return Position of the first found block or null.
@ -733,9 +733,9 @@ public class EternalRitual {
} }
/** /**
* @param world World for search * @param world World for search
* @param checkPos Start search position * @param checkPos Start search position
* @param radius Search radius * @param radius Search radius
* @param searchBlock Target block * @param searchBlock Target block
* @param condition Predicate for test block states in the chunk section * @param condition Predicate for test block states in the chunk section
* @return List of positions of the all found blocks or empty list. * @return List of positions of the all found blocks or empty list.

View file

@ -75,7 +75,7 @@ public class BlockFixer {
for (Direction dir : BlocksHelper.HORIZONTAL) { for (Direction dir : BlocksHelper.HORIZONTAL) {
if (level.isEmptyBlock(POS.relative(dir))) { if (level.isEmptyBlock(POS.relative(dir))) {
try { try {
level.getLiquidTicks().scheduleTick(POS, state.getFluidState().getType(), 0); level.scheduleTick(POS, state.getFluidState().getType(), 0);
} }
catch (Exception e) {} catch (Exception e) {}
break; break;

View file

@ -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();
}
}

View file

@ -1,23 +1,177 @@
package ru.betterend.world.biome; package ru.betterend.world.biome;
import net.minecraft.core.BlockPos;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.resources.ResourceLocation; 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.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.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.EndFeatures;
import ru.betterend.registry.EndSounds;
public class EndBiome extends BCLBiome { import java.util.function.BiFunction;
public EndBiome(BCLBiomeDef def) {
super(updateDef(def)); 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();
}
@Override
public BlockState getAltTopMaterial() {
return getTopMaterial();
}
@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 EndBiome(ResourceLocation id, Biome biome, float fogDensity, float genChance, boolean hasCaves) { public abstract static class Config {
super(id, biome, fogDensity, genChance); public static final SurfaceMaterialProvider DEFAULT_MATERIAL = new DefaultSurfaceMaterialProvider();
this.addCustomData("has_caves", hasCaves);
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;
}
} }
private static BCLBiomeDef updateDef(BCLBiomeDef def) { public EndBiome(ResourceLocation biomeID, Biome biome) {
EndFeatures.addDefaultFeatures(def); super(biomeID, biome);
return def; }
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)));
} }
} }

View file

@ -1,25 +1,33 @@
package ru.betterend.world.biome.air; package ru.betterend.world.biome.air;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class BiomeIceStarfield extends EndBiome { public class BiomeIceStarfield extends EndBiome.Config {
public BiomeIceStarfield() { public BiomeIceStarfield() {
super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false) super("ice_starfield");
.addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()) }
.setFogColor(224, 245, 254)
.setTemperature(0F) @Override
.setFogDensity(2.2F) protected boolean hasCaves() {
.setFoliageColor(193, 244, 244) return false;
.setGenChance(0.25F) }
.setParticles(EndParticles.SNOWFLAKE, 0.002F)
.addFeature(EndFeatures.ICE_STAR) @Override
.addFeature(EndFeatures.ICE_STAR_SMALL) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.addMobSpawn(EntityType.ENDERMAN, 20, 1, 4)); 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);
} }
} }

View file

@ -1,30 +1,50 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.resources.ResourceLocation;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome;
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);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
}
@Override
public float getFloorDensity() {
return 0.01F;
}
@Override
public float getCeilDensity() {
return 0.1F;
}
}
public class EmptyAuroraCaveBiome extends EndCaveBiome {
public EmptyAuroraCaveBiome() { public EmptyAuroraCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68) super("empty_aurora_cave");
.setFogDensity(2.0F)
.setPlantsColor(108, 25, 46)
.setWaterAndFogColor(186, 77, 237)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F));
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
} }
@Override @Override
public float getFloorDensity() { protected void addCustomBuildData(BCLBiomeBuilder builder) {
return 0.01F; 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 @Override
public float getCeilDensity() { public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return 0.1F; return EmptyAuroraCaveBiome.Biome::new;
} }
} }

View file

@ -1,23 +1,44 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.resources.ResourceLocation;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.registry.EndFeatures; 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);
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
}
@Override
public float getFloorDensity() {
return 0.1F;
}
@Override
public float getCeilDensity() {
return 0.1F;
}
}
public class EmptyEndCaveBiome extends EndCaveBiome {
public EmptyEndCaveBiome() { public EmptyEndCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("empty_end_cave")).setFogDensity(2.0F)); super("empty_end_cave");
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
} }
@Override @Override
public float getFloorDensity() { protected void addCustomBuildData(BCLBiomeBuilder builder) {
return 0.1F; super.addCustomBuildData(builder);
builder.fogDensity(2.0F);
} }
@Override @Override
public float getCeilDensity() { public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return 0.1F; return Biome::new;
} }
} }

View file

@ -1,31 +1,51 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.resources.ResourceLocation;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome;
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);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
}
@Override
public float getFloorDensity() {
return 0.1F;
}
@Override
public float getCeilDensity() {
return 0.1F;
}
}
public class EmptySmaragdantCaveBiome extends EndCaveBiome {
public EmptySmaragdantCaveBiome() { public EmptySmaragdantCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182) super("empty_smaragdant_cave");
.setFogDensity(2.0F)
.setPlantsColor(0, 131, 145)
.setWaterAndFogColor(31, 167, 212)
.setParticles(EndParticles.SMARAGDANT, 0.001F));
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
} }
@Override @Override
public float getFloorDensity() { protected void addCustomBuildData(BCLBiomeBuilder builder) {
return 0.1F; 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 @Override
public float getCeilDensity() { public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return 0.1F; return EmptySmaragdantCaveBiome.Biome::new;
} }
} }

View file

@ -1,12 +1,15 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import net.minecraft.core.BlockPos; 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.biome.Biome.BiomeCategory;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.feature.Feature; 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.util.WeightedList;
import ru.bclib.world.biomes.BCLBiomeDef;
import ru.bclib.world.features.BCLFeature; import ru.bclib.world.features.BCLFeature;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
@ -14,24 +17,44 @@ import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature; import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature;
import java.util.Random; import java.util.Random;
import java.util.function.BiFunction;
public class EndCaveBiome extends EndBiome { 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<?>> floorFeatures = new WeightedList<Feature<?>>();
private WeightedList<Feature<?>> ceilFeatures = new WeightedList<Feature<?>>(); private WeightedList<Feature<?>> ceilFeatures = new WeightedList<Feature<?>>();
public EndCaveBiome(BCLBiomeDef definition) { public EndCaveBiome(ResourceLocation biomeID, Biome biome) {
super(makeDef(definition)); super(biomeID, biome);
}
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 void addFloorFeature(Feature<?> feature, float weight) { public void addFloorFeature(Feature<?> feature, float weight) {
@ -65,4 +88,8 @@ public class EndCaveBiome extends EndBiome {
public BlockState getWall(BlockPos pos) { public BlockState getWall(BlockPos pos) {
return null; return null;
} }
public static EndCaveBiome create(EndBiome.Config biomeConfig){
return (EndCaveBiome) EndBiome.create(biomeConfig);
}
} }

View file

@ -1,32 +1,53 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.BetterEnd;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.world.biome.EndBiome;
public class JadeCaveBiome extends EndCaveBiome { import java.util.function.BiFunction;
private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode());
private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode()); public class JadeCaveBiome extends EndCaveBiome.Config {
private static final BlockState[] JADE = new BlockState[3]; public static class Biome extends EndCaveBiome {
private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode());
public JadeCaveBiome() { private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode());
super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112) private static final BlockState[] JADE = new BlockState[3];
.setFogDensity(2.0F)
.setWaterAndFogColor(95, 223, 255)); public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState(); super(biomeID, biome);
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState(); JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState();
}
@Override
public BlockState getWall(BlockPos pos) {
double depth = DEPTH_NOISE.eval(pos.getX() * 0.02, pos.getZ() * 0.02) * 0.2 + 0.5;
int index = Mth.floor((pos.getY() + WALL_NOISE.eval(pos.getX() * 0.2, pos.getZ() * 0.2) * 1.5) * depth + 0.5);
index = Mth.abs(index) % 3;
return JADE[index];
}
} }
public JadeCaveBiome() {
super("jade_cave");
}
@Override @Override
public BlockState getWall(BlockPos pos) { protected void addCustomBuildData(BCLBiomeBuilder builder) {
double depth = DEPTH_NOISE.eval(pos.getX() * 0.02, pos.getZ() * 0.02) * 0.2 + 0.5; super.addCustomBuildData(builder);
int index = Mth.floor((pos.getY() + WALL_NOISE.eval(pos.getX() * 0.2, pos.getZ() * 0.2) * 1.5) * depth + 0.5); builder.fogColor(118, 150, 112)
index = Mth.abs(index) % 3; .fogDensity(2.0F)
return JADE[index]; .waterAndFogColor(95, 223, 255);
}
@Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return JadeCaveBiome.Biome::new;
} }
} }

View file

@ -1,48 +1,79 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome;
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);
this.addFloorFeature(EndFeatures.CAVE_GRASS, 40);
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE_CAVEMOSS, 5);
this.addCeilFeature(EndFeatures.CAVE_BUSH, 1);
this.addCeilFeature(EndFeatures.CAVE_PUMPKIN, 1);
this.addCeilFeature(EndFeatures.RUBINEA, 3);
this.addCeilFeature(EndFeatures.MAGNULA, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE_CAVEMOSS, 10);
}
@Override
public float getFloorDensity() {
return 0.2F;
}
@Override
public float getCeilDensity() {
return 0.1F;
}
@Override
public BlockState getCeil(BlockPos pos) {
return EndBlocks.CAVE_MOSS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP);
}
}
public class LushAuroraCaveBiome extends EndCaveBiome {
public LushAuroraCaveBiome() { public LushAuroraCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68) super("lush_aurora_cave");
.setFogDensity(2.0F)
.setPlantsColor(108, 25, 46)
.setWaterAndFogColor(186, 77, 237)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setSurface(EndBlocks.CAVE_MOSS));
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.CAVE_BUSH, 5);
this.addFloorFeature(EndFeatures.CAVE_GRASS, 40);
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE_CAVEMOSS, 5);
this.addCeilFeature(EndFeatures.CAVE_BUSH, 1);
this.addCeilFeature(EndFeatures.CAVE_PUMPKIN, 1);
this.addCeilFeature(EndFeatures.RUBINEA, 3);
this.addCeilFeature(EndFeatures.MAGNULA, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE_CAVEMOSS, 10);
} }
@Override @Override
public float getFloorDensity() { protected void addCustomBuildData(BCLBiomeBuilder builder) {
return 0.2F; 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 @Override
public float getCeilDensity() { public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return 0.1F; return LushAuroraCaveBiome.Biome::new;
} }
@Override @Override
public BlockState getCeil(BlockPos pos) { protected SurfaceMaterialProvider surfaceMaterial() {
return EndBlocks.CAVE_MOSS.defaultBlockState() return new EndBiome.DefaultSurfaceMaterialProvider() {
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP); @Override
public BlockState getTopMaterial() {
return EndBlocks.CAVE_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,33 +1,64 @@
package ru.betterend.world.biome.cave; package ru.betterend.world.biome.cave;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.resources.ResourceLocation;
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.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome;
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);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
}
@Override
public float getFloorDensity() {
return 0.1F;
}
@Override
public float getCeilDensity() {
return 0.1F;
}
}
public class LushSmaragdantCaveBiome extends EndCaveBiome {
public LushSmaragdantCaveBiome() { public LushSmaragdantCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182) super("lush_smaragdant_cave");
.setFogDensity(2.0F)
.setPlantsColor(0, 131, 145)
.setWaterAndFogColor(31, 167, 212)
.setParticles(EndParticles.SMARAGDANT, 0.001F)
.setSurface(EndBlocks.CAVE_MOSS));
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
} }
@Override @Override
public float getFloorDensity() { protected void addCustomBuildData(BCLBiomeBuilder builder) {
return 0.1F; 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 @Override
public float getCeilDensity() { public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() {
return 0.1F; return LushSmaragdantCaveBiome.Biome::new;
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.CAVE_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,9 +1,9 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
@ -11,30 +11,43 @@ import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class AmberLandBiome extends EndBiome { public class AmberLandBiome extends EndBiome.Config {
public AmberLandBiome() { public AmberLandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("amber_land")) super("amber_land");
.setFogColor(255, 184, 71) }
.setFogDensity(2.0F)
.setPlantsColor(219, 115, 38) @Override
.setWaterAndFogColor(145, 108, 72) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setMusic(EndSounds.MUSIC_FOREST) builder.fogColor(255, 184, 71)
.setLoop(EndSounds.AMBIENT_AMBER_LAND) .fogDensity(2.0F)
.setParticles(EndParticles.AMBER_SPHERE, 0.001F) .plantsColor(219, 115, 38)
.setSurface(EndBlocks.AMBER_MOSS) .waterAndFogColor(145, 108, 72)
.addFeature(EndFeatures.AMBER_ORE) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.END_LAKE_RARE) .loop(EndSounds.AMBIENT_AMBER_LAND)
.addFeature(EndFeatures.HELIX_TREE) .particles(EndParticles.AMBER_SPHERE, 0.001F)
.addFeature(EndFeatures.LANCELEAF) .feature(EndFeatures.AMBER_ORE)
.addFeature(EndFeatures.GLOW_PILLAR) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.AMBER_GRASS) .feature(EndFeatures.HELIX_TREE)
.addFeature(EndFeatures.AMBER_ROOT) .feature(EndFeatures.LANCELEAF)
.addFeature(EndFeatures.BULB_MOSS) .feature(EndFeatures.GLOW_PILLAR)
.addFeature(EndFeatures.BULB_MOSS_WOOD) .feature(EndFeatures.AMBER_GRASS)
.addFeature(EndFeatures.CHARNIA_ORANGE) .feature(EndFeatures.AMBER_ROOT)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.BULB_MOSS)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.BULB_MOSS_WOOD)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) .feature(EndFeatures.CHARNIA_ORANGE)
.addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); .feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEND_CITY())
.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();
}
};
} }
} }

View file

@ -1,36 +1,54 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class BlossomingSpiresBiome extends EndBiome { public class BlossomingSpiresBiome extends EndBiome.Config {
public BlossomingSpiresBiome() { public BlossomingSpiresBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")) super("blossoming_spires");
.addCustomData("has_caves", false) }
.setFogColor(241, 146, 229)
.setFogDensity(1.7F) @Override
.setPlantsColor(122, 45, 122) protected boolean hasCaves() {
.setSurface(EndBlocks.PINK_MOSS) return false;
.setMusic(EndSounds.MUSIC_FOREST) }
.setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
.addFeature(EndFeatures.SPIRE) @Override
.addFeature(EndFeatures.FLOATING_SPIRE) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.addFeature(EndFeatures.TENANEA) builder.fogColor(241, 146, 229)
.addFeature(EndFeatures.TENANEA_BUSH) .fogDensity(1.7F)
.addFeature(EndFeatures.BULB_VINE) .plantsColor(122, 45, 122)
.addFeature(EndFeatures.BUSHY_GRASS) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.BUSHY_GRASS_WG) .loop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
.addFeature(EndFeatures.BLOSSOM_BERRY) .feature(EndFeatures.SPIRE)
.addFeature(EndFeatures.TWISTED_MOSS) .feature(EndFeatures.FLOATING_SPIRE)
.addFeature(EndFeatures.TWISTED_MOSS_WOOD) .feature(EndFeatures.TENANEA)
.addFeature(EndFeatures.SILK_MOTH_NEST) .feature(EndFeatures.TENANEA_BUSH)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) .feature(EndFeatures.BULB_VINE)
.addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,44 +1,56 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.Features; import net.minecraft.data.worldgen.placement.EndPlacements;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import ru.bclib.world.biomes.BCLBiomeDef; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.betterend.BetterEnd; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class ChorusForestBiome extends EndBiome { public class ChorusForestBiome extends EndBiome.Config {
public ChorusForestBiome() { public ChorusForestBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")) super("chorus_forest");
.setFogColor(87, 26, 87) }
.setFogDensity(1.5F)
.setPlantsColor(122, 45, 122) @Override
.setWaterAndFogColor(73, 30, 73) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setSurface(EndBlocks.CHORUS_NYLIUM) builder.fogColor(87, 26, 87)
.setParticles(ParticleTypes.PORTAL, 0.01F) .fogDensity(1.5F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST) .plantsColor(122, 45, 122)
.setMusic(EndSounds.MUSIC_DARK) .waterAndFogColor(73, 30, 73)
.addFeature(EndFeatures.VIOLECITE_LAYER) .particles(ParticleTypes.PORTAL, 0.01F)
.addFeature(EndFeatures.END_LAKE_RARE) .loop(EndSounds.AMBIENT_CHORUS_FOREST)
.addFeature(EndFeatures.PYTHADENDRON_TREE) .music(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.PYTHADENDRON_BUSH) .feature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.PURPLE_POLYPORE) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) .feature(EndFeatures.PYTHADENDRON_TREE)
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) .feature(EndFeatures.PYTHADENDRON_BUSH)
.addFeature(EndFeatures.CHORUS_GRASS) .feature(EndFeatures.PURPLE_POLYPORE)
.addFeature(EndFeatures.CHORUS_MUSHROOM) .feature(Decoration.VEGETAL_DECORATION, EndPlacements.CHORUS_PLANT)
.addFeature(EndFeatures.TAIL_MOSS) .feature(EndFeatures.CHORUS_GRASS)
.addFeature(EndFeatures.TAIL_MOSS_WOOD) .feature(EndFeatures.CHORUS_MUSHROOM)
.addFeature(EndFeatures.CHARNIA_PURPLE) .feature(EndFeatures.TAIL_MOSS)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.TAIL_MOSS_WOOD)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_PURPLE)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .structure(VANILLA_FEATURES.getEND_CITY())
.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();
}
};
} }
} }

View file

@ -1,23 +1,36 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class CrystalMountainsBiome extends EndBiome { public class CrystalMountainsBiome extends EndBiome.Config {
public CrystalMountainsBiome() { public CrystalMountainsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")) super("crystal_mountains");
.addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()) }
.setPlantsColor(255, 133, 211)
.setSurface(EndBlocks.CRYSTAL_MOSS) @Override
.setMusic(EndSounds.MUSIC_OPENSPACE) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.addFeature(EndFeatures.ROUND_CAVE) builder.structure(EndStructures.MOUNTAIN.getFeatureConfigured())
.addFeature(EndFeatures.CRYSTAL_GRASS) .plantsColor(255, 133, 211)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,35 +1,49 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class DragonGraveyardsBiome extends EndBiome { public class DragonGraveyardsBiome extends EndBiome.Config {
public DragonGraveyardsBiome() { public DragonGraveyardsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")) super("dragon_graveyards");
.setGenChance(0.1F) }
.setFogColor(244, 46, 79)
.setFogDensity(1.3F) @Override
.setParticles(EndParticles.FIREFLY, 0.0007F) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setMusic(EndSounds.MUSIC_OPENSPACE) builder.genChance(0.1f)
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) .fogColor(244, 46, 79)
.setSurface(EndBlocks.SANGNUM) .fogDensity(1.3F)
.setWaterAndFogColor(203, 59, 167) .particles(EndParticles.FIREFLY, 0.0007F)
.setPlantsColor(244, 46, 79) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT) .loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.addFeature(EndFeatures.DRAGON_BONE_BLOCK_ORE) .waterAndFogColor(203, 59, 167)
.addFeature(EndFeatures.FALLEN_PILLAR) .plantsColor(244, 46, 79)
.addFeature(EndFeatures.OBSIDIAN_BOULDER) .feature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
.addFeature(EndFeatures.GIGANTIC_AMARANITA) .feature(EndFeatures.DRAGON_BONE_BLOCK_ORE)
.addFeature(EndFeatures.LARGE_AMARANITA) .feature(EndFeatures.FALLEN_PILLAR)
.addFeature(EndFeatures.SMALL_AMARANITA) .feature(EndFeatures.OBSIDIAN_BOULDER)
.addFeature(EndFeatures.GLOBULAGUS) .feature(EndFeatures.GIGANTIC_AMARANITA)
.addFeature(EndFeatures.CLAWFERN) .feature(EndFeatures.LARGE_AMARANITA)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,29 +1,42 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class DryShrublandBiome extends EndBiome { public class DryShrublandBiome extends EndBiome.Config {
public DryShrublandBiome() { public DryShrublandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")) super("dry_shrubland");
.setFogColor(132, 35, 13) }
.setFogDensity(1.2F)
.setWaterAndFogColor(113, 88, 53) @Override
.setPlantsColor(237, 122, 66) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setSurface(EndBlocks.RUTISCUS) builder.fogColor(132, 35, 13)
.setMusic(EndSounds.MUSIC_OPENSPACE) .fogDensity(1.2F)
.addFeature(EndFeatures.LUCERNIA_BUSH_RARE) .waterAndFogColor(113, 88, 53)
.addFeature(EndFeatures.ORANGO) .plantsColor(237, 122, 66)
.addFeature(EndFeatures.AERIDIUM) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.LUTEBUS) .feature(EndFeatures.LUCERNIA_BUSH_RARE)
.addFeature(EndFeatures.LAMELLARIUM) .feature(EndFeatures.ORANGO)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.AERIDIUM)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.LUTEBUS)
.feature(EndFeatures.LAMELLARIUM)
.structure(VANILLA_FEATURES.getEND_CITY())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.RUTISCUS.defaultBlockState();
}
};
} }
} }

View file

@ -1,26 +1,40 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class DustWastelandsBiome extends EndBiome { public class DustWastelandsBiome extends EndBiome.Config {
public DustWastelandsBiome() { public DustWastelandsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")) super("dust_wastelands");
.setFogColor(226, 239, 168) }
.setFogDensity(2)
.setWaterAndFogColor(192, 180, 131) @Override
.setSurface(EndBlocks.ENDSTONE_DUST) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setDepth(1.5F) builder.fogColor(226, 239, 168)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .fogDensity(2)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .waterAndFogColor(192, 180, 131)
.setMusic(EndSounds.MUSIC_OPENSPACE) //TODO: 1.18 removed
.addStructureFeature(StructureFeatures.END_CITY) //.depth(1.5F)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .particles(ParticleTypes.WHITE_ASH, 0.01F)
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
.music(EndSounds.MUSIC_OPENSPACE)
.structure(VANILLA_FEATURES.getEND_CITY())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
};
} }
} }

View file

@ -1,9 +1,9 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
@ -12,38 +12,57 @@ import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class FoggyMushroomlandBiome extends EndBiome { public class FoggyMushroomlandBiome extends EndBiome.Config {
public FoggyMushroomlandBiome() { public FoggyMushroomlandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")) super("foggy_mushroomland");
.addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM }
.getFeatureConfigured())
.setPlantsColor(73, 210, 209) @Override
.setFogColor(41, 122, 173) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setFogDensity(3) builder.structure(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured())
.setWaterAndFogColor(119, 227, 250) .plantsColor(73, 210, 209)
.setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM) .fogColor(41, 122, 173)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .fogDensity(3)
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND) .waterAndFogColor(119, 227, 250)
.setMusic(EndSounds.MUSIC_FOREST) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.END_LAKE) .loop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
.addFeature(EndFeatures.MOSSY_GLOWSHROOM) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.BLUE_VINE) .feature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.UMBRELLA_MOSS) .feature(EndFeatures.MOSSY_GLOWSHROOM)
.addFeature(EndFeatures.CREEPING_MOSS) .feature(EndFeatures.BLUE_VINE)
.addFeature(EndFeatures.DENSE_VINE) .feature(EndFeatures.UMBRELLA_MOSS)
//.addFeature(EndFeatures.PEARLBERRY) .feature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.CYAN_MOSS) .feature(EndFeatures.DENSE_VINE)
.addFeature(EndFeatures.CYAN_MOSS_WOOD) //.feature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.END_LILY) .feature(EndFeatures.CYAN_MOSS)
.addFeature(EndFeatures.BUBBLE_CORAL) .feature(EndFeatures.CYAN_MOSS_WOOD)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.END_LILY)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.BUBBLE_CORAL)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.CHARNIA_CYAN)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EndEntities.END_FISH, 20, 2, 5) .structure(VANILLA_FEATURES.getEND_CITY())
.addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8) .spawn(EndEntities.DRAGONFLY, 80, 2, 5)
.addMobSpawn(EndEntities.END_SLIME, 10, 1, 2) .spawn(EndEntities.END_FISH, 20, 2, 5)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,40 +1,53 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class GlowingGrasslandsBiome extends EndBiome { public class GlowingGrasslandsBiome extends EndBiome.Config {
public GlowingGrasslandsBiome() { public GlowingGrasslandsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")) super("glowing_grasslands");
.setFogColor(99, 228, 247) }
.setFogDensity(1.3F)
.setParticles(EndParticles.FIREFLY, 0.001F) @Override
.setMusic(EndSounds.MUSIC_OPENSPACE) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) builder.fogColor(99, 228, 247)
.setSurface(EndBlocks.END_MOSS) .fogDensity(1.3F)
.setWaterAndFogColor(92, 250, 230) .particles(EndParticles.FIREFLY, 0.001F)
.setPlantsColor(73, 210, 209) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.END_LAKE_RARE) .loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.addFeature(EndFeatures.LUMECORN) .waterAndFogColor(92, 250, 230)
.addFeature(EndFeatures.BLOOMING_COOKSONIA) .plantsColor(73, 210, 209)
.addFeature(EndFeatures.SALTEAGO) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.VAIOLUSH_FERN) .feature(EndFeatures.LUMECORN)
.addFeature(EndFeatures.FRACTURN) .feature(EndFeatures.BLOOMING_COOKSONIA)
.addFeature(EndFeatures.UMBRELLA_MOSS_RARE) .feature(EndFeatures.SALTEAGO)
.addFeature(EndFeatures.CREEPING_MOSS_RARE) .feature(EndFeatures.VAIOLUSH_FERN)
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE) .feature(EndFeatures.FRACTURN)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.UMBRELLA_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_GREEN) .feature(EndFeatures.CREEPING_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.CHARNIA_CYAN)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_GREEN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEND_CITY())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.END_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,40 +1,53 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class LanternWoodsBiome extends EndBiome { public class LanternWoodsBiome extends EndBiome.Config {
public LanternWoodsBiome() { public LanternWoodsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")) super("lantern_woods");
.setFogColor(189, 82, 70) }
.setFogDensity(1.1F)
.setWaterAndFogColor(171, 234, 226) @Override
.setPlantsColor(254, 85, 57) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setSurface(EndBlocks.RUTISCUS) builder.fogColor(189, 82, 70)
.setMusic(EndSounds.MUSIC_FOREST) .fogDensity(1.1F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .waterAndFogColor(171, 234, 226)
.addFeature(EndFeatures.END_LAKE_NORMAL) .plantsColor(254, 85, 57)
.addFeature(EndFeatures.FLAMAEA) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.LUCERNIA) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.LUCERNIA_BUSH) .feature(EndFeatures.END_LAKE_NORMAL)
.addFeature(EndFeatures.FILALUX) .feature(EndFeatures.FLAMAEA)
.addFeature(EndFeatures.AERIDIUM) .feature(EndFeatures.LUCERNIA)
.addFeature(EndFeatures.LAMELLARIUM) .feature(EndFeatures.LUCERNIA_BUSH)
.addFeature(EndFeatures.BOLUX_MUSHROOM) .feature(EndFeatures.FILALUX)
.addFeature(EndFeatures.AURANT_POLYPORE) .feature(EndFeatures.AERIDIUM)
.addFeature(EndFeatures.POND_ANEMONE) .feature(EndFeatures.LAMELLARIUM)
.addFeature(EndFeatures.CHARNIA_ORANGE) .feature(EndFeatures.BOLUX_MUSHROOM)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.AURANT_POLYPORE)
.addFeature(EndFeatures.RUSCUS) .feature(EndFeatures.POND_ANEMONE)
.addFeature(EndFeatures.RUSCUS_WOOD) .feature(EndFeatures.CHARNIA_ORANGE)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_RED)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.RUSCUS)
.feature(EndFeatures.RUSCUS_WOOD)
.structure(VANILLA_FEATURES.getEND_CITY())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.RUTISCUS.defaultBlockState();
}
};
} }
} }

View file

@ -1,8 +1,9 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
@ -10,33 +11,52 @@ import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class MegalakeBiome extends EndBiome { public class MegalakeBiome extends EndBiome.Config {
public MegalakeBiome() { public MegalakeBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("megalake")) super("megalake");
.addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()) }
.setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248) @Override
.setWaterAndFogColor(96, 163, 255) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setFogDensity(1.75F) builder.structure(EndStructures.MEGALAKE.getFeatureConfigured())
.setMusic(EndSounds.MUSIC_WATER) .plantsColor(73, 210, 209)
.setLoop(EndSounds.AMBIENT_MEGALAKE) .fogColor(178, 209, 248)
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST) .waterAndFogColor(96, 163, 255)
.setDepth(0F) .fogDensity(1.75F)
.addFeature(EndFeatures.END_LOTUS) .music(EndSounds.MUSIC_WATER)
.addFeature(EndFeatures.END_LOTUS_LEAF) .loop(EndSounds.AMBIENT_MEGALAKE)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE) //TODO: 1.18 removed
.addFeature(EndFeatures.END_LILY_RARE) //.depth(0F)
.addFeature(EndFeatures.UMBRELLA_MOSS) .feature(EndFeatures.END_LOTUS)
.addFeature(EndFeatures.CREEPING_MOSS) .feature(EndFeatures.END_LOTUS_LEAF)
//.addFeature(EndFeatures.PEARLBERRY) .feature(EndFeatures.BUBBLE_CORAL_RARE)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.END_LILY_RARE)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.MENGER_SPONGE) //.feature(EndFeatures.PEARLBERRY)
.addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3) .feature(EndFeatures.CHARNIA_CYAN)
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8) .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) .feature(EndFeatures.MENGER_SPONGE)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,8 +1,9 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
@ -11,35 +12,49 @@ import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class MegalakeGroveBiome extends EndBiome { public class MegalakeGroveBiome extends EndBiome.Config {
public MegalakeGroveBiome() { public MegalakeGroveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")) super("megalake_grove");
.addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()) }
.setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248) @Override
.setWaterAndFogColor(96, 163, 255) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setFogDensity(2.0F) builder.structure(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .plantsColor(73, 210, 209)
.setMusic(EndSounds.MUSIC_WATER) .fogColor(178, 209, 248)
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE) .waterAndFogColor(96, 163, 255)
.setSurface(EndBlocks.END_MOSS) .fogDensity(2.0F)
.setDepth(0F) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.LACUGROVE) .music(EndSounds.MUSIC_WATER)
.addFeature(EndFeatures.END_LOTUS) .loop(EndSounds.AMBIENT_MEGALAKE_GROVE)
.addFeature(EndFeatures.END_LOTUS_LEAF) //TODO: 1.18 removed
.addFeature(EndFeatures.BUBBLE_CORAL_RARE) //.depth(0F)
.addFeature(EndFeatures.END_LILY_RARE) .feature(EndFeatures.LACUGROVE)
.addFeature(EndFeatures.UMBRELLA_MOSS) .feature(EndFeatures.END_LOTUS)
//.addFeature(EndFeatures.PEARLBERRY) .feature(EndFeatures.END_LOTUS_LEAF)
.addFeature(EndFeatures.CREEPING_MOSS) .feature(EndFeatures.BUBBLE_CORAL_RARE)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.END_LILY_RARE)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CHARNIA_RED_RARE) //.feature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.MENGER_SPONGE) .feature(EndFeatures.CREEPING_MOSS)
.addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3) .feature(EndFeatures.CHARNIA_CYAN)
.addMobSpawn(EndEntities.END_FISH, 20, 3, 8) .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) .feature(EndFeatures.MENGER_SPONGE)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,34 +1,52 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class NeonOasisBiome extends EndBiome { public class NeonOasisBiome extends EndBiome.Config {
public NeonOasisBiome() { public NeonOasisBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")) super("neon_oasis");
.setGenChance(0.5F) }
.setFogColor(226, 239, 168)
.setFogDensity(2) @Override
.setWaterAndFogColor(106, 238, 215) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS) builder.genChance(0.5F)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .fogColor(226, 239, 168)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .fogDensity(2)
.setMusic(EndSounds.MUSIC_OPENSPACE) .waterAndFogColor(106, 238, 215)
.addFeature(EndFeatures.DESERT_LAKE) .particles(ParticleTypes.WHITE_ASH, 0.01F)
.addFeature(EndFeatures.NEON_CACTUS) .loop(EndSounds.AMBIENT_DUST_WASTELANDS)
.addFeature(EndFeatures.UMBRELLA_MOSS) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.CREEPING_MOSS) .feature(EndFeatures.DESERT_LAKE)
.addFeature(EndFeatures.CHARNIA_GREEN) .feature(EndFeatures.NEON_CACTUS)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.CREEPING_MOSS)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_GREEN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_CYAN)
.feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEND_CITY())
.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();
}
};
} }
} }

View file

@ -2,24 +2,38 @@ package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class PaintedMountainsBiome extends EndBiome { public class PaintedMountainsBiome extends EndBiome.Config {
public PaintedMountainsBiome() { public PaintedMountainsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")) super("painted_mountains");
.addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()) }
.setFogColor(226, 239, 168)
.setFogDensity(2) @Override
.setWaterAndFogColor(192, 180, 131) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setMusic(EndSounds.MUSIC_OPENSPACE) builder.structure(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .fogColor(226, 239, 168)
.setSurface(EndBlocks.ENDSTONE_DUST) .fogDensity(2)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .waterAndFogColor(192, 180, 131)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .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();
}
};
} }
} }

View file

@ -1,44 +1,57 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes; import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class ShadowForestBiome extends EndBiome { public class ShadowForestBiome extends EndBiome.Config {
public ShadowForestBiome() { public ShadowForestBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")) super("shadow_forest");
.setFogColor(0, 0, 0) }
.setFogDensity(2.5F)
.setPlantsColor(45, 45, 45) @Override
.setWaterAndFogColor(42, 45, 80) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setSurface(EndBlocks.SHADOW_GRASS) builder.fogColor(0, 0, 0)
.setParticles(ParticleTypes.MYCELIUM, 0.01F) .fogDensity(2.5F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST) .plantsColor(45, 45, 45)
.setMusic(EndSounds.MUSIC_DARK) .waterAndFogColor(42, 45, 80)
.addFeature(EndFeatures.VIOLECITE_LAYER) .particles(ParticleTypes.MYCELIUM, 0.01F)
.addFeature(EndFeatures.END_LAKE_RARE) .loop(EndSounds.AMBIENT_CHORUS_FOREST)
.addFeature(EndFeatures.DRAGON_TREE) .music(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.DRAGON_TREE_BUSH) .feature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.SHADOW_PLANT) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.MURKWEED) .feature(EndFeatures.DRAGON_TREE)
.addFeature(EndFeatures.NEEDLEGRASS) .feature(EndFeatures.DRAGON_TREE_BUSH)
.addFeature(EndFeatures.SHADOW_BERRY) .feature(EndFeatures.SHADOW_PLANT)
.addFeature(EndFeatures.TWISTED_VINE) .feature(EndFeatures.MURKWEED)
.addFeature(EndFeatures.PURPLE_POLYPORE) .feature(EndFeatures.NEEDLEGRASS)
.addFeature(EndFeatures.TAIL_MOSS) .feature(EndFeatures.SHADOW_BERRY)
.addFeature(EndFeatures.TAIL_MOSS_WOOD) .feature(EndFeatures.TWISTED_VINE)
.addFeature(EndFeatures.CHARNIA_PURPLE) .feature(EndFeatures.PURPLE_POLYPORE)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.TAIL_MOSS)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.TAIL_MOSS_WOOD)
.addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4) .feature(EndFeatures.CHARNIA_PURPLE)
.addMobSpawn(EntityType.ENDERMAN, 40, 1, 4) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); .structure(VANILLA_FEATURES.getEND_CITY())
.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();
}
};
} }
} }

View file

@ -1,38 +1,94 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.Blocks;
import ru.betterend.BetterEnd; 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.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; 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() { public SulphurSpringsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")) super("sulphur_springs");
.addCustomData("has_caves", false) }
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
.setMusic(EndSounds.MUSIC_OPENSPACE) @Override
.setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS) protected boolean hasCaves() {
.setWaterColor(25, 90, 157) return false;
.setWaterFogColor(30, 65, 61) }
.setFogColor(207, 194, 62)
.setFogDensity(1.5F) @Override
.setDepth(0F) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F) builder
.addFeature(EndFeatures.GEYSER) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.SURFACE_VENT) .loop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
.addFeature(EndFeatures.SULPHURIC_LAKE) .waterColor(25, 90, 157)
.addFeature(EndFeatures.SULPHURIC_CAVE) .waterFogColor(30, 65, 61)
.addFeature(EndFeatures.HYDRALUX) .fogColor(207, 194, 62)
.addFeature(EndFeatures.CHARNIA_GREEN) .fogDensity(1.5F)
.addFeature(EndFeatures.CHARNIA_ORANGE) //TODO: 1.18 removed
.addFeature(EndFeatures.CHARNIA_RED_RARE) //.depth(0F)
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8) .particles(EndParticles.SULPHUR_PARTICLE, 0.001F)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) .feature(EndFeatures.GEYSER)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .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() {
return super
.surface()
.rule(2,
SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
new SwitchRuleSource(
new SulphuricSurfaceNoiseCondition(),
List.of(
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
SurfaceRules.state(surfaceMaterial().getTopMaterial()),
SULPHURIC_ROCK,
BRIMSTONE
)
)
)
);
}
};
} }
} }

View file

@ -1,27 +1,76 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; 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.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.surface.SurfaceBuilders; import ru.betterend.world.surface.UmbraSurfaceNoiseCondition;
public class UmbraValleyBiome extends EndBiome { import java.util.List;
public class UmbraValleyBiome extends EndBiome.Config {
public UmbraValleyBiome() { public UmbraValleyBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("umbra_valley")) super("umbra_valley");
.setFogColor(100, 100, 100) }
.setPlantsColor(172, 189, 190)
.setWaterAndFogColor(69, 104, 134) @Override
.setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setParticles(EndParticles.AMBER_SPHERE, 0.0001F) builder.fogColor(100, 100, 100)
.setLoop(EndSounds.UMBRA_VALLEY) .plantsColor(172, 189, 190)
.setMusic(EndSounds.MUSIC_DARK) .waterAndFogColor(69, 104, 134)
.addFeature(EndFeatures.UMBRALITH_ARCH) .particles(EndParticles.AMBER_SPHERE, 0.0001F)
.addFeature(EndFeatures.THIN_UMBRALITH_ARCH) .loop(EndSounds.UMBRA_VALLEY)
.addFeature(EndFeatures.INFLEXIA) .music(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.FLAMMALIX) .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 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())
)
)
)
);
}
};
} }
} }

View file

@ -1,44 +1,57 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EntityType;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.state.BlockState;
import ru.betterend.BetterEnd; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class UmbrellaJungleBiome extends EndBiome { public class UmbrellaJungleBiome extends EndBiome.Config {
public UmbrellaJungleBiome() { public UmbrellaJungleBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")) super("umbrella_jungle");
.setFogColor(87, 223, 221) }
.setWaterAndFogColor(119, 198, 253)
.setFoliageColor(27, 183, 194) @Override
.setFogDensity(2.3F) protected void addCustomBuildData(BCLBiomeBuilder builder) {
.setParticles(EndParticles.JUNGLE_SPORE, 0.001F) builder.fogColor(87, 223, 221)
.setMusic(EndSounds.MUSIC_FOREST) .waterAndFogColor(119, 198, 253)
.setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE) .foliageColor(27, 183, 194)
.setSurface(EndBlocks.JUNGLE_MOSS) .fogDensity(2.3F)
.addFeature(EndFeatures.END_LAKE) .particles(EndParticles.JUNGLE_SPORE, 0.001F)
.addFeature(EndFeatures.UMBRELLA_TREE) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.JELLYSHROOM) .loop(EndSounds.AMBIENT_UMBRELLA_JUNGLE)
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS) .feature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR) .feature(EndFeatures.UMBRELLA_TREE)
.addFeature(EndFeatures.JUNGLE_GRASS) .feature(EndFeatures.JELLYSHROOM)
.addFeature(EndFeatures.CYAN_MOSS) .feature(EndFeatures.TWISTED_UMBRELLA_MOSS)
.addFeature(EndFeatures.CYAN_MOSS_WOOD) .feature(EndFeatures.SMALL_JELLYSHROOM_FLOOR)
.addFeature(EndFeatures.JUNGLE_FERN_WOOD) .feature(EndFeatures.JUNGLE_GRASS)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL) .feature(EndFeatures.CYAN_MOSS)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD) .feature(EndFeatures.CYAN_MOSS_WOOD)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL) .feature(EndFeatures.JUNGLE_FERN_WOOD)
.addFeature(EndFeatures.JUNGLE_VINE) .feature(EndFeatures.SMALL_JELLYSHROOM_WALL)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.SMALL_JELLYSHROOM_WOOD)
.addFeature(EndFeatures.CHARNIA_GREEN) .feature(EndFeatures.SMALL_JELLYSHROOM_CEIL)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.JUNGLE_VINE)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.CHARNIA_CYAN)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_GREEN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEND_CITY())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.JUNGLE_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -8,8 +8,6 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFTranslate; import ru.bclib.sdf.operator.SDFTranslate;
@ -17,6 +15,7 @@ import ru.bclib.sdf.primitive.SDFCappedCone;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.world.biome.EndBiome;
public class BiomeIslandFeature extends DefaultFeature { public class BiomeIslandFeature extends DefaultFeature {
private static final MutableBlockPos CENTER = new MutableBlockPos(); private static final MutableBlockPos CENTER = new MutableBlockPos();
@ -25,21 +24,24 @@ public class BiomeIslandFeature extends DefaultFeature {
private static OpenSimplexNoise simplexNoise = new OpenSimplexNoise(412L); private static OpenSimplexNoise simplexNoise = new OpenSimplexNoise(412L);
private static BlockState topBlock = Blocks.GRASS_BLOCK.defaultBlockState(); private static BlockState topBlock = Blocks.GRASS_BLOCK.defaultBlockState();
private static BlockState underBlock = Blocks.DIRT.defaultBlockState(); private static BlockState underBlock = Blocks.DIRT.defaultBlockState();
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
Biome biome = world.getBiome(pos); Biome biome = world.getBiome(pos);
SurfaceBuilderConfiguration surfaceConfig = biome.getGenerationSettings().getSurfaceBuilderConfig(); int dist = BlocksHelper.downRay(world, pos, 10) + 1;
BlockState topMaterial = surfaceConfig.getTopMaterial(); BlockPos surfacePos = new BlockPos(pos.getX(), pos.getY()-dist, pos.getZ());
BlockState topMaterial = EndBiome.findTopMaterial(world, surfacePos);;
if (BlocksHelper.isFluid(topMaterial)) { if (BlocksHelper.isFluid(topMaterial)) {
topBlock = ((SurfaceBuilderBaseConfiguration) surfaceConfig).getUnderwaterMaterial(); topBlock = Blocks.GRAVEL.defaultBlockState();
underBlock = Blocks.STONE.defaultBlockState();
} }
else { else {
topBlock = topMaterial; underBlock = EndBiome.findUnderMaterial(world, surfacePos);
} }
underBlock = surfaceConfig.getUnderMaterial();
simplexNoise = new OpenSimplexNoise(world.getSeed()); simplexNoise = new OpenSimplexNoise(world.getSeed());
CENTER.set(pos); CENTER.set(pos);
ISLAND.fillRecursive(world, pos.below()); ISLAND.fillRecursive(world, pos.below());

View file

@ -23,6 +23,7 @@ import ru.bclib.util.MHelper;
import ru.bclib.util.StructureHelper; import ru.bclib.util.StructureHelper;
import ru.bclib.world.features.NBTStructureFeature; import ru.bclib.world.features.NBTStructureFeature;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -30,7 +31,11 @@ public class CrashedShipFeature extends NBTStructureFeature {
private static final StructureProcessor REPLACER; private static final StructureProcessor REPLACER;
private static final String STRUCTURE_PATH = "/data/minecraft/structures/end_city/ship.nbt"; private static final String STRUCTURE_PATH = "/data/minecraft/structures/end_city/ship.nbt";
private StructureTemplate structure; private StructureTemplate structure;
public CrashedShipFeature() {
super(EndBiome.Config.DEFAULT_MATERIAL.getTopMaterial());
}
@Override @Override
protected StructureTemplate getStructure(WorldGenLevel world, BlockPos pos, Random random) { protected StructureTemplate getStructure(WorldGenLevel world, BlockPos pos, Random random) {
if (structure == null) { if (structure == null) {

View file

@ -16,6 +16,7 @@ import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -123,10 +124,7 @@ public class DesertLakeFeature extends DefaultFeature {
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
state = world.getBiome(pos) state = EndBiome.findTopMaterial(world, pos); //world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel) else if (y > waterLevel)
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
@ -198,10 +196,7 @@ public class DesertLakeFeature extends DefaultFeature {
} }
else if (y < waterLevel) { else if (y < waterLevel) {
if (world.isEmptyBlock(POS.above())) { if (world.isEmptyBlock(POS.above())) {
state = world.getBiome(POS) state = EndBiome.findTopMaterial(world, pos); //world.getBiome(POS).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
POS, POS,

View file

@ -16,6 +16,7 @@ import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -23,6 +24,10 @@ public class EndLakeFeature extends DefaultFeature {
private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState();
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152);
private static final MutableBlockPos POS = new MutableBlockPos(); private static final MutableBlockPos POS = new MutableBlockPos();
public EndLakeFeature(){
}
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
@ -123,10 +128,11 @@ public class EndLakeFeature extends DefaultFeature {
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) {
state = world.getBiome(pos) state = EndBiome.findTopMaterial(world, pos);
.getGenerationSettings() //state = world.getBiome(pos)
.getSurfaceBuilderConfig() // .getGenerationSettings()
.getTopMaterial(); // .getSurfaceBuilderConfig()
// .getTopMaterial();
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel) else if (y > waterLevel)
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
@ -193,10 +199,11 @@ public class EndLakeFeature extends DefaultFeature {
// Make border // Make border
else if (y < waterLevel && y2 + x2 + z2 <= rb) { else if (y < waterLevel && y2 + x2 + z2 <= rb) {
if (world.isEmptyBlock(POS.above())) { if (world.isEmptyBlock(POS.above())) {
state = world.getBiome(POS) state = EndBiome.findTopMaterial(world, pos);
.getGenerationSettings() // state = world.getBiome(POS)
.getSurfaceBuilderConfig() // .getGenerationSettings()
.getTopMaterial(); // .getSurfaceBuilderConfig()
// .getTopMaterial();
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
POS, POS,

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.primitive.SDFSphere; import ru.bclib.sdf.primitive.SDFSphere;
@ -16,8 +16,10 @@ import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBiomes; import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.Random; import java.util.Random;
public class FloatingSpireFeature extends SpireFeature { public class FloatingSpireFeature extends SpireFeature {
@ -62,13 +64,14 @@ public class FloatingSpireFeature extends SpireFeature {
if (random.nextInt(16) == 0) { if (random.nextInt(16) == 0) {
support.add(info.getPos().above()); support.add(info.getPos().above());
} }
return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); return EndBiome.findTopMaterial(world, info.getPos());//world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
} }
else if (info.getState(Direction.UP, 3).isAir()) { else if (info.getState(Direction.UP, 3).isAir()) {
return world.getBiome(info.getPos()) return EndBiome.findUnderMaterial(world, info.getPos());
.getGenerationSettings() // return world.getBiome(info.getPos())
.getSurfaceBuilderConfig() // .getGenerationSettings()
.getUnderMaterial(); // .getSurfaceBuilderConfig()
// .getUnderMaterial();
} }
return info.getState(); return info.getState();
}); });
@ -77,7 +80,7 @@ public class FloatingSpireFeature extends SpireFeature {
support.forEach((bpos) -> { support.forEach((bpos) -> {
if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) { if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
EndFeatures.TENANEA_BUSH.getFeature() EndFeatures.TENANEA_BUSH.getFeature()
.place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); .place(new FeaturePlaceContext<>(Optional.empty(), world, chunkGenerator, random, bpos, null));
} }
}); });

View file

@ -37,6 +37,7 @@ import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import java.util.Optional;
import java.util.Random; import java.util.Random;
import java.util.function.Function; import java.util.function.Function;
@ -259,7 +260,7 @@ public class GeyserFeature extends DefaultFeature {
} }
EndFeatures.SULPHURIC_LAKE.getFeature() EndFeatures.SULPHURIC_LAKE.getFeature()
.place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null)); .place(new FeaturePlaceContext<>(Optional.empty(), world, chunkGenerator, random, pos, null));
double distance = radius1 * 1.7; double distance = radius1 * 1.7;
BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance); BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance);

Some files were not shown because too many files have changed in this diff Show more