Merge pull request #372 from paulevsGitch/1.18

1.18
This commit is contained in:
paulevsGitch 2021-12-30 06:43:55 +03:00 committed by GitHub
commit 417350db2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 3649 additions and 2636 deletions

1
.gitignore vendored
View file

@ -32,3 +32,4 @@ output/
*.getBlock("log") *.getBlock("log")
Convert.class Convert.class
ModelPart.class ModelPart.class
libs/

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

@ -7,12 +7,12 @@ buildscript {
plugins { plugins {
id 'idea' id 'idea'
id 'eclipse' id 'eclipse'
id 'fabric-loom' version '0.8-SNAPSHOT' id 'fabric-loom' version "${loom_version}"
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_16 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_16 targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version version = project.mod_version
@ -25,15 +25,23 @@ 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' }
flatDir {
dirs 'libs'
}
}
loom {
accessWidenerPath = file("src/main/resources/betterend.accesswidener")
} }
dependencies { dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings minecraft.officialMojangMappings() mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-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

@ -1,12 +1,17 @@
# Done to increase the memory available to gradle. # Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx2G 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.17.1 minecraft_version=1.18.1
yarn_mappings=6 fabric_version = 0.44.0+1.18
loader_version=0.12.4 loader_version=0.12.12
#Loom
loom_version=0.10-SNAPSHOT
# Mod Properties # Mod Properties
mod_version=0.12.5 mod_version=1.0.0
maven_group=ru.betterend maven_group=ru.betterend
archives_base_name=better-end archives_base_name=better-end
@ -14,7 +19,6 @@ archives_base_name=better-end
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # 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.42.1+1.17 bclib_version = 1.2.0
bclib_version = 0.5.4 rei_version = 7.0.343
rei_version = 6.0.264-alpha
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,7 +30,6 @@ 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";
@ -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();
@ -63,12 +63,20 @@ public class BetterEnd implements ModInitializer {
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

@ -1,12 +1,12 @@
package ru.betterend.blocks; package ru.betterend.blocks;
import com.google.common.collect.Maps;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.basis.PedestalBlock; import ru.betterend.blocks.basis.PedestalBlock;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class EndPedestal extends PedestalBlock { public class EndPedestal extends PedestalBlock {
@ -19,16 +19,12 @@ public class EndPedestal extends PedestalBlock {
protected Map<String, String> createTexturesMap() { protected Map<String, String> createTexturesMap() {
ResourceLocation blockId = Registry.BLOCK.getKey(parent); ResourceLocation blockId = Registry.BLOCK.getKey(parent);
String name = blockId.getPath(); String name = blockId.getPath();
return new HashMap<String, String>() { Map<String, String> textures = Maps.newHashMap();
private static final long serialVersionUID = 1L; textures.put("%mod%", BetterEnd.MOD_ID);
textures.put("%top%", name + "_polished");
{ textures.put("%base%", name + "_polished");
put("%mod%", BetterEnd.MOD_ID); textures.put("%pillar%", name + "_pillar_side");
put("%top%", name + "_polished"); textures.put("%bottom%", name + "_polished");
put("%base%", name + "_polished"); return textures;
put("%pillar%", name + "_pillar_side");
put("%bottom%", name + "_polished");
}
};
} }
} }

View file

@ -4,16 +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 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

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,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 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

View file

@ -4,18 +4,27 @@ 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

View file

@ -1,7 +1,8 @@
package ru.betterend.blocks; package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.tags.Tag.Named;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
@ -9,26 +10,35 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI;
import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.TagProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
public class MossyGlowshroomCapBlock extends BaseBlock { import java.util.List;
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION; public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION;
public MossyGlowshroomCapBlock() { public MossyGlowshroomCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD)); super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false)); this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false));
} }
public BlockState getStateForPlacement(BlockPlaceContext ctx) { public BlockState getStateForPlacement(BlockPlaceContext ctx) {
return this.defaultBlockState() return this.defaultBlockState()
.setValue( .setValue(
TRANSITION, TRANSITION,
EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel().getBlockState(ctx.getClickedPos().below())) EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel().getBlockState(ctx.getClickedPos().below()))
); );
} }
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(TRANSITION); builder.add(TRANSITION);
} }
@Override
public void addTags(List<Named<Block>> blockTags, List<Named<Item>> itemTags) {
blockTags.add(TagAPI.MINEABLE_AXE);
}
} }

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 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

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,13 +11,7 @@ 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

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

@ -1,6 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
@ -23,8 +24,6 @@ import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
@ -45,17 +44,14 @@ import ru.betterend.blocks.InfusionPedestal;
import ru.betterend.blocks.entities.InfusionPedestalEntity; import ru.betterend.blocks.entities.InfusionPedestalEntity;
import ru.betterend.blocks.entities.PedestalBlockEntity; import ru.betterend.blocks.entities.PedestalBlockEntity;
import ru.betterend.client.models.Patterns; import ru.betterend.client.models.Patterns;
import ru.betterend.registry.EndBlocks;
import ru.betterend.rituals.InfusionRitual; import ru.betterend.rituals.InfusionRitual;
import java.awt.Point; import java.awt.Point;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.function.ToIntFunction; import java.util.function.ToIntFunction;
@SuppressWarnings({"deprecation"})
public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE; public final static EnumProperty<PedestalState> STATE = EndBlockProperties.PEDESTAL_STATE;
public static final BooleanProperty HAS_ITEM = EndBlockProperties.HAS_ITEM; public static final BooleanProperty HAS_ITEM = EndBlockProperties.HAS_ITEM;
@ -68,37 +64,18 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
private static final VoxelShape SHAPE_COLUMN_TOP; private static final VoxelShape SHAPE_COLUMN_TOP;
private static final VoxelShape SHAPE_BOTTOM; private static final VoxelShape SHAPE_BOTTOM;
/**
* Register new Pedestal block with Better End mod id.
*
* @param name pedestal name
* @param source source block
* @return new Pedestal block with Better End id.
*/
public static Block registerPedestal(String name, Block source) {
return EndBlocks.registerBlock(name, new PedestalBlock(source));
}
/**
* Register new Pedestal block with specified mod id.
*
* @param id pedestal id
* @param source source block
* @return new Pedestal block with specified id.
*/
public static Block registerPedestal(ResourceLocation id, Block source) {
return EndBlocks.registerBlock(id, new PedestalBlock(source));
}
protected final Block parent; protected final Block parent;
protected float height = 1.0F; protected float height = 1.0F;
public PedestalBlock(Block parent) { public PedestalBlock(Block parent) {
super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState()))); super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState())));
this.registerDefaultState(stateDefinition.any() this.registerDefaultState(
.setValue(STATE, PedestalState.DEFAULT) stateDefinition
.setValue(HAS_ITEM, false) .any()
.setValue(HAS_LIGHT, false)); .setValue(STATE, PedestalState.DEFAULT)
.setValue(HAS_ITEM, false)
.setValue(HAS_LIGHT, false)
);
this.parent = parent; this.parent = parent;
} }
@ -118,28 +95,29 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
} }
@Override @Override
@Deprecated @SuppressWarnings("deprecation")
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
if (world.isClientSide || !state.is(this)) return InteractionResult.CONSUME; if (!state.is(this) || !isPlaceable(state)) {
if (!isPlaceable(state)) {
return InteractionResult.PASS; return InteractionResult.PASS;
} }
BlockEntity blockEntity = world.getBlockEntity(pos); BlockEntity blockEntity = level.getBlockEntity(pos);
if (blockEntity instanceof PedestalBlockEntity) { if (blockEntity instanceof PedestalBlockEntity) {
PedestalBlockEntity pedestal = (PedestalBlockEntity) blockEntity; PedestalBlockEntity pedestal = (PedestalBlockEntity) blockEntity;
if (pedestal.isEmpty()) { if (pedestal.isEmpty()) {
ItemStack itemStack = player.getItemInHand(hand); ItemStack itemStack = player.getItemInHand(hand);
if (itemStack.isEmpty()) return InteractionResult.CONSUME; if (itemStack.isEmpty()) return InteractionResult.CONSUME;
pedestal.setItem(0, itemStack); pedestal.setItem(0, itemStack);
checkRitual(world, pos); level.blockEntityChanged(pos);
return InteractionResult.SUCCESS; checkRitual(level, pos);
return InteractionResult.sidedSuccess(level.isClientSide());
} }
else { else {
ItemStack itemStack = pedestal.getItem(0); ItemStack itemStack = pedestal.getItem(0);
if (player.addItem(itemStack)) { if (player.addItem(itemStack)) {
pedestal.removeItemNoUpdate(0); pedestal.removeItemNoUpdate(0);
checkRitual(world, pos); level.blockEntityChanged(pos);
return InteractionResult.SUCCESS; checkRitual(level, pos);
return InteractionResult.sidedSuccess(level.isClientSide());
} }
return InteractionResult.FAIL; return InteractionResult.FAIL;
} }
@ -207,7 +185,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
} }
@Override @Override
@Deprecated @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) {
BlockState updated = getUpdatedState(state, direction, newState, world, pos, posFrom); BlockState updated = getUpdatedState(state, direction, newState, world, pos, posFrom);
if (!updated.is(this)) return updated; if (!updated.is(this)) return updated;
@ -344,7 +322,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
} }
@Override @Override
@Deprecated @SuppressWarnings("deprecation")
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
if (state.is(this)) { if (state.is(this)) {
switch (state.getValue(STATE)) { switch (state.getValue(STATE)) {
@ -386,13 +364,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
} }
@Override @Override
@Deprecated @SuppressWarnings("deprecation")
public boolean hasAnalogOutputSignal(BlockState state) { public boolean hasAnalogOutputSignal(BlockState state) {
return state.getBlock() instanceof PedestalBlock; return state.getBlock() instanceof PedestalBlock;
} }
@Override @Override
@Deprecated @SuppressWarnings("deprecation")
public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
return state.getValue(HAS_ITEM) ? 15 : 0; return state.getValue(HAS_ITEM) ? 15 : 0;
} }
@ -446,17 +424,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
protected Map<String, String> createTexturesMap() { protected Map<String, String> createTexturesMap() {
ResourceLocation blockId = Registry.BLOCK.getKey(parent); ResourceLocation blockId = Registry.BLOCK.getKey(parent);
String name = blockId.getPath(); String name = blockId.getPath();
return new HashMap<String, String>() { Map<String, String> textures = Maps.newHashMap();
private static final long serialVersionUID = 1L; textures.put("%mod%", blockId.getNamespace());
textures.put("%top%", name + "_top");
{ textures.put("%base%", name + "_base");
put("%mod%", blockId.getNamespace()); textures.put("%pillar%", name + "_pillar");
put("%top%", name + "_top"); textures.put("%bottom%", name + "_bottom");
put("%base%", name + "_base"); return textures;
put("%pillar%", name + "_pillar");
put("%bottom%", name + "_bottom");
}
};
} }
static { static {
@ -478,9 +452,9 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
SHAPE_BOTTOM = Shapes.or(basin, SHAPE_PILLAR); SHAPE_BOTTOM = Shapes.or(basin, SHAPE_PILLAR);
} }
@Override /*@Override
@Nullable @Nullable
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) { public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
return level.isClientSide() ? PedestalBlockEntity::tick : null; return level.isClientSide() ? PedestalBlockEntity::tick : null;
} }*/
} }

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
@ -62,7 +62,7 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
if (blockEntity.hasRitual()) { if (blockEntity.hasRitual()) {
blockEntity.linkedRitual.tick(); blockEntity.linkedRitual.tick();
} }
PedestalBlockEntity.tick(level, blockPos, blockState, blockEntity); //PedestalBlockEntity.tick(level, blockPos, blockState, blockEntity);
} }
} }
} }

View file

@ -1,12 +1,11 @@
package ru.betterend.blocks.entities; package ru.betterend.blocks.entities;
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.network.protocol.game.ClientboundBlockEntityDataPacket;
import net.minecraft.world.Container; import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Player; 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.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -14,12 +13,9 @@ import ru.betterend.blocks.basis.PedestalBlock;
import ru.betterend.registry.EndBlockEntities; import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class PedestalBlockEntity extends BlockEntity implements Container, BlockEntityClientSerializable { public class PedestalBlockEntity extends BlockEntity implements Container {
private ItemStack activeItem = ItemStack.EMPTY; private ItemStack activeItem = ItemStack.EMPTY;
private final int maxAge = 314;
private int age;
public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) { public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) {
this(EndBlockEntities.PEDESTAL, blockPos, blockState); this(EndBlockEntities.PEDESTAL, blockPos, blockState);
} }
@ -28,12 +24,17 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
super(blockEntityType, blockPos, blockState); super(blockEntityType, blockPos, blockState);
} }
public int getAge() { protected void toTag(CompoundTag tag) {
return age; if (activeItem != ItemStack.EMPTY) {
tag.put("active_item", activeItem.save(new CompoundTag()));
}
} }
public int getMaxAge() { protected void fromTag(CompoundTag tag) {
return maxAge; if (tag.contains("active_item")) {
CompoundTag itemTag = tag.getCompound("active_item");
activeItem = ItemStack.of(itemTag);
}
} }
@Override @Override
@ -98,7 +99,6 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
super.setChanged(); super.setChanged();
} }
@Override @Override
public boolean stillValid(Player player) { public boolean stillValid(Player player) {
return true; return true;
@ -111,38 +111,18 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block
} }
@Override @Override
public CompoundTag save(CompoundTag tag) { protected void saveAdditional(CompoundTag tag) {
tag.put("active_item", activeItem.save(new CompoundTag())); super.saveAdditional(tag);
return super.save(tag); toTag(tag);
} }
@Override @Override
public void fromClientTag(CompoundTag tag) { public ClientboundBlockEntityDataPacket getUpdatePacket() {
fromTag(tag); return ClientboundBlockEntityDataPacket.create(this);
} }
@Override @Override
public CompoundTag toClientTag(CompoundTag tag) { public CompoundTag getUpdateTag() {
return save(tag); return this.saveWithoutMetadata();
}
protected void fromTag(CompoundTag tag) {
if (tag.contains("active_item")) {
CompoundTag itemTag = tag.getCompound("active_item");
activeItem = ItemStack.of(itemTag);
}
}
public static <T extends BlockEntity> void tick(Level level, BlockPos blockPos, BlockState blockState, T uncastedEntity) {
clientTick(level, blockPos, blockState, (PedestalBlockEntity) uncastedEntity);
}
private static void clientTick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) {
if (!blockEntity.isEmpty()) {
blockEntity.age++;
if (blockEntity.age > blockEntity.maxAge) {
blockEntity.age = 0;
}
}
} }
} }

View file

@ -19,6 +19,7 @@ import ru.bclib.util.MHelper;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.AuroraCrystalBlock; import ru.betterend.blocks.AuroraCrystalBlock;
// TODO make crystals bright
public class EternalCrystalRenderer { public class EternalCrystalRenderer {
private static final RenderType RENDER_LAYER; private static final RenderType RENDER_LAYER;
private static final ModelPart[] SHARDS; private static final ModelPart[] SHARDS;
@ -116,7 +117,7 @@ public class EternalCrystalRenderer {
} }
static { static {
RENDER_LAYER = RenderType.beaconBeam(BetterEnd.makeID("textures/entity/eternal_crystal.png"), true); RENDER_LAYER = RenderType.itemEntityTranslucentCull(BetterEnd.makeID("textures/entity/eternal_crystal.png"));
SHARDS = new ModelPart[4]; SHARDS = new ModelPart[4];
ModelPart root = getTexturedModelData().bakeRoot(); ModelPart root = getTexturedModelData().bakeRoot();

View file

@ -24,7 +24,6 @@ import ru.betterend.registry.EndItems;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public class PedestalItemRenderer<T extends PedestalBlockEntity> implements BlockEntityRenderer<T> { public class PedestalItemRenderer<T extends PedestalBlockEntity> implements BlockEntityRenderer<T> {
public PedestalItemRenderer(BlockEntityRendererProvider.Context ctx) { public PedestalItemRenderer(BlockEntityRendererProvider.Context ctx) {
super(); super();
} }
@ -41,7 +40,6 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
matrices.pushPose(); matrices.pushPose();
Minecraft minecraft = Minecraft.getInstance(); Minecraft minecraft = Minecraft.getInstance();
//TODO: check i=0
BakedModel model = minecraft.getItemRenderer().getModel(activeItem, world, null, 0); BakedModel model = minecraft.getItemRenderer().getModel(activeItem, world, null, 0);
Vector3f translate = model.getTransforms().ground.translation; Vector3f translate = model.getTransforms().ground.translation;
PedestalBlock pedestal = (PedestalBlock) state.getBlock(); PedestalBlock pedestal = (PedestalBlock) state.getBlock();
@ -52,28 +50,17 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
else { else {
matrices.scale(1.25F, 1.25F, 1.25F); matrices.scale(1.25F, 1.25F, 1.25F);
} }
int age = blockEntity.getAge(); int age = (int) (minecraft.level.getGameTime() % 314);
if (state.is(EndBlocks.ETERNAL_PEDESTAL) && state.getValue(EternalPedestal.ACTIVATED)) { if (state.is(EndBlocks.ETERNAL_PEDESTAL) && state.getValue(EternalPedestal.ACTIVATED)) {
float[] colors = EternalCrystalRenderer.colors(age); float[] colors = EternalCrystalRenderer.colors(age);
int y = blockEntity.getBlockPos().getY(); int y = blockEntity.getBlockPos().getY();
BeamRenderer.renderLightBeam( BeamRenderer.renderLightBeam(matrices, vertexConsumers, age, tickDelta, -y, 1024 - y, colors, 0.25F, 0.13F, 0.16F);
matrices, float altitude = Mth.sin((age + tickDelta) / 10.0F) * 0.1F + 0.1F;
vertexConsumers,
age,
tickDelta,
-y,
1024 - y,
colors,
0.25F,
0.13F,
0.16F
);
float altitude = Mth.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F;
matrices.translate(0.0D, altitude, 0.0D); matrices.translate(0.0D, altitude, 0.0D);
} }
if (activeItem.getItem() == Items.END_CRYSTAL) { if (activeItem.getItem() == Items.END_CRYSTAL) {
EndCrystalRenderer.render(age, blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light); EndCrystalRenderer.render(age, 314, tickDelta, matrices, vertexConsumers, light);
} }
else if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) { else if (activeItem.getItem() == EndItems.ETERNAL_CRYSTAL) {
EternalCrystalRenderer.render(age, tickDelta, matrices, vertexConsumers, light); EternalCrystalRenderer.render(age, tickDelta, matrices, vertexConsumers, light);
@ -81,16 +68,7 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> implements Bloc
else { else {
float rotation = (age + tickDelta) / 25.0F + 6.0F; float rotation = (age + tickDelta) / 25.0F + 6.0F;
matrices.mulPose(Vector3f.YP.rotation(rotation)); matrices.mulPose(Vector3f.YP.rotation(rotation));
minecraft.getItemRenderer() minecraft.getItemRenderer().render(activeItem, ItemTransforms.TransformType.GROUND, false, matrices, vertexConsumers, light, overlay, model);
.render(activeItem,
ItemTransforms.TransformType.GROUND,
false,
matrices,
vertexConsumers,
light,
overlay,
model
);
} }
matrices.popPose(); matrices.popPose();
} }

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 { public class OldBulbisGardens extends EndBiome.Config {
shadowHEIGHTMAP_SQUARE = Decorators.HEIGHTMAP_SQUARE;
}
}
public class OldBulbisGardens extends EndBiome {
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) {
@ -82,7 +82,8 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
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) {
@ -86,7 +86,8 @@ 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;
@ -55,12 +52,13 @@ public class REIPlugin implements REIClientPlugin {
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>> getEndCity();
}

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")) // @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 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())) { // if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) {
return; // return;
} // }
//
// be_lastWorld = session.getLevelId();
// //ServerLevel world = ServerLevel.class.cast(this);
// //EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY));
// }
be_lastWorld = session.getLevelId(); @Inject(method = "<init>*", at = @At("TAIL"))
ServerLevel world = ServerLevel.class.cast(this); 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) {
EndBiomes.onWorldLoad(world.getSeed(), world.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY)); ServerLevel level = ServerLevel.class.cast(this);
if (level.dimension() == Level.END) {
TerrainGenerator.initNoise(seed, chunkGenerator.getBiomeSource(), chunkGenerator.climateSampler());
}
} }
@Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true) @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>> getEndCity(){
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,29 +1,42 @@
package ru.betterend.registry; package ru.betterend.registry;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.minecraft.core.Registry;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation; import net.minecraft.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.VerticalAnchor;
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.HeightRangePlacement;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.placement.PlacementModifier;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.features.BCLCommonFeatures;
import ru.bclib.api.features.BCLFeatureBuilder;
import ru.bclib.util.JsonFactory;
import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.biomes.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.bclib.world.features.ListFeature.StructureInfo;
import ru.bclib.world.features.NBTStructureFeature.TerrainMerge;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.complexmaterials.StoneMaterial; import ru.betterend.complexmaterials.StoneMaterial;
import ru.betterend.config.Configs; import ru.betterend.config.Configs;
import ru.betterend.world.biome.cave.EndCaveBiome; import ru.betterend.world.biome.cave.EndCaveBiome;
import ru.betterend.world.biome.land.UmbraValleyBiome;
import ru.betterend.world.features.BiomeIslandFeature; import ru.betterend.world.features.BiomeIslandFeature;
import ru.betterend.world.features.BlueVineFeature; import ru.betterend.world.features.BlueVineFeature;
import ru.betterend.world.features.BuildingListFeature;
import ru.betterend.world.features.CavePumpkinFeature; import ru.betterend.world.features.CavePumpkinFeature;
import ru.betterend.world.features.CharniaFeature; import ru.betterend.world.features.CharniaFeature;
import ru.betterend.world.features.CrashedShipFeature; import ru.betterend.world.features.CrashedShipFeature;
@ -81,29 +94,27 @@ import ru.betterend.world.features.trees.MossyGlowshroomFeature;
import ru.betterend.world.features.trees.PythadendronTreeFeature; import ru.betterend.world.features.trees.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.io.InputStream;
import java.util.List; import java.util.List;
import java.util.function.Supplier;
public class EndFeatures { public class EndFeatures {
// Trees // // Trees //
public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 3); public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom", new MossyGlowshroomFeature(), 2);
public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree", new PythadendronTreeFeature(), 2); public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree", new PythadendronTreeFeature(), 1);
public static final BCLFeature LACUGROVE = redisterVegetation("lacugrove", new LacugroveFeature(), 4); public static final BCLFeature LACUGROVE = redisterVegetation("lacugrove", new LacugroveFeature(), 4);
public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 3); public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 2);
public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 3); public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 2);
public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 2); public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 1);
public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 4); public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 2);
public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 3); public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 2);
public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita", new GiganticAmaranitaFeature(), 1); public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita", new GiganticAmaranitaFeature(), 1);
public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3); public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3);
// Bushes // // Bushes //
public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.getBark()), 4); public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.getBark()), 3);
public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.getBark()), 15); public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.getBark()), 5);
public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 10); public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 6);
public static final BCLFeature LUMECORN = redisterVegetation("lumecorn", new Lumecorn(), 5); public static final BCLFeature LUMECORN = redisterVegetation("lumecorn", new Lumecorn(), 5);
public static final BCLFeature LARGE_AMARANITA = redisterVegetation("large_amaranita", new LargeAmaranitaFeature(), 5); public static final BCLFeature LARGE_AMARANITA = redisterVegetation("large_amaranita", new LargeAmaranitaFeature(), 5);
public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.getBark()), 10); public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.getBark()), 10);
@ -111,23 +122,23 @@ public class EndFeatures {
public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2); public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2);
// Plants // // Plants //
public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5); public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 3);
public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5); public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 3);
public static final BCLFeature BLUE_VINE = redisterVegetation("blue_vine", new BlueVineFeature(), 1); public static final BCLFeature BLUE_VINE = redisterVegetation("blue_vine", new BlueVineFeature(), 1);
public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 5); public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 3);
public static final BCLFeature CRYSTAL_GRASS = redisterVegetation("crystal_grass", new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), 5); public static final BCLFeature CRYSTAL_GRASS = redisterVegetation("crystal_grass", new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), 5);
public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant", new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), 9); public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant", new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6), 5);
public static final BCLFeature MURKWEED = redisterVegetation("murkweed", new SinglePlantFeature(EndBlocks.MURKWEED, 3), 2); public static final BCLFeature MURKWEED = redisterVegetation("murkweed", new SinglePlantFeature(EndBlocks.MURKWEED, 3), 2);
public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass", new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), 2); public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass", new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3), 1);
public static final BCLFeature SHADOW_BERRY = redisterVegetation("shadow_berry", new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2), 1); public static final BCLFeature SHADOW_BERRY = redisterVegetation("shadow_berry", new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2), 1);
public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), 20); public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 8, false), 10);
public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), 10); public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg", new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5), 8);
public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 9); public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass", new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6), 7);
public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 3); public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 2);
public static final BCLFeature GLOW_PILLAR = redisterVegetation("glow_pillar", new GlowPillarFeature(), 1); public static final BCLFeature GLOW_PILLAR = redisterVegetation("glow_pillar", new GlowPillarFeature(), 1);
public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 5); public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss", new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS_TALL, 6), 3);
public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 8); public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass", new SinglePlantFeature(EndBlocks.JUNGLE_GRASS, 7, 3), 6);
public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 4); public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor", new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM, 5, 5), 2);
public static final BCLFeature BLOSSOM_BERRY = redisterVegetation("blossom_berry", new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), 2); public static final BCLFeature BLOSSOM_BERRY = redisterVegetation("blossom_berry", new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY, 3, 3), 2);
public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation("blooming_cooksonia", new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), 5); public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation("blooming_cooksonia", new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA, 5), 5);
public static final BCLFeature SALTEAGO = redisterVegetation("salteago", new SinglePlantFeature(EndBlocks.SALTEAGO, 5), 5); public static final BCLFeature SALTEAGO = redisterVegetation("salteago", new SinglePlantFeature(EndBlocks.SALTEAGO, 5), 5);
@ -144,7 +155,7 @@ public class EndFeatures {
public static final BCLFeature GLOBULAGUS = redisterVegetation("globulagus", new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), 6); public static final BCLFeature GLOBULAGUS = redisterVegetation("globulagus", new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3), 6);
public static final BCLFeature CLAWFERN = redisterVegetation("clawfern", new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), 5); public static final BCLFeature CLAWFERN = redisterVegetation("clawfern", new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4), 5);
public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation("bolux_mushroom", new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM, 5, 5), 2); public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation("bolux_mushroom", new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM, 5, 5), 2);
public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 5), 1); public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 3, 5), 1);
public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root", new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), 1); public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root", new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), 1);
//public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1); //public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1);
public static final BCLFeature INFLEXIA = redisterVegetation("inflexia", new SinglePlantFeature(EndBlocks.INFLEXIA, 7, false, 3), 16); public static final BCLFeature INFLEXIA = redisterVegetation("inflexia", new SinglePlantFeature(EndBlocks.INFLEXIA, 7, false, 3), 16);
@ -152,8 +163,8 @@ public class EndFeatures {
// Vines // // Vines //
public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3); public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 3); public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 1);
public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5); public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 3);
public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine", new VineFeature(EndBlocks.JUNGLE_VINE, 24), 5); public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine", new VineFeature(EndBlocks.JUNGLE_VINE, 24), 5);
// Ceil plants // Ceil plants
@ -197,7 +208,7 @@ public class EndFeatures {
public static final BCLFeature CHARNIA_GREEN = redisterVegetation("charnia_green", new CharniaFeature(EndBlocks.CHARNIA_GREEN), 10); public static final BCLFeature CHARNIA_GREEN = redisterVegetation("charnia_green", new CharniaFeature(EndBlocks.CHARNIA_GREEN), 10);
public static final BCLFeature MENGER_SPONGE = redisterVegetation("menger_sponge", new MengerSpongeFeature(5), 1); public static final BCLFeature MENGER_SPONGE = redisterVegetation("menger_sponge", new MengerSpongeFeature(5), 1);
public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED),2); public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED),2);
public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured(BetterEnd.makeID("overworld_island"), Decoration.RAW_GENERATION, new BiomeIslandFeature()); public static final BCLFeature BIOME_ISLAND = BCLFeatureBuilder.start(BetterEnd.makeID("overworld_island"), new BiomeIslandFeature()).decoration(Decoration.RAW_GENERATION).build();
public static final BCLFeature FLAMAEA = redisterVegetation("flamaea", new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), 20); public static final BCLFeature FLAMAEA = redisterVegetation("flamaea", new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), 20);
// Terrain // // Terrain //
@ -206,11 +217,11 @@ public class EndFeatures {
public static final BCLFeature END_LAKE_RARE = registerLake("end_lake_rare", new EndLakeFeature(), 40); public static final BCLFeature END_LAKE_RARE = registerLake("end_lake_rare", new EndLakeFeature(), 40);
public static final BCLFeature DESERT_LAKE = registerLake("desert_lake", new DesertLakeFeature(), 8); public static final BCLFeature DESERT_LAKE = registerLake("desert_lake", new DesertLakeFeature(), 8);
public static final BCLFeature ROUND_CAVE = registerRawGen("round_cave", new RoundCaveFeature(), 2); public static final BCLFeature ROUND_CAVE = registerRawGen("round_cave", new RoundCaveFeature(), 2);
public static final BCLFeature SPIRE = registerRawGen("spire", new SpireFeature(), 2); public static final BCLFeature SPIRE = registerRawGen("spire", new SpireFeature(), 4);
public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8); public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8);
public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8); public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8);
public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8); public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8);
public static final BCLFeature SULPHURIC_CAVE = BCLFeature.makeCountFeature(BetterEnd.makeID("sulphuric_cave"), Decoration.RAW_GENERATION, new SulphuricCaveFeature(), 2); public static final BCLFeature SULPHURIC_CAVE = BCLCommonFeatures.makeCountFeature(BetterEnd.makeID("sulphuric_cave"), Decoration.RAW_GENERATION, new SulphuricCaveFeature(), 2);
public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15); public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
public static final BCLFeature ICE_STAR_SMALL = registerRawGen("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8); public static final BCLFeature ICE_STAR_SMALL = registerRawGen("ice_star_small", new IceStarFeature(3, 5, 7, 12), 8);
public static final BCLFeature SURFACE_VENT = registerChanced("surface_vent", new SurfaceVentFeature(), 4); public static final BCLFeature SURFACE_VENT = registerChanced("surface_vent", new SurfaceVentFeature(), 4);
@ -218,21 +229,18 @@ public class EndFeatures {
public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced("obsidian_pillar_basement", new ObsidianPillarBasementFeature(), 8); public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced("obsidian_pillar_basement", new ObsidianPillarBasementFeature(), 8);
public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder", new ObsidianBoulderFeature(), 10); public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder", new ObsidianBoulderFeature(), 10);
public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20); public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20);
public static final BCLFeature TUNEL_CAVE = BCLFeature.makeChunkFeature(BetterEnd.makeID("tunel_cave"), Decoration.RAW_GENERATION, new TunelCaveFeature()); public static final BCLFeature TUNEL_CAVE = BCLCommonFeatures.makeChunkFeature(BetterEnd.makeID("tunel_cave"), Decoration.RAW_GENERATION, new TunelCaveFeature());
public static final BCLFeature UMBRALITH_ARCH = registerChanced( public static final BCLFeature UMBRALITH_ARCH = registerChanced("umbralith_arch", new ArchFeature(
"umbralith_arch", EndBlocks.UMBRALITH.stone,
new ArchFeature( pos -> UmbraValleyBiome.getSurface(pos.getX(), pos.getZ()).defaultBlockState()
EndBlocks.UMBRALITH.stone, ), 10);
UmbraSurfaceBuilder::getSurfaceState
),
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);
// Ores // // Ores //
public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8, 5, 128); public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8);
public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4, 5, 128); public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4);
public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 24, 6, 5, 128); public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 60, 6);
public static final BCLFeature DRAGON_BONE_BLOCK_ORE = registerOre("dragon_bone_ore", EndBlocks.DRAGON_BONE_BLOCK, 24, 8, 5, 128); public static final BCLFeature DRAGON_BONE_BLOCK_ORE = registerOre("dragon_bone_ore", EndBlocks.DRAGON_BONE_BLOCK, 24, 8);
public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer", EndBlocks.VIOLECITE, 15, 16, 128, 8); public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer", EndBlocks.VIOLECITE, 15, 16, 128, 8);
public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer", EndBlocks.FLAVOLITE, 12, 16, 128, 6); public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer", EndBlocks.FLAVOLITE, 12, 16, 128, 6);
@ -274,30 +282,29 @@ public class EndFeatures {
public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature(); public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature();
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) { private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density); ResourceLocation id = BetterEnd.makeID(name);
return BCLFeatureBuilder.start(id, feature).countLayersMax(density).onlyInBiome().build();
} }
private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) { private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance); return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
} }
private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) { private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance); return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.LAKES, feature, chance);
} }
private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) { private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLFeature.makeChancedFeature(BetterEnd.makeID(name), Decoration.SURFACE_STRUCTURES, feature, chance); return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.SURFACE_STRUCTURES, feature, chance);
} }
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int minY, int maxY) { private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize) {
return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, Blocks.END_STONE, veins, veinSize, minY, maxY); return BCLCommonFeatures.makeOreFeature(BetterEnd.makeID(name), blockOre, Blocks.END_STONE, veins, veinSize, 0, HeightRangePlacement.uniform(VerticalAnchor.bottom(), VerticalAnchor.absolute(128)), false);
} }
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) { 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 +312,81 @@ 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) {
BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
BCLBiome bclbiome = BiomeAPI.getBiome(id);
BCLFeature feature = getBiomeStructures(bclbiome);
if (feature != null) {
BiomeAPI.addBiomeFeature(biome, feature);
}
if (id.getNamespace().equals(BetterEnd.MOD_ID)) { if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
return; return;
} }
if (GeneratorOptions.removeChorusFromVanillaBiomes()) {
if (id.getNamespace().equals("minecraft")) {
String path = id.getPath();
if (path.equals("end_highlands") || path.equals("end_midlands") || path.equals("small_end_islands")) {
int pos = GenerationStep.Decoration.VEGETAL_DECORATION.ordinal();
if (pos < features.size()) {
List<Supplier<ConfiguredFeature<?, ?>>> list = features.get(pos);
// If only chorus plants are enabled
if (list.size() == 1) {
features.get(pos).clear();
}
}
}
}
}
addFeature(FLAVOLITE_LAYER, features);
addFeature(THALLASIUM_ORE, features);
addFeature(ENDER_ORE, features);
addFeature(CRASHED_SHIP, features);
BCLBiome bclbiome = BiomeAPI.getBiome(id);
boolean hasCaves = bclbiome.getCustomData("has_caves", true) && !(bclbiome instanceof EndCaveBiome); 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); BiomeAPI.addBiomeFeature(biome, ROUND_CAVE);
addFeature(TUNEL_CAVE, features); BiomeAPI.addBiomeFeature(biome, TUNEL_CAVE);
} }
} }
BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature();
if (feature != null) {
addFeature(feature, features);
}
} }
public static void addDefaultFeatures(BCLBiomeDef def) { private static BCLFeature getBiomeStructures(BCLBiome biome) {
def.addFeature(FLAVOLITE_LAYER); String ns = biome.getID().getNamespace();
def.addFeature(THALLASIUM_ORE); String nm = biome.getID().getPath();
def.addFeature(ENDER_ORE); ResourceLocation id = new ResourceLocation(ns, nm + "_structures");
def.addFeature(CRASHED_SHIP);
if (def.getID().getPath().endsWith("_cave")) { if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
return; PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
Feature<?> feature = Registry.FEATURE.get(id);
return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
} }
boolean hasCaves = def.getCustomData("has_caves", true); String path = "/data/" + ns + "/structures/biome/" + nm + "/";
hasCaves = Configs.BIOME_CONFIG.getBoolean(def.getID(), "hasCaves", hasCaves); InputStream inputstream = EndFeatures.class.getResourceAsStream(path + "structures.json");
if (inputstream != null) {
JsonObject obj = JsonFactory.getJsonObject(inputstream);
JsonArray structures = obj.getAsJsonArray("structures");
if (structures != null) {
List<StructureInfo> list = Lists.newArrayList();
structures.forEach((entry) -> {
JsonObject e = entry.getAsJsonObject();
String structure = path + e.get("nbt").getAsString() + ".nbt";
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
int offsetY = e.get("offsetY").getAsInt();
list.add(new StructureInfo(structure, offsetY, terrainMerge));
});
if (!list.isEmpty()) {
return BCLCommonFeatures.makeChancedFeature(
new ResourceLocation(ns, nm + "_structures"),
Decoration.SURFACE_STRUCTURES,
new BuildingListFeature(list, Blocks.END_STONE.defaultBlockState()),
10
);
}
}
}
return null;
}
public static BCLBiomeBuilder addDefaultFeatures(BCLBiomeBuilder builder, boolean hasCaves) {
builder.feature(FLAVOLITE_LAYER);
builder.feature(THALLASIUM_ORE);
builder.feature(ENDER_ORE);
builder.feature(CRASHED_SHIP);
if (hasCaves) { 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) { return builder;
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);
}
} }
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;
@ -442,7 +441,7 @@ public class EternalRitual {
} }
} }
if (targetWorld.dimension() == Level.END) { if (targetWorld.dimension() == Level.END) {
Features.END_ISLAND.place( net.minecraft.data.worldgen.features.EndFeatures.END_ISLAND.place(
targetWorld, targetWorld,
targetWorld.getChunkSource().getGenerator(), targetWorld.getChunkSource().getGenerator(),
new Random(basePos.asLong()), new Random(basePos.asLong()),
@ -450,15 +449,15 @@ public class EternalRitual {
); );
} }
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 +693,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 +732,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,35 +1,154 @@
package ru.betterend.util; package ru.betterend.util;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder; import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.FabricLootSupplierBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback; import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.storage.loot.entries.LootItem; import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemRandomChanceCondition;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator; import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.complexmaterials.WoodenComplexMaterial;
import ru.bclib.world.biomes.BCLBiome;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class LootTableUtil { public class LootTableUtil {
private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure"); private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure");
private static final ResourceLocation COMMON = BetterEnd.makeID("chests/common");
private static final ResourceLocation FOGGY_MUSHROOMLAND = BetterEnd.makeID("chests/foggy_mushroomland");
private static final ResourceLocation CHORUS_FOREST = BetterEnd.makeID("chests/chorus_forest");
private static final ResourceLocation SHADOW_FOREST = BetterEnd.makeID("chests/shadow_forest");
private static final ResourceLocation LANTERN_WOODS = BetterEnd.makeID("chests/lantern_woods");
private static final ResourceLocation UMBRELLA_JUNGLE = BetterEnd.makeID("chests/umbrella_jungle");
public static void init() { public static void init() {
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, supplier, setter) -> { LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, table, setter) -> {
if (END_CITY_TREASURE_ID.equals(id)) { if (END_CITY_TREASURE_ID.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder(); FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(0, 5)); builder.setRolls(ConstantValue.exactly(1));
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.5f).build()); builder.withCondition(LootItemRandomChanceCondition.randomChance(0.2f).build());
builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build()); builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build());
supplier.withPool(builder); table.withPool(builder);
builder = FabricLootPoolBuilder.builder(); builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(0, 5)); builder.setRolls(UniformGenerator.between(0, 3));
builder.withCondition(LootItemRandomChanceCondition.randomChance(0.1f).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build()); builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_GRASPING_AT_STARS).build()); builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_GRASPING_AT_STARS).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER).build()); builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA).build()); builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA).build());
supplier.withPool(builder); table.withPool(builder);
}
else if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
addCommonItems(table);
if (FOGGY_MUSHROOMLAND.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.MOSSY_GLOWSHROOM.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.MOSSY_GLOWSHROOM_SAPLING).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.BLUE_VINE_SEED).build());
table.withPool(builder);
}
else if (CHORUS_FOREST.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.PYTHADENDRON.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.PYTHADENDRON_SAPLING).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.CHORUS_MUSHROOM).build());
table.withPool(builder);
}
else if (SHADOW_FOREST.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.DRAGON_TREE.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.DRAGON_TREE_SAPLING).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.SHADOW_BERRY).build());
builder.withEntry(LootItem.lootTableItem(EndItems.SHADOW_BERRY_RAW).build());
table.withPool(builder);
}
else if (LANTERN_WOODS.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.LUCERNIA.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.LUCERNIA_SAPLING).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.BOLUX_MUSHROOM).build());
table.withPool(builder);
}
else if (UMBRELLA_JUNGLE.equals(id)) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.UMBRELLA_TREE.getBlock(WoodenComplexMaterial.BLOCK_PLANKS)).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.UMBRELLA_TREE_SAPLING).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.SMALL_JELLYSHROOM).build());
table.withPool(builder);
}
} }
}); });
} }
public static ResourceLocation getTable(Biome biome) {
BCLBiome bclBiome = BiomeAPI.getBiome(biome);
if (bclBiome == EndBiomes.FOGGY_MUSHROOMLAND) {
return FOGGY_MUSHROOMLAND;
}
else if (bclBiome == EndBiomes.CHORUS_FOREST) {
return CHORUS_FOREST;
}
else if (bclBiome == EndBiomes.SHADOW_FOREST) {
return SHADOW_FOREST;
}
else if (bclBiome == EndBiomes.LANTERN_WOODS) {
return LANTERN_WOODS;
}
else if (bclBiome == EndBiomes.UMBRELLA_JUNGLE) {
return UMBRELLA_JUNGLE;
}
return COMMON;
}
private static void addCommonItems(FabricLootSupplierBuilder table) {
FabricLootPoolBuilder builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(0, 2));
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_STRANGE_AND_ALIEN).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_GRASPING_AT_STARS).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_ENDSEEKER).build());
builder.withEntry(LootItem.lootTableItem(EndItems.MUSIC_DISC_EO_DRACONA).build());
table.withPool(builder);
builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(4, 8));
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.ingot).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.rawOre).build());
builder.withEntry(LootItem.lootTableItem(Items.ENDER_PEARL).build());
table.withPool(builder);
builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(2, 4));
builder.withEntry(LootItem.lootTableItem(EndBlocks.TERMINITE.ingot).build());
builder.withEntry(LootItem.lootTableItem(EndItems.ENDER_SHARD).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.AURORA_CRYSTAL).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.axe).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.pickaxe).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.hoe).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.sword).build());
builder.withEntry(LootItem.lootTableItem(EndBlocks.THALLASIUM.shovel).build());
builder.withEntry(LootItem.lootTableItem(Items.ENDER_EYE).build());
builder.withEntry(LootItem.lootTableItem(Blocks.OBSIDIAN).build());
table.withPool(builder);
builder = FabricLootPoolBuilder.builder();
builder.setRolls(UniformGenerator.between(0, 4));
builder.withEntry(LootItem.lootTableItem(EndBlocks.FLAVOLITE_RUNED).build());
builder.withEntry(LootItem.lootTableItem(EndItems.AETERNIUM_INGOT).build());
builder.withEntry(LootItem.lootTableItem(EndItems.AMBER_GEM).build());
builder.withEntry(LootItem.lootTableItem(Items.END_CRYSTAL).build());
builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build());
table.withPool(builder);
}
} }

View file

@ -0,0 +1,276 @@
package ru.betterend.util;
import com.google.common.collect.Sets;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper;
import java.util.Random;
import java.util.Set;
public class StructureErode {
private static final Direction[] DIR = BlocksHelper.makeHorizontal();
public static void erode(WorldGenLevel world, BoundingBox bounds, int iterations, Random random) {
MutableBlockPos mut = new MutableBlockPos();
boolean canDestruct = true;
for (int i = 0; i < iterations; i++) {
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
boolean ignore = ignore(state, world, mut);
if (canDestruct && BlocksHelper.isInvulnerable(
state,
world,
mut
) && random.nextInt(8) == 0 && world.isEmptyBlock(mut.below(2))) {
int r = MHelper.randRange(1, 4, random);
int cx = mut.getX();
int cy = mut.getY();
int cz = mut.getZ();
int x1 = cx - r;
int y1 = cy - r;
int z1 = cz - r;
int x2 = cx + r;
int y2 = cy + r;
int z2 = cz + r;
for (int px = x1; px <= x2; px++) {
int dx = px - cx;
dx *= dx;
mut.setX(px);
for (int py = y1; py <= y2; py++) {
int dy = py - cy;
dy *= dy;
mut.setY(py);
for (int pz = z1; pz <= z2; pz++) {
int dz = pz - cz;
dz *= dz;
mut.setZ(pz);
if (dx + dy + dz <= r && BlocksHelper.isInvulnerable(
world.getBlockState(mut),
world,
mut
)) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
}
}
}
}
mut.setX(cx);
mut.setY(cy);
mut.setZ(cz);
canDestruct = false;
continue;
}
else if (ignore) {
continue;
}
if (!state.isAir() && random.nextBoolean()) {
MHelper.shuffle(DIR, random);
for (Direction dir : DIR) {
if (world.isEmptyBlock(mut.relative(dir)) && world.isEmptyBlock(mut.below()
.relative(dir))) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
mut.move(dir).move(Direction.DOWN);
for (int py = mut.getY(); y >= bounds.minY() - 10; y--) {
mut.setY(py - 1);
if (!world.isEmptyBlock(mut)) {
mut.setY(py);
BlocksHelper.setWithoutUpdate(world, mut, state);
break;
}
}
}
}
break;
}
else if (random.nextInt(8) == 0 && !BlocksHelper.isInvulnerable(
world.getBlockState(mut.above()),
world,
mut
)) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
}
}
}
}
}
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (!ignore(state, world, mut) && world.isEmptyBlock(mut.below())) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
for (int py = mut.getY(); py >= bounds.minY() - 10; py--) {
mut.setY(py - 1);
if (!world.isEmptyBlock(mut)) {
mut.setY(py);
BlocksHelper.setWithoutUpdate(world, mut, state);
break;
}
}
}
}
}
}
}
public static void erodeIntense(WorldGenLevel world, BoundingBox bounds, Random random) {
MutableBlockPos mut = new MutableBlockPos();
MutableBlockPos mut2 = new MutableBlockPos();
int minY = bounds.minY() - 10;
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (!ignore(state, world, mut)) {
if (random.nextInt(6) == 0) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
if (random.nextBoolean()) {
int px = MHelper.floor(random.nextGaussian() * 2 + x + 0.5);
int pz = MHelper.floor(random.nextGaussian() * 2 + z + 0.5);
mut2.set(px, y, pz);
while (world.getBlockState(mut2).getMaterial().isReplaceable() && mut2.getY() > minY) {
mut2.setY(mut2.getY() - 1);
}
if (!world.getBlockState(mut2).isAir() && state.canSurvive(world, mut2)) {
mut2.setY(mut2.getY() + 1);
BlocksHelper.setWithoutUpdate(world, mut2, state);
}
}
}
else if (random.nextInt(8) == 0) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
}
}
}
}
}
drop(world, bounds);
}
private static void drop(WorldGenLevel world, BoundingBox bounds) {
MutableBlockPos mut = new MutableBlockPos();
Set<BlockPos> blocks = Sets.newHashSet();
Set<BlockPos> edge = Sets.newHashSet();
Set<BlockPos> add = Sets.newHashSet();
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
for (int y = bounds.minY(); y <= bounds.maxY(); y++) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (!ignore(state, world, mut) && isTerrainNear(world, mut)) {
edge.add(mut.immutable());
}
}
}
}
if (edge.isEmpty()) {
return;
}
while (!edge.isEmpty()) {
for (BlockPos center : edge) {
for (Direction dir : BlocksHelper.DIRECTIONS) {
BlockState state = world.getBlockState(center);
if (state.isCollisionShapeFullBlock(world, center)) {
mut.set(center).move(dir);
if (bounds.isInside(mut)) {
state = world.getBlockState(mut);
if (!ignore(state, world, mut) && !blocks.contains(mut)) {
add.add(mut.immutable());
}
}
}
}
}
blocks.addAll(edge);
edge.clear();
edge.addAll(add);
add.clear();
}
int minY = bounds.minY() - 10;
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
for (int y = bounds.minY(); y <= bounds.maxY(); y++) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (!ignore(state, world, mut) && !blocks.contains(mut)) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.AIR);
while (world.getBlockState(mut).getMaterial().isReplaceable() && mut.getY() > minY) {
mut.setY(mut.getY() - 1);
}
if (mut.getY() > minY) {
mut.setY(mut.getY() + 1);
BlocksHelper.setWithoutUpdate(world, mut, state);
}
}
}
}
}
}
private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(BlockTags.NYLIUM)) {
return true;
}
return !state.getMaterial().equals(Material.STONE) || BlocksHelper.isInvulnerable(state, world, pos);
}
private static boolean isTerrainNear(WorldGenLevel world, BlockPos pos) {
for (Direction dir : BlocksHelper.DIRECTIONS) {
if (world.getBlockState(pos.relative(dir)).is(TagAPI.BLOCK_GEN_TERRAIN)) {
return true;
}
}
return false;
}
public static void cover(WorldGenLevel world, BoundingBox bounds, Random random, BlockState defaultBlock) {
MutableBlockPos mut = new MutableBlockPos();
for (int x = bounds.minX(); x <= bounds.maxX(); x++) {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
BlockState top = BiomeAPI.findTopMaterial(world.getBiome(mut)).orElse(defaultBlock);
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (state.is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) {
BlocksHelper.setWithoutUpdate(world, mut, top);
}
}
}
}
}
}

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());
private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode());
private static final BlockState[] JADE = new BlockState[3];
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) {
super(biomeID, biome);
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState();
}
@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() { public JadeCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112) super("jade_cave");
.setFogDensity(2.0F)
.setWaterAndFogColor(95, 223, 255));
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState();
} }
@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,44 @@ 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
.setLoop(EndSounds.AMBIENT_AMBER_LAND) .fogColor(255, 184, 71)
.setParticles(EndParticles.AMBER_SPHERE, 0.001F) .fogDensity(2.0F)
.setSurface(EndBlocks.AMBER_MOSS) .plantsColor(219, 115, 38)
.addFeature(EndFeatures.AMBER_ORE) .waterAndFogColor(145, 108, 72)
.addFeature(EndFeatures.END_LAKE_RARE) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.HELIX_TREE) .loop(EndSounds.AMBIENT_AMBER_LAND)
.addFeature(EndFeatures.LANCELEAF) .particles(EndParticles.AMBER_SPHERE, 0.001F)
.addFeature(EndFeatures.GLOW_PILLAR) .feature(EndFeatures.AMBER_ORE)
.addFeature(EndFeatures.AMBER_GRASS) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.AMBER_ROOT) .feature(EndFeatures.HELIX_TREE)
.addFeature(EndFeatures.BULB_MOSS) .feature(EndFeatures.LANCELEAF)
.addFeature(EndFeatures.BULB_MOSS_WOOD) .feature(EndFeatures.GLOW_PILLAR)
.addFeature(EndFeatures.CHARNIA_ORANGE) .feature(EndFeatures.AMBER_GRASS)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.AMBER_ROOT)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.BULB_MOSS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) .feature(EndFeatures.BULB_MOSS_WOOD)
.addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); .feature(EndFeatures.CHARNIA_ORANGE)
.feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 4)
.spawn(EndEntities.END_SLIME, 30, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.AMBER_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,36 +1,55 @@
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
.addFeature(EndFeatures.TENANEA_BUSH) .fogColor(241, 146, 229)
.addFeature(EndFeatures.BULB_VINE) .fogDensity(1.7F)
.addFeature(EndFeatures.BUSHY_GRASS) .plantsColor(122, 45, 122)
.addFeature(EndFeatures.BUSHY_GRASS_WG) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.BLOSSOM_BERRY) .loop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
.addFeature(EndFeatures.TWISTED_MOSS) .feature(EndFeatures.SPIRE)
.addFeature(EndFeatures.TWISTED_MOSS_WOOD) .feature(EndFeatures.FLOATING_SPIRE)
.addFeature(EndFeatures.SILK_MOTH_NEST) .feature(EndFeatures.TENANEA)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) .feature(EndFeatures.TENANEA_BUSH)
.addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); .feature(EndFeatures.BULB_VINE)
.feature(EndFeatures.BUSHY_GRASS)
.feature(EndFeatures.BUSHY_GRASS_WG)
.feature(EndFeatures.BLOSSOM_BERRY)
.feature(EndFeatures.TWISTED_MOSS)
.feature(EndFeatures.TWISTED_MOSS_WOOD)
.feature(EndFeatures.SILK_MOTH_NEST)
.spawn(EntityType.ENDERMAN, 50, 1, 4)
.spawn(EndEntities.SILK_MOTH, 5, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.PINK_MOSS.defaultBlockState();
}
};
} }
} }

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.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
.setParticles(ParticleTypes.PORTAL, 0.01F) .fogColor(87, 26, 87)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST) .fogDensity(1.5F)
.setMusic(EndSounds.MUSIC_DARK) .plantsColor(122, 45, 122)
.addFeature(EndFeatures.VIOLECITE_LAYER) .waterAndFogColor(73, 30, 73)
.addFeature(EndFeatures.END_LAKE_RARE) .particles(ParticleTypes.PORTAL, 0.01F)
.addFeature(EndFeatures.PYTHADENDRON_TREE) .loop(EndSounds.AMBIENT_CHORUS_FOREST)
.addFeature(EndFeatures.PYTHADENDRON_BUSH) .music(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.PURPLE_POLYPORE) .feature(EndFeatures.VIOLECITE_LAYER)
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) .feature(EndFeatures.PYTHADENDRON_TREE)
.addFeature(EndFeatures.CHORUS_GRASS) .feature(EndFeatures.PYTHADENDRON_BUSH)
.addFeature(EndFeatures.CHORUS_MUSHROOM) .feature(EndFeatures.PURPLE_POLYPORE)
.addFeature(EndFeatures.TAIL_MOSS) .feature(Decoration.VEGETAL_DECORATION, EndPlacements.CHORUS_PLANT)
.addFeature(EndFeatures.TAIL_MOSS_WOOD) .feature(EndFeatures.CHORUS_GRASS)
.addFeature(EndFeatures.CHARNIA_PURPLE) .feature(EndFeatures.CHORUS_MUSHROOM)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.TAIL_MOSS)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.TAIL_MOSS_WOOD)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) .feature(EndFeatures.CHARNIA_PURPLE)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EndEntities.END_SLIME, 5, 1, 2)
.spawn(EntityType.ENDERMAN, 50, 1, 4);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.CHORUS_NYLIUM.defaultBlockState();
}
};
} }
} }

View file

@ -1,23 +1,37 @@
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
.addFeature(EndFeatures.CRYSTAL_GRASS) .structure(EndStructures.MOUNTAIN.getFeatureConfigured())
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .plantsColor(255, 133, 211)
.music(EndSounds.MUSIC_OPENSPACE)
.feature(EndFeatures.CRYSTAL_GRASS)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.CRYSTAL_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,35 +1,50 @@
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
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) .genChance(0.1f)
.setSurface(EndBlocks.SANGNUM) .fogColor(244, 46, 79)
.setWaterAndFogColor(203, 59, 167) .fogDensity(1.3F)
.setPlantsColor(244, 46, 79) .particles(EndParticles.FIREFLY, 0.0007F)
.addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.DRAGON_BONE_BLOCK_ORE) .loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.addFeature(EndFeatures.FALLEN_PILLAR) .waterAndFogColor(203, 59, 167)
.addFeature(EndFeatures.OBSIDIAN_BOULDER) .plantsColor(244, 46, 79)
.addFeature(EndFeatures.GIGANTIC_AMARANITA) .feature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
.addFeature(EndFeatures.LARGE_AMARANITA) .feature(EndFeatures.DRAGON_BONE_BLOCK_ORE)
.addFeature(EndFeatures.SMALL_AMARANITA) .feature(EndFeatures.FALLEN_PILLAR)
.addFeature(EndFeatures.GLOBULAGUS) .feature(EndFeatures.OBSIDIAN_BOULDER)
.addFeature(EndFeatures.CLAWFERN) .feature(EndFeatures.GIGANTIC_AMARANITA)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.LARGE_AMARANITA)
.feature(EndFeatures.SMALL_AMARANITA)
.feature(EndFeatures.GLOBULAGUS)
.feature(EndFeatures.CLAWFERN)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.SANGNUM.defaultBlockState();
}
};
} }
} }

View file

@ -1,29 +1,43 @@
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
.setMusic(EndSounds.MUSIC_OPENSPACE) .fogColor(132, 35, 13)
.addFeature(EndFeatures.LUCERNIA_BUSH_RARE) .fogDensity(1.2F)
.addFeature(EndFeatures.ORANGO) .waterAndFogColor(113, 88, 53)
.addFeature(EndFeatures.AERIDIUM) .plantsColor(237, 122, 66)
.addFeature(EndFeatures.LUTEBUS) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.LAMELLARIUM) .feature(EndFeatures.LUCERNIA_BUSH_RARE)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.ORANGO)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.AERIDIUM)
.feature(EndFeatures.LUTEBUS)
.feature(EndFeatures.LAMELLARIUM)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.RUTISCUS.defaultBlockState();
}
};
} }
} }

View file

@ -1,26 +1,54 @@
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.Blocks;
import ru.betterend.BetterEnd; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.SurfaceRules;
import net.minecraft.world.level.levelgen.placement.CaveSurface;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.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
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .fogColor(226, 239, 168)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .fogDensity(2)
.setMusic(EndSounds.MUSIC_OPENSPACE) .waterAndFogColor(192, 180, 131)
.addStructureFeature(StructureFeatures.END_CITY) .terrainHeight(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.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
@Override
public SurfaceRuleBuilder surface() {
return super
.surface()
.ceil(Blocks.END_STONE.defaultBlockState())
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
));
}
};
} }
} }

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,58 @@ 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
.setWaterAndFogColor(119, 227, 250) .structure(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured())
.setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM) .plantsColor(73, 210, 209)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .fogColor(41, 122, 173)
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND) .fogDensity(3)
.setMusic(EndSounds.MUSIC_FOREST) .waterAndFogColor(119, 227, 250)
.addFeature(EndFeatures.END_LAKE) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.MOSSY_GLOWSHROOM) .loop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
.addFeature(EndFeatures.BLUE_VINE) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.UMBRELLA_MOSS) .feature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.CREEPING_MOSS) .feature(EndFeatures.MOSSY_GLOWSHROOM)
.addFeature(EndFeatures.DENSE_VINE) .feature(EndFeatures.BLUE_VINE)
//.addFeature(EndFeatures.PEARLBERRY) .feature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CYAN_MOSS) .feature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.CYAN_MOSS_WOOD) .feature(EndFeatures.DENSE_VINE)
.addFeature(EndFeatures.END_LILY) //.feature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.BUBBLE_CORAL) .feature(EndFeatures.CYAN_MOSS)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.CYAN_MOSS_WOOD)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.END_LILY)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.BUBBLE_CORAL)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_CYAN)
.addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5) .feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addMobSpawn(EndEntities.END_FISH, 20, 2, 5) .feature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8) .structure(VANILLA_FEATURES.getEndCity())
.addMobSpawn(EndEntities.END_SLIME, 10, 1, 2) .spawn(EndEntities.DRAGONFLY, 80, 2, 5)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .spawn(EndEntities.END_FISH, 20, 2, 5)
.spawn(EndEntities.CUBOZOA, 10, 3, 8)
.spawn(EndEntities.END_SLIME, 10, 1, 2)
.spawn(EntityType.ENDERMAN, 10, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.END_MOSS.defaultBlockState();
}
@Override
public BlockState getAltTopMaterial() {
return EndBlocks.END_MYCELIUM.defaultBlockState();
}
};
} }
} }

View file

@ -1,40 +1,54 @@
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
.setSurface(EndBlocks.END_MOSS) .fogColor(99, 228, 247)
.setWaterAndFogColor(92, 250, 230) .fogDensity(1.3F)
.setPlantsColor(73, 210, 209) .particles(EndParticles.FIREFLY, 0.001F)
.addFeature(EndFeatures.END_LAKE_RARE) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.LUMECORN) .loop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.addFeature(EndFeatures.BLOOMING_COOKSONIA) .waterAndFogColor(92, 250, 230)
.addFeature(EndFeatures.SALTEAGO) .plantsColor(73, 210, 209)
.addFeature(EndFeatures.VAIOLUSH_FERN) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.FRACTURN) .feature(EndFeatures.LUMECORN)
.addFeature(EndFeatures.UMBRELLA_MOSS_RARE) .feature(EndFeatures.BLOOMING_COOKSONIA)
.addFeature(EndFeatures.CREEPING_MOSS_RARE) .feature(EndFeatures.SALTEAGO)
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE) .feature(EndFeatures.VAIOLUSH_FERN)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.FRACTURN)
.addFeature(EndFeatures.CHARNIA_GREEN) .feature(EndFeatures.UMBRELLA_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) .feature(EndFeatures.CREEPING_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_CYAN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.END_MOSS.defaultBlockState();
}
};
} }
} }

View file

@ -1,40 +1,54 @@
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
.setMusic(EndSounds.MUSIC_FOREST) .fogColor(189, 82, 70)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .fogDensity(1.1F)
.addFeature(EndFeatures.END_LAKE_NORMAL) .waterAndFogColor(171, 234, 226)
.addFeature(EndFeatures.FLAMAEA) .plantsColor(254, 85, 57)
.addFeature(EndFeatures.LUCERNIA) .music(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.LUCERNIA_BUSH) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.FILALUX) .feature(EndFeatures.END_LAKE_NORMAL)
.addFeature(EndFeatures.AERIDIUM) .feature(EndFeatures.FLAMAEA)
.addFeature(EndFeatures.LAMELLARIUM) .feature(EndFeatures.LUCERNIA)
.addFeature(EndFeatures.BOLUX_MUSHROOM) .feature(EndFeatures.LUCERNIA_BUSH)
.addFeature(EndFeatures.AURANT_POLYPORE) .feature(EndFeatures.FILALUX)
.addFeature(EndFeatures.POND_ANEMONE) .feature(EndFeatures.AERIDIUM)
.addFeature(EndFeatures.CHARNIA_ORANGE) .feature(EndFeatures.LAMELLARIUM)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.BOLUX_MUSHROOM)
.addFeature(EndFeatures.RUSCUS) .feature(EndFeatures.AURANT_POLYPORE)
.addFeature(EndFeatures.RUSCUS_WOOD) .feature(EndFeatures.POND_ANEMONE)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CHARNIA_ORANGE)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_RED)
.feature(EndFeatures.RUSCUS)
.feature(EndFeatures.RUSCUS_WOOD)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.RUTISCUS.defaultBlockState();
}
};
} }
} }

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
.setMusic(EndSounds.MUSIC_WATER) .structure(EndStructures.MEGALAKE.getFeatureConfigured())
.setLoop(EndSounds.AMBIENT_MEGALAKE) .plantsColor(73, 210, 209)
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST) .fogColor(178, 209, 248)
.setDepth(0F) .waterAndFogColor(96, 163, 255)
.addFeature(EndFeatures.END_LOTUS) .fogDensity(1.75F)
.addFeature(EndFeatures.END_LOTUS_LEAF) .music(EndSounds.MUSIC_WATER)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE) .loop(EndSounds.AMBIENT_MEGALAKE)
.addFeature(EndFeatures.END_LILY_RARE) .terrainHeight(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
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F) .structure(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
.setMusic(EndSounds.MUSIC_WATER) .plantsColor(73, 210, 209)
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE) .fogColor(178, 209, 248)
.setSurface(EndBlocks.END_MOSS) .waterAndFogColor(96, 163, 255)
.setDepth(0F) .fogDensity(2.0F)
.addFeature(EndFeatures.LACUGROVE) .particles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.END_LOTUS) .music(EndSounds.MUSIC_WATER)
.addFeature(EndFeatures.END_LOTUS_LEAF) .loop(EndSounds.AMBIENT_MEGALAKE_GROVE)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE) .terrainHeight(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,80 @@
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.Blocks;
import ru.betterend.BetterEnd; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.SurfaceRules;
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
import net.minecraft.world.level.levelgen.placement.CaveSurface;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.api.surface.rules.SwitchRuleSource;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.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;
import ru.betterend.world.surface.SplitNoiseCondition;
public class NeonOasisBiome extends EndBiome { import java.util.List;
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
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .genChance(0.5F)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .fogColor(226, 239, 168)
.setMusic(EndSounds.MUSIC_OPENSPACE) .fogDensity(2)
.addFeature(EndFeatures.DESERT_LAKE) .waterAndFogColor(106, 238, 215)
.addFeature(EndFeatures.NEON_CACTUS) .particles(ParticleTypes.WHITE_ASH, 0.01F)
.addFeature(EndFeatures.UMBRELLA_MOSS) .loop(EndSounds.AMBIENT_DUST_WASTELANDS)
.addFeature(EndFeatures.CREEPING_MOSS) .music(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.CHARNIA_GREEN) .feature(EndFeatures.DESERT_LAKE)
.addFeature(EndFeatures.CHARNIA_CYAN) .feature(EndFeatures.NEON_CACTUS)
.addFeature(EndFeatures.CHARNIA_RED) .feature(EndFeatures.UMBRELLA_MOSS)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.CREEPING_MOSS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_CYAN)
.feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
@Override
public BlockState getAltTopMaterial() {
return EndBlocks.END_MOSS.defaultBlockState();
}
@Override
public SurfaceRuleBuilder surface() {
RuleSource surfaceBlockRule = new SwitchRuleSource(
new SplitNoiseCondition(),
List.of(
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState()),
SurfaceRules.state(EndBlocks.END_MOSS.defaultBlockState())
)
);
return super
.surface()
.ceil(Blocks.END_STONE.defaultBlockState())
.rule(1, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
));
}
};
} }
} }

View file

@ -2,24 +2,39 @@ 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
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) .structure(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
.setSurface(EndBlocks.ENDSTONE_DUST) .fogColor(226, 239, 168)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .fogDensity(2)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .waterAndFogColor(192, 180, 131)
.music(EndSounds.MUSIC_OPENSPACE)
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
.particles(ParticleTypes.WHITE_ASH, 0.01F)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
};
} }
} }

View file

@ -1,44 +1,58 @@
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
.setParticles(ParticleTypes.MYCELIUM, 0.01F) .fogColor(0, 0, 0)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST) .fogDensity(2.5F)
.setMusic(EndSounds.MUSIC_DARK) .plantsColor(45, 45, 45)
.addFeature(EndFeatures.VIOLECITE_LAYER) .waterAndFogColor(42, 45, 80)
.addFeature(EndFeatures.END_LAKE_RARE) .particles(ParticleTypes.MYCELIUM, 0.01F)
.addFeature(EndFeatures.DRAGON_TREE) .loop(EndSounds.AMBIENT_CHORUS_FOREST)
.addFeature(EndFeatures.DRAGON_TREE_BUSH) .music(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.SHADOW_PLANT) .feature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.MURKWEED) .feature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.NEEDLEGRASS) .feature(EndFeatures.DRAGON_TREE)
.addFeature(EndFeatures.SHADOW_BERRY) .feature(EndFeatures.DRAGON_TREE_BUSH)
.addFeature(EndFeatures.TWISTED_VINE) .feature(EndFeatures.SHADOW_PLANT)
.addFeature(EndFeatures.PURPLE_POLYPORE) .feature(EndFeatures.MURKWEED)
.addFeature(EndFeatures.TAIL_MOSS) .feature(EndFeatures.NEEDLEGRASS)
.addFeature(EndFeatures.TAIL_MOSS_WOOD) .feature(EndFeatures.SHADOW_BERRY)
.addFeature(EndFeatures.CHARNIA_PURPLE) .feature(EndFeatures.TWISTED_VINE)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .feature(EndFeatures.PURPLE_POLYPORE)
.addStructureFeature(StructureFeatures.END_CITY) .feature(EndFeatures.TAIL_MOSS)
.addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4) .feature(EndFeatures.TAIL_MOSS_WOOD)
.addMobSpawn(EntityType.ENDERMAN, 40, 1, 4) .feature(EndFeatures.CHARNIA_PURPLE)
.addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); .feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.spawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
.spawn(EntityType.ENDERMAN, 40, 1, 4)
.spawn(EntityType.PHANTOM, 1, 1, 2);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.SHADOW_GRASS.defaultBlockState();
}
};
} }
} }

View file

@ -1,38 +1,93 @@
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 net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
import net.minecraft.world.level.levelgen.placement.CaveSurface;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.api.surface.rules.SwitchRuleSource;
import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.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) .terrainHeight(0F)
.addFeature(EndFeatures.CHARNIA_RED_RARE) .particles(EndParticles.SULPHUR_PARTICLE, 0.001F)
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8) .feature(EndFeatures.GEYSER)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) .feature(EndFeatures.SURFACE_VENT)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .feature(EndFeatures.SULPHURIC_LAKE)
.feature(EndFeatures.SULPHURIC_CAVE)
.feature(EndFeatures.HYDRALUX)
.feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_ORANGE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.spawn(EndEntities.END_FISH, 50, 3, 8)
.spawn(EndEntities.CUBOZOA, 50, 3, 8)
.spawn(EntityType.ENDERMAN, 50, 1, 4);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.FLAVOLITE.stone.defaultBlockState();
}
@Override
public BlockState getAltTopMaterial() {
return Blocks.END_STONE.defaultBlockState();
}
@Override
public boolean generateFloorRule() {
return false;
}
@Override
public SurfaceRuleBuilder surface() {
RuleSource surfaceBlockRule = new SwitchRuleSource(
new SulphuricSurfaceNoiseCondition(),
List.of(
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
SurfaceRules.state(surfaceMaterial().getTopMaterial()),
SULPHURIC_ROCK,
BRIMSTONE
)
);
return super
.surface()
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
.rule(2, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR), surfaceBlockRule));
}
};
} }
} }

View file

@ -1,27 +1,92 @@
package ru.betterend.world.biome.land; package ru.betterend.world.biome.land;
import ru.bclib.world.biomes.BCLBiomeDef; import net.minecraft.world.level.block.Block;
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.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;
import java.util.List;
public class UmbraValleyBiome extends EndBiome.Config {
private static final Block[] SURFACE_BLOCKS = new Block[] {
EndBlocks.PALLIDIUM_FULL,
EndBlocks.PALLIDIUM_HEAVY,
EndBlocks.PALLIDIUM_THIN,
EndBlocks.PALLIDIUM_TINY,
EndBlocks.UMBRALITH.stone
};
public class UmbraValleyBiome extends EndBiome {
public UmbraValleyBiome() { 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
.setLoop(EndSounds.UMBRA_VALLEY) .fogColor(100, 100, 100)
.setMusic(EndSounds.MUSIC_DARK) .plantsColor(172, 189, 190)
.addFeature(EndFeatures.UMBRALITH_ARCH) .waterAndFogColor(69, 104, 134)
.addFeature(EndFeatures.THIN_UMBRALITH_ARCH) .particles(EndParticles.AMBER_SPHERE, 0.0001F)
.addFeature(EndFeatures.INFLEXIA) .loop(EndSounds.UMBRA_VALLEY)
.addFeature(EndFeatures.FLAMMALIX) .music(EndSounds.MUSIC_DARK)
); .feature(EndFeatures.UMBRALITH_ARCH)
.feature(EndFeatures.THIN_UMBRALITH_ARCH)
.feature(EndFeatures.INFLEXIA)
.feature(EndFeatures.FLAMMALIX);
}
@Override
protected SurfaceMaterialProvider surfaceMaterial() {
return new EndBiome.DefaultSurfaceMaterialProvider() {
@Override
public BlockState getTopMaterial() {
return EndBlocks.UMBRALITH.stone.defaultBlockState();
}
@Override
public BlockState getUnderMaterial() {
return EndBlocks.UMBRALITH.stone.defaultBlockState();
}
@Override
public BlockState getAltTopMaterial() {
return EndBlocks.PALLIDIUM_FULL.defaultBlockState();
}
@Override
public boolean generateFloorRule() {
return false;
}
@Override
public SurfaceRuleBuilder surface() {
return super.surface()
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR,
new SwitchRuleSource(
new UmbraSurfaceNoiseCondition(),
List.of(
SurfaceRules.state(surfaceMaterial().getAltTopMaterial()),
PALLIDIUM_HEAVY,
PALLIDIUM_THIN,
PALLIDIUM_TINY,
SurfaceRules.state(surfaceMaterial().getTopMaterial())
)
)
));
}
};
}
public static Block getSurface(int x, int z) {
return SURFACE_BLOCKS[UmbraSurfaceNoiseCondition.getDepth(x, z)];
} }
} }

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