Tag switching (WIP)
This commit is contained in:
parent
0486d7d89c
commit
41df84404b
72 changed files with 303 additions and 628 deletions
|
@ -29,7 +29,7 @@ import ru.betterend.registry.EndPortals;
|
|||
import ru.betterend.registry.EndSounds;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BonemealUtil;
|
||||
import ru.betterend.util.BonemealPlants;
|
||||
import ru.betterend.util.DataFixerUtil;
|
||||
import ru.betterend.util.LootTableUtil;
|
||||
import ru.betterend.world.generator.BetterEndBiomeSource;
|
||||
|
@ -64,7 +64,7 @@ public class BetterEnd implements ModInitializer {
|
|||
InfusionRecipes.register();
|
||||
EndStructures.register();
|
||||
Integrations.register();
|
||||
BonemealUtil.init();
|
||||
BonemealPlants.init();
|
||||
GeneratorOptions.init();
|
||||
DataFixerUtil.init();
|
||||
LootTableUtil.init();
|
||||
|
|
|
@ -7,17 +7,17 @@ import net.minecraft.tags.BlockTags;
|
|||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
BlockState up = world.getBlockState(pos.above());
|
||||
return up.is(EndTags.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||
return up.is(TagAPI.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.world.level.material.Material;
|
|||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.LumecornShape;
|
||||
import ru.betterend.blocks.basis.BlockBaseNotFull;
|
||||
|
@ -29,7 +30,6 @@ import ru.betterend.client.render.ERenderLayer;
|
|||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class LumecornBlock extends BlockBaseNotFull implements IRenderTypeable {
|
||||
public static final EnumProperty<LumecornShape> SHAPE = EnumProperty.create("shape", LumecornShape.class);
|
||||
|
@ -62,7 +62,7 @@ public class LumecornBlock extends BlockBaseNotFull implements IRenderTypeable {
|
|||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
LumecornShape shape = state.getValue(SHAPE);
|
||||
if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL) {
|
||||
return world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
else if (shape == LumecornShape.LIGHT_TOP) {
|
||||
return world.getBlockState(pos.below()).is(this);
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.minecraft.world.level.material.Fluids;
|
|||
import net.minecraft.world.level.pathfinder.PathComputationType;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.CactusBottom;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
|
@ -44,7 +45,6 @@ import ru.betterend.blocks.basis.BlockBaseNotFull;
|
|||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class NeonCactusPlantBlock extends BlockBaseNotFull implements SimpleWaterloggedBlock, IRenderTypeable {
|
||||
|
@ -311,7 +311,7 @@ public class NeonCactusPlantBlock extends BlockBaseNotFull implements SimpleWate
|
|||
mut.move(dir);
|
||||
state = world.getBlockState(mut);
|
||||
if (!state.is(this)) {
|
||||
if (!state.is(EndTags.END_GROUND)) {
|
||||
if (!state.is(TagAPI.END_GROUND)) {
|
||||
length = -1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -29,11 +29,11 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.basis.AttachedBlock;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class SmallJellyshroomBlock extends AttachedBlock implements IRenderTypeable, BonemealableBlock {
|
||||
|
@ -87,7 +87,7 @@ public class SmallJellyshroomBlock extends AttachedBlock implements IRenderTypea
|
|||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,10 +34,10 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class DoublePlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock {
|
||||
|
@ -94,7 +94,7 @@ public class DoublePlantBlock extends BlockBaseNotFull implements IRenderTypeabl
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,9 +30,9 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class EndPlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -84,7 +84,7 @@ public class EndPlantBlock extends BlockBaseNotFull implements IRenderTypeable,
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,12 +28,12 @@ import net.minecraft.world.level.material.Material;
|
|||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.models.BlockModelProvider;
|
||||
import ru.betterend.client.models.ModelsHelper;
|
||||
import ru.betterend.client.models.Patterns;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public abstract class FeatureSaplingBlock extends SaplingBlock implements IRenderTypeable, BlockModelProvider {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -71,7 +71,7 @@ public abstract class FeatureSaplingBlock extends SaplingBlock implements IRende
|
|||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
return world.getBlockState(pos.below()).is(EndTags.END_GROUND);
|
||||
return world.getBlockState(pos.below()).is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,10 +34,10 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class UnderwaterPlantBlock extends BlockBaseNotFull implements IRenderTypeable, BonemealableBlock, LiquidBlockContainer {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 14, 12);
|
||||
|
@ -82,7 +82,7 @@ public class UnderwaterPlantBlock extends BlockBaseNotFull implements IRenderTyp
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND) || state.getBlock() == EndBlocks.ENDSTONE_DUST;
|
||||
return state.is(TagAPI.END_GROUND) || state.getBlock() == EndBlocks.ENDSTONE_DUST;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,9 +26,9 @@ import net.minecraft.world.level.storage.loot.LootContext;
|
|||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class UpDownPlantBlock extends BlockBaseNotFull implements IRenderTypeable {
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
||||
|
@ -54,7 +54,7 @@ public class UpDownPlantBlock extends BlockBaseNotFull implements IRenderTypeabl
|
|||
}
|
||||
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndTags.END_GROUND);
|
||||
return state.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
protected boolean isSupport(BlockState state, LevelReader world, BlockPos pos) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.tags.ItemTags;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.blocks.EndPedestal;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
|
@ -21,7 +22,6 @@ import ru.betterend.recipe.CraftingRecipes;
|
|||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class StoneMaterial {
|
||||
public final Block stone;
|
||||
|
@ -90,15 +90,15 @@ public class StoneMaterial {
|
|||
TagHelper.addTag(ItemTags.STONE_BRICKS, bricks);
|
||||
TagHelper.addTag(ItemTags.STONE_CRAFTING_MATERIALS, stone);
|
||||
TagHelper.addTag(ItemTags.STONE_TOOL_MATERIALS, stone);
|
||||
TagHelper.addTag(EndTags.FURNACES, furnace);
|
||||
TagHelper.addTag(TagAPI.FURNACES, furnace);
|
||||
|
||||
// Block Tags //
|
||||
TagHelper.addTag(BlockTags.STONE_BRICKS, bricks);
|
||||
TagHelper.addTag(BlockTags.WALLS, wall, brick_wall);
|
||||
TagHelper.addTag(BlockTags.SLABS, slab, brick_slab);
|
||||
TagHelper.addTags(pressure_plate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES);
|
||||
TagHelper.addTag(EndTags.END_STONES, stone);
|
||||
TagHelper.addTag(TagAPI.END_STONES, stone);
|
||||
|
||||
TagHelper.addTag(EndTags.DRAGON_IMMUNE, stone, stairs, slab, wall);
|
||||
TagHelper.addTag(TagAPI.DRAGON_IMMUNE, stone, stairs, slab, wall);
|
||||
}
|
||||
}
|
|
@ -11,7 +11,9 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.BarkBlock;
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.blocks.basis.EndBarrelBlock;
|
||||
|
@ -34,7 +36,6 @@ import ru.betterend.blocks.basis.EndWoodenPlateBlock;
|
|||
import ru.betterend.blocks.basis.StrippableBarkBlock;
|
||||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class WoodenMaterial {
|
||||
public final Block log;
|
||||
|
@ -127,7 +128,7 @@ public class WoodenMaterial {
|
|||
TagHelper.addTags(slab, ItemTags.WOODEN_SLABS, ItemTags.SLABS);
|
||||
TagHelper.addTags(stairs, ItemTags.WOODEN_STAIRS, ItemTags.STAIRS);
|
||||
TagHelper.addTags(trapdoor, ItemTags.WOODEN_TRAPDOORS, ItemTags.TRAPDOORS);
|
||||
TagHelper.addTag(EndTags.ITEM_CHEST, chest);
|
||||
TagHelper.addTag(TagAPI.ITEM_CHEST, chest);
|
||||
|
||||
// Block Tags //
|
||||
TagHelper.addTag(BlockTags.PLANKS, planks);
|
||||
|
@ -141,11 +142,11 @@ public class WoodenMaterial {
|
|||
TagHelper.addTags(slab, BlockTags.WOODEN_SLABS, BlockTags.SLABS);
|
||||
TagHelper.addTags(stairs, BlockTags.WOODEN_STAIRS, BlockTags.STAIRS);
|
||||
TagHelper.addTags(trapdoor, BlockTags.WOODEN_TRAPDOORS, BlockTags.TRAPDOORS);
|
||||
TagHelper.addTag(EndTags.BOOKSHELVES, shelf);
|
||||
TagHelper.addTag(EndTags.BLOCK_CHEST, chest);
|
||||
TagHelper.addTag(TagAPI.BOOKSHELVES, shelf);
|
||||
TagHelper.addTag(TagAPI.BLOCK_CHEST, chest);
|
||||
|
||||
logBlockTag = EndTags.makeBlockTag(name + "_logs");
|
||||
logItemTag = EndTags.makeItemTag(name + "_logs");
|
||||
logBlockTag = TagAPI.makeBlockTag(BetterEnd.MOD_ID, name + "_logs");
|
||||
logItemTag = TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_logs");
|
||||
TagHelper.addTag(logBlockTag, log_stripped, bark_stripped, log, bark);
|
||||
TagHelper.addTag(logItemTag, log_stripped, bark_stripped, log, bark);
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@ import net.minecraft.data.BuiltinRegistries;
|
|||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.ai.behavior.WeightedList;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.ModIntegration;
|
||||
import ru.betterend.integration.byg.biomes.BYGBiomes;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class BYGIntegration extends ModIntegration {
|
||||
|
@ -23,7 +23,7 @@ public class BYGIntegration extends ModIntegration {
|
|||
|
||||
@Override
|
||||
public void register() {
|
||||
TagHelper.addTags(Integrations.BYG.getBlock("ivis_phylium"), EndTags.END_GROUND, EndTags.GEN_TERRAIN);
|
||||
TagHelper.addTags(Integrations.BYG.getBlock("ivis_phylium"), TagAPI.END_GROUND, TagAPI.GEN_TERRAIN);
|
||||
BYGBlocks.register();
|
||||
BYGFeatures.register();
|
||||
BYGBiomes.register();
|
||||
|
|
|
@ -12,17 +12,17 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class BigEtherTreeFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState log = Integrations.BYG.getDefaultState("ether_log");
|
||||
|
@ -31,7 +31,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
return log;
|
||||
};
|
||||
Function<BlockState, Boolean> replace = (state) -> {
|
||||
return state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().isReplaceable();
|
||||
};
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
sdf.setReplaceFunction((state) -> {
|
||||
return state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().isReplaceable();
|
||||
}).addPostProcess((info) -> {
|
||||
if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -27,7 +28,6 @@ import ru.bclib.sdf.primitive.SDFSphere;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class GreatNightshadeTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState log = Integrations.BYG.getDefaultState("nightshade_log");
|
||||
|
@ -50,7 +50,7 @@ public class GreatNightshadeTreeFeature extends DefaultFeature {
|
|||
return log;
|
||||
};
|
||||
Function<BlockState, Boolean> replace = (state) -> {
|
||||
return state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().isReplaceable();
|
||||
};
|
||||
Function<PosInfo, BlockState> post = (info) -> {
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -27,7 +28,6 @@ import ru.bclib.sdf.primitive.SDFSphere;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState log = Integrations.BYG.getDefaultState("nightshade_log");
|
||||
|
@ -49,7 +49,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
|||
return log;
|
||||
};
|
||||
Function<BlockState, Boolean> replace = (state) -> {
|
||||
return state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().isReplaceable();
|
||||
};
|
||||
Function<PosInfo, BlockState> post = (info) -> {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFSubtraction;
|
||||
|
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class OldBulbisTreeFeature extends DefaultFeature {
|
||||
|
@ -38,9 +38,9 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
if (!world.getBlockState(pos.below(4)).getBlock().is(EndTags.GEN_TERRAIN))
|
||||
if (!world.getBlockState(pos.below(4)).getBlock().is(TagAPI.GEN_TERRAIN))
|
||||
return false;
|
||||
|
||||
BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem");
|
||||
|
@ -50,7 +50,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight");
|
||||
|
||||
Function<BlockState, Boolean> replacement = (state) -> {
|
||||
if (state.equals(stem) || state.equals(wood) || state.is(EndTags.END_GROUND)
|
||||
if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND)
|
||||
|| state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, wood, pos, replacement);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package ru.betterend.mixin.client;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EnchantmentTableBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
@Mixin(EnchantmentTableBlock.class)
|
||||
public abstract class EnchantingTableBlockMixin extends Block {
|
||||
public EnchantingTableBlockMixin(Properties settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Inject(method = "animateTick", at = @At(value = "TAIL"))
|
||||
private void be_onRandomDisplayTick(BlockState state, Level world, BlockPos pos, Random random, CallbackInfo info) {
|
||||
for (int px = -2; px <= 2; ++px) {
|
||||
for (int pz = -2; pz <= 2; ++pz) {
|
||||
if (px > -2 && px < 2 && pz == -1) {
|
||||
pz = 2;
|
||||
}
|
||||
if (random.nextInt(16) == 0) {
|
||||
for (int py = 0; py <= 1; ++py) {
|
||||
BlockPos blockPos = pos.offset(px, py, pz);
|
||||
if (world.getBlockState(blockPos).is(EndTags.BOOKSHELVES)) {
|
||||
if (!world.isEmptyBlock(pos.offset(px / 2, 0, pz / 2))) {
|
||||
break;
|
||||
}
|
||||
world.addParticle(ParticleTypes.ENCHANT, pos.getX() + 0.5, pos.getY() + 2.0, pos.getZ() + 0.5, px + random.nextFloat() - 0.5, py - random.nextFloat() - 1.0, pz + random.nextFloat() - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
package ru.betterend.mixin.common;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.item.BoneMealItem;
|
||||
import net.minecraft.world.item.context.UseOnContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.biome.Biome.BiomeCategory;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.BonemealUtil;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
@Mixin(BoneMealItem.class)
|
||||
public class BoneMealItemMixin {
|
||||
private static final MutableBlockPos BE_BLOCK_POS = new MutableBlockPos();
|
||||
|
||||
@Inject(method = "useOn", at = @At("HEAD"), cancellable = true)
|
||||
private void be_onUse(UseOnContext context, CallbackInfoReturnable<InteractionResult> info) {
|
||||
Level world = context.getLevel();
|
||||
BlockPos blockPos = context.getClickedPos();
|
||||
if (!world.isClientSide) {
|
||||
BlockPos offseted = blockPos.relative(context.getClickedFace());
|
||||
boolean endBiome = world.getBiome(offseted).getBiomeCategory() == BiomeCategory.THEEND;
|
||||
|
||||
if (world.getBlockState(blockPos).is(EndTags.END_GROUND)) {
|
||||
boolean consume = false;
|
||||
if (world.getBlockState(blockPos).is(Blocks.END_STONE)) {
|
||||
BlockState nylium = be_getNylium(world, blockPos);
|
||||
if (nylium != null) {
|
||||
BlocksHelper.setWithoutUpdate(world, blockPos, nylium);
|
||||
consume = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||
if (world.getBlockState(offseted).getBlock().equals(Blocks.WATER)) {
|
||||
consume = be_growWaterGrass(world, blockPos);
|
||||
}
|
||||
}
|
||||
else {
|
||||
consume = be_growGrass(world, blockPos);
|
||||
}
|
||||
}
|
||||
if (consume) {
|
||||
if (!context.getPlayer().isCreative()) {
|
||||
context.getItemInHand().shrink(1);
|
||||
}
|
||||
world.levelEvent(2005, blockPos, 0);
|
||||
info.setReturnValue(InteractionResult.SUCCESS);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
|
||||
if (world.getBlockState(offseted).getBlock().equals(Blocks.WATER)) {
|
||||
info.setReturnValue(InteractionResult.FAIL);
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean be_growGrass(Level world, BlockPos pos) {
|
||||
int y1 = pos.getY() + 3;
|
||||
int y2 = pos.getY() - 3;
|
||||
boolean result = false;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
int x = (int) (pos.getX() + world.random.nextGaussian() * 2);
|
||||
int z = (int) (pos.getZ() + world.random.nextGaussian() * 2);
|
||||
BE_BLOCK_POS.setX(x);
|
||||
BE_BLOCK_POS.setZ(z);
|
||||
for (int y = y1; y >= y2; y--) {
|
||||
BE_BLOCK_POS.setY(y);
|
||||
BlockPos down = BE_BLOCK_POS.below();
|
||||
if (world.isEmptyBlock(BE_BLOCK_POS) && !world.isEmptyBlock(down)) {
|
||||
BlockState grass = be_getGrassState(world, down);
|
||||
if (grass != null) {
|
||||
BlocksHelper.setWithoutUpdate(world, BE_BLOCK_POS, grass);
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean be_growWaterGrass(Level world, BlockPos pos) {
|
||||
int y1 = pos.getY() + 3;
|
||||
int y2 = pos.getY() - 3;
|
||||
boolean result = false;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
int x = (int) (pos.getX() + world.random.nextGaussian() * 2);
|
||||
int z = (int) (pos.getZ() + world.random.nextGaussian() * 2);
|
||||
BE_BLOCK_POS.setX(x);
|
||||
BE_BLOCK_POS.setZ(z);
|
||||
for (int y = y1; y >= y2; y--) {
|
||||
BE_BLOCK_POS.setY(y);
|
||||
BlockPos down = BE_BLOCK_POS.below();
|
||||
if (world.getBlockState(BE_BLOCK_POS).is(Blocks.WATER) && world.getBlockState(down).is(EndTags.END_GROUND)) {
|
||||
BlockState grass = be_getWaterGrassState(world, down);
|
||||
if (grass != null) {
|
||||
BlocksHelper.setWithoutUpdate(world, BE_BLOCK_POS, grass);
|
||||
result = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private BlockState be_getGrassState(Level world, BlockPos pos) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
block = BonemealUtil.getGrass(EndBiomes.getBiomeID(world.getBiome(pos)), block, world.getRandom());
|
||||
return block == null ? null : block.defaultBlockState();
|
||||
}
|
||||
|
||||
private BlockState be_getWaterGrassState(Level world, BlockPos pos) {
|
||||
EndBiome biome = EndBiomes.getFromBiome(world.getBiome(pos));
|
||||
if (world.random.nextInt(16) == 0) {
|
||||
return EndBlocks.CHARNIA_RED.defaultBlockState();
|
||||
}
|
||||
else if (biome == EndBiomes.FOGGY_MUSHROOMLAND || biome == EndBiomes.MEGALAKE || biome == EndBiomes.MEGALAKE_GROVE) {
|
||||
return world.random.nextBoolean() ? EndBlocks.CHARNIA_LIGHT_BLUE.defaultBlockState() : EndBlocks.CHARNIA_LIGHT_BLUE.defaultBlockState();
|
||||
}
|
||||
else if (biome == EndBiomes.AMBER_LAND) {
|
||||
return world.random.nextBoolean() ? EndBlocks.CHARNIA_ORANGE.defaultBlockState() : EndBlocks.CHARNIA_RED.defaultBlockState();
|
||||
}
|
||||
else if (biome == EndBiomes.CHORUS_FOREST || biome == EndBiomes.SHADOW_FOREST) {
|
||||
return EndBlocks.CHARNIA_PURPLE.defaultBlockState();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private BlockState be_getNylium(Level world, BlockPos pos) {
|
||||
Vec3i[] offsets = MHelper.getOffsets(world.getRandom());
|
||||
for (Vec3i dir : offsets) {
|
||||
BlockPos p = pos.offset(dir);
|
||||
BlockState state = world.getBlockState(p);
|
||||
if (BlocksHelper.isEndNylium(state) && !world.getBlockState(p.above()).is(EndTags.END_GROUND)) {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -26,8 +26,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
|
|||
|
||||
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
|
||||
private void be_randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random, CallbackInfo info) {
|
||||
if (world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
BlockPos up = pos.above();
|
||||
if (world.isEmptyBlock(up) && up.getY() < 256) {
|
||||
int i = state.getValue(ChorusFlowerBlock.AGE);
|
||||
|
@ -102,7 +102,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
|
|||
@Inject(method = "placeDeadFlower", at = @At("HEAD"), cancellable = true)
|
||||
private void be_placeDeadFlower(Level world, BlockPos pos, CallbackInfo info) {
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
if (down.is(Blocks.CHORUS_PLANT) || down.is(EndTags.GEN_TERRAIN)) {
|
||||
if (down.is(Blocks.CHORUS_PLANT) || down.is(TagAPI.GEN_TERRAIN)) {
|
||||
world.setBlock(pos, this.defaultBlockState().setValue(BlockStateProperties.AGE_5, 5), 2);
|
||||
world.levelEvent(1034, pos, 0);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
|
||||
|
@ -51,7 +51,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
|
|||
BlockPos pos = ctx.getClickedPos();
|
||||
Level world = ctx.getLevel();
|
||||
BlockState plant = info.getReturnValue();
|
||||
if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
if (GeneratorOptions.changeChorusPlant()) {
|
||||
info.setReturnValue(plant.setValue(BlocksHelper.ROOTS, true).setValue(BlockStateProperties.DOWN, true));
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
|
|||
private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable<BlockState> info) {
|
||||
BlockState plant = info.getReturnValue();
|
||||
if (plant.is(Blocks.CHORUS_PLANT)) {
|
||||
if (blockGetter.getBlockState(blockPos.below()).is(EndTags.END_GROUND)) {
|
||||
if (blockGetter.getBlockState(blockPos.below()).is(TagAPI.END_GROUND)) {
|
||||
if (GeneratorOptions.changeChorusPlant()) {
|
||||
info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true).setValue(BlocksHelper.ROOTS, true));
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
|
|||
private void be_updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable<BlockState> info) {
|
||||
BlockState plant = info.getReturnValue();
|
||||
if (plant.is(Blocks.CHORUS_PLANT)) {
|
||||
if (world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
if (GeneratorOptions.changeChorusPlant()) {
|
||||
plant = plant.setValue(BlockStateProperties.DOWN, true).setValue(BlocksHelper.ROOTS, true);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.world.inventory.MenuType;
|
|||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentInstance;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.bclib.api.TagAPI;
|
||||
|
||||
@Mixin(EnchantmentMenu.class)
|
||||
public abstract class EnchantmentMenuMixin extends AbstractContainerMenu {
|
||||
|
@ -68,28 +68,28 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu {
|
|||
for (j = -1; j <= 1; ++j) {
|
||||
for (int k = -1; k <= 1; ++k) {
|
||||
if ((j != 0 || k != 0) && world.isEmptyBlock(blockPos.offset(k, 0, j)) && world.isEmptyBlock(blockPos.offset(k, 1, j))) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (k != 0 && j != 0) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(EndTags.BOOKSHELVES)) {
|
||||
if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(TagAPI.BOOKSHELVES)) {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,12 +8,12 @@ import net.minecraft.world.item.alchemy.PotionUtils;
|
|||
import net.minecraft.world.item.alchemy.Potions;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.item.GuideBookItem;
|
||||
import ru.betterend.recipe.builders.GridRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class CraftingRecipes {
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class CraftingRecipes {
|
|||
.setShape("T#T", "V V", "T#T")
|
||||
.addMaterial('#', Blocks.END_STONE_BRICKS)
|
||||
.addMaterial('T', EndBlocks.THALLASIUM.ingot)
|
||||
.addMaterial('V', EndTags.FURNACES)
|
||||
.addMaterial('V', TagAPI.FURNACES)
|
||||
.build();
|
||||
|
||||
registerPedestal("andesite_pedestal", EndBlocks.ANDESITE_PEDESTAL, Blocks.POLISHED_ANDESITE_SLAB, Blocks.POLISHED_ANDESITE);
|
||||
|
@ -145,13 +145,13 @@ public class CraftingRecipes {
|
|||
GridRecipe.make("hopper", Blocks.HOPPER)
|
||||
.setShape("I I", "ICI", " I ")
|
||||
.addMaterial('I', Items.IRON_INGOT)
|
||||
.addMaterial('C', EndTags.ITEM_CHEST)
|
||||
.addMaterial('C', TagAPI.ITEM_CHEST)
|
||||
.build();
|
||||
|
||||
GridRecipe.make("shulker_box", Blocks.SHULKER_BOX)
|
||||
.setShape("S", "C", "S")
|
||||
.addMaterial('S', Items.SHULKER_SHELL)
|
||||
.addMaterial('C', EndTags.ITEM_CHEST)
|
||||
.addMaterial('C', TagAPI.ITEM_CHEST)
|
||||
.build();
|
||||
|
||||
GridRecipe.make("twisted_umbrella_moss_dye", Items.PURPLE_DYE).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS).build();
|
||||
|
@ -208,17 +208,17 @@ public class CraftingRecipes {
|
|||
GridRecipe.make("neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB).setShape("###").setOutputCount(6).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
|
||||
GridRecipe.make("neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS).setShape("# ", "## ", "###").setOutputCount(4).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build();
|
||||
|
||||
GridRecipe.make("tag_smith_table", Blocks.SMITHING_TABLE).setShape("II", "##", "##").addMaterial('#', ItemTags.PLANKS).addMaterial('I', EndTags.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_cauldron", Blocks.CAULDRON).setShape("I I", "I I", "III").addMaterial('I', EndTags.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_hopper", Blocks.HOPPER).setShape("I I", "ICI", " I ").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('C', EndTags.ITEM_CHEST).build();
|
||||
GridRecipe.make("tag_piston", Blocks.PISTON).setShape("WWW", "CIC", "CDC").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('D', Items.REDSTONE).addMaterial('C', Items.COBBLESTONE).addMaterial('W', ItemTags.PLANKS).build();
|
||||
GridRecipe.make("tag_rail", Blocks.RAIL).setShape("I I", "ISI", "I I").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('S', Items.STICK).build();
|
||||
GridRecipe.make("tag_stonecutter", Blocks.STONECUTTER).setShape(" I ", "SSS").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('S', Items.STONE).build();
|
||||
GridRecipe.make("tag_smith_table", Blocks.SMITHING_TABLE).setShape("II", "##", "##").addMaterial('#', ItemTags.PLANKS).addMaterial('I', TagAPI.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_cauldron", Blocks.CAULDRON).setShape("I I", "I I", "III").addMaterial('I', TagAPI.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_hopper", Blocks.HOPPER).setShape("I I", "ICI", " I ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('C', TagAPI.ITEM_CHEST).build();
|
||||
GridRecipe.make("tag_piston", Blocks.PISTON).setShape("WWW", "CIC", "CDC").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('D', Items.REDSTONE).addMaterial('C', Items.COBBLESTONE).addMaterial('W', ItemTags.PLANKS).build();
|
||||
GridRecipe.make("tag_rail", Blocks.RAIL).setShape("I I", "ISI", "I I").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('S', Items.STICK).build();
|
||||
GridRecipe.make("tag_stonecutter", Blocks.STONECUTTER).setShape(" I ", "SSS").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('S', Items.STONE).build();
|
||||
|
||||
GridRecipe.make("tag_bucket", Items.BUCKET).setShape("I I", " I ").addMaterial('I', EndTags.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_compass", Items.COMPASS).setShape(" I ", "IDI", " I ").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('D', Items.REDSTONE).build();
|
||||
GridRecipe.make("tag_minecart", Items.MINECART).setShape("I I", "III").addMaterial('I', EndTags.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_shield", Items.SHIELD).setShape("WIW", "WWW", " W ").addMaterial('I', EndTags.IRON_INGOTS).addMaterial('W', ItemTags.PLANKS).build();
|
||||
GridRecipe.make("tag_bucket", Items.BUCKET).setShape("I I", " I ").addMaterial('I', TagAPI.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_compass", Items.COMPASS).setShape(" I ", "IDI", " I ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('D', Items.REDSTONE).build();
|
||||
GridRecipe.make("tag_minecart", Items.MINECART).setShape("I I", "III").addMaterial('I', TagAPI.IRON_INGOTS).build();
|
||||
GridRecipe.make("tag_shield", Items.SHIELD).setShape("WIW", "WWW", " W ").addMaterial('I', TagAPI.IRON_INGOTS).addMaterial('W', ItemTags.PLANKS).build();
|
||||
|
||||
GridRecipe.make("sugar_from_root", Items.SUGAR).setList("###").addMaterial('#', EndItems.AMBER_ROOT_RAW).build();
|
||||
}
|
||||
|
|
|
@ -18,14 +18,13 @@ import net.minecraft.tags.TagCollection;
|
|||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome.BiomeCategory;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.TagHelper;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.EndTerrainBlock;
|
||||
|
@ -40,18 +39,11 @@ public class EndTags {
|
|||
// https://fabricmc.net/wiki/tutorial:tags
|
||||
|
||||
// Block Tags
|
||||
public static final Tag.Named<Block> BOOKSHELVES = makeCommonBlockTag("bookshelves");
|
||||
public static final Tag.Named<Block> GEN_TERRAIN = makeBlockTag("gen_terrain");
|
||||
public static final Tag.Named<Block> END_GROUND = makeBlockTag("end_ground");
|
||||
public static final Tag.Named<Block> PEDESTALS = makeBlockTag("pedestal");
|
||||
public static final Tag.Named<Block> BLOCK_CHEST = makeCommonBlockTag("chest");
|
||||
public static final Tag.Named<Block> END_STONES = makeCommonBlockTag("end_stones");
|
||||
public static final Tag.Named<Block> DRAGON_IMMUNE = getMCBlockTag("dragon_immune");
|
||||
|
||||
// Item Tags
|
||||
public static final Tag.Named<Item> ITEM_CHEST = makeCommonItemTag("chest");
|
||||
public static final Tag.Named<Item> IRON_INGOTS = makeCommonItemTag("iron_ingots");
|
||||
public static final Tag.Named<Item> FURNACES = makeCommonItemTag("furnaces");
|
||||
public final static Tag.Named<Item> HAMMERS = makeFabricItemTag("hammers");
|
||||
|
||||
public static <T> Tag.Named<T> makeTag(Supplier<TagCollection<T>> containerSupplier, ResourceLocation id) {
|
||||
|
@ -86,15 +78,14 @@ public class EndTags {
|
|||
}
|
||||
|
||||
public static void register() {
|
||||
addSurfaceBlock(Blocks.END_STONE);
|
||||
addSurfaceBlock(EndBlocks.THALLASIUM.ore);
|
||||
addSurfaceBlock(EndBlocks.ENDSTONE_DUST);
|
||||
addSurfaceBlock(EndBlocks.AMBER_ORE);
|
||||
TagAPI.addEndGround(EndBlocks.THALLASIUM.ore);
|
||||
TagAPI.addEndGround(EndBlocks.ENDSTONE_DUST);
|
||||
TagAPI.addEndGround(EndBlocks.AMBER_ORE);
|
||||
|
||||
EndItems.getModBlocks().forEach(blockItem -> {
|
||||
Block block = ((BlockItem) blockItem).getBlock();
|
||||
if (block instanceof EndTerrainBlock) {
|
||||
addSurfaceBlock(block);
|
||||
TagAPI.addEndGround(block);
|
||||
TagHelper.addTag(BlockTags.NYLIUM, block);
|
||||
}
|
||||
else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) {
|
||||
|
@ -130,7 +121,7 @@ public class EndTags {
|
|||
ToolManagerImpl.tag(HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(hammers));
|
||||
|
||||
TagHelper.addTag(
|
||||
GEN_TERRAIN,
|
||||
TagAPI.GEN_TERRAIN,
|
||||
EndBlocks.ENDER_ORE,
|
||||
EndBlocks.FLAVOLITE.stone,
|
||||
EndBlocks.VIOLECITE.stone,
|
||||
|
@ -140,23 +131,17 @@ public class EndTags {
|
|||
EndBlocks.AZURE_JADESTONE.stone,
|
||||
EndBlocks.SANDY_JADESTONE.stone
|
||||
);
|
||||
TagHelper.addTag(END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
|
||||
|
||||
TagHelper.addTag(FURNACES, Blocks.FURNACE);
|
||||
TagHelper.addTag(TagAPI.END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
|
||||
TagHelper.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL);
|
||||
|
||||
TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK);
|
||||
TagHelper.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT);
|
||||
|
||||
TagHelper.addTag(EndTags.DRAGON_IMMUNE, EndBlocks.ENDER_ORE, EndBlocks.ETERNAL_PEDESTAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED);
|
||||
|
||||
TagHelper.addTag(EndTags.IRON_INGOTS, Items.IRON_INGOT);
|
||||
TagHelper.addTag(EndTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
|
||||
}
|
||||
|
||||
public static void addSurfaceBlock(Block block) {
|
||||
TagHelper.addTag(END_GROUND, block);
|
||||
TagHelper.addTag(GEN_TERRAIN, block);
|
||||
TagHelper.addTag(EndTags.DRAGON_IMMUNE,
|
||||
EndBlocks.ENDER_ORE,
|
||||
EndBlocks.ETERNAL_PEDESTAL,
|
||||
EndBlocks.FLAVOLITE_RUNED_ETERNAL,
|
||||
EndBlocks.FLAVOLITE_RUNED
|
||||
);
|
||||
TagHelper.addTag(TagAPI.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
|
||||
}
|
||||
|
||||
public static void addTerrainTags(Registry<Biome> biomeRegistry) {
|
||||
|
@ -165,10 +150,10 @@ public class EndTags {
|
|||
SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig();
|
||||
Block under = config.getUnderMaterial().getBlock();
|
||||
Block surface = config.getTopMaterial().getBlock();
|
||||
TagHelper.addTag(GEN_TERRAIN, under, surface);
|
||||
TagHelper.addTag(END_GROUND, surface);
|
||||
TagHelper.addTag(TagAPI.GEN_TERRAIN, under, surface);
|
||||
TagHelper.addTag(TagAPI.END_GROUND, surface);
|
||||
}
|
||||
});
|
||||
END_STONES.getValues().forEach(EndTags::addSurfaceBlock);
|
||||
END_STONES.getValues().forEach(TagAPI::addEndGround);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@ import net.minecraft.world.level.block.Rotation;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.Property;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlueVineBlock;
|
||||
import ru.betterend.blocks.basis.DoublePlantBlock;
|
||||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.blocks.basis.StalactiteBlock;
|
||||
import ru.betterend.blocks.basis.VineBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class BlocksHelper {
|
||||
public static final BooleanProperty ROOTS = BooleanProperty.create("roots");
|
||||
|
@ -346,7 +346,7 @@ public class BlocksHelper {
|
|||
}
|
||||
|
||||
public static boolean isEndNylium(Block block) {
|
||||
return block.is(BlockTags.NYLIUM) && block.is(EndTags.END_GROUND);
|
||||
return block.is(BlockTags.NYLIUM) && block.is(TagAPI.END_GROUND);
|
||||
}
|
||||
|
||||
public static boolean isEndNylium(BlockState state) {
|
||||
|
|
55
src/main/java/ru/betterend/util/BonemealPlants.java
Normal file
55
src/main/java/ru/betterend/util/BonemealPlants.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import ru.bclib.api.BonemealAPI;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
public class BonemealPlants {
|
||||
public static void init() {
|
||||
BonemealAPI.addLandGrass(EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.END_MYCELIUM, EndBlocks.CREEPING_MOSS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.END_MYCELIUM, EndBlocks.UMBRELLA_MOSS);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.CAVE_MOSS, EndBlocks.CAVE_GRASS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.CHORUS_NYLIUM, EndBlocks.CHORUS_GRASS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.CRYSTAL_MOSS, EndBlocks.CRYSTAL_GRASS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.SHADOW_GRASS, EndBlocks.SHADOW_PLANT);
|
||||
BonemealAPI.addLandGrass(EndBlocks.PINK_MOSS, EndBlocks.BUSHY_GRASS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.AMBER_MOSS, EndBlocks.AMBER_GRASS);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.JUNGLE_GRASS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.SMALL_JELLYSHROOM, 0.1F);
|
||||
|
||||
// Wait for Lib changes
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.BLOOMING_COOKSONIA);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.VAIOLUSH_FERN);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.FRACTURN);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.SALTEAGO);
|
||||
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS, 0.1F);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS, 0.1F);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS, 0.1F);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.ORANGO);
|
||||
BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F);
|
||||
BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.LUTEBUS, 0.2F);
|
||||
BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.LAMELLARIUM);
|
||||
|
||||
//BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.LAMELLARIUM);
|
||||
//BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.BOLUX_MUSHROOM, 0.05F);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.SANGNUM, EndBlocks.GLOBULAGUS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.SANGNUM, EndBlocks.CLAWFERN);
|
||||
BonemealAPI.addLandGrass(EndBlocks.SANGNUM, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.GLOBULAGUS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.CLAWFERN);
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.GLOBULAGUS);
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.CLAWFERN);
|
||||
BonemealAPI.addLandGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
}
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
package ru.betterend.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class BonemealUtil {
|
||||
private static final Map<ResourceLocation, Map<Block, GrassList>> GRASS_BIOMES = Maps.newHashMap();
|
||||
private static final Map<Block, GrassList> GRASS_TYPES = Maps.newHashMap();
|
||||
|
||||
public static void init() {
|
||||
addBonemealGrass(EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS);
|
||||
addBonemealGrass(EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS);
|
||||
addBonemealGrass(EndBlocks.END_MYCELIUM, EndBlocks.CREEPING_MOSS);
|
||||
addBonemealGrass(EndBlocks.END_MYCELIUM, EndBlocks.UMBRELLA_MOSS);
|
||||
|
||||
addBonemealGrass(EndBlocks.CAVE_MOSS, EndBlocks.CAVE_GRASS);
|
||||
addBonemealGrass(EndBlocks.CHORUS_NYLIUM, EndBlocks.CHORUS_GRASS);
|
||||
addBonemealGrass(EndBlocks.CRYSTAL_MOSS, EndBlocks.CRYSTAL_GRASS);
|
||||
addBonemealGrass(EndBlocks.SHADOW_GRASS, EndBlocks.SHADOW_PLANT);
|
||||
addBonemealGrass(EndBlocks.PINK_MOSS, EndBlocks.BUSHY_GRASS);
|
||||
addBonemealGrass(EndBlocks.AMBER_MOSS, EndBlocks.AMBER_GRASS);
|
||||
|
||||
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.JUNGLE_GRASS);
|
||||
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS);
|
||||
addBonemealGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.SMALL_JELLYSHROOM, 0.1F);
|
||||
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.BLOOMING_COOKSONIA);
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.VAIOLUSH_FERN);
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.FRACTURN);
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.SALTEAGO);
|
||||
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS, 0.1F);
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS, 0.1F);
|
||||
addBonemealGrass(EndBiomes.GLOWING_GRASSLANDS, EndBlocks.END_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS, 0.1F);
|
||||
|
||||
addBonemealGrass(EndBlocks.RUTISCUS, EndBlocks.ORANGO);
|
||||
addBonemealGrass(EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F);
|
||||
addBonemealGrass(EndBlocks.RUTISCUS, EndBlocks.LUTEBUS, 0.2F);
|
||||
addBonemealGrass(EndBlocks.RUTISCUS, EndBlocks.LAMELLARIUM);
|
||||
|
||||
addBonemealGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F);
|
||||
addBonemealGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.LAMELLARIUM);
|
||||
addBonemealGrass(EndBiomes.LANTERN_WOODS, EndBlocks.RUTISCUS, EndBlocks.BOLUX_MUSHROOM, 0.05F);
|
||||
|
||||
addBonemealGrass(EndBlocks.SANGNUM, EndBlocks.GLOBULAGUS);
|
||||
addBonemealGrass(EndBlocks.SANGNUM, EndBlocks.CLAWFERN);
|
||||
addBonemealGrass(EndBlocks.SANGNUM, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
|
||||
addBonemealGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.GLOBULAGUS);
|
||||
addBonemealGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.CLAWFERN);
|
||||
addBonemealGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
|
||||
addBonemealGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.GLOBULAGUS);
|
||||
addBonemealGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.CLAWFERN);
|
||||
addBonemealGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F);
|
||||
}
|
||||
|
||||
public static void addBonemealGrass(Block terrain, Block plant) {
|
||||
addBonemealGrass(terrain, plant, 1F);
|
||||
}
|
||||
|
||||
public static void addBonemealGrass(Block terrain, Block plant, float chance) {
|
||||
GrassList list = GRASS_TYPES.get(terrain);
|
||||
if (list == null) {
|
||||
list = new GrassList();
|
||||
GRASS_TYPES.put(terrain, list);
|
||||
}
|
||||
list.addGrass(plant, chance);
|
||||
}
|
||||
|
||||
public static void addBonemealGrass(EndBiome biome, Block terrain, Block plant) {
|
||||
addBonemealGrass(biome, terrain, plant, 1F);
|
||||
}
|
||||
|
||||
public static void addBonemealGrass(EndBiome biome, Block terrain, Block plant, float chance) {
|
||||
Map<Block, GrassList> map = GRASS_BIOMES.get(biome.getID());
|
||||
if (map == null) {
|
||||
map = Maps.newHashMap();
|
||||
GRASS_BIOMES.put(biome.getID(), map);
|
||||
}
|
||||
GrassList list = map.get(terrain);
|
||||
if (list == null) {
|
||||
list = new GrassList();
|
||||
map.put(terrain, list);
|
||||
}
|
||||
list.addGrass(plant, chance);
|
||||
}
|
||||
|
||||
public static Block getGrass(ResourceLocation biomeID, Block terrain, Random random) {
|
||||
Map<Block, GrassList> map = GRASS_BIOMES.get(biomeID);
|
||||
GrassList list = null;
|
||||
if (map != null) {
|
||||
list = map.get(terrain);
|
||||
if (list == null) {
|
||||
list = GRASS_TYPES.get(terrain);
|
||||
}
|
||||
}
|
||||
else {
|
||||
list = GRASS_TYPES.get(terrain);
|
||||
}
|
||||
return list == null ? null : list.getGrass(random);
|
||||
}
|
||||
|
||||
private static final class GrassInfo {
|
||||
final Block grass;
|
||||
float chance;
|
||||
|
||||
public GrassInfo(Block grass, float chance) {
|
||||
this.grass = grass;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
public float addChance(float chance) {
|
||||
this.chance += chance;
|
||||
return this.chance;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class GrassList {
|
||||
final List<GrassInfo> list = Lists.newArrayList();
|
||||
float maxChance = 0;
|
||||
|
||||
public void addGrass(Block grass, float chance) {
|
||||
GrassInfo info = new GrassInfo(grass, chance);
|
||||
maxChance = info.addChance(maxChance);
|
||||
list.add(info);
|
||||
}
|
||||
|
||||
public Block getGrass(Random random) {
|
||||
if (maxChance == 0 || list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
float chance = random.nextFloat() * maxChance;
|
||||
for (GrassInfo info: list) {
|
||||
if (chance <= info.chance) {
|
||||
return info.grass;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,16 +6,16 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CavePumpkinFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.above()).is(EndTags.GEN_TERRAIN) || !world.isEmptyBlock(pos)
|
||||
if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos)
|
||||
|| !world.isEmptyBlock(pos.below())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ 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.StructureBlockInfo;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.StructureHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CrashedShipFeature extends NBTStructureFeature {
|
||||
|
@ -48,7 +48,7 @@ public class CrashedShipFeature extends NBTStructureFeature {
|
|||
if (x * x + z * z < 3600) {
|
||||
return false;
|
||||
}
|
||||
return pos.getY() > 5 && world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN);
|
||||
return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,8 +9,8 @@ import net.minecraft.world.level.block.Mirror;
|
|||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.StructureHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class ListFeature extends NBTStructureFeature {
|
||||
private final List<StructureInfo> list;
|
||||
|
@ -30,7 +30,7 @@ public class ListFeature extends NBTStructureFeature {
|
|||
protected boolean canSpawn(WorldGenLevel world, BlockPos pos, Random random) {
|
||||
int cx = pos.getX() >> 4;
|
||||
int cz = pos.getZ() >> 4;
|
||||
return ((cx + cz) & 1) == 0 && pos.getY() > 58 && world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN);
|
||||
return ((cx + cz) & 1) == 0 && pos.getY() > 58 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,8 +22,8 @@ import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
|||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
|
||||
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.processors.DestructionStructureProcessor;
|
||||
|
||||
|
@ -125,11 +125,11 @@ public abstract class NBTStructureFeature extends DefaultFeature {
|
|||
mut.setZ(z);
|
||||
mut.setY(surfMax);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!state.is(EndTags.GEN_TERRAIN) && state.isFaceSturdy(world, mut, Direction.DOWN)) {
|
||||
if (!state.is(TagAPI.GEN_TERRAIN) && state.isFaceSturdy(world, mut, Direction.DOWN)) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
BlockState stateSt = world.getBlockState(mut);
|
||||
if (!stateSt.is(EndTags.GEN_TERRAIN)) {
|
||||
if (!stateSt.is(TagAPI.GEN_TERRAIN)) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings()
|
||||
.getSurfaceBuilderConfig();
|
||||
|
@ -140,7 +140,7 @@ public abstract class NBTStructureFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, mut, state);
|
||||
}
|
||||
} else {
|
||||
if (stateSt.is(EndTags.END_GROUND) && state.getMaterial().isSolidBlocking()) {
|
||||
if (stateSt.is(TagAPI.END_GROUND) && state.getMaterial().isSolidBlocking()) {
|
||||
if (merge == TerrainMerge.SURFACE) {
|
||||
SurfaceBuilderConfiguration config = world.getBiome(mut).getGenerationSettings()
|
||||
.getSurfaceBuilderConfig();
|
||||
|
|
|
@ -7,8 +7,8 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public abstract class ScatterFeature extends DefaultFeature {
|
||||
|
@ -31,7 +31,7 @@ public abstract class ScatterFeature extends DefaultFeature {
|
|||
protected boolean canSpawn(WorldGenLevel world, BlockPos pos) {
|
||||
if (pos.getY() < 5) {
|
||||
return false;
|
||||
} else if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
} else if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -20,7 +21,6 @@ import ru.bclib.sdf.operator.SDFTranslate;
|
|||
import ru.bclib.sdf.primitive.SDFSphere;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,8 +37,8 @@ public class BushFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -21,7 +22,6 @@ import ru.bclib.sdf.operator.SDFTranslate;
|
|||
import ru.bclib.sdf.primitive.SDFSphere;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -41,8 +41,8 @@ public class BushWithOuterFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND)
|
||||
&& !world.getBlockState(pos.above()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class LargeAmaranitaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
MutableBlockPos mut = new MutableBlockPos().set(pos);
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties.LumecornShape;
|
||||
import ru.betterend.blocks.LumecornBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class Lumecorn extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
int height = MHelper.randRange(4, 7, random);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -27,7 +28,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class TenaneaBushFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 3.5F, random);
|
||||
|
|
|
@ -9,12 +9,12 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
import ru.bclib.sdf.primitive.SDFHexPrism;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class BigAuroraCrystalFeature extends DefaultFeature {
|
|||
Vector3f vec = MHelper.randomHorizontal(random);
|
||||
prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism);
|
||||
prism.setReplaceFunction((bState) -> {
|
||||
return bState.getMaterial().isReplaceable() || bState.is(EndTags.GEN_TERRAIN)
|
||||
return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN)
|
||||
|| bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES);
|
||||
});
|
||||
prism.fillRecursive(world, pos);
|
||||
|
|
|
@ -11,10 +11,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -110,11 +110,11 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
r *= r;
|
||||
if (x2 + z2 <= r) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
|
||||
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
if (y > waterLevel + 1)
|
||||
BlocksHelper.setWithoutUpdate(world, pos, state);
|
||||
|
@ -162,7 +162,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, POS, state);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).getBlock().is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).getBlock().is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
|
||||
}
|
||||
pos = POS.above();
|
||||
|
@ -174,7 +174,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
// Make border
|
||||
else if (y2 + x2 + z2 <= rb) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) && world.isEmptyBlock(POS.above())) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS);
|
||||
}
|
||||
else if (y < waterLevel) {
|
||||
|
@ -201,7 +201,7 @@ public class DesertLakeFeature extends DefaultFeature {
|
|||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial().isReplaceable()
|
||||
|| state.is(EndTags.GEN_TERRAIN)
|
||||
|| state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT)
|
||||
|
|
|
@ -11,10 +11,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -110,11 +110,11 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
r *= r;
|
||||
if (x2 + z2 <= r) {
|
||||
state = world.getBlockState(POS);
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, AIR);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
|
||||
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
if (y > waterLevel + 1)
|
||||
BlocksHelper.setWithoutUpdate(world, pos, state);
|
||||
|
@ -162,7 +162,7 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
BlocksHelper.setWithoutUpdate(world, POS, state);
|
||||
}
|
||||
pos = POS.below();
|
||||
if (world.getBlockState(pos).getBlock().is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos).getBlock().is(TagAPI.GEN_TERRAIN)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
|
||||
}
|
||||
pos = POS.above();
|
||||
|
@ -195,7 +195,7 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
|
||||
private boolean canReplace(BlockState state) {
|
||||
return state.getMaterial().isReplaceable()
|
||||
|| state.is(EndTags.GEN_TERRAIN)
|
||||
|| state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.is(EndBlocks.ENDSTONE_DUST)
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT)
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -19,16 +20,14 @@ import ru.bclib.sdf.primitive.SDFCappedCone;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class FallenPillarFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(5)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -52,7 +51,7 @@ public class FallenPillarFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN)
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -35,7 +36,6 @@ import ru.betterend.blocks.HydrothermalVentBlock;
|
|||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
MutableBlockPos bpos = new MutableBlockPos().set(pos);
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
@ -221,7 +221,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
mut.setY(mut.getY() + 1);
|
||||
|
@ -252,12 +252,11 @@ public class GeyserFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE1 = (state) -> {
|
||||
return state.isAir() || (state.is(EndTags.GEN_TERRAIN));
|
||||
return state.isAir() || (state.is(TagAPI.GEN_TERRAIN));
|
||||
};
|
||||
|
||||
REPLACE2 = (state) -> {
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
|| state.is(EndBlocks.SULPHUR_CRYSTAL)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
|
@ -267,8 +266,7 @@ public class GeyserFeature extends DefaultFeature {
|
|||
};
|
||||
|
||||
IGNORE = (state) -> {
|
||||
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone)
|
||||
|| state.is(EndBlocks.BRIMSTONE);
|
||||
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state.is(EndBlocks.BRIMSTONE);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -16,7 +17,6 @@ import ru.bclib.sdf.primitive.SDFSphere;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class ObsidianBoulderFeature extends DefaultFeature {
|
||||
|
@ -25,7 +25,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class ObsidianBoulderFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN)
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -21,14 +22,13 @@ import ru.bclib.sdf.primitive.SDFFlatland;
|
|||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class ObsidianPillarBasementFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(5)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
|
|||
}
|
||||
return info.getState();
|
||||
}).setReplaceFunction((state) -> {
|
||||
return state.getMaterial().isReplaceable() || state.is(EndTags.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
|
||||
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
|
||||
}).fillRecursive(world, pos);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -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.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,9 +21,8 @@ public class SingleBlockFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN)) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, crystal);
|
||||
mut.setY(mut.getY() + 1);
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFSmoothUnion;
|
||||
|
@ -24,7 +25,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class SpireFeature extends DefaultFeature {
|
||||
|
@ -34,8 +34,8 @@ public class SpireFeature extends DefaultFeature {
|
|||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurfaceWG(world, pos);
|
||||
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(EndTags.GEN_TERRAIN)
|
||||
|| !world.getBlockState(pos.below(6)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)
|
||||
|| !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class SpireFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() instanceof LeavesBlock) {
|
||||
|
|
|
@ -11,8 +11,8 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.blocks.basis.StalactiteBlock;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class StalactiteFeature extends DefaultFeature {
|
|||
mut.setY(pos.getY() + i * dir);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (!state.getMaterial().isReplaceable()) {
|
||||
stalagnate = state.is(EndTags.GEN_TERRAIN);
|
||||
stalagnate = state.is(TagAPI.GEN_TERRAIN);
|
||||
height = i;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.SulphurCrystalBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
bpos.setY(top - 1);
|
||||
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (!state.is(EndTags.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
top = (int) (bpos.getY() - (radius * 1.3F + 5));
|
||||
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
} else if (dist < r2 * r2) {
|
||||
state = world.getBlockState(mut);
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.is(Blocks.AIR)) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) {
|
||||
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1)
|
||||
+ noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5;
|
||||
if (v > 0.4) {
|
||||
|
@ -132,7 +132,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
@ -167,7 +167,7 @@ public class SulphuricCaveFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(EndTags.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT)
|
||||
|| state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL)
|
||||
|| state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES);
|
||||
|
|
|
@ -14,12 +14,12 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.SulphurCrystalBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
int dist = x2 + z2;
|
||||
if (dist <= r) {
|
||||
POS.setY(getYOnSurface(world, x, z) - 1);
|
||||
if (world.getBlockState(POS).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(POS).is(TagAPI.GEN_TERRAIN)) {
|
||||
if (isBorder(world, POS)) {
|
||||
if (random.nextInt(8) > 0) {
|
||||
brimstone.add(POS.immutable());
|
||||
|
@ -93,7 +93,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
brimstone.remove(POS);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos offseted = POS.relative(dir);
|
||||
if (world.getBlockState(offseted).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(offseted);
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
brimstone.remove(POS);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos offseted = POS.relative(dir);
|
||||
if (world.getBlockState(offseted).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(offseted).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(offseted);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class SulphuricLakeFeature extends DefaultFeature {
|
|||
}
|
||||
} else if (dist < r2) {
|
||||
POS.setY(getYOnSurface(world, x, z) - 1);
|
||||
if (world.getBlockState(POS).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(POS).is(TagAPI.GEN_TERRAIN)) {
|
||||
brimstone.add(POS.immutable());
|
||||
if (random.nextBoolean()) {
|
||||
brimstone.add(POS.below());
|
||||
|
|
|
@ -8,10 +8,10 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.blocks.HydrothermalVentBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -21,26 +21,23 @@ public class SurfaceVentFeature extends DefaultFeature {
|
|||
NoneFeatureConfiguration config) {
|
||||
pos = getPosOnSurface(world,
|
||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
|
||||
if (!world.getBlockState(pos.below(3)).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
int count = MHelper.randRange(15, 30, random);
|
||||
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED,
|
||||
false);
|
||||
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED, false);
|
||||
for (int i = 0; i < count; i++) {
|
||||
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5,
|
||||
MHelper.floor(random.nextGaussian() * 2 + 0.5));
|
||||
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()))
|
||||
+ random.nextInt(2);
|
||||
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
|
||||
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
|
||||
if (dist > 0) {
|
||||
BlockState state = world.getBlockState(mut);
|
||||
for (int n = 0; n < 10 && state.isAir(); n++) {
|
||||
mut.setY(mut.getY() - 1);
|
||||
state = world.getBlockState(mut);
|
||||
}
|
||||
if (state.is(EndTags.GEN_TERRAIN)
|
||||
if (state.is(TagAPI.GEN_TERRAIN)
|
||||
&& !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
|
||||
for (int j = 0; j <= dist; j++) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraft.world.level.chunk.ChunkAccess;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
@ -28,8 +28,7 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
Set<BlockPos> floorPositions = Sets.newHashSet();
|
||||
Set<BlockPos> ceilPositions = Sets.newHashSet();
|
||||
int sx = (pos.getX() >> 4) << 4;
|
||||
|
@ -61,12 +60,13 @@ public class CaveChunkPopulatorFeature extends DefaultFeature {
|
|||
mut.setY(y);
|
||||
BlockState top = chunk.getBlockState(mut);
|
||||
BlockState bottom = chunk.getBlockState(mut2);
|
||||
if (top.isAir() && (bottom.is(EndTags.GEN_TERRAIN) || bottom.is(Blocks.STONE))) {
|
||||
if (top.isAir() && (bottom.is(TagAPI.GEN_TERRAIN) || bottom.is(Blocks.STONE))) {
|
||||
mut3.set(mut2).move(sx, 0, sz);
|
||||
floorPositions.add(mut3.immutable());
|
||||
updateMin(mut3, min);
|
||||
updateMax(mut3, max);
|
||||
} else if (bottom.isAir() && (top.is(EndTags.GEN_TERRAIN) || top.is(Blocks.STONE))) {
|
||||
}
|
||||
else if (bottom.isAir() && (top.is(TagAPI.GEN_TERRAIN) || top.is(Blocks.STONE))) {
|
||||
mut3.set(mut).move(sx, 0, sz);
|
||||
ceilPositions.add(mut3.immutable());
|
||||
updateMin(mut3, min);
|
||||
|
|
|
@ -19,10 +19,10 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.interfaces.IBiomeArray;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
|
@ -63,11 +63,11 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
mut.set(bpos);
|
||||
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
mut.setY(bpos.getY() - 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
floorPositions.add(mut.immutable());
|
||||
}
|
||||
mut.setY(bpos.getY() + 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
ceilPositions.add(mut.immutable());
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
if (wallBlock != null) {
|
||||
for (Vec3i offset: SPHERE) {
|
||||
BlockPos wallPos = pos.offset(offset);
|
||||
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(EndTags.GEN_TERRAIN)) {
|
||||
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(TagAPI.GEN_TERRAIN)) {
|
||||
wallBlock = biome.getWall(wallPos);
|
||||
BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock);
|
||||
placed.add(wallPos);
|
||||
|
@ -164,7 +164,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
bpos.setY(top - 1);
|
||||
|
||||
BlockState state = world.getBlockState(bpos);
|
||||
while (!state.is(EndTags.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
|
|||
}
|
||||
top = (int) (bpos.getY() - (radius * 1.3F + 5));
|
||||
|
||||
while (state.is(EndTags.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) {
|
||||
bpos.setY(bpos.getY() - 1);
|
||||
state = world.getBlockState(bpos);
|
||||
}
|
||||
|
|
|
@ -10,9 +10,9 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
|||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class RoundCaveFeature extends EndCaveFeature {
|
||||
|
@ -76,7 +76,7 @@ public class RoundCaveFeature extends EndCaveFeature {
|
|||
}
|
||||
|
||||
private boolean isReplaceable(BlockState state) {
|
||||
return state.is(EndTags.GEN_TERRAIN)
|
||||
return state.is(TagAPI.GEN_TERRAIN)
|
||||
|| state.getMaterial().isReplaceable()
|
||||
|| state.getMaterial().equals(Material.PLANT)
|
||||
|| state.getMaterial().equals(Material.LEAVES);
|
||||
|
|
|
@ -18,9 +18,9 @@ import net.minecraft.world.level.chunk.ChunkGenerator;
|
|||
import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
float vert = Mth.sin((y + (float) noiseV.eval(x * 0.01, z * 0.01) * 20) * 0.1F) * 0.9F;
|
||||
float dist = (float) noiseD.eval(x * 0.1, y * 0.1, z * 0.1) * 0.12F;
|
||||
vert *= vert;
|
||||
if (val + vert + dist < 0.15 && world.getBlockState(pos).is(EndTags.GEN_TERRAIN) && noWaterNear(world, pos)) {
|
||||
if (val + vert + dist < 0.15 && world.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && noWaterNear(world, pos)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
positions.add(pos.immutable());
|
||||
int height = world.getHeight(Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
|
@ -115,7 +115,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
}
|
||||
else if (world.getBlockState(mut).getMaterial().isReplaceable()) {
|
||||
mut.setY(bpos.getY() - 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
Set<BlockPos> floorPositions = floorSets.get(bio);
|
||||
if (floorPositions == null) {
|
||||
floorPositions = Sets.newHashSet();
|
||||
|
@ -124,7 +124,7 @@ public class TunelCaveFeature extends EndCaveFeature {
|
|||
floorPositions.add(mut.immutable());
|
||||
}
|
||||
mut.setY(bpos.getY() + 1);
|
||||
if (world.getBlockState(mut).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.GEN_TERRAIN)) {
|
||||
Set<BlockPos> ceilPositions = ceilSets.get(bio);
|
||||
if (ceilPositions == null) {
|
||||
ceilPositions = Sets.newHashSet();
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -28,7 +29,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(10, 25, random);
|
||||
|
@ -111,7 +111,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.defaultBlockState(), pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ public class DragonTreeFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) {
|
||||
|
|
|
@ -17,13 +17,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.basis.AttachedBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(5, 10, random);
|
||||
|
@ -329,7 +329,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFRotation;
|
||||
|
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.HelixTreeLeavesBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class HelixTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||
import ru.bclib.sdf.operator.SDFScale3D;
|
||||
|
@ -25,7 +26,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.blocks.JellyshroomCapBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
public class JellyshroomFeature extends DefaultFeature {
|
||||
|
@ -35,7 +35,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState bark = EndBlocks.JELLYSHROOM.bark.defaultBlockState();
|
||||
|
@ -89,7 +89,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSpline(branch, world, wood, pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class JellyshroomFeature extends DefaultFeature {
|
|||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -25,7 +26,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(15, 25, random);
|
||||
|
@ -82,7 +82,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
boolean generate = false;
|
||||
for (int y = minY; y < maxY; y++) {
|
||||
mut.setY(y);
|
||||
if (world.getBlockState(mut).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(mut).is(TagAPI.END_GROUND)) {
|
||||
generate = true;
|
||||
break;
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
mut.setY(y);
|
||||
BlockState state = world.getBlockState(mut);
|
||||
if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.is(EndTags.END_GROUND)) {
|
||||
|| state.is(TagAPI.END_GROUND)) {
|
||||
BlocksHelper.setWithoutUpdate(world, mut,
|
||||
y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log);
|
||||
} else {
|
||||
|
@ -180,7 +180,7 @@ public class LacugroveFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (EndBlocks.LACUGROVE.isTreeLog(state)) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(12, 20, random);
|
||||
|
@ -184,7 +184,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.bark.defaultBlockState(), pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ public class LucerniaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) {
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFBinary;
|
||||
import ru.bclib.sdf.operator.SDFCoordModify;
|
||||
|
@ -32,7 +33,6 @@ import ru.betterend.blocks.MossyGlowshroomCapBlock;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -86,12 +86,14 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
|
||||
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
|
||||
return info.getState();
|
||||
} else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp())
|
||||
}
|
||||
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp())
|
||||
|| !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState());
|
||||
return info.getState();
|
||||
}
|
||||
} else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
|
||||
}
|
||||
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
|
||||
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
|
||||
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
|
||||
|
@ -100,7 +102,8 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
|
||||
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState());
|
||||
return info.getState();
|
||||
} else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
|
||||
}
|
||||
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
if (info.getState(dir) == AIR) {
|
||||
info.setBlockPos(info.getPos().relative(dir),
|
||||
|
@ -123,8 +126,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
|
||||
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
|
||||
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0)
|
||||
.setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
|
||||
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
|
||||
SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone);
|
||||
SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave);
|
||||
|
@ -163,7 +165,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
|
|||
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.PosInfo;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
|
@ -26,7 +27,6 @@ import ru.bclib.util.MHelper;
|
|||
import ru.bclib.util.SplineHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -36,10 +36,10 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
private static final Function<PosInfo, BlockState> POST;
|
||||
|
||||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (world.getBlockState(pos.below()).getBlock() != EndBlocks.CHORUS_NYLIUM)
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, NoneFeatureConfiguration config) {
|
||||
if (world.getBlockState(pos.below()).getBlock() != EndBlocks.CHORUS_NYLIUM) {
|
||||
return false;
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, pos, AIR);
|
||||
|
||||
float size = MHelper.randRange(10, 20, random);
|
||||
|
@ -168,7 +168,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFDisplacement;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.betterend.blocks.BlockProperties.TripleShape;
|
|||
import ru.betterend.blocks.basis.FurBlock;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
float size = MHelper.randRange(7, 10, random);
|
||||
|
@ -173,7 +173,7 @@ public class TenaneaFeature extends DefaultFeature {
|
|||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND)) {
|
||||
if (state.is(TagAPI.END_GROUND)) {
|
||||
return true;
|
||||
}
|
||||
if (state.getBlock() == EndBlocks.TENANEA_LEAVES) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.sdf.SDF;
|
||||
import ru.bclib.sdf.operator.SDFFlatWave;
|
||||
import ru.bclib.sdf.operator.SDFScale;
|
||||
|
@ -30,7 +31,6 @@ import ru.bclib.util.SplineHelper;
|
|||
import ru.betterend.blocks.UmbrellaTreeClusterBlock;
|
||||
import ru.betterend.blocks.UmbrellaTreeMembraneBlock;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.world.features.DefaultFeature;
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
@Override
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(EndTags.END_GROUND))
|
||||
if (!world.getBlockState(pos.below()).getBlock().is(TagAPI.END_GROUND))
|
||||
return false;
|
||||
|
||||
BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState();
|
||||
|
@ -156,7 +156,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
SplineHelper.rotateSpline(branch, angle);
|
||||
SplineHelper.scale(branch, scale);
|
||||
Vector3f last = branch.get(branch.size() - 1);
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(EndTags.GEN_TERRAIN)) {
|
||||
if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(TagAPI.GEN_TERRAIN)) {
|
||||
SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE);
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class UmbrellaTreeFeature extends DefaultFeature {
|
|||
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
|
||||
|
||||
REPLACE = (state) -> {
|
||||
if (state.is(EndTags.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)
|
||||
|| state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ import net.minecraft.world.level.block.Blocks;
|
|||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class CavePiece extends BasePiece {
|
||||
|
@ -66,7 +66,7 @@ public class CavePiece extends BasePiece {
|
|||
double r2 = r - 4.5;
|
||||
double dist = xsq + ysq + zsq;
|
||||
if (dist < r2 * r2) {
|
||||
if (world.getBlockState(pos).is(EndTags.END_GROUND)) {
|
||||
if (world.getBlockState(pos).is(TagAPI.END_GROUND)) {
|
||||
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ import net.minecraft.world.level.levelgen.Heightmap;
|
|||
import net.minecraft.world.level.levelgen.Heightmap.Types;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class CrystalMountainPiece extends MountainPiece {
|
||||
private BlockState top;
|
||||
|
@ -68,7 +68,7 @@ public class CrystalMountainPiece extends MountainPiece {
|
|||
continue;
|
||||
}
|
||||
pos.setY(minY);
|
||||
while (!chunk.getBlockState(pos).is(EndTags.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) {
|
||||
while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) {
|
||||
pos.setY(pos.getY() - 1);
|
||||
}
|
||||
minY = pos.getY();
|
||||
|
|
|
@ -24,12 +24,12 @@ import net.minecraft.world.level.levelgen.Heightmap.Types;
|
|||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import ru.bclib.api.TagAPI;
|
||||
import ru.bclib.util.MHelper;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
||||
public class LakePiece extends BasePiece {
|
||||
|
@ -117,7 +117,7 @@ public class LakePiece extends BasePiece {
|
|||
double dist = x3 + y2 + z3;
|
||||
if (dist < r2) {
|
||||
BlockState state = chunk.getBlockState(mut);
|
||||
if (state.is(EndTags.GEN_TERRAIN) || state.isAir()) {
|
||||
if (state.is(TagAPI.GEN_TERRAIN) || state.isAir()) {
|
||||
state = mut.getY() < center.getY() ? WATER : CAVE_AIR;
|
||||
chunk.setBlockState(mut, state, false);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
"client": [
|
||||
"AbstractSoundInstanceAccessor",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"EnchantingTableBlockMixin",
|
||||
"HumanoidMobRendererMixin",
|
||||
"ArmorStandRendererMixin",
|
||||
"BackgroundRendererMixin",
|
||||
|
|
|
@ -16,13 +16,11 @@
|
|||
"EndPodiumFeatureMixin",
|
||||
"PotionBrewingAccessor",
|
||||
"RecipeManagerAccessor",
|
||||
"EnchantmentMenuMixin",
|
||||
"MinecraftServerMixin",
|
||||
"EndDragonFightMixin",
|
||||
"BlockBehaviourMixin",
|
||||
"DimensionTypeMixin",
|
||||
"RecipeManagerMixin",
|
||||
"BoneMealItemMixin",
|
||||
"CraftingMenuMixin",
|
||||
"LivingEntityMixin",
|
||||
"ServerPlayerMixin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue