Merge branch 'master' into 1.18

This commit is contained in:
Frank 2022-04-03 21:57:44 +02:00
commit 49c0a4f9e1
109 changed files with 591 additions and 479 deletions

View file

@ -5,8 +5,6 @@ buildscript {
} }
plugins { plugins {
id 'idea'
id 'eclipse'
id 'fabric-loom' version "${loom_version}" id 'fabric-loom' version "${loom_version}"
id 'maven-publish' id 'maven-publish'
} }
@ -86,17 +84,11 @@ def useApi(String dep) {
} }
processResources { processResources {
inputs.property "version", project.version println "Version: ${project.version}"
duplicatesStrategy = 'WARN' inputs.property "version", project.version
filesMatching("fabric.mod.json") {
from(sourceSets.main.resources.srcDirs) { expand "version": project.version
include "fabric.mod.json" }
expand "version": project.version
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
} }
// ensure that the encoding is set to UTF-8, no matter what the system default is // ensure that the encoding is set to UTF-8, no matter what the system default is
@ -104,6 +96,7 @@ processResources {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.encoding = "UTF-8" options.encoding = "UTF-8"
it.options.release = 17
} }
javadoc { javadoc {
@ -123,6 +116,13 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource from sourceSets.main.allSource
} }
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
jar { jar {
from "LICENSE" from "LICENSE"
} }
@ -159,21 +159,21 @@ task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
} }
// configure the maven publication // configure the maven publication
//publishing { publishing {
// publications { publications {
// mavenJava(MavenPublication) { mavenJava(MavenPublication) {
// artifact(remapJar) { artifact(remapJar) {
// builtBy remapJar builtBy remapJar
// } }
// artifact(sourcesJar) { artifact(sourcesJar) {
// builtBy remapSourcesJar builtBy remapSourcesJar
// } }
// } }
// } }
//
// // select the repositories you want to publish to // select the repositories you want to publish to
// repositories { repositories {
// // uncomment to publish to the local maven // uncomment to publish to the local maven
// // mavenLocal() // mavenLocal()
// } }
//} }

View file

@ -4,14 +4,14 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.18.1 minecraft_version=1.18.1
fabric_version = 0.44.0+1.18 fabric_version = 0.46.4+1.18
loader_version=0.12.12 loader_version=0.13.3
#Loom #Loom
loom_version=0.10-SNAPSHOT loom_version=0.10-SNAPSHOT
# Mod Properties # Mod Properties
mod_version=1.0.0 mod_version=1.0.3
maven_group=ru.betterend maven_group=ru.betterend
archives_base_name=better-end archives_base_name=better-end
@ -19,6 +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
bclib_version = 1.2.0 bclib_version = 1.3.5
rei_version = 7.0.343 rei_version = 7.2.408
canvas_version = 1.0.+ canvas_version = 1.0.+

View file

@ -20,7 +20,7 @@ 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;
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;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonItemTags;
import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.interfaces.CustomColorProvider;
import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.interfaces.RenderLayerProvider;
@ -39,7 +39,7 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
super(FabricBlockSettings super(FabricBlockSettings
.of(Material.GLASS) .of(Material.GLASS)
.breakByTool(FabricToolTags.PICKAXES) .breakByTool(FabricToolTags.PICKAXES)
.breakByTool(TagAPI.ITEM_HAMMERS) .breakByTool(CommonItemTags.HAMMERS)
.hardness(1F) .hardness(1F)
.resistance(1F) .resistance(1F)
.luminance(15) .luminance(15)

View file

@ -5,7 +5,7 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
@ -19,7 +19,7 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
@Override @Override
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
BlockState up = world.getBlockState(pos.above()); BlockState up = world.getBlockState(pos.above());
return up.is(TagAPI.BLOCK_GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES); return up.is(CommonBlockTags.GEN_END_STONES) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
} }
@Override @Override

View file

@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.blocks.UnderwaterPlantWithAgeBlock; import ru.bclib.blocks.UnderwaterPlantWithAgeBlock;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
@ -48,6 +48,6 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -6,7 +6,7 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.blocks.UnderwaterPlantWithAgeBlock; import ru.bclib.blocks.UnderwaterPlantWithAgeBlock;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
@ -134,6 +134,6 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -5,18 +5,23 @@ 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;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
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.FallingBlock; import net.minecraft.world.level.block.FallingBlock;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.LootContext;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.interfaces.TagProvider;
import ru.bclib.util.ColorUtil; import ru.bclib.util.ColorUtil;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class EndstoneDustBlock extends FallingBlock { public class EndstoneDustBlock extends FallingBlock implements TagProvider {
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
private static final int COLOR = ColorUtil.color(226, 239, 168); private static final int COLOR = ColorUtil.color(226, 239, 168);
@ -38,4 +43,9 @@ public class EndstoneDustBlock extends FallingBlock {
public int getDustColor(BlockState state, BlockGetter world, BlockPos pos) { public int getDustColor(BlockState state, BlockGetter world, BlockPos pos) {
return COLOR; return COLOR;
} }
@Override
public void addTags(List<TagLocation<Block>> blockTags, List<TagLocation<Item>> itemTags) {
blockTags.add(NamedCommonBlockTags.END_STONES);
}
} }

View file

@ -1,6 +1,5 @@
package ru.betterend.blocks; package ru.betterend.blocks;
import com.google.common.collect.Lists;
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.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColor;
@ -8,8 +7,6 @@ import net.minecraft.client.color.item.ItemColor;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
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;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -18,16 +15,16 @@ import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
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 ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseLeavesBlock;
import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.interfaces.CustomColorProvider;
import ru.bclib.util.ColorUtil; import ru.bclib.util.ColorUtil;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import java.util.Collections;
import java.util.List; import java.util.List;
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider { public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider {
@ -44,7 +41,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
.strength(0.2F) .strength(0.2F)
); );
TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); TagAPI.addBlockTag(NamedBlockTags.LEAVES, this);
} }
@Override @Override
@ -81,21 +78,6 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
@Override @Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL); return BaseLeavesBlock.getLeaveDrops(this, EndBlocks.HELIX_TREE_SAPLING, builder, 16, 32);
if (tool != null) {
if (tool.is(FabricToolTags.SHEARS) || tool.isCorrectToolForDrops(state) || EnchantmentHelper.getItemEnchantmentLevel(
Enchantments.SILK_TOUCH,
tool
) > 0) {
return Collections.singletonList(new ItemStack(this));
}
int fortune = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool);
if (MHelper.RANDOM.nextInt(16) <= fortune) {
return Lists.newArrayList(new ItemStack(EndBlocks.HELIX_TREE_SAPLING));
}
return Lists.newArrayList();
}
return MHelper.RANDOM.nextInt(32) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.HELIX_TREE_SAPLING)) : Lists
.newArrayList();
} }
} }

View file

@ -17,7 +17,7 @@ import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
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 ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.UnderwaterPlantBlock; import ru.bclib.blocks.UnderwaterPlantBlock;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.blocks.EndBlockProperties.HydraluxShape; import ru.betterend.blocks.EndBlockProperties.HydraluxShape;
@ -63,7 +63,7 @@ public class HydraluxBlock extends UnderwaterPlantBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
@Override @Override

View file

@ -19,7 +19,7 @@ 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.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BaseBlockNotFull;
import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.interfaces.RenderLayerProvider;
@ -63,7 +63,7 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
LumecornShape shape = state.getValue(SHAPE); LumecornShape shape = state.getValue(SHAPE);
if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL) { if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL) {
return world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND); return world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES);
} }
else if (shape == LumecornShape.LIGHT_TOP) { else if (shape == LumecornShape.LIGHT_TOP) {
return world.getBlockState(pos.below()).is(this); return world.getBlockState(pos.below()).is(this);

View file

@ -1,7 +1,6 @@
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.minecraft.tags.Tag.Named;
import net.minecraft.world.item.Item; 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;
@ -10,7 +9,8 @@ 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.api.tag.NamedMineableTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.TagProvider; import ru.bclib.interfaces.TagProvider;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
@ -38,7 +38,7 @@ public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
} }
@Override @Override
public void addTags(List<Named<Block>> blockTags, List<Named<Item>> itemTags) { public void addTags(List<TagLocation<Block>> blockTags, List<TagLocation<Item>> itemTags) {
blockTags.add(TagAPI.MINEABLE_AXE); blockTags.add(NamedMineableTags.AXE);
} }
} }

View file

@ -34,7 +34,7 @@ import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.pathfinder.PathComputationType; import net.minecraft.world.level.pathfinder.PathComputationType;
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;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BaseBlockNotFull;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
@ -331,7 +331,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
mut.move(dir); mut.move(dir);
state = world.getBlockState(mut); state = world.getBlockState(mut);
if (!state.is(this)) { if (!state.is(this)) {
if (!state.is(TagAPI.BLOCK_END_GROUND)) { if (!state.is(CommonBlockTags.END_STONES)) {
length = -1; length = -1;
} }
break; break;

View file

@ -3,15 +3,21 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
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.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.interfaces.TagProvider;
import ru.betterend.blocks.basis.EndTerrainBlock; import ru.betterend.blocks.basis.EndTerrainBlock;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import java.util.List;
import java.util.Random; import java.util.Random;
public class ShadowGrassBlock extends EndTerrainBlock { public class ShadowGrassBlock extends EndTerrainBlock implements TagProvider {
public ShadowGrassBlock() { public ShadowGrassBlock() {
super(MaterialColor.COLOR_BLACK); super(MaterialColor.COLOR_BLACK);
} }
@ -31,4 +37,9 @@ public class ShadowGrassBlock extends EndTerrainBlock {
); );
} }
} }
@Override
public void addTags(List<TagLocation<Block>> blockTags, List<TagLocation<Item>> itemTags) {
blockTags.add(NamedCommonBlockTags.END_STONES);
}
} }

View file

@ -29,7 +29,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.interfaces.RenderLayerProvider;
@ -93,7 +93,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
@Override @Override
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND); return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES);
} }
@Override @Override

View file

@ -2,7 +2,7 @@ package ru.betterend.blocks.basis;
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 ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BasePlantBlock; import ru.bclib.blocks.BasePlantBlock;
import ru.betterend.interfaces.PottablePlant; import ru.betterend.interfaces.PottablePlant;
@ -29,7 +29,7 @@ public class EndPlantBlock extends BasePlantBlock implements PottablePlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
@Override @Override

View file

@ -1,7 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BasePlantWithAgeBlock; import ru.bclib.blocks.BasePlantWithAgeBlock;
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock { public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
@ -15,6 +15,6 @@ public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -1,12 +1,24 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.item.Item;
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.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.blocks.BaseTerrainBlock; import ru.bclib.blocks.BaseTerrainBlock;
import ru.bclib.interfaces.TagProvider;
import ru.betterend.interfaces.PottableTerrain; import ru.betterend.interfaces.PottableTerrain;
public class EndTerrainBlock extends BaseTerrainBlock implements PottableTerrain { import java.util.List;
public class EndTerrainBlock extends BaseTerrainBlock implements PottableTerrain, TagProvider {
public EndTerrainBlock(MaterialColor color) { public EndTerrainBlock(MaterialColor color) {
super(Blocks.END_STONE, color); super(Blocks.END_STONE, color);
} }
@Override
public void addTags(List<TagLocation<Block>> blockTags, List<TagLocation<Item>> itemTags) {
blockTags.add(NamedCommonBlockTags.END_STONES);
}
} }

View file

@ -1,7 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.UnderwaterPlantBlock; import ru.bclib.blocks.UnderwaterPlantBlock;
public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock { public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
@ -19,6 +19,6 @@ public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -1,7 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseUnderwaterWallPlantBlock; import ru.bclib.blocks.BaseUnderwaterWallPlantBlock;
public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock { public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock {
@ -19,6 +19,6 @@ public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -1,7 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.WallMushroomBlock; import ru.bclib.blocks.WallMushroomBlock;
public class EndWallMushroom extends WallMushroomBlock { public class EndWallMushroom extends WallMushroomBlock {
@ -12,6 +12,6 @@ public class EndWallMushroom extends WallMushroomBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -1,7 +1,7 @@
package ru.betterend.blocks.basis; package ru.betterend.blocks.basis;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseWallPlantBlock; import ru.bclib.blocks.BaseWallPlantBlock;
public class EndWallPlantBlock extends BaseWallPlantBlock { public class EndWallPlantBlock extends BaseWallPlantBlock {
@ -18,6 +18,6 @@ public class EndWallPlantBlock extends BaseWallPlantBlock {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.is(TagAPI.BLOCK_END_GROUND); return state.is(CommonBlockTags.END_STONES);
} }
} }

View file

@ -19,7 +19,8 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider; import ru.bclib.interfaces.RenderLayerProvider;
@ -42,7 +43,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider {
.noCollission()); .noCollission());
this.drop = drop; this.drop = drop;
this.dropChance = dropChance; this.dropChance = dropChance;
TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); TagAPI.addBlockTag(NamedBlockTags.LEAVES, this);
} }
public FurBlock(ItemLike drop, int dropChance) { public FurBlock(ItemLike drop, int dropChance) {
@ -53,7 +54,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider {
.noCollission()); .noCollission());
this.drop = drop; this.drop = drop;
this.dropChance = dropChance; this.dropChance = dropChance;
TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); TagAPI.addBlockTag(NamedBlockTags.LEAVES, this);
} }
@Override @Override

View file

@ -136,7 +136,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock {
if (blockEntity instanceof InfusionPedestalEntity) { if (blockEntity instanceof InfusionPedestalEntity) {
InfusionPedestalEntity pedestal = (InfusionPedestalEntity) blockEntity; InfusionPedestalEntity pedestal = (InfusionPedestalEntity) blockEntity;
if (pedestal.hasRitual()) { if (pedestal.hasRitual()) {
pedestal.getRitual().markDirty(); pedestal.getRitual().setDirty();
} }
} }
break; break;

View file

@ -17,12 +17,12 @@ import ru.betterend.interfaces.FallFlyingItem;
import ru.betterend.registry.EndBlockEntities; import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.util.GlobalState;
import java.util.List; import java.util.List;
public class BlockEntityHydrothermalVent extends BlockEntity { public class BlockEntityHydrothermalVent extends BlockEntity {
private final static Vec3 POSITIVE_Y = new Vec3(0.0f, 1.0f, 0.0f); private final static Vec3 POSITIVE_Y = new Vec3(0.0f, 1.0f, 0.0f);
private static final MutableBlockPos POS = new MutableBlockPos();
public BlockEntityHydrothermalVent(BlockPos blockPos, BlockState blockState) { public BlockEntityHydrothermalVent(BlockPos blockPos, BlockState blockState) {
super(EndBlockEntities.HYDROTHERMAL_VENT, blockPos, blockState); super(EndBlockEntities.HYDROTHERMAL_VENT, blockPos, blockState);
@ -51,6 +51,7 @@ public class BlockEntityHydrothermalVent extends BlockEntity {
} }
private static void serverTick(Level level, BlockPos worldPosition, BlockState state, BlockEntityHydrothermalVent blockEntity) { private static void serverTick(Level level, BlockPos worldPosition, BlockState state, BlockEntityHydrothermalVent blockEntity) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
boolean active = state.getValue(HydrothermalVentBlock.ACTIVATED); boolean active = state.getValue(HydrothermalVentBlock.ACTIVATED);
POS.set(worldPosition).move(Direction.UP); POS.set(worldPosition).move(Direction.UP);
int height = active ? 85 : 25; int height = active ? 85 : 25;

View file

@ -1,10 +1,10 @@
package ru.betterend.complexmaterials; package ru.betterend.complexmaterials;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.NamedItemTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseSlabBlock; import ru.bclib.blocks.BaseSlabBlock;
import ru.bclib.blocks.BaseStairsBlock; import ru.bclib.blocks.BaseStairsBlock;
import ru.bclib.blocks.BaseWallBlock; import ru.bclib.blocks.BaseWallBlock;
@ -120,14 +120,14 @@ public class CrystalSubblocksMaterial {
CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar);
// Item Tags // // Item Tags //
TagAPI.addTag(ItemTags.SLABS, slab, brick_slab); TagAPI.addItemTag(NamedItemTags.SLABS, slab, brick_slab);
TagAPI.addTag(ItemTags.STONE_BRICKS, bricks); TagAPI.addItemTag(NamedItemTags.STONE_BRICKS, bricks);
TagAPI.addTag(ItemTags.STONE_CRAFTING_MATERIALS, source); TagAPI.addItemTag(NamedItemTags.STONE_CRAFTING_MATERIALS, source);
TagAPI.addTag(ItemTags.STONE_TOOL_MATERIALS, source); TagAPI.addItemTag(NamedItemTags.STONE_TOOL_MATERIALS, source);
// Block Tags // // Block Tags //
TagAPI.addTag(BlockTags.STONE_BRICKS, bricks); TagAPI.addBlockTag(NamedBlockTags.STONE_BRICKS, bricks);
TagAPI.addTag(BlockTags.WALLS, wall, brick_wall); TagAPI.addBlockTag(NamedBlockTags.WALLS, wall, brick_wall);
TagAPI.addTag(BlockTags.SLABS, slab, brick_slab); TagAPI.addBlockTag(NamedBlockTags.SLABS, slab, brick_slab);
} }
} }

View file

@ -1,9 +1,6 @@
package ru.betterend.complexmaterials; package ru.betterend.complexmaterials;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.Tag;
import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@ -15,7 +12,11 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.NamedItemTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.api.tag.TagAPI.TagNamed;
import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseChainBlock; import ru.bclib.blocks.BaseChainBlock;
import ru.bclib.blocks.BaseDoorBlock; import ru.bclib.blocks.BaseDoorBlock;
@ -89,7 +90,7 @@ public class MetalMaterial {
public final Item leggings; public final Item leggings;
public final Item boots; public final Item boots;
public final Tag.Named<Item> alloyingOre; public final TagNamed<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(
@ -153,7 +154,7 @@ public class MetalMaterial {
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.addItemTag(alloyingOre.getName(), ore, rawOre);
} }
block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings)); block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings));
@ -490,10 +491,9 @@ public class MetalMaterial {
.setGroup("end_metal_boots") .setGroup("end_metal_boots")
.build(); .build();
TagAPI.addTag(BlockTags.ANVIL, anvilBlock); TagAPI.addBlockTag(NamedBlockTags.ANVIL, anvilBlock);
TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, block); TagAPI.addBlockTag(NamedBlockTags.BEACON_BASE_BLOCKS, block);
TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, ingot); TagAPI.addItemTag(NamedItemTags.BEACON_PAYMENT_ITEMS, ingot);
TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, ore, bars); TagAPI.addBlockTag(NamedCommonBlockTags.DRAGON_IMMUNE, ore, bars);
TagAPI.addTag(TagAPI.ITEM_HAMMERS, hammer);
} }
} }

View file

@ -1,12 +1,14 @@
package ru.betterend.complexmaterials; package ru.betterend.complexmaterials;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
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.material.MaterialColor; import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.NamedCommonItemTags;
import ru.bclib.api.tag.NamedItemTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseFurnaceBlock; import ru.bclib.blocks.BaseFurnaceBlock;
import ru.bclib.blocks.BaseRotatedPillarBlock; import ru.bclib.blocks.BaseRotatedPillarBlock;
@ -177,22 +179,22 @@ public class StoneMaterial {
CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar);
// Item Tags // // Item Tags //
TagAPI.addTag(ItemTags.SLABS, slab, brickSlab); TagAPI.addItemTag(NamedItemTags.SLABS, slab, brickSlab);
TagAPI.addTag(ItemTags.STONE_BRICKS, bricks); TagAPI.addItemTag(NamedItemTags.STONE_BRICKS, bricks);
TagAPI.addTag(ItemTags.STONE_CRAFTING_MATERIALS, stone); TagAPI.addItemTag(NamedItemTags.STONE_CRAFTING_MATERIALS, stone);
TagAPI.addTag(ItemTags.STONE_TOOL_MATERIALS, stone); TagAPI.addItemTag(NamedItemTags.STONE_TOOL_MATERIALS, stone);
TagAPI.addTag(TagAPI.ITEM_FURNACES, furnace); TagAPI.addItemTag(NamedCommonItemTags.FURNACES, furnace);
// Block Tags // // Block Tags //
TagAPI.addTag(BlockTags.STONE_BRICKS, bricks); TagAPI.addBlockTag(NamedBlockTags.STONE_BRICKS, bricks);
TagAPI.addTag(BlockTags.WALLS, wall, brickWall); TagAPI.addBlockTag(NamedBlockTags.WALLS, wall, brickWall);
TagAPI.addTag(BlockTags.SLABS, slab, brickSlab); TagAPI.addBlockTag(NamedBlockTags.SLABS, slab, brickSlab);
TagAPI.addTags(pressurePlate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES); TagAPI.addBlockTags(pressurePlate, NamedBlockTags.PRESSURE_PLATES, NamedBlockTags.STONE_PRESSURE_PLATES);
TagAPI.addTag(TagAPI.BLOCK_END_STONES, stone); TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, stone);
TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, stone, stairs, slab, wall); TagAPI.addBlockTag(NamedCommonBlockTags.DRAGON_IMMUNE, stone, stairs, slab, wall);
TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, stone); TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, stone);
TagAPI.addTag(TagAPI.BLOCK_END_GROUND, stone); TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, stone);
} }
} }

View file

@ -33,13 +33,14 @@ 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.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
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;
import ru.betterend.interfaces.ISlime; import ru.betterend.interfaces.ISlime;
import ru.betterend.registry.EndBiomes; import ru.betterend.registry.EndBiomes;
import ru.betterend.util.GlobalState;
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Random; import java.util.Random;
@ -49,7 +50,6 @@ public class EndSlimeEntity extends Slime {
EndSlimeEntity.class, EndSlimeEntity.class,
EntityDataSerializers.BYTE EntityDataSerializers.BYTE
); );
private static final MutableBlockPos POS = new MutableBlockPos();
public EndSlimeEntity(EntityType<EndSlimeEntity> entityType, Level world) { public EndSlimeEntity(EntityType<EndSlimeEntity> entityType, Level world) {
super(entityType, world); super(entityType, world);
@ -213,7 +213,7 @@ public class EndSlimeEntity extends Slime {
} }
public static boolean canSpawn(EntityType entityType, LevelAccessor world, MobSpawnType spawnType, BlockPos pos, Random random) { public static boolean canSpawn(EntityType entityType, LevelAccessor world, MobSpawnType spawnType, BlockPos pos, Random random) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
return false; return false;
} }
BCLBiome biome = BiomeAPI.getFromBiome(world.getBiome(pos)); BCLBiome biome = BiomeAPI.getFromBiome(world.getBiome(pos));
@ -227,6 +227,8 @@ public class EndSlimeEntity extends Slime {
} }
private static boolean isWaterNear(LevelAccessor world, BlockPos pos) { private static boolean isWaterNear(LevelAccessor world, BlockPos pos) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
for (int x = pos.getX() - 32; x <= pos.getX() + 32; x++) { for (int x = pos.getX() - 32; x <= pos.getX() + 32; x++) {
POS.setX(x); POS.setX(x);
for (int z = pos.getZ() - 32; z <= pos.getZ() + 32; z++) { for (int z = pos.getZ() - 32; z <= pos.getZ() + 32; z++) {

View file

@ -4,9 +4,10 @@ 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.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.integration.modmenu.ModIntegration; import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.integration.ModIntegration;
import ru.bclib.world.features.BCLFeature; import ru.bclib.world.features.BCLFeature;
public class EnderscapeIntegration extends ModIntegration { public class EnderscapeIntegration extends ModIntegration {
@ -42,7 +43,7 @@ public class EnderscapeIntegration extends ModIntegration {
} }
}); });
TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, getBlock("nebulite_ore")); TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, getBlock("nebulite_ore"));
TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, getBlock("shadow_quartz_ore")); TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, getBlock("shadow_quartz_ore"));
} }
} }

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.modmenu.ModIntegration; import ru.bclib.integration.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.modmenu.ModIntegration; import ru.bclib.integration.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

@ -1,9 +1,9 @@
package ru.betterend.integration; package ru.betterend.integration;
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.tag.TagAPI;
import ru.bclib.integration.modmenu.ModIntegration; import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.integration.ModIntegration;
import ru.betterend.registry.EndItems; import ru.betterend.registry.EndItems;
public class NourishIntegration extends ModIntegration { public class NourishIntegration extends ModIntegration {
@ -13,13 +13,13 @@ public class NourishIntegration extends ModIntegration {
@Override @Override
public void init() { public void init() {
Tag.Named<Item> fats = getItemTag("fats"); TagLocation<Item> fats = TagLocation.of(getItemTag("fats"));
Tag.Named<Item> fruit = getItemTag("fruit"); TagLocation<Item> fruit = TagLocation.of(getItemTag("fruit"));
Tag.Named<Item> protein = getItemTag("protein"); TagLocation<Item> protein = TagLocation.of(getItemTag("protein"));
Tag.Named<Item> sweets = getItemTag("sweets"); TagLocation<Item> sweets = TagLocation.of(getItemTag("sweets"));
TagAPI.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); TagAPI.addItemTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
TagAPI.addTag( TagAPI.addItemTag(
fruit, fruit,
EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_RAW,
EndItems.SHADOW_BERRY_COOKED, EndItems.SHADOW_BERRY_COOKED,
@ -32,7 +32,7 @@ public class NourishIntegration extends ModIntegration {
EndItems.CHORUS_MUSHROOM_COOKED, EndItems.CHORUS_MUSHROOM_COOKED,
EndItems.BOLUX_MUSHROOM_COOKED EndItems.BOLUX_MUSHROOM_COOKED
); );
TagAPI.addTag( TagAPI.addItemTag(
protein, protein,
EndItems.END_FISH_RAW, EndItems.END_FISH_RAW,
EndItems.END_FISH_COOKED, EndItems.END_FISH_COOKED,
@ -40,7 +40,7 @@ public class NourishIntegration extends ModIntegration {
EndItems.BOLUX_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED,
EndItems.CAVE_PUMPKIN_PIE EndItems.CAVE_PUMPKIN_PIE
); );
TagAPI.addTag( TagAPI.addItemTag(
sweets, sweets,
EndItems.SHADOW_BERRY_JELLY, EndItems.SHADOW_BERRY_JELLY,
EndItems.SWEET_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY,

View file

@ -1,6 +1,6 @@
package ru.betterend.integration.byg; package ru.betterend.integration.byg;
import ru.bclib.integration.modmenu.ModIntegration; import ru.bclib.integration.ModIntegration;
import ru.betterend.integration.EndBiomeIntegration; import ru.betterend.integration.EndBiomeIntegration;
public class BYGIntegration extends ModIntegration implements EndBiomeIntegration { public class BYGIntegration extends ModIntegration implements EndBiomeIntegration {
@ -12,7 +12,7 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
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, CommonBlockTags.END_STONES, CommonBlockTags.GEN_END_STONES);
} }
BYGBlocks.register(); BYGBlocks.register();
BYGFeatures.register(); BYGFeatures.register();

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.util.SplineHelper; import ru.bclib.util.SplineHelper;
@ -24,7 +24,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
BlockState log = Integrations.BYG.getDefaultState("ether_log"); BlockState log = Integrations.BYG.getDefaultState("ether_log");
BlockState wood = Integrations.BYG.getDefaultState("ether_wood"); BlockState wood = Integrations.BYG.getDefaultState("ether_wood");
@ -32,7 +32,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
return log; return log;
}; };
Function<BlockState, Boolean> replace = (state) -> { Function<BlockState, Boolean> replace = (state) -> {
return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable(); .isReplaceable();
}; };
@ -63,7 +63,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
} }
sdf.setReplaceFunction((state) -> { sdf.setReplaceFunction((state) -> {
return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable(); .isReplaceable();
}).addPostProcess((info) -> { }).addPostProcess((info) -> {
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {

View file

@ -13,7 +13,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.PosInfo;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
@ -38,7 +38,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
BlockState log = Integrations.BYG.getDefaultState("nightshade_log"); BlockState log = Integrations.BYG.getDefaultState("nightshade_log");
BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood"); BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood");
@ -49,7 +49,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
return log; return log;
}; };
Function<BlockState, Boolean> replace = (state) -> { Function<BlockState, Boolean> replace = (state) -> {
return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial()
.isReplaceable(); .isReplaceable();
}; };
Function<PosInfo, BlockState> post = (info) -> { Function<PosInfo, BlockState> post = (info) -> {

View file

@ -11,7 +11,8 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFSubtraction; import ru.bclib.sdf.operator.SDFSubtraction;
@ -39,8 +40,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
if (!world.getBlockState(pos.below(4)).is(TagAPI.BLOCK_GEN_TERRAIN)) return false; if (!world.getBlockState(pos.below(4)).is(CommonBlockTags.GEN_END_STONES)) return false;
BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem"); BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem");
BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood"); BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood");
@ -48,7 +49,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight"); BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
Function<BlockState, Boolean> replacement = (state) -> { Function<BlockState, Boolean> replacement = (state) -> {
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial() if (state.equals(stem) || state.equals(wood) || state.is(CommonBlockTags.END_STONES) || state.getMaterial()
.equals(Material.PLANT)) { .equals(Material.PLANT)) {
return true; return true;
} }
@ -155,7 +156,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline(branch, world, wood, pos, replacement); SplineHelper.fillSpline(branch, world, wood, pos, replacement);
} }
} }

View file

@ -24,16 +24,21 @@ import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Tier; import net.minecraft.world.item.Tier;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonItemTags;
import ru.bclib.api.tag.NamedCommonItemTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.client.models.ModelsHelper; import ru.bclib.client.models.ModelsHelper;
import ru.bclib.interfaces.ItemModelProvider; import ru.bclib.interfaces.ItemModelProvider;
import ru.bclib.interfaces.TagProvider;
import java.util.List;
import java.util.UUID; import java.util.UUID;
public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, ItemModelProvider { public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, ItemModelProvider, TagProvider {
public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = Mth.createInsecureUUID(ThreadLocalRandom.current()); public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = Mth.createInsecureUUID(ThreadLocalRandom.current());
private final Multimap<Attribute, AttributeModifier> attributeModifiers; private final Multimap<Attribute, AttributeModifier> attributeModifiers;
@ -113,7 +118,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I
@Override @Override
public float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) { public float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(TagAPI.ITEM_HAMMERS)) { if (tag.equals(CommonItemTags.HAMMERS)) {
return this.getDestroySpeed(stack, state); return this.getDestroySpeed(stack, state);
} }
return 1.0F; return 1.0F;
@ -121,7 +126,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I
@Override @Override
public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) { public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(TagAPI.ITEM_HAMMERS)) { if (tag.equals(CommonItemTags.HAMMERS)) {
return this.getTier().getLevel(); return this.getTier().getLevel();
} }
return 0; return 0;
@ -161,4 +166,9 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I
public BlockModel getItemModel(ResourceLocation resourceLocation) { public BlockModel getItemModel(ResourceLocation resourceLocation) {
return ModelsHelper.createHandheldItem(resourceLocation); return ModelsHelper.createHandheldItem(resourceLocation);
} }
@Override
public void addTags(List<TagLocation<Block>> blockTags, List<TagLocation<Item>> itemTags) {
itemTags.add(NamedCommonItemTags.HAMMERS);
}
} }

View file

@ -20,7 +20,8 @@ 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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.world.generator.GeneratorOptions; import ru.betterend.world.generator.GeneratorOptions;
@ -50,7 +51,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
private void be_randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random, CallbackInfo info) { private void be_randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random, CallbackInfo info) {
if (world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
BlockPos up = pos.above(); BlockPos up = pos.above();
if (world.isEmptyBlock(up) && up.getY() < 256) { if (world.isEmptyBlock(up) && up.getY() < 256) {
int i = state.getValue(ChorusFlowerBlock.AGE); int i = state.getValue(ChorusFlowerBlock.AGE);
@ -80,7 +81,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "placeDeadFlower", at = @At("HEAD"), cancellable = true) @Inject(method = "placeDeadFlower", at = @At("HEAD"), cancellable = true)
private void be_placeDeadFlower(Level world, BlockPos pos, CallbackInfo info) { private void be_placeDeadFlower(Level world, BlockPos pos, CallbackInfo info) {
BlockState down = world.getBlockState(pos.below()); BlockState down = world.getBlockState(pos.below());
if (down.is(Blocks.CHORUS_PLANT) || down.is(TagAPI.BLOCK_GEN_TERRAIN)) { if (down.is(Blocks.CHORUS_PLANT) || down.is(CommonBlockTags.GEN_END_STONES)) {
world.setBlock(pos, this.defaultBlockState().setValue(BlockStateProperties.AGE_5, 5), 2); world.setBlock(pos, this.defaultBlockState().setValue(BlockStateProperties.AGE_5, 5), 2);
world.levelEvent(1034, pos, 0); world.levelEvent(1034, pos, 0);
} }

View file

@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.Mixin;
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.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
@Mixin(value = ChorusPlantBlock.class, priority = 100) @Mixin(value = ChorusPlantBlock.class, priority = 100)
@ -30,7 +30,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
BlockPos pos = ctx.getClickedPos(); BlockPos pos = ctx.getClickedPos();
Level world = ctx.getLevel(); Level world = ctx.getLevel();
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true));
} }
} }
@ -38,7 +38,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
@Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + "Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true) @Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + "Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true)
private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<BlockState> info) { private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<BlockState> info) {
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (plant.is(Blocks.CHORUS_PLANT) && blockGetter.getBlockState(blockPos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (plant.is(Blocks.CHORUS_PLANT) && blockGetter.getBlockState(blockPos.below()).is(CommonBlockTags.END_STONES)) {
info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true));
} }
} }
@ -54,7 +54,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
@Inject(method = "updateShape", at = @At("RETURN"), cancellable = true) @Inject(method = "updateShape", at = @At("RETURN"), cancellable = true)
private void be_updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable<BlockState> info) { private void be_updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable<BlockState> info) {
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
plant = plant.setValue(BlockStateProperties.DOWN, true); plant = plant.setValue(BlockStateProperties.DOWN, true);
info.setReturnValue(plant); info.setReturnValue(plant);
} }

View file

@ -16,7 +16,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.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -71,28 +71,28 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu {
0, 0,
j j
)) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { )) && world.isEmptyBlock(blockPos.offset(k, 1, j))) {
if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
if (k != 0 && j != 0) { if (k != 0 && j != 0) {
if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(CommonBlockTags.BOOKSHELVES)) {
++i; ++i;
} }
} }

View file

@ -7,7 +7,7 @@ import net.minecraft.world.item.alchemy.PotionUtils;
import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.item.alchemy.Potions;
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 ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonItemTags;
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;
@ -34,7 +34,7 @@ public class CraftingRecipes {
.setShape("T#T", "V V", "T#T") .setShape("T#T", "V V", "T#T")
.addMaterial('#', Blocks.END_STONE_BRICKS) .addMaterial('#', Blocks.END_STONE_BRICKS)
.addMaterial('T', EndBlocks.THALLASIUM.ingot) .addMaterial('T', EndBlocks.THALLASIUM.ingot)
.addMaterial('V', TagAPI.ITEM_FURNACES) .addMaterial('V', CommonItemTags.FURNACES)
.build(); .build();
registerPedestal( registerPedestal(

View file

@ -6,9 +6,6 @@ import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocks
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor; import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor;
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor; import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor;
import net.minecraft.core.Registry; import net.minecraft.core.Registry;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.Tag;
import net.minecraft.world.food.FoodProperties; 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;
@ -20,13 +17,21 @@ import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
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;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonItemTags;
import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.NamedCommonItemTags;
import ru.bclib.api.tag.NamedItemTags;
import ru.bclib.api.tag.NamedMineableTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.api.tag.TagAPI.TagNamed;
import ru.bclib.blocks.BaseVineBlock; import ru.bclib.blocks.BaseVineBlock;
import ru.bclib.blocks.SimpleLeavesBlock; import ru.bclib.blocks.SimpleLeavesBlock;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.basis.EndTerrainBlock; import ru.betterend.blocks.basis.EndTerrainBlock;
import ru.betterend.blocks.basis.PedestalBlock; import ru.betterend.blocks.basis.PedestalBlock;
import ru.betterend.item.tool.EndHammerItem; import ru.betterend.item.tool.EndHammerItem;
import ru.betterend.world.biome.EndBiome;
import java.util.List; import java.util.List;
@ -35,17 +40,17 @@ public class EndTags {
// https://fabricmc.net/wiki/tutorial:tags // https://fabricmc.net/wiki/tutorial:tags
// Block Tags // Block Tags
public static final Tag.Named<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal"); public static final TagNamed<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal");
// Item Tags // Item Tags
public static final Tag.Named<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron"); public static final TagNamed<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
public static final Tag.Named<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold"); public static final TagNamed<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
public static final Tag.Named<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper"); public static final TagNamed<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
public static void register() { public static void register() {
TagAPI.addEndGround(EndBlocks.THALLASIUM.ore); addEndGround(EndBlocks.THALLASIUM.ore);
TagAPI.addEndGround(EndBlocks.ENDSTONE_DUST); addEndGround(EndBlocks.ENDSTONE_DUST);
TagAPI.addEndGround(EndBlocks.AMBER_ORE); addEndGround(EndBlocks.AMBER_ORE);
EndBlocks.getModBlocks().forEach(block -> { EndBlocks.getModBlocks().forEach(block -> {
Properties properties = ((AbstractBlockAccessor) block).getSettings(); Properties properties = ((AbstractBlockAccessor) block).getSettings();
@ -53,32 +58,32 @@ public class EndTags {
final Item item = block.asItem(); final Item item = block.asItem();
if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) { if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) {
TagAPI.addTag(TagAPI.MINEABLE_PICKAXE, block); TagAPI.addBlockTag(NamedMineableTags.PICKAXE, block);
} }
else if (material.equals(Material.WOOD)) { else if (material.equals(Material.WOOD)) {
TagAPI.addTag(TagAPI.MINEABLE_AXE, block); TagAPI.addBlockTag(NamedMineableTags.AXE, block);
} }
else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT) || material.equals(Material.SPONGE)) { else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT) || material.equals(Material.SPONGE)) {
TagAPI.addTag(TagAPI.MINEABLE_HOE, block); TagAPI.addBlockTag(NamedMineableTags.HOE, block);
} }
else if (material.equals(Material.SAND)) { else if (material.equals(Material.SAND)) {
TagAPI.addTag(TagAPI.MINEABLE_SHOVEL, block); TagAPI.addBlockTag(NamedMineableTags.SHOVEL, block);
} }
if (block instanceof EndTerrainBlock) { if (block instanceof EndTerrainBlock) {
TagAPI.addEndGround(block); addEndGround(block);
TagAPI.addTag(BlockTags.NYLIUM, block); TagAPI.addBlockTag(NamedBlockTags.NYLIUM, block);
BonemealAPI.addSpreadableBlock(block, Blocks.END_STONE); BonemealAPI.addSpreadableBlock(block, Blocks.END_STONE);
} }
else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) { else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) {
TagAPI.addTag(BlockTags.LEAVES, block); TagAPI.addBlockTag(NamedBlockTags.LEAVES, block);
ComposterAPI.allowCompost(0.3f, item); ComposterAPI.allowCompost(0.3f, item);
} }
else if (block instanceof BaseVineBlock) { else if (block instanceof BaseVineBlock) {
TagAPI.addTag(BlockTags.CLIMBABLE, block); TagAPI.addBlockTag(NamedBlockTags.CLIMBABLE, block);
} }
else if (block instanceof PedestalBlock) { else if (block instanceof PedestalBlock) {
TagAPI.addTag(PEDESTALS, block); TagAPI.addBlockTag(PEDESTALS.getName(), block);
} }
Material mat = block.defaultBlockState().getMaterial(); Material mat = block.defaultBlockState().getMaterial();
@ -86,8 +91,8 @@ public class EndTags {
ComposterAPI.allowCompost(0.1F, item); ComposterAPI.allowCompost(0.1F, item);
} }
}); });
TagAPI.addEndGround(EndBlocks.CAVE_MOSS); addEndGround(EndBlocks.CAVE_MOSS);
TagAPI.addTag(BlockTags.NYLIUM, EndBlocks.CAVE_MOSS); TagAPI.addBlockTag(NamedBlockTags.NYLIUM, EndBlocks.CAVE_MOSS);
BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS, Blocks.END_STONE); BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS, Blocks.END_STONE);
BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_OBSIDIAN, Blocks.OBSIDIAN); BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_OBSIDIAN, Blocks.OBSIDIAN);
BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.DRAGON_BONE_BLOCK); BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.DRAGON_BONE_BLOCK);
@ -105,30 +110,39 @@ public class EndTags {
ITEM_HAMMERS.add(item); ITEM_HAMMERS.add(item);
} }
}); });
ToolManagerImpl.tag(TagAPI.ITEM_HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS)); ToolManagerImpl.tag(CommonItemTags.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS));
TagAPI.addTag(TagAPI.ITEM_HAMMERS, EndItems.AETERNIUM_HAMMER);
TagAPI.addTag( TagAPI.addBlockTag(
TagAPI.BLOCK_GEN_TERRAIN, NamedCommonBlockTags.GEN_END_STONES,
EndBlocks.ENDER_ORE, EndBlocks.ENDER_ORE,
EndBlocks.BRIMSTONE EndBlocks.BRIMSTONE
); );
TagAPI.addTag(TagAPI.BLOCK_END_GROUND, EndBlocks.BRIMSTONE); TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, EndBlocks.BRIMSTONE);
TagAPI.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL); TagAPI.addBlockTag(NamedBlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL);
TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK); TagAPI.addBlockTag(NamedBlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK);
TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT); TagAPI.addItemTag(NamedItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT);
TagAPI.addTag( TagAPI.addBlockTag(
TagAPI.BLOCK_DRAGON_IMMUNE, NamedCommonBlockTags.DRAGON_IMMUNE,
EndBlocks.ENDER_ORE, EndBlocks.ENDER_ORE,
EndBlocks.ETERNAL_PEDESTAL, EndBlocks.ETERNAL_PEDESTAL,
EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL,
EndBlocks.FLAVOLITE_RUNED EndBlocks.FLAVOLITE_RUNED
); );
TagAPI.addTag(TagAPI.ITEM_IRON_INGOTS, EndBlocks.THALLASIUM.ingot); TagAPI.addItemTag(NamedCommonItemTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
TagAPI.addTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); TagAPI.addItemTag(ALLOYING_IRON.getName(), Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD); TagAPI.addItemTag(ALLOYING_GOLD.getName(), Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER); TagAPI.addItemTag(ALLOYING_COPPER.getName(), Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
}
public static void addEndGround(Block bl){
TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, bl);
}
public static void addBiomeSurfaceToEndGroup(EndBiome b){
addEndGround(b.getTopMaterial().getBlock());
addEndGround(b.getAltTopMaterial().getBlock());
addEndGround(b.getUnderMaterial().getBlock());
} }
// TODO make getter for biome top blocks // TODO make getter for biome top blocks
@ -138,8 +152,8 @@ public class EndTags {
SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig(); SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig();
Block under = config.getUnderMaterial().getBlock(); Block under = config.getUnderMaterial().getBlock();
Block surface = config.getTopMaterial().getBlock(); Block surface = config.getTopMaterial().getBlock();
TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, under, surface); TagAPI.addTag(CommonBlockTags.GEN_END_STONES, under, surface);
TagAPI.addTag(TagAPI.BLOCK_END_GROUND, surface); TagAPI.addTag(CommonBlockTags.END_STONES, surface);
} }
}); });
TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/ TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/

View file

@ -228,7 +228,7 @@ public class InfusionRitual implements Container {
} }
} }
public void markDirty() { public void setDirty() {
this.isDirty = true; this.isDirty = true;
} }

View file

@ -0,0 +1,10 @@
package ru.betterend.util;
import net.minecraft.core.BlockPos.MutableBlockPos;
public class GlobalState {
private static final ThreadLocal<GlobalState> STATE = ThreadLocal.withInitial(()->new GlobalState());
public static GlobalState stateForThread() { return STATE.get(); }
public final MutableBlockPos POS = new MutableBlockPos();
}

View file

@ -10,7 +10,8 @@ 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.structure.BoundingBox; import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; 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;
@ -241,7 +242,7 @@ public class StructureErode {
} }
private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) { private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(BlockTags.NYLIUM)) { if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(BlockTags.NYLIUM)) {
return true; return true;
} }
return !state.getMaterial().equals(Material.STONE) || BlocksHelper.isInvulnerable(state, world, pos); return !state.getMaterial().equals(Material.STONE) || BlocksHelper.isInvulnerable(state, world, pos);
@ -249,7 +250,7 @@ public class StructureErode {
private static boolean isTerrainNear(WorldGenLevel world, BlockPos pos) { private static boolean isTerrainNear(WorldGenLevel world, BlockPos pos) {
for (Direction dir : BlocksHelper.DIRECTIONS) { for (Direction dir : BlocksHelper.DIRECTIONS) {
if (world.getBlockState(pos.relative(dir)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.relative(dir)).is(CommonBlockTags.GEN_END_STONES)) {
return true; return true;
} }
} }
@ -266,7 +267,7 @@ public class StructureErode {
for (int y = bounds.maxY(); y >= bounds.minY(); y--) { for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y); mut.setY(y);
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);
if (state.is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) { if (state.is(CommonBlockTags.END_STONES) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) {
BlocksHelper.setWithoutUpdate(world, mut, top); BlocksHelper.setWithoutUpdate(world, mut, top);
} }
} }

View file

@ -10,17 +10,18 @@ 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.SurfaceRules; import net.minecraft.world.level.levelgen.SurfaceRules;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.surface.SurfaceRuleBuilder; import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.biomes.BCLBiome;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.interfaces.StructureFeaturesAccessor; import ru.betterend.interfaces.StructureFeaturesAccessor;
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.EndTags;
import java.util.function.BiFunction;
public class EndBiome extends BCLBiome implements SurfaceMaterialProvider { public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
public static class DefaultSurfaceMaterialProvider implements SurfaceMaterialProvider{ public static class DefaultSurfaceMaterialProvider implements SurfaceMaterialProvider{
@ -85,7 +86,7 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
protected abstract void addCustomBuildData(BCLBiomeBuilder builder); protected abstract void addCustomBuildData(BCLBiomeBuilder builder);
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier(){ public BiomeSupplier<EndBiome> getSupplier(){
return EndBiome::new; return EndBiome::new;
} }
@ -98,8 +99,8 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
} }
} }
public EndBiome(ResourceLocation biomeID, Biome biome) { public EndBiome(ResourceLocation biomeID, Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
} }
public static EndBiome create(Config biomeConfig){ public static EndBiome create(Config biomeConfig){
@ -125,6 +126,7 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
biome.addCustomData("has_caves", biomeConfig.hasCaves()); biome.addCustomData("has_caves", biomeConfig.hasCaves());
biome.setSurfaceMaterial(biomeConfig.surfaceMaterial()); biome.setSurfaceMaterial(biomeConfig.surfaceMaterial());
EndTags.addBiomeSurfaceToEndGroup(biome);
return biome; return biome;
} }

View file

@ -2,16 +2,16 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
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 ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class EmptyAuroraCaveBiome extends EndCaveBiome.Config { public class EmptyAuroraCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
@ -44,7 +44,7 @@ public class EmptyAuroraCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EmptyAuroraCaveBiome.Biome::new; return EmptyAuroraCaveBiome.Biome::new;
} }
} }

View file

@ -2,6 +2,8 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
@ -9,8 +11,8 @@ import java.util.function.BiFunction;
public class EmptyEndCaveBiome extends EndCaveBiome.Config { public class EmptyEndCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1); this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
@ -38,7 +40,7 @@ public class EmptyEndCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return Biome::new; return Biome::new;
} }
} }

View file

@ -2,16 +2,16 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
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 ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config { public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
@ -45,7 +45,7 @@ public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EmptySmaragdantCaveBiome.Biome::new; return EmptySmaragdantCaveBiome.Biome::new;
} }
} }

View file

@ -8,8 +8,10 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.GenerationStep; 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.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.WeightedList; import ru.bclib.util.WeightedList;
import ru.bclib.world.biomes.BCLBiomeSettings;
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;
@ -17,7 +19,6 @@ 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 { public static abstract class Config extends EndBiome.Config {
@ -45,7 +46,7 @@ public class EndCaveBiome extends EndBiome {
} }
@Override @Override
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EndCaveBiome::new; return EndCaveBiome::new;
} }
} }
@ -53,8 +54,8 @@ public class EndCaveBiome extends EndBiome {
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(ResourceLocation biomeID, Biome biome) { public EndCaveBiome(ResourceLocation biomeID, Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
} }
public void addFloorFeature(Feature<?> feature, float weight) { public void addFloorFeature(Feature<?> feature, float weight) {

View file

@ -5,20 +5,20 @@ 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.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
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; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class JadeCaveBiome extends EndCaveBiome.Config { public class JadeCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode()); 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 OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode());
private static final BlockState[] JADE = new BlockState[3]; private static final BlockState[] JADE = new BlockState[3];
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState(); JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState(); JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
@ -47,7 +47,7 @@ public class JadeCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return JadeCaveBiome.Biome::new; return JadeCaveBiome.Biome::new;
} }
} }

View file

@ -4,19 +4,19 @@ import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; 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.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiomeSettings;
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 ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class LushAuroraCaveBiome extends EndCaveBiome.Config { public class LushAuroraCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.CAVE_BUSH, 5); this.addFloorFeature(EndFeatures.CAVE_BUSH, 5);
@ -63,7 +63,7 @@ public class LushAuroraCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return LushAuroraCaveBiome.Biome::new; return LushAuroraCaveBiome.Biome::new;
} }

View file

@ -3,18 +3,18 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; 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.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiomeSettings;
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 ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class LushSmaragdantCaveBiome extends EndCaveBiome.Config { public class LushSmaragdantCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
@ -48,7 +48,7 @@ public class LushSmaragdantCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return LushSmaragdantCaveBiome.Biome::new; return LushSmaragdantCaveBiome.Biome::new;
} }

View file

@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.blocks.EndBlockProperties; import ru.betterend.blocks.EndBlockProperties;
@ -18,7 +18,7 @@ public class CavePumpkinFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.above()).is(TagAPI.BLOCK_GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock( if (!world.getBlockState(pos.above()).is(CommonBlockTags.GEN_END_STONES) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(
pos.below())) { pos.below())) {
return false; return false;
} }

View file

@ -18,7 +18,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProc
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.util.StructureHelper; import ru.bclib.util.StructureHelper;
import ru.bclib.world.features.NBTStructureFeature; import ru.bclib.world.features.NBTStructureFeature;
@ -55,7 +55,7 @@ public class CrashedShipFeature extends NBTStructureFeature {
if (x * x + z * z < 3600) { if (x * x + z * z < 3600) {
return false; return false;
} }
return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN); return pos.getY() > 5 && world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES);
} }
@Override @Override

View file

@ -9,11 +9,11 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
public abstract class FullHeightScatterFeature extends DefaultFeature { public abstract class FullHeightScatterFeature extends DefaultFeature {
private static final MutableBlockPos POS = new MutableBlockPos();
private final int radius; private final int radius;
public FullHeightScatterFeature(int radius) { public FullHeightScatterFeature(int radius) {
@ -26,6 +26,7 @@ public abstract class FullHeightScatterFeature extends DefaultFeature {
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos center = featureConfig.origin(); final BlockPos center = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();

View file

@ -9,11 +9,11 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
public abstract class InvertedScatterFeature extends DefaultFeature { public abstract class InvertedScatterFeature extends DefaultFeature {
private static final MutableBlockPos POS = new MutableBlockPos();
private final int radius; private final int radius;
public InvertedScatterFeature(int radius) { public InvertedScatterFeature(int radius) {
@ -26,6 +26,7 @@ public abstract class InvertedScatterFeature extends DefaultFeature {
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos center = featureConfig.origin(); final BlockPos center = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();

View file

@ -5,15 +5,15 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
public abstract class ScatterFeature extends DefaultFeature { public abstract class ScatterFeature extends DefaultFeature {
private static final MutableBlockPos POS = new MutableBlockPos();
private final int radius; private final int radius;
public ScatterFeature(int radius) { public ScatterFeature(int radius) {
@ -32,7 +32,7 @@ public abstract class ScatterFeature extends DefaultFeature {
if (pos.getY() < 5) { if (pos.getY() < 5) {
return false; return false;
} }
else if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { else if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
return false; return false;
} }
return true; return true;
@ -57,6 +57,7 @@ public abstract class ScatterFeature extends DefaultFeature {
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
BlockPos center = featureConfig.origin(); BlockPos center = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();

View file

@ -14,12 +14,11 @@ import ru.bclib.blocks.BlockProperties;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
public class SilkMothNestFeature extends DefaultFeature { public class SilkMothNestFeature extends DefaultFeature {
private static final MutableBlockPos POS = new MutableBlockPos();
private boolean canGenerate(WorldGenLevel world, BlockPos pos) { private boolean canGenerate(WorldGenLevel world, BlockPos pos) {
BlockState state = world.getBlockState(pos.above()); BlockState state = world.getBlockState(pos.above());
if (state.is(BlockTags.LEAVES) || state.is(BlockTags.LOGS)) { if (state.is(BlockTags.LEAVES) || state.is(BlockTags.LOGS)) {
@ -35,6 +34,7 @@ public class SilkMothNestFeature extends DefaultFeature {
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos center = featureConfig.origin(); final BlockPos center = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();

View file

@ -4,18 +4,18 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
public abstract class UnderwaterPlantScatter extends ScatterFeature { public abstract class UnderwaterPlantScatter extends ScatterFeature {
private static final MutableBlockPos POS = new MutableBlockPos();
public UnderwaterPlantScatter(int radius) { public UnderwaterPlantScatter(int radius) {
super(radius); super(radius);
} }
@Override @Override
protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
POS.setX(pos.getX()); POS.setX(pos.getX());
POS.setZ(pos.getZ()); POS.setZ(pos.getZ());
POS.setY(0); POS.setY(0);

View file

@ -9,7 +9,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFScale3D; import ru.bclib.sdf.operator.SDFScale3D;
@ -39,8 +39,8 @@ public class BushFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above()) if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES) && !world.getBlockState(pos.above())
.is(TagAPI.BLOCK_END_GROUND)) .is(CommonBlockTags.END_STONES))
return false; return false;
float radius = MHelper.randRange(1.8F, 3.5F, random); float radius = MHelper.randRange(1.8F, 3.5F, random);

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFScale3D; import ru.bclib.sdf.operator.SDFScale3D;
@ -43,8 +43,8 @@ public class BushWithOuterFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above()) if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES) && !world.getBlockState(pos.above())
.is(TagAPI.BLOCK_END_GROUND)) .is(CommonBlockTags.END_STONES))
return false; return false;
float radius = MHelper.randRange(1.8F, 3.5F, random); float radius = MHelper.randRange(1.8F, 3.5F, random);

View file

@ -7,7 +7,7 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
@ -23,7 +23,7 @@ public class LargeAmaranitaFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
MutableBlockPos mut = new MutableBlockPos().set(pos); MutableBlockPos mut = new MutableBlockPos().set(pos);
int height = MHelper.randRange(2, 3, random); int height = MHelper.randRange(2, 3, random);

View file

@ -7,7 +7,7 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -23,7 +23,7 @@ public class Lumecorn extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
int height = MHelper.randRange(4, 7, random); int height = MHelper.randRange(4, 7, random);
MutableBlockPos mut = new MutableBlockPos().set(pos); MutableBlockPos mut = new MutableBlockPos().set(pos);

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
@ -42,7 +42,7 @@ public class TenaneaBushFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false;
float radius = MHelper.randRange(1.8F, 3.5F, random); float radius = MHelper.randRange(1.8F, 3.5F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());

View file

@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFRotation; import ru.bclib.sdf.operator.SDFRotation;
@ -41,7 +41,7 @@ public class ArchFeature extends DefaultFeature {
world, world,
new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7) new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7)
); );
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }

View file

@ -6,7 +6,7 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFRotation; import ru.bclib.sdf.operator.SDFRotation;
import ru.bclib.sdf.primitive.SDFHexPrism; import ru.bclib.sdf.primitive.SDFHexPrism;
@ -40,8 +40,8 @@ public class BigAuroraCrystalFeature extends DefaultFeature {
Vector3f vec = MHelper.randomHorizontal(random); Vector3f vec = MHelper.randomHorizontal(random);
prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism); prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism);
prism.setReplaceFunction((bState) -> { prism.setReplaceFunction((bState) -> {
return bState.getMaterial().isReplaceable() || bState.is(TagAPI.BLOCK_GEN_TERRAIN) || bState.getMaterial() return bState.getMaterial().isReplaceable() || bState.is(CommonBlockTags.GEN_END_STONES) || bState.getMaterial()
.equals(Material.PLANT) || bState .equals(Material.PLANT) || bState
.getMaterial() .getMaterial()
.equals(Material.LEAVES); .equals(Material.LEAVES);
}); });

View file

@ -9,13 +9,14 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import ru.betterend.util.GlobalState;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -23,10 +24,11 @@ import java.util.Random;
public class DesertLakeFeature extends DefaultFeature { public class DesertLakeFeature extends DefaultFeature {
private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState();
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152);
private static final MutableBlockPos POS = new MutableBlockPos();
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
BlockPos blockPos = featureConfig.origin(); BlockPos blockPos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
@ -119,11 +121,11 @@ public class DesertLakeFeature extends DefaultFeature {
r *= r; r *= r;
if (x2 + z2 <= r) { if (x2 + z2 <= r) {
state = world.getBlockState(POS); state = world.getBlockState(POS);
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { if (state.is(CommonBlockTags.GEN_END_STONES)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR); BlocksHelper.setWithoutUpdate(world, POS, AIR);
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) {
state = EndBiome.findTopMaterial(world, pos); //world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); state = EndBiome.findTopMaterial(world, pos); //world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel) else if (y > waterLevel)
@ -178,7 +180,7 @@ public class DesertLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, POS, state); BlocksHelper.setWithoutUpdate(world, POS, state);
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
} }
pos = POS.above(); pos = POS.above();
@ -191,7 +193,7 @@ public class DesertLakeFeature extends DefaultFeature {
// Make border // Make border
else if (y2 + x2 + z2 <= rb) { else if (y2 + x2 + z2 <= rb) {
state = world.getBlockState(POS); state = world.getBlockState(POS);
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && world.isEmptyBlock(POS.above())) { if (state.is(CommonBlockTags.GEN_END_STONES) && world.isEmptyBlock(POS.above())) {
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS); BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS);
} }
else if (y < waterLevel) { else if (y < waterLevel) {
@ -230,7 +232,7 @@ public class DesertLakeFeature extends DefaultFeature {
private boolean canReplace(BlockState state) { private boolean canReplace(BlockState state) {
return state.getMaterial() return state.getMaterial()
.isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() .isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals( .equals(
Material.PLANT) || state Material.PLANT) || state
.getMaterial() .getMaterial()

View file

@ -9,13 +9,14 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
import ru.betterend.util.GlobalState;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -23,14 +24,13 @@ import java.util.Random;
public class EndLakeFeature extends DefaultFeature { public class EndLakeFeature extends DefaultFeature {
private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState();
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152);
private static final MutableBlockPos POS = new MutableBlockPos();
public EndLakeFeature(){ public EndLakeFeature(){
} }
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final MutableBlockPos POS = GlobalState.stateForThread().POS;
final Random random = featureConfig.random(); final Random random = featureConfig.random();
BlockPos blockPos = featureConfig.origin(); BlockPos blockPos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
@ -123,11 +123,11 @@ public class EndLakeFeature extends DefaultFeature {
r *= r; r *= r;
if (x2 + z2 <= r) { if (x2 + z2 <= r) {
state = world.getBlockState(POS); state = world.getBlockState(POS);
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { if (state.is(CommonBlockTags.GEN_END_STONES)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR); BlocksHelper.setWithoutUpdate(world, POS, AIR);
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) {
state = EndBiome.findTopMaterial(world, pos); state = EndBiome.findTopMaterial(world, pos);
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel) else if (y > waterLevel)
@ -182,7 +182,7 @@ public class EndLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, POS, state); BlocksHelper.setWithoutUpdate(world, POS, state);
} }
pos = POS.below(); pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
} }
pos = POS.above(); pos = POS.above();
@ -228,7 +228,7 @@ public class EndLakeFeature extends DefaultFeature {
private boolean canReplace(BlockState state) { private boolean canReplace(BlockState state) {
return state.getMaterial() return state.getMaterial()
.isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() .isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals( .equals(
Material.PLANT) || state Material.PLANT) || state
.getMaterial() .getMaterial()

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFRotation; import ru.bclib.sdf.operator.SDFRotation;
@ -31,7 +31,7 @@ public class FallenPillarFeature extends DefaultFeature {
world, world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
); );
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }
@ -57,7 +57,7 @@ public class FallenPillarFeature extends DefaultFeature {
} }
return info.getState(); return info.getState();
}).setReplaceFunction((state) -> { }).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
.equals(Material.PLANT); .equals(Material.PLANT);
}).fillRecursive(world, pos); }).fillRecursive(world, pos);

View file

@ -13,7 +13,7 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFCoordModify; import ru.bclib.sdf.operator.SDFCoordModify;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
@ -61,7 +61,7 @@ public class GeyserFeature extends DefaultFeature {
MutableBlockPos bpos = new MutableBlockPos().set(pos); MutableBlockPos bpos = new MutableBlockPos().set(pos);
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
BlockState state = world.getBlockState(bpos); BlockState state = world.getBlockState(bpos);
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos); state = world.getBlockState(bpos);
} }
@ -195,7 +195,7 @@ public class GeyserFeature extends DefaultFeature {
mut.setY(mut.getY() - 1); mut.setY(mut.getY() - 1);
state = world.getBlockState(mut); state = world.getBlockState(mut);
} }
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
for (int j = 0; j <= dist; j++) { for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
MHelper.shuffle(HORIZONTAL, random); MHelper.shuffle(HORIZONTAL, random);
@ -240,7 +240,7 @@ public class GeyserFeature extends DefaultFeature {
mut.setY(mut.getY() - 1); mut.setY(mut.getY() - 1);
state = world.getBlockState(mut); state = world.getBlockState(mut);
} }
if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { if (state.is(CommonBlockTags.GEN_END_STONES)) {
for (int j = 0; j <= dist; j++) { for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
mut.setY(mut.getY() + 1); mut.setY(mut.getY() + 1);
@ -272,11 +272,11 @@ public class GeyserFeature extends DefaultFeature {
static { static {
REPLACE1 = (state) -> { REPLACE1 = (state) -> {
return state.isAir() || (state.is(TagAPI.BLOCK_GEN_TERRAIN)); return state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES));
}; };
REPLACE2 = (state) -> { REPLACE2 = (state) -> {
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) { if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
return true; return true;
} }
if (state.getMaterial().equals(Material.PLANT)) { if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFScale3D; import ru.bclib.sdf.operator.SDFScale3D;
@ -29,7 +29,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
world, world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
); );
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
return false; return false;
} }
@ -46,7 +46,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
} }
private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) { private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) {
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) {
return; return;
} }
@ -68,7 +68,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
} }
return info.getState(); return info.getState();
}).setReplaceFunction((state) -> { }).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
.equals(Material.PLANT); .equals(Material.PLANT);
}).fillRecursive(world, pos); }).fillRecursive(world, pos);
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFRotation; import ru.bclib.sdf.operator.SDFRotation;
@ -33,7 +33,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
world, world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
); );
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }
@ -64,7 +64,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
} }
return info.getState(); return info.getState();
}).setReplaceFunction((state) -> { }).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial()
.equals(Material.PLANT); .equals(Material.PLANT);
}).fillRecursive(world, pos); }).fillRecursive(world, pos);

View file

@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -25,7 +25,7 @@ public class SingleBlockFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }

View file

@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -21,7 +21,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
final Random random = featureConfig.random(); final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin(); final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }
@ -42,7 +42,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
mut.setY(mut.getY() - 1); mut.setY(mut.getY() - 1);
state = world.getBlockState(mut); state = world.getBlockState(mut);
} }
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) { if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
for (int j = 0; j <= dist; j++) { for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, crystal); BlocksHelper.setWithoutUpdate(world, mut, crystal);
mut.setY(mut.getY() + 1); mut.setY(mut.getY() + 1);

View file

@ -11,8 +11,8 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
import ru.bclib.sdf.operator.SDFSmoothUnion; import ru.bclib.sdf.operator.SDFSmoothUnion;
@ -41,8 +41,8 @@ public class SpireFeature extends DefaultFeature {
final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator();
pos = getPosOnSurfaceWG(world, pos); pos = getPosOnSurfaceWG(world, pos);
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)) if (pos.getY() < 10 || !world.getBlockState(pos.below(3))
.is(TagAPI.BLOCK_GEN_TERRAIN) || !world.getBlockState(pos.below(6)) .is(CommonBlockTags.GEN_END_STONES) || !world.getBlockState(pos.below(6))
.is(TagAPI.BLOCK_GEN_TERRAIN)) { .is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }
@ -99,7 +99,7 @@ public class SpireFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
if (state.is(TagAPI.BLOCK_END_GROUND)) { if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
} }
if (state.getBlock() instanceof LeavesBlock) { if (state.getBlock() instanceof LeavesBlock) {

View file

@ -9,7 +9,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.StalactiteBlock; import ru.bclib.blocks.StalactiteBlock;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -45,7 +45,7 @@ public class StalactiteFeature extends DefaultFeature {
mut.setY(pos.getY() + i * dir); mut.setY(pos.getY() + i * dir);
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);
if (!state.getMaterial().isReplaceable()) { if (!state.getMaterial().isReplaceable()) {
stalagnate = state.is(TagAPI.BLOCK_GEN_TERRAIN); stalagnate = state.is(CommonBlockTags.GEN_END_STONES);
height = i; height = i;
break; break;
} }

View file

@ -12,7 +12,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -44,7 +44,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
bpos.setY(top - 1); bpos.setY(top - 1);
BlockState state = world.getBlockState(bpos); BlockState state = world.getBlockState(bpos);
while (!state.is(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) { while (!state.is(CommonBlockTags.GEN_END_STONES) && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos); state = world.getBlockState(bpos);
} }
@ -53,7 +53,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
} }
top = (int) (bpos.getY() - (radius * 1.3F + 5)); top = (int) (bpos.getY() - (radius * 1.3F + 5));
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos); state = world.getBlockState(bpos);
} }
@ -105,7 +105,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
} }
else if (dist < r2 * r2) { else if (dist < r2 * r2) {
state = world.getBlockState(mut); state = world.getBlockState(mut);
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(Blocks.AIR)) { if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(Blocks.AIR)) {
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval( double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(
x * 0.03, x * 0.03,
y * 0.03, y * 0.03,
@ -144,7 +144,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
mut.setY(mut.getY() - 1); mut.setY(mut.getY() - 1);
state = world.getBlockState(mut); state = world.getBlockState(mut);
} }
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()) if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above())
.is(EndBlocks.HYDROTHERMAL_VENT)) { .is(EndBlocks.HYDROTHERMAL_VENT)) {
for (int j = 0; j <= dist; j++) { for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
@ -182,7 +182,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
} }
private boolean isReplaceable(BlockState state) { private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state return state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state
.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial() .is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state .equals(Material.PLANT) || state
.getMaterial() .getMaterial()

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -18,17 +18,16 @@ import ru.betterend.blocks.EndBlockProperties;
import ru.betterend.blocks.SulphurCrystalBlock; import ru.betterend.blocks.SulphurCrystalBlock;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
import java.util.Set; import java.util.Set;
public class SulphuricLakeFeature extends DefaultFeature { public class SulphuricLakeFeature extends DefaultFeature {
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152);
private static final MutableBlockPos POS = new MutableBlockPos();
@Override @Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) { public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final Random random = featureConfig.random();
BlockPos blockPos = featureConfig.origin(); BlockPos blockPos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level(); final WorldGenLevel world = featureConfig.level();
blockPos = getPosOnSurfaceWG(world, blockPos); blockPos = getPosOnSurfaceWG(world, blockPos);
@ -37,6 +36,8 @@ public class SulphuricLakeFeature extends DefaultFeature {
return false; return false;
} }
final Random random = featureConfig.random();
final MutableBlockPos POS = GlobalState.stateForThread().POS;
double radius = MHelper.randRange(10.0, 20.0, random); double radius = MHelper.randRange(10.0, 20.0, random);
int dist2 = MHelper.floor(radius * 1.5); int dist2 = MHelper.floor(radius * 1.5);
@ -61,7 +62,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
int dist = x2 + z2; int dist = x2 + z2;
if (dist <= r) { if (dist <= r) {
POS.setY(getYOnSurface(world, x, z) - 1); POS.setY(getYOnSurface(world, x, z) - 1);
if (world.getBlockState(POS).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(POS).is(CommonBlockTags.GEN_END_STONES)) {
if (isBorder(world, POS)) { if (isBorder(world, POS)) {
if (random.nextInt(8) > 0) { if (random.nextInt(8) > 0) {
brimstone.add(POS.immutable()); brimstone.add(POS.immutable());
@ -75,6 +76,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
else { else {
if (!isAbsoluteBorder(world, POS)) { if (!isAbsoluteBorder(world, POS)) {
BlocksHelper.setWithoutUpdate(world, POS, Blocks.WATER); BlocksHelper.setWithoutUpdate(world, POS, Blocks.WATER);
//world.setBlock(blockPos, Blocks.WATER.defaultBlockState(), 2);
world.scheduleTick(POS, Fluids.WATER, 0); world.scheduleTick(POS, Fluids.WATER, 0);
brimstone.add(POS.below()); brimstone.add(POS.below());
if (random.nextBoolean()) { if (random.nextBoolean()) {
@ -97,7 +99,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
brimstone.remove(POS); brimstone.remove(POS);
for (Direction dir : BlocksHelper.HORIZONTAL) { for (Direction dir : BlocksHelper.HORIZONTAL) {
BlockPos offseted = POS.relative(dir); BlockPos offseted = POS.relative(dir);
if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(offseted).is(CommonBlockTags.GEN_END_STONES)) {
brimstone.add(offseted); brimstone.add(offseted);
} }
} }
@ -106,7 +108,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
brimstone.remove(POS); brimstone.remove(POS);
for (Direction dir : BlocksHelper.HORIZONTAL) { for (Direction dir : BlocksHelper.HORIZONTAL) {
BlockPos offseted = POS.relative(dir); BlockPos offseted = POS.relative(dir);
if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(offseted).is(CommonBlockTags.GEN_END_STONES)) {
brimstone.add(offseted); brimstone.add(offseted);
} }
} }
@ -123,7 +125,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
} }
else if (dist < r2) { else if (dist < r2) {
POS.setY(getYOnSurface(world, x, z) - 1); POS.setY(getYOnSurface(world, x, z) - 1);
if (world.getBlockState(POS).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(POS).is(CommonBlockTags.GEN_END_STONES)) {
brimstone.add(POS.immutable()); brimstone.add(POS.immutable());
if (random.nextBoolean()) { if (random.nextBoolean()) {
brimstone.add(POS.below()); brimstone.add(POS.below());

View file

@ -6,7 +6,7 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
@ -25,7 +25,7 @@ public class SurfaceVentFeature extends DefaultFeature {
world, world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
); );
if (!world.getBlockState(pos.below(3)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below(3)).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }
@ -46,7 +46,7 @@ public class SurfaceVentFeature extends DefaultFeature {
mut.setY(mut.getY() - 1); mut.setY(mut.getY() - 1);
state = world.getBlockState(mut); state = world.getBlockState(mut);
} }
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
for (int j = 0; j <= dist; j++) { for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
mut.setY(mut.getY() + 1); mut.setY(mut.getY() + 1);

View file

@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFCoordModify; import ru.bclib.sdf.operator.SDFCoordModify;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
@ -36,7 +36,7 @@ public class ThinArchFeature extends DefaultFeature {
Random random = featurePlaceContext.random(); Random random = featurePlaceContext.random();
BlockPos pos = getPosOnSurfaceWG(world, new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7)); BlockPos pos = getPosOnSurfaceWG(world, new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7));
if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) {
return false; return false;
} }

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.levelgen.feature.Feature; 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.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.features.DefaultFeature; import ru.bclib.world.features.DefaultFeature;
import ru.betterend.util.BlockFixer; import ru.betterend.util.BlockFixer;
@ -63,13 +63,13 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
mut.setY(y); mut.setY(y);
BlockState top = chunk.getBlockState(mut); BlockState top = chunk.getBlockState(mut);
BlockState bottom = chunk.getBlockState(mut2); BlockState bottom = chunk.getBlockState(mut2);
if (top.isAir() && (bottom.is(TagAPI.BLOCK_GEN_TERRAIN) || bottom.is(Blocks.STONE))) { if (top.isAir() && (bottom.is(CommonBlockTags.GEN_END_STONES) || bottom.is(Blocks.STONE))) {
mut3.set(mut2).move(sx, 0, sz); mut3.set(mut2).move(sx, 0, sz);
floorPositions.add(mut3.immutable()); floorPositions.add(mut3.immutable());
updateMin(mut3, min); updateMin(mut3, min);
updateMax(mut3, max); updateMax(mut3, max);
} }
else if (bottom.isAir() && (top.is(TagAPI.BLOCK_GEN_TERRAIN) || top.is(Blocks.STONE))) { else if (bottom.isAir() && (top.is(CommonBlockTags.GEN_END_STONES) || top.is(Blocks.STONE))) {
mut3.set(mut).move(sx, 0, sz); mut3.set(mut).move(sx, 0, sz);
ceilPositions.add(mut3.immutable()); ceilPositions.add(mut3.immutable());
updateMin(mut3, min); updateMin(mut3, min);

View file

@ -14,8 +14,8 @@ import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.feature.Feature; 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.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
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;
@ -66,11 +66,11 @@ public abstract class EndCaveFeature extends DefaultFeature {
caveBlocks.parallelStream().forEach((bpos) -> { caveBlocks.parallelStream().forEach((bpos) -> {
if (world.getBlockState(bpos).getMaterial().isReplaceable()) { if (world.getBlockState(bpos).getMaterial().isReplaceable()) {
BlockPos side = bpos.below(); BlockPos side = bpos.below();
if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(side).is(CommonBlockTags.GEN_END_STONES)) {
floorPositions.add(side); floorPositions.add(side);
} }
side = bpos.above(); side = bpos.above();
if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(side).is(CommonBlockTags.GEN_END_STONES)) {
ceilPositions.add(side); ceilPositions.add(side);
} }
} }
@ -128,7 +128,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
if (wallBlock != null) { if (wallBlock != null) {
for (Vec3i offset : SPHERE) { for (Vec3i offset : SPHERE) {
BlockPos wallPos = pos.offset(offset); BlockPos wallPos = pos.offset(offset);
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(CommonBlockTags.GEN_END_STONES)) {
wallBlock = biome.getWall(wallPos); wallBlock = biome.getWall(wallPos);
BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock); BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock);
placed.add(wallPos); placed.add(wallPos);
@ -164,7 +164,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
bpos.setY(top - 1); bpos.setY(top - 1);
BlockState state = world.getBlockState(bpos); BlockState state = world.getBlockState(bpos);
while (!state.is(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) { while (!state.is(CommonBlockTags.GEN_END_STONES) && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos); state = world.getBlockState(bpos);
} }
@ -173,7 +173,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
} }
top = (int) (bpos.getY() - (radius * 1.3F + 5)); top = (int) (bpos.getY() - (radius * 1.3F + 5));
while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
state = world.getBlockState(bpos); state = world.getBlockState(bpos);
} }

View file

@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
@ -74,7 +74,7 @@ public class RoundCaveFeature extends EndCaveFeature {
} }
private boolean isReplaceable(BlockState state) { private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.BLOCK_GEN_TERRAIN) || return state.is(CommonBlockTags.GEN_END_STONES) ||
state.getMaterial().isReplaceable() || state.getMaterial().isReplaceable() ||
state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.PLANT) ||
state.getMaterial().equals(Material.LEAVES); state.getMaterial().equals(Material.LEAVES);

View file

@ -15,8 +15,8 @@ import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.feature.Feature; 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.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.biomes.BCLBiome;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
@ -82,7 +82,7 @@ public class TunelCaveFeature extends EndCaveFeature {
) * 20) * 0.1F) * 0.9F; ) * 20) * 0.1F) * 0.9F;
float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F; float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F;
val = (val + vert * vert + dist) + density + gradient; val = (val + vert * vert + dist) + density + gradient;
if (val < 0.15 && world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && noWaterNear(world, pos)) { if (val < 0.15 && world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES) && noWaterNear(world, pos)) {
positions.add(pos.immutable()); positions.add(pos.immutable());
} }
} }
@ -141,7 +141,7 @@ public class TunelCaveFeature extends EndCaveFeature {
} }
else if (world.getBlockState(mut).getMaterial().isReplaceable()) { else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
mut.setY(bpos.getY() - 1); mut.setY(bpos.getY() - 1);
if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(mut).is(CommonBlockTags.GEN_END_STONES)) {
Set<BlockPos> floorPositions = floorSets.get(bio); Set<BlockPos> floorPositions = floorSets.get(bio);
if (floorPositions == null) { if (floorPositions == null) {
floorPositions = Sets.newHashSet(); floorPositions = Sets.newHashSet();
@ -150,7 +150,7 @@ public class TunelCaveFeature extends EndCaveFeature {
floorPositions.add(mut.immutable()); floorPositions.add(mut.immutable());
} }
mut.setY(bpos.getY() + 1); mut.setY(bpos.getY() + 1);
if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(mut).is(CommonBlockTags.GEN_END_STONES)) {
Set<BlockPos> ceilPositions = ceilSets.get(bio); Set<BlockPos> ceilPositions = ceilSets.get(bio);
if (ceilPositions == null) { if (ceilPositions == null) {
ceilPositions = Sets.newHashSet(); ceilPositions = Sets.newHashSet();

View file

@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.PosInfo;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
@ -112,7 +112,7 @@ public class DragonTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.getBark().defaultBlockState(), pos, REPLACE); SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.getBark().defaultBlockState(), pos, REPLACE);
} }
} }
@ -196,7 +196,7 @@ public class DragonTreeFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) { if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) {

View file

@ -361,7 +361,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT)) { if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) {
return true; return true;
} }
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFFlatWave; import ru.bclib.sdf.operator.SDFFlatWave;
import ru.bclib.sdf.operator.SDFScale3D; import ru.bclib.sdf.operator.SDFScale3D;
@ -90,7 +90,7 @@ public class JellyshroomFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSpline(branch, world, wood, pos, REPLACE); SplineHelper.fillSpline(branch, world, wood, pos, REPLACE);
} }
} }
@ -123,7 +123,7 @@ public class JellyshroomFeature extends DefaultFeature {
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> { REPLACE = (state) -> {
if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT)) { if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) {
return true; return true;
} }
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();

View file

@ -11,7 +11,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.PosInfo;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFDisplacement;
@ -83,7 +83,7 @@ public class LacugroveFeature extends DefaultFeature {
boolean generate = false; boolean generate = false;
for (int y = minY; y < maxY; y++) { for (int y = minY; y < maxY; y++) {
mut.setY(y); mut.setY(y);
if (world.getBlockState(mut).is(TagAPI.BLOCK_END_GROUND)) { if (world.getBlockState(mut).is(CommonBlockTags.END_STONES)) {
generate = true; generate = true;
break; break;
} }
@ -94,7 +94,7 @@ public class LacugroveFeature extends DefaultFeature {
mut.setY(y); mut.setY(y);
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);
if (state.getMaterial().isReplaceable() || state.getMaterial() if (state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state.is(TagAPI.BLOCK_END_GROUND)) { .equals(Material.PLANT) || state.is(CommonBlockTags.END_STONES)) {
BlocksHelper.setWithoutUpdate( BlocksHelper.setWithoutUpdate(
world, world,
mut, mut,
@ -189,7 +189,7 @@ public class LacugroveFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (EndBlocks.LACUGROVE.isTreeLog(state)) { if (EndBlocks.LACUGROVE.isTreeLog(state)) {

View file

@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
@ -187,7 +187,7 @@ public class LucerniaFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.getBark().defaultBlockState(), pos, REPLACE); SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.getBark().defaultBlockState(), pos, REPLACE);
} }
} }
@ -195,7 +195,7 @@ public class LucerniaFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) { if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) {

View file

@ -171,7 +171,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); .setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (state.getMaterial().equals(Material.PLANT)) { if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -187,7 +187,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) { if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {

View file

@ -175,7 +175,7 @@ public class TenaneaFeature extends DefaultFeature {
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
/*if (state.is(TagAPI.BLOCK_END_GROUND)) { /*if (state.is(CommonBlockTags.END_STONES)) {
return true; return true;
}*/ }*/
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) { if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {

View file

@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.sdf.SDF; import ru.bclib.sdf.SDF;
import ru.bclib.sdf.operator.SDFFlatWave; import ru.bclib.sdf.operator.SDFFlatWave;
import ru.bclib.sdf.operator.SDFScale; import ru.bclib.sdf.operator.SDFScale;
@ -159,7 +159,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
SplineHelper.rotateSpline(branch, angle); SplineHelper.rotateSpline(branch, angle);
SplineHelper.scale(branch, scale); SplineHelper.scale(branch, scale);
Vector3f last = branch.get(branch.size() - 1); Vector3f last = branch.get(branch.size() - 1);
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.BLOCK_GEN_TERRAIN)) { if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) {
SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE); SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE);
} }
} }
@ -218,7 +218,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> { REPLACE = (state) -> {
if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
return true; return true;
} }
return state.getMaterial().isReplaceable(); return state.getMaterial().isReplaceable();

View file

@ -10,7 +10,6 @@ public class GeneratorOptions {
private static boolean hasPillars; private static boolean hasPillars;
private static boolean hasDragonFights; private static boolean hasDragonFights;
private static boolean changeChorusPlant; private static boolean changeChorusPlant;
private static boolean removeChorusFromVanillaBiomes;
private static boolean newGenerator; private static boolean newGenerator;
private static boolean generateCentralIsland; private static boolean generateCentralIsland;
private static boolean generateObsidianPlatform; private static boolean generateObsidianPlatform;
@ -25,6 +24,7 @@ public class GeneratorOptions {
private static int islandDistChunk; private static int islandDistChunk;
private static boolean directSpikeHeight; private static boolean directSpikeHeight;
private static int circleRadius = 1000; private static int circleRadius = 1000;
private static int circleRadiusSqr;
public static void init() { public static void init() {
biomeSizeCaves = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeCaves", 32); biomeSizeCaves = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeCaves", 32);
@ -32,11 +32,6 @@ public class GeneratorOptions {
hasPillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "hasSpikes", true); hasPillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "hasSpikes", true);
hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true); hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true);
changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true); changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true);
removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean(
"chorusPlant",
"removeChorusFromVanillaBiomes",
true
);
newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true); newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true);
generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true); generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true);
endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5); endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5);
@ -77,6 +72,7 @@ public class GeneratorOptions {
replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true); replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true);
replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true); replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true);
circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000); circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000);
circleRadiusSqr = circleRadius * circleRadius;
islandDistChunk = (circleRadius >> 3); // Twice bigger than normal islandDistChunk = (circleRadius >> 3); // Twice bigger than normal
} }
@ -100,10 +96,6 @@ public class GeneratorOptions {
return changeChorusPlant; return changeChorusPlant;
} }
public static boolean removeChorusFromVanillaBiomes() {
return removeChorusFromVanillaBiomes;
}
public static boolean useNewGenerator() { public static boolean useNewGenerator() {
return newGenerator; return newGenerator;
} }
@ -140,6 +132,10 @@ public class GeneratorOptions {
return circleRadius; return circleRadius;
} }
public static int getIslandDistBlockSqr() {
return circleRadiusSqr;
}
public static int getIslandDistChunk() { public static int getIslandDistChunk() {
return islandDistChunk; return islandDistChunk;
} }

View file

@ -41,10 +41,7 @@ public class IslandLayer {
SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2); SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2);
SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4); SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4);
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed) noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop);
.setRadius(0.5F)
.setIntensity(0.2F)
.setSource(coneTop);
island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom); island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom);
} }
@ -87,7 +84,7 @@ public class IslandLayer {
for (int n = 0; n < count; n++) { for (int n = 0; n < count; n++) {
BlockPos pos = positions.get(n); BlockPos pos = positions.get(n);
long d = (long) pos.getX() * (long) pos.getX() + (long) pos.getZ() * (long) pos.getZ(); long d = (long) pos.getX() * (long) pos.getX() + (long) pos.getZ() * (long) pos.getZ();
if (d < GeneratorOptions.getIslandDistBlock()) { if (d < GeneratorOptions.getIslandDistBlockSqr()) {
positions.remove(n); positions.remove(n);
count--; count--;
n--; n--;

View file

@ -25,9 +25,9 @@ public class EternalPortalStructure extends FeatureBaseStructure {
public EternalPortalStructure() { public EternalPortalStructure() {
super(PieceGeneratorSupplier.simple( super(PieceGeneratorSupplier.simple(
EternalPortalStructure::checkLocation, EternalPortalStructure::checkLocation,
EternalPortalStructure::generatePieces EternalPortalStructure::generatePieces)
)); );
} }
protected static boolean checkLocation(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context) { protected static boolean checkLocation(PieceGeneratorSupplier.Context<NoneFeatureConfiguration> context) {

View file

@ -11,11 +11,12 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext;
import ru.bclib.api.TagAPI; import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.util.GlobalState;
import java.util.Random; import java.util.Random;
@ -49,7 +50,7 @@ public class CavePiece extends BasePiece {
double hr = radius * 0.75; double hr = radius * 0.75;
double nr = radius * 0.25; double nr = radius * 0.25;
MutableBlockPos pos = new MutableBlockPos(); final MutableBlockPos pos = GlobalState.stateForThread().POS;
for (int x = x1; x <= x2; x++) { for (int x = x1; x <= x2; x++) {
int xsq = x - center.getX(); int xsq = x - center.getX();
xsq *= xsq; xsq *= xsq;
@ -67,7 +68,7 @@ public class CavePiece extends BasePiece {
double r2 = r - 4.5; double r2 = r - 4.5;
double dist = xsq + ysq + zsq; double dist = xsq + ysq + zsq;
if (dist < r2 * r2) { if (dist < r2 * r2) {
if (world.getBlockState(pos).is(TagAPI.BLOCK_END_GROUND)) { if (world.getBlockState(pos).is(CommonBlockTags.END_STONES)) {
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR); BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
} }
} }

View file

@ -16,11 +16,12 @@ import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
import ru.betterend.util.GlobalState;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.Random; import java.util.Random;
@ -47,7 +48,7 @@ public class CrystalMountainPiece extends MountainPiece {
public void postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { public void postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
int sx = chunkPos.getMinBlockX(); int sx = chunkPos.getMinBlockX();
int sz = chunkPos.getMinBlockZ(); int sz = chunkPos.getMinBlockZ();
MutableBlockPos pos = new MutableBlockPos(); final MutableBlockPos pos = GlobalState.stateForThread().POS;
ChunkAccess chunk = world.getChunk(chunkPos.x, chunkPos.z); ChunkAccess chunk = world.getChunk(chunkPos.x, chunkPos.z);
Heightmap map = chunk.getOrCreateHeightmapUnprimed(Types.WORLD_SURFACE); Heightmap map = chunk.getOrCreateHeightmapUnprimed(Types.WORLD_SURFACE);
Heightmap map2 = chunk.getOrCreateHeightmapUnprimed(Types.WORLD_SURFACE_WG); Heightmap map2 = chunk.getOrCreateHeightmapUnprimed(Types.WORLD_SURFACE_WG);
@ -69,7 +70,7 @@ public class CrystalMountainPiece extends MountainPiece {
continue; continue;
} }
pos.setY(minY); pos.setY(minY);
while (!chunk.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState( while (!chunk.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES) && pos.getY() > 56 && !chunk.getBlockState(
pos.below()).is(Blocks.CAVE_AIR)) { pos.below()).is(Blocks.CAVE_AIR)) {
pos.setY(pos.getY() - 1); pos.setY(pos.getY() - 1);
} }

View file

@ -21,8 +21,8 @@ import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import ru.bclib.api.TagAPI;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.util.BlocksHelper; import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper; import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
@ -118,7 +118,7 @@ public class LakePiece extends BasePiece {
double dist = x3 + y2 + z3; double dist = x3 + y2 + z3;
if (dist < r2) { if (dist < r2) {
BlockState state = chunk.getBlockState(mut); BlockState state = chunk.getBlockState(mut);
if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.isAir()) { if (state.is(CommonBlockTags.GEN_END_STONES) || state.isAir()) {
state = mut.getY() < center.getY() ? WATER : CAVE_AIR; state = mut.getY() < center.getY() ? WATER : CAVE_AIR;
chunk.setBlockState(mut, state, false); chunk.setBlockState(mut, state, false);
} }

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