From a1c87165aea7aa0581684ee832310036eba1909d Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 23 Jan 2022 22:32:25 +0100 Subject: [PATCH] Adopted new TagAPI --- .../betterend/blocks/AuroraCrystalBlock.java | 4 +- .../betterend/blocks/BulbVineSeedBlock.java | 4 +- .../ru/betterend/blocks/EndLilySeedBlock.java | 4 +- .../betterend/blocks/EndLotusSeedBlock.java | 4 +- .../blocks/HelixTreeLeavesBlock.java | 5 +- .../ru/betterend/blocks/HydraluxBlock.java | 4 +- .../ru/betterend/blocks/LumecornBlock.java | 4 +- .../blocks/MossyGlowshroomCapBlock.java | 8 +- .../blocks/NeonCactusPlantBlock.java | 4 +- .../blocks/SmallJellyshroomBlock.java | 4 +- .../betterend/blocks/basis/EndPlantBlock.java | 4 +- .../blocks/basis/EndPlantWithAgeBlock.java | 4 +- .../blocks/basis/EndUnderwaterPlantBlock.java | 4 +- .../basis/EndUnderwaterWallPlantBlock.java | 4 +- .../blocks/basis/EndWallMushroom.java | 4 +- .../blocks/basis/EndWallPlantBlock.java | 4 +- .../ru/betterend/blocks/basis/FurBlock.java | 7 +- .../CrystalSubblocksMaterial.java | 20 ++--- .../complexmaterials/MetalMaterial.java | 24 +++--- .../complexmaterials/StoneMaterial.java | 34 ++++---- .../ru/betterend/entity/EndSlimeEntity.java | 4 +- .../integration/EnderscapeIntegration.java | 7 +- .../integration/NourishIntegration.java | 20 ++--- .../integration/byg/BYGIntegration.java | 2 +- .../byg/features/BigEtherTreeFeature.java | 8 +- .../NightshadeRedwoodTreeFeature.java | 6 +- .../byg/features/OldBulbisTreeFeature.java | 11 +-- .../ru/betterend/item/tool/EndHammerItem.java | 6 +- .../mixin/common/ChorusFlowerBlockMixin.java | 7 +- .../mixin/common/ChorusPlantBlockMixin.java | 8 +- .../mixin/common/EnchantmentMenuMixin.java | 14 ++-- .../ru/betterend/recipe/CraftingRecipes.java | 4 +- .../java/ru/betterend/registry/EndTags.java | 84 ++++++++++--------- .../ru/betterend/util/StructureErode.java | 9 +- .../world/features/CavePumpkinFeature.java | 4 +- .../world/features/CrashedShipFeature.java | 4 +- .../world/features/ScatterFeature.java | 4 +- .../world/features/bushes/BushFeature.java | 6 +- .../features/bushes/BushWithOuterFeature.java | 6 +- .../bushes/LargeAmaranitaFeature.java | 4 +- .../world/features/bushes/Lumecorn.java | 4 +- .../features/bushes/TenaneaBushFeature.java | 4 +- .../world/features/terrain/ArchFeature.java | 4 +- .../terrain/BigAuroraCrystalFeature.java | 6 +- .../features/terrain/DesertLakeFeature.java | 12 +-- .../features/terrain/EndLakeFeature.java | 10 +-- .../features/terrain/FallenPillarFeature.java | 6 +- .../world/features/terrain/GeyserFeature.java | 12 +-- .../terrain/ObsidianBoulderFeature.java | 8 +- .../ObsidianPillarBasementFeature.java | 6 +- .../features/terrain/SingleBlockFeature.java | 4 +- .../terrain/SmaragdantCrystalFeature.java | 6 +- .../world/features/terrain/SpireFeature.java | 8 +- .../features/terrain/StalactiteFeature.java | 4 +- .../terrain/SulphuricCaveFeature.java | 12 +-- .../terrain/SulphuricLakeFeature.java | 10 +-- .../features/terrain/SurfaceVentFeature.java | 6 +- .../features/terrain/ThinArchFeature.java | 4 +- .../caves/CaveChunkPopulatorFeature.java | 6 +- .../terrain/caves/EndCaveFeature.java | 12 +-- .../terrain/caves/RoundCaveFeature.java | 4 +- .../terrain/caves/TunelCaveFeature.java | 8 +- .../features/trees/DragonTreeFeature.java | 6 +- .../trees/GiganticAmaranitaFeature.java | 2 +- .../features/trees/JellyshroomFeature.java | 6 +- .../features/trees/LacugroveFeature.java | 8 +- .../world/features/trees/LucerniaFeature.java | 6 +- .../trees/MossyGlowshroomFeature.java | 2 +- .../trees/PythadendronTreeFeature.java | 2 +- .../world/features/trees/TenaneaFeature.java | 2 +- .../features/trees/UmbrellaTreeFeature.java | 6 +- .../world/structures/piece/CavePiece.java | 4 +- .../piece/CrystalMountainPiece.java | 5 +- .../world/structures/piece/LakePiece.java | 4 +- 74 files changed, 300 insertions(+), 281 deletions(-) diff --git a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java index f36efa2f..7ffb9212 100644 --- a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java @@ -20,7 +20,7 @@ import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonItemTags; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.interfaces.RenderLayerProvider; @@ -39,7 +39,7 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye super(FabricBlockSettings .of(Material.GLASS) .breakByTool(FabricToolTags.PICKAXES) - .breakByTool(TagAPI.ITEM_HAMMERS) + .breakByTool(CommonItemTags.HAMMERS) .hardness(1F) .resistance(1F) .luminance(15) diff --git a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java index 00bd9485..7ef8f7eb 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java @@ -5,7 +5,7 @@ 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.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.util.BlocksHelper; @@ -19,7 +19,7 @@ public class BulbVineSeedBlock extends EndPlantWithAgeBlock { @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState up = world.getBlockState(pos.above()); - return up.is(TagAPI.BLOCK_GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES); + return up.is(CommonBlockTags.GEN_END_STONES) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES); } @Override diff --git a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java index 71a7dd2d..e3ba67a5 100644 --- a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java @@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.UnderwaterPlantWithAgeBlock; import ru.bclib.util.BlocksHelper; @@ -48,6 +48,6 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java index 20d3e1c4..e385e34d 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java @@ -6,7 +6,7 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluids; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.blocks.UnderwaterPlantWithAgeBlock; import ru.bclib.util.BlocksHelper; @@ -134,6 +134,6 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java index 92403686..6d731d95 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java @@ -19,7 +19,8 @@ import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.MaterialColor; import net.minecraft.world.level.storage.loot.LootContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.blocks.BaseBlock; import ru.bclib.interfaces.CustomColorProvider; import ru.bclib.util.ColorUtil; @@ -44,7 +45,7 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid .strength(0.2F) ); - TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); + TagAPI.addBlockTag(NamedBlockTags.LEAVES, this); } @Override diff --git a/src/main/java/ru/betterend/blocks/HydraluxBlock.java b/src/main/java/ru/betterend/blocks/HydraluxBlock.java index 7db4f4af..69e3dd39 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxBlock.java @@ -17,7 +17,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.material.Material; import net.minecraft.world.level.storage.loot.LootContext; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.UnderwaterPlantBlock; import ru.bclib.util.MHelper; import ru.betterend.blocks.EndBlockProperties.HydraluxShape; @@ -63,7 +63,7 @@ public class HydraluxBlock extends UnderwaterPlantBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } @Override diff --git a/src/main/java/ru/betterend/blocks/LumecornBlock.java b/src/main/java/ru/betterend/blocks/LumecornBlock.java index ac27121f..51fec348 100644 --- a/src/main/java/ru/betterend/blocks/LumecornBlock.java +++ b/src/main/java/ru/betterend/blocks/LumecornBlock.java @@ -19,7 +19,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.api.tag.CommonBlockTags; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.RenderLayerProvider; @@ -63,7 +63,7 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { LumecornShape shape = state.getValue(SHAPE); if (shape == LumecornShape.BOTTOM_BIG || shape == LumecornShape.BOTTOM_SMALL) { - return world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND); + return world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES); } else if (shape == LumecornShape.LIGHT_TOP) { return world.getBlockState(pos.below()).is(this); diff --git a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java index 4bd1bbcb..ea88735b 100644 --- a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java @@ -1,7 +1,6 @@ package ru.betterend.blocks; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.tags.Tag.Named; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.block.Block; @@ -10,7 +9,8 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedMineableTags; +import ru.bclib.api.tag.TagAPI.TagLocation; import ru.bclib.blocks.BaseBlock; import ru.bclib.interfaces.TagProvider; import ru.betterend.registry.EndBlocks; @@ -38,7 +38,7 @@ public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider { } @Override - public void addTags(List> blockTags, List> itemTags) { - blockTags.add(TagAPI.MINEABLE_AXE); + public void addTags(List> blockTags, List> itemTags) { + blockTags.add(NamedMineableTags.AXE); } } diff --git a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java index 2e428182..e238dc67 100644 --- a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java @@ -34,7 +34,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.api.tag.CommonBlockTags; import ru.bclib.blocks.BaseBlockNotFull; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; @@ -331,7 +331,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate mut.move(dir); state = world.getBlockState(mut); if (!state.is(this)) { - if (!state.is(TagAPI.BLOCK_END_GROUND)) { + if (!state.is(CommonBlockTags.END_STONES)) { length = -1; } break; diff --git a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java index cda6ec18..7ae95d30 100644 --- a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java @@ -29,7 +29,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.RenderLayerProvider; @@ -93,7 +93,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { - return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND); + return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES); } @Override diff --git a/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java index 9a064a4e..2c30a4ae 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java @@ -2,7 +2,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BasePlantBlock; import ru.betterend.interfaces.PottablePlant; @@ -29,7 +29,7 @@ public class EndPlantBlock extends BasePlantBlock implements PottablePlant { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } @Override diff --git a/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java b/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java index 1519d471..47e52267 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java @@ -1,7 +1,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BasePlantWithAgeBlock; public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock { @@ -15,6 +15,6 @@ public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java index a3acf2d2..ecdfd821 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java @@ -1,7 +1,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.UnderwaterPlantBlock; public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock { @@ -19,6 +19,6 @@ public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java index 9a23df46..b5fa2d18 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java @@ -1,7 +1,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BaseUnderwaterWallPlantBlock; public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock { @@ -19,6 +19,6 @@ public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java b/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java index 6faeaf88..a08cc07b 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java +++ b/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java @@ -1,7 +1,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.WallMushroomBlock; public class EndWallMushroom extends WallMushroomBlock { @@ -12,6 +12,6 @@ public class EndWallMushroom extends WallMushroomBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java index 46fdba5c..f08d6da1 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java @@ -1,7 +1,7 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.state.BlockState; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BaseWallPlantBlock; public class EndWallPlantBlock extends BaseWallPlantBlock { @@ -18,6 +18,6 @@ public class EndWallPlantBlock extends BaseWallPlantBlock { @Override protected boolean isTerrain(BlockState state) { - return state.is(TagAPI.BLOCK_END_GROUND); + return state.is(CommonBlockTags.END_STONES); } } diff --git a/src/main/java/ru/betterend/blocks/basis/FurBlock.java b/src/main/java/ru/betterend/blocks/basis/FurBlock.java index 951e8278..187f92a7 100644 --- a/src/main/java/ru/betterend/blocks/basis/FurBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/FurBlock.java @@ -19,7 +19,8 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.RenderLayerProvider; @@ -42,7 +43,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider { .noCollission()); this.drop = drop; this.dropChance = dropChance; - TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); + TagAPI.addBlockTag(NamedBlockTags.LEAVES, this); } public FurBlock(ItemLike drop, int dropChance) { @@ -53,7 +54,7 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider { .noCollission()); this.drop = drop; this.dropChance = dropChance; - TagAPI.addTags(this, TagAPI.BLOCK_LEAVES); + TagAPI.addBlockTag(NamedBlockTags.LEAVES, this); } @Override diff --git a/src/main/java/ru/betterend/complexmaterials/CrystalSubblocksMaterial.java b/src/main/java/ru/betterend/complexmaterials/CrystalSubblocksMaterial.java index 1582a268..4e626a3b 100644 --- a/src/main/java/ru/betterend/complexmaterials/CrystalSubblocksMaterial.java +++ b/src/main/java/ru/betterend/complexmaterials/CrystalSubblocksMaterial.java @@ -1,10 +1,10 @@ package ru.betterend.complexmaterials; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; import net.minecraft.world.level.block.Block; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.NamedItemTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.blocks.BaseSlabBlock; import ru.bclib.blocks.BaseStairsBlock; import ru.bclib.blocks.BaseWallBlock; @@ -120,14 +120,14 @@ public class CrystalSubblocksMaterial { CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); // Item Tags // - TagAPI.addTag(ItemTags.SLABS, slab, brick_slab); - TagAPI.addTag(ItemTags.STONE_BRICKS, bricks); - TagAPI.addTag(ItemTags.STONE_CRAFTING_MATERIALS, source); - TagAPI.addTag(ItemTags.STONE_TOOL_MATERIALS, source); + TagAPI.addItemTag(NamedItemTags.SLABS, slab, brick_slab); + TagAPI.addItemTag(NamedItemTags.STONE_BRICKS, bricks); + TagAPI.addItemTag(NamedItemTags.STONE_CRAFTING_MATERIALS, source); + TagAPI.addItemTag(NamedItemTags.STONE_TOOL_MATERIALS, source); // Block Tags // - TagAPI.addTag(BlockTags.STONE_BRICKS, bricks); - TagAPI.addTag(BlockTags.WALLS, wall, brick_wall); - TagAPI.addTag(BlockTags.SLABS, slab, brick_slab); + TagAPI.addBlockTag(NamedBlockTags.STONE_BRICKS, bricks); + TagAPI.addBlockTag(NamedBlockTags.WALLS, wall, brick_wall); + TagAPI.addBlockTag(NamedBlockTags.SLABS, slab, brick_slab); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/complexmaterials/MetalMaterial.java b/src/main/java/ru/betterend/complexmaterials/MetalMaterial.java index 53183d2d..bb31ef59 100644 --- a/src/main/java/ru/betterend/complexmaterials/MetalMaterial.java +++ b/src/main/java/ru/betterend/complexmaterials/MetalMaterial.java @@ -1,9 +1,6 @@ package ru.betterend.complexmaterials; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ArmorMaterial; import net.minecraft.world.item.Item; @@ -15,7 +12,12 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.MaterialColor; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.NamedCommonBlockTags; +import ru.bclib.api.tag.NamedCommonItemTags; +import ru.bclib.api.tag.NamedItemTags; +import ru.bclib.api.tag.TagAPI; +import ru.bclib.api.tag.TagAPI.TagNamed; import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseChainBlock; import ru.bclib.blocks.BaseDoorBlock; @@ -89,7 +91,7 @@ public class MetalMaterial { public final Item leggings; public final Item boots; - public final Tag.Named alloyingOre; + public final TagNamed alloyingOre; public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) { return new MetalMaterial( @@ -153,7 +155,7 @@ public class MetalMaterial { ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(()->rawOre, 1, 3, 1)) : null; alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null; if (hasOre) { - TagAPI.addTag(alloyingOre, ore, rawOre); + TagAPI.addItemTag(alloyingOre.getName(), ore, rawOre); } block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings)); @@ -490,10 +492,10 @@ public class MetalMaterial { .setGroup("end_metal_boots") .build(); - TagAPI.addTag(BlockTags.ANVIL, anvilBlock); - TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, block); - TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, ingot); - TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, ore, bars); - TagAPI.addTag(TagAPI.ITEM_HAMMERS, hammer); + TagAPI.addBlockTag(NamedBlockTags.ANVIL, anvilBlock); + TagAPI.addBlockTag(NamedBlockTags.BEACON_BASE_BLOCKS, block); + TagAPI.addItemTag(NamedItemTags.BEACON_PAYMENT_ITEMS, ingot); + TagAPI.addBlockTag(NamedCommonBlockTags.DRAGON_IMMUNE, ore, bars); + TagAPI.addItemTag(NamedCommonItemTags.HAMMERS, hammer); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/complexmaterials/StoneMaterial.java b/src/main/java/ru/betterend/complexmaterials/StoneMaterial.java index 107471e6..1bd60202 100644 --- a/src/main/java/ru/betterend/complexmaterials/StoneMaterial.java +++ b/src/main/java/ru/betterend/complexmaterials/StoneMaterial.java @@ -1,12 +1,14 @@ package ru.betterend.complexmaterials; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.MaterialColor; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.NamedCommonBlockTags; +import ru.bclib.api.tag.NamedCommonItemTags; +import ru.bclib.api.tag.NamedItemTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.blocks.BaseBlock; import ru.bclib.blocks.BaseFurnaceBlock; import ru.bclib.blocks.BaseRotatedPillarBlock; @@ -177,22 +179,22 @@ public class StoneMaterial { CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); // Item Tags // - TagAPI.addTag(ItemTags.SLABS, slab, brickSlab); - TagAPI.addTag(ItemTags.STONE_BRICKS, bricks); - TagAPI.addTag(ItemTags.STONE_CRAFTING_MATERIALS, stone); - TagAPI.addTag(ItemTags.STONE_TOOL_MATERIALS, stone); - TagAPI.addTag(TagAPI.ITEM_FURNACES, furnace); + TagAPI.addItemTag(NamedItemTags.SLABS, slab, brickSlab); + TagAPI.addItemTag(NamedItemTags.STONE_BRICKS, bricks); + TagAPI.addItemTag(NamedItemTags.STONE_CRAFTING_MATERIALS, stone); + TagAPI.addItemTag(NamedItemTags.STONE_TOOL_MATERIALS, stone); + TagAPI.addItemTag(NamedCommonItemTags.FURNACES, furnace); // Block Tags // - TagAPI.addTag(BlockTags.STONE_BRICKS, bricks); - TagAPI.addTag(BlockTags.WALLS, wall, brickWall); - TagAPI.addTag(BlockTags.SLABS, slab, brickSlab); - TagAPI.addTags(pressurePlate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES); - TagAPI.addTag(TagAPI.BLOCK_END_STONES, stone); + TagAPI.addBlockTag(NamedBlockTags.STONE_BRICKS, bricks); + TagAPI.addBlockTag(NamedBlockTags.WALLS, wall, brickWall); + TagAPI.addBlockTag(NamedBlockTags.SLABS, slab, brickSlab); + TagAPI.addBlockTags(pressurePlate, NamedBlockTags.PRESSURE_PLATES, NamedBlockTags.STONE_PRESSURE_PLATES); + TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, stone); - TagAPI.addTag(TagAPI.BLOCK_DRAGON_IMMUNE, stone, stairs, slab, wall); + TagAPI.addBlockTag(NamedCommonBlockTags.DRAGON_IMMUNE, stone, stairs, slab, wall); - TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, stone); - TagAPI.addTag(TagAPI.BLOCK_END_GROUND, stone); + TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, stone); + TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, stone); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/entity/EndSlimeEntity.java b/src/main/java/ru/betterend/entity/EndSlimeEntity.java index f44cb34c..fb738466 100644 --- a/src/main/java/ru/betterend/entity/EndSlimeEntity.java +++ b/src/main/java/ru/betterend/entity/EndSlimeEntity.java @@ -33,8 +33,8 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.ServerLevelAccessor; import net.minecraft.world.level.block.Blocks; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.biomes.BCLBiome; @@ -213,7 +213,7 @@ public class EndSlimeEntity extends Slime { } public static boolean canSpawn(EntityType entityType, LevelAccessor world, MobSpawnType spawnType, BlockPos pos, Random random) { - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { return false; } BCLBiome biome = BiomeAPI.getFromBiome(world.getBiome(pos)); diff --git a/src/main/java/ru/betterend/integration/EnderscapeIntegration.java b/src/main/java/ru/betterend/integration/EnderscapeIntegration.java index 83099d0c..891731c0 100644 --- a/src/main/java/ru/betterend/integration/EnderscapeIntegration.java +++ b/src/main/java/ru/betterend/integration/EnderscapeIntegration.java @@ -4,8 +4,9 @@ import net.minecraft.core.MappedRegistry; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.levelgen.GenerationStep.Decoration; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.NamedCommonBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.integration.modmenu.ModIntegration; import ru.bclib.world.features.BCLFeature; @@ -42,7 +43,7 @@ public class EnderscapeIntegration extends ModIntegration { } }); - TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, getBlock("nebulite_ore")); - TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, getBlock("shadow_quartz_ore")); + TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, getBlock("nebulite_ore")); + TagAPI.addBlockTag(NamedCommonBlockTags.GEN_END_STONES, getBlock("shadow_quartz_ore")); } } diff --git a/src/main/java/ru/betterend/integration/NourishIntegration.java b/src/main/java/ru/betterend/integration/NourishIntegration.java index 4d17a020..ed268d8a 100644 --- a/src/main/java/ru/betterend/integration/NourishIntegration.java +++ b/src/main/java/ru/betterend/integration/NourishIntegration.java @@ -1,8 +1,8 @@ package ru.betterend.integration; -import net.minecraft.tags.Tag; import net.minecraft.world.item.Item; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.TagAPI; +import ru.bclib.api.tag.TagAPI.TagLocation; import ru.bclib.integration.modmenu.ModIntegration; import ru.betterend.registry.EndItems; @@ -13,13 +13,13 @@ public class NourishIntegration extends ModIntegration { @Override public void init() { - Tag.Named fats = getItemTag("fats"); - Tag.Named fruit = getItemTag("fruit"); - Tag.Named protein = getItemTag("protein"); - Tag.Named sweets = getItemTag("sweets"); + TagLocation fats = TagLocation.of(getItemTag("fats")); + TagLocation fruit = TagLocation.of(getItemTag("fruit")); + TagLocation protein = TagLocation.of(getItemTag("protein")); + TagLocation sweets = TagLocation.of(getItemTag("sweets")); - TagAPI.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); - TagAPI.addTag( + TagAPI.addItemTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); + TagAPI.addItemTag( fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, @@ -32,7 +32,7 @@ public class NourishIntegration extends ModIntegration { EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED ); - TagAPI.addTag( + TagAPI.addItemTag( protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED, @@ -40,7 +40,7 @@ public class NourishIntegration extends ModIntegration { EndItems.BOLUX_MUSHROOM_COOKED, EndItems.CAVE_PUMPKIN_PIE ); - TagAPI.addTag( + TagAPI.addItemTag( sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, diff --git a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java index 7d00ea2a..8b3dc233 100644 --- a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java +++ b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java @@ -12,7 +12,7 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio public void init() { /*Block block = Integrations.BYG.getBlock("ivis_phylium"); if (block != null) { - TagAPI.addTags(block, TagAPI.BLOCK_END_GROUND, TagAPI.BLOCK_GEN_TERRAIN); + TagAPI.addTags(block, CommonBlockTags.END_STONES, CommonBlockTags.GEN_END_STONES); } BYGBlocks.register(); BYGFeatures.register(); diff --git a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java index de5ad664..155f7c9b 100644 --- a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.util.MHelper; import ru.bclib.util.SplineHelper; @@ -24,7 +24,7 @@ public class BigEtherTreeFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; BlockState log = Integrations.BYG.getDefaultState("ether_log"); BlockState wood = Integrations.BYG.getDefaultState("ether_wood"); @@ -32,7 +32,7 @@ public class BigEtherTreeFeature extends DefaultFeature { return log; }; Function replace = (state) -> { - return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() .isReplaceable(); }; @@ -63,7 +63,7 @@ public class BigEtherTreeFeature extends DefaultFeature { } sdf.setReplaceFunction((state) -> { - return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() .isReplaceable(); }).addPostProcess((info) -> { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { diff --git a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java index ef330a00..0bbee4e7 100644 --- a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java @@ -13,7 +13,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; @@ -38,7 +38,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; BlockState log = Integrations.BYG.getDefaultState("nightshade_log"); BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood"); @@ -49,7 +49,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { return log; }; Function replace = (state) -> { - return state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() + return state.is(CommonBlockTags.END_STONES) || state.getMaterial().equals(Material.PLANT) || state.getMaterial() .isReplaceable(); }; Function post = (info) -> { diff --git a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java index b874a391..2f05a6b1 100644 --- a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java @@ -11,7 +11,8 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; import net.minecraft.world.phys.AABB; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFSubtraction; @@ -39,8 +40,8 @@ public class OldBulbisTreeFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; - if (!world.getBlockState(pos.below(4)).is(TagAPI.BLOCK_GEN_TERRAIN)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; + if (!world.getBlockState(pos.below(4)).is(CommonBlockTags.GEN_END_STONES)) return false; BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem"); BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood"); @@ -48,7 +49,7 @@ public class OldBulbisTreeFeature extends DefaultFeature { BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight"); Function replacement = (state) -> { - if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.BLOCK_END_GROUND) || state.getMaterial() + if (state.equals(stem) || state.equals(wood) || state.is(CommonBlockTags.END_STONES) || state.getMaterial() .equals(Material.PLANT)) { return true; } @@ -155,7 +156,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { SplineHelper.fillSpline(branch, world, wood, pos, replacement); } } diff --git a/src/main/java/ru/betterend/item/tool/EndHammerItem.java b/src/main/java/ru/betterend/item/tool/EndHammerItem.java index d5536255..cc5cfa57 100644 --- a/src/main/java/ru/betterend/item/tool/EndHammerItem.java +++ b/src/main/java/ru/betterend/item/tool/EndHammerItem.java @@ -27,7 +27,7 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonItemTags; import ru.bclib.client.models.ModelsHelper; import ru.bclib.interfaces.ItemModelProvider; @@ -113,7 +113,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I @Override public float getMiningSpeedMultiplier(Tag tag, BlockState state, ItemStack stack, LivingEntity user) { - if (tag.equals(TagAPI.ITEM_HAMMERS)) { + if (tag.equals(CommonItemTags.HAMMERS)) { return this.getDestroySpeed(stack, state); } return 1.0F; @@ -121,7 +121,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I @Override public int getMiningLevel(Tag tag, BlockState state, ItemStack stack, LivingEntity user) { - if (tag.equals(TagAPI.ITEM_HAMMERS)) { + if (tag.equals(CommonItemTags.HAMMERS)) { return this.getTier().getLevel(); } return 0; diff --git a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java index 7acd396b..8aa684f3 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java @@ -20,7 +20,8 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.util.BlocksHelper; import ru.betterend.registry.EndBlocks; import ru.betterend.world.generator.GeneratorOptions; @@ -50,7 +51,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(TagAPI.BLOCK_END_GROUND)) { + if (world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { BlockPos up = pos.above(); if (world.isEmptyBlock(up) && up.getY() < 256) { int i = state.getValue(ChorusFlowerBlock.AGE); @@ -80,7 +81,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (down.is(Blocks.CHORUS_PLANT) || down.is(CommonBlockTags.GEN_END_STONES)) { world.setBlock(pos, this.defaultBlockState().setValue(BlockStateProperties.AGE_5, 5), 2); world.levelEvent(1034, pos, 0); } diff --git a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java index 74cfac6d..89251667 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java @@ -16,7 +16,7 @@ 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 ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.betterend.registry.EndBlocks; @Mixin(value = ChorusPlantBlock.class, priority = 100) @@ -30,7 +30,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(TagAPI.BLOCK_END_GROUND)) { + if (ctx.canPlace() && plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); } } @@ -38,7 +38,7 @@ public abstract class ChorusPlantBlockMixin extends Block { @Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + "Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true) private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable info) { BlockState plant = info.getReturnValue(); - if (plant.is(Blocks.CHORUS_PLANT) && blockGetter.getBlockState(blockPos.below()).is(TagAPI.BLOCK_END_GROUND)) { + if (plant.is(Blocks.CHORUS_PLANT) && blockGetter.getBlockState(blockPos.below()).is(CommonBlockTags.END_STONES)) { info.setReturnValue(plant.setValue(BlockStateProperties.DOWN, true)); } } @@ -54,7 +54,7 @@ public abstract class ChorusPlantBlockMixin extends Block { @Inject(method = "updateShape", at = @At("RETURN"), cancellable = true) private void be_updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable info) { BlockState plant = info.getReturnValue(); - if (plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { + if (plant.is(Blocks.CHORUS_PLANT) && world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { plant = plant.setValue(BlockStateProperties.DOWN, true); info.setReturnValue(plant); } diff --git a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java index 77cb6d3e..d2f5e986 100644 --- a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java @@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import java.util.List; import java.util.Random; @@ -71,28 +71,28 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { 0, j )) && world.isEmptyBlock(blockPos.offset(k, 1, j))) { - if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } - if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } if (k != 0 && j != 0) { - if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } - if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } - if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } - if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(TagAPI.BLOCK_BOOKSHELVES)) { + if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(CommonBlockTags.BOOKSHELVES)) { ++i; } } diff --git a/src/main/java/ru/betterend/recipe/CraftingRecipes.java b/src/main/java/ru/betterend/recipe/CraftingRecipes.java index 559dcfc9..92e9227f 100644 --- a/src/main/java/ru/betterend/recipe/CraftingRecipes.java +++ b/src/main/java/ru/betterend/recipe/CraftingRecipes.java @@ -7,7 +7,7 @@ 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.bclib.api.tag.CommonItemTags; import ru.bclib.recipes.GridRecipe; import ru.betterend.BetterEnd; import ru.betterend.config.Configs; @@ -34,7 +34,7 @@ public class CraftingRecipes { .setShape("T#T", "V V", "T#T") .addMaterial('#', Blocks.END_STONE_BRICKS) .addMaterial('T', EndBlocks.THALLASIUM.ingot) - .addMaterial('V', TagAPI.ITEM_FURNACES) + .addMaterial('V', CommonItemTags.FURNACES) .build(); registerPedestal( diff --git a/src/main/java/ru/betterend/registry/EndTags.java b/src/main/java/ru/betterend/registry/EndTags.java index 569932b9..d2ce638b 100644 --- a/src/main/java/ru/betterend/registry/EndTags.java +++ b/src/main/java/ru/betterend/registry/EndTags.java @@ -6,9 +6,6 @@ import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocks import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor; import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor; import net.minecraft.core.Registry; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; -import net.minecraft.tags.Tag; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; @@ -20,7 +17,14 @@ import net.minecraft.world.level.block.state.BlockBehaviour.Properties; import net.minecraft.world.level.material.Material; import ru.bclib.api.BonemealAPI; import ru.bclib.api.ComposterAPI; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonItemTags; +import ru.bclib.api.tag.NamedBlockTags; +import ru.bclib.api.tag.NamedCommonBlockTags; +import ru.bclib.api.tag.NamedCommonItemTags; +import ru.bclib.api.tag.NamedItemTags; +import ru.bclib.api.tag.NamedMineableTags; +import ru.bclib.api.tag.TagAPI; +import ru.bclib.api.tag.TagAPI.TagNamed; import ru.bclib.blocks.BaseVineBlock; import ru.bclib.blocks.SimpleLeavesBlock; import ru.betterend.BetterEnd; @@ -35,17 +39,17 @@ public class EndTags { // https://fabricmc.net/wiki/tutorial:tags // Block Tags - public static final Tag.Named PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal"); + public static final TagNamed PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal"); // Item Tags - public static final Tag.Named ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron"); - public static final Tag.Named ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold"); - public static final Tag.Named ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper"); + public static final TagNamed ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron"); + public static final TagNamed ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold"); + public static final TagNamed ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper"); public static void register() { - TagAPI.addEndGround(EndBlocks.THALLASIUM.ore); - TagAPI.addEndGround(EndBlocks.ENDSTONE_DUST); - TagAPI.addEndGround(EndBlocks.AMBER_ORE); + addEndGround(EndBlocks.THALLASIUM.ore); + addEndGround(EndBlocks.ENDSTONE_DUST); + addEndGround(EndBlocks.AMBER_ORE); EndBlocks.getModBlocks().forEach(block -> { Properties properties = ((AbstractBlockAccessor) block).getSettings(); @@ -53,32 +57,32 @@ public class EndTags { final Item item = block.asItem(); if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) { - TagAPI.addTag(TagAPI.MINEABLE_PICKAXE, block); + TagAPI.addBlockTag(NamedMineableTags.PICKAXE, block); } else if (material.equals(Material.WOOD)) { - TagAPI.addTag(TagAPI.MINEABLE_AXE, block); + TagAPI.addBlockTag(NamedMineableTags.AXE, block); } else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT) || material.equals(Material.SPONGE)) { - TagAPI.addTag(TagAPI.MINEABLE_HOE, block); + TagAPI.addBlockTag(NamedMineableTags.HOE, block); } else if (material.equals(Material.SAND)) { - TagAPI.addTag(TagAPI.MINEABLE_SHOVEL, block); + TagAPI.addBlockTag(NamedMineableTags.SHOVEL, block); } if (block instanceof EndTerrainBlock) { - TagAPI.addEndGround(block); - TagAPI.addTag(BlockTags.NYLIUM, block); + addEndGround(block); + TagAPI.addBlockTag(NamedBlockTags.NYLIUM, block); BonemealAPI.addSpreadableBlock(block, Blocks.END_STONE); } else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) { - TagAPI.addTag(BlockTags.LEAVES, block); + TagAPI.addBlockTag(NamedBlockTags.LEAVES, block); ComposterAPI.allowCompost(0.3f, item); } else if (block instanceof BaseVineBlock) { - TagAPI.addTag(BlockTags.CLIMBABLE, block); + TagAPI.addBlockTag(NamedBlockTags.CLIMBABLE, block); } else if (block instanceof PedestalBlock) { - TagAPI.addTag(PEDESTALS, block); + TagAPI.addBlockTag(PEDESTALS.getName(), block); } Material mat = block.defaultBlockState().getMaterial(); @@ -86,8 +90,8 @@ public class EndTags { ComposterAPI.allowCompost(0.1F, item); } }); - TagAPI.addEndGround(EndBlocks.CAVE_MOSS); - TagAPI.addTag(BlockTags.NYLIUM, EndBlocks.CAVE_MOSS); + addEndGround(EndBlocks.CAVE_MOSS); + TagAPI.addBlockTag(NamedBlockTags.NYLIUM, EndBlocks.CAVE_MOSS); BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS, Blocks.END_STONE); BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_OBSIDIAN, Blocks.OBSIDIAN); BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.DRAGON_BONE_BLOCK); @@ -105,30 +109,34 @@ public class EndTags { ITEM_HAMMERS.add(item); } }); - ToolManagerImpl.tag(TagAPI.ITEM_HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS)); - TagAPI.addTag(TagAPI.ITEM_HAMMERS, EndItems.AETERNIUM_HAMMER); + ToolManagerImpl.tag(CommonItemTags.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS)); + TagAPI.addItemTag(NamedCommonItemTags.HAMMERS, EndItems.AETERNIUM_HAMMER); - TagAPI.addTag( - TagAPI.BLOCK_GEN_TERRAIN, + TagAPI.addBlockTag( + NamedCommonBlockTags.GEN_END_STONES, EndBlocks.ENDER_ORE, EndBlocks.BRIMSTONE ); - TagAPI.addTag(TagAPI.BLOCK_END_GROUND, EndBlocks.BRIMSTONE); - TagAPI.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL); - TagAPI.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK); - TagAPI.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT); - TagAPI.addTag( - TagAPI.BLOCK_DRAGON_IMMUNE, + TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, EndBlocks.BRIMSTONE); + TagAPI.addBlockTag(NamedBlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL); + TagAPI.addBlockTag(NamedBlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK); + TagAPI.addItemTag(NamedItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT); + TagAPI.addBlockTag( + NamedCommonBlockTags.DRAGON_IMMUNE, EndBlocks.ENDER_ORE, EndBlocks.ETERNAL_PEDESTAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED ); - TagAPI.addTag(TagAPI.ITEM_IRON_INGOTS, EndBlocks.THALLASIUM.ingot); + TagAPI.addItemTag(NamedCommonItemTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot); - TagAPI.addTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); - TagAPI.addTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD); - TagAPI.addTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER); + TagAPI.addItemTag(ALLOYING_IRON.getName(), Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); + TagAPI.addItemTag(ALLOYING_GOLD.getName(), Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD); + TagAPI.addItemTag(ALLOYING_COPPER.getName(), Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER); + } + + public static void addEndGround(Block bl){ + TagAPI.addBlockTag(NamedCommonBlockTags.END_STONES, bl); } // TODO make getter for biome top blocks @@ -138,8 +146,8 @@ public class EndTags { SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig(); Block under = config.getUnderMaterial().getBlock(); Block surface = config.getTopMaterial().getBlock(); - TagAPI.addTag(TagAPI.BLOCK_GEN_TERRAIN, under, surface); - TagAPI.addTag(TagAPI.BLOCK_END_GROUND, surface); + TagAPI.addTag(CommonBlockTags.GEN_END_STONES, under, surface); + TagAPI.addTag(CommonBlockTags.END_STONES, surface); } }); TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/ diff --git a/src/main/java/ru/betterend/util/StructureErode.java b/src/main/java/ru/betterend/util/StructureErode.java index 82441194..7e268a3a 100644 --- a/src/main/java/ru/betterend/util/StructureErode.java +++ b/src/main/java/ru/betterend/util/StructureErode.java @@ -10,7 +10,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; @@ -241,7 +242,7 @@ public class StructureErode { } private static boolean ignore(BlockState state, WorldGenLevel world, BlockPos pos) { - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(BlockTags.NYLIUM)) { + if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(BlockTags.NYLIUM)) { return true; } return !state.getMaterial().equals(Material.STONE) || BlocksHelper.isInvulnerable(state, world, pos); @@ -249,7 +250,7 @@ public class StructureErode { private static boolean isTerrainNear(WorldGenLevel world, BlockPos pos) { for (Direction dir : BlocksHelper.DIRECTIONS) { - if (world.getBlockState(pos.relative(dir)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.relative(dir)).is(CommonBlockTags.GEN_END_STONES)) { return true; } } @@ -266,7 +267,7 @@ public class StructureErode { for (int y = bounds.maxY(); y >= bounds.minY(); y--) { mut.setY(y); BlockState state = world.getBlockState(mut); - if (state.is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) { + if (state.is(CommonBlockTags.END_STONES) && !world.getBlockState(mut.above()).getMaterial().isSolidBlocking()) { BlocksHelper.setWithoutUpdate(world, mut, top); } } diff --git a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java index 6af34e7d..424a4348 100644 --- a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java +++ b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java @@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.world.features.DefaultFeature; import ru.betterend.blocks.EndBlockProperties; @@ -18,7 +18,7 @@ public class CavePumpkinFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.above()).is(TagAPI.BLOCK_GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock( + if (!world.getBlockState(pos.above()).is(CommonBlockTags.GEN_END_STONES) || !world.isEmptyBlock(pos) || !world.isEmptyBlock( pos.below())) { return false; } diff --git a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java index 124e07ea..dbf45baa 100644 --- a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java +++ b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java @@ -18,7 +18,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProc import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.MHelper; import ru.bclib.util.StructureHelper; import ru.bclib.world.features.NBTStructureFeature; @@ -55,7 +55,7 @@ public class CrashedShipFeature extends NBTStructureFeature { if (x * x + z * z < 3600) { return false; } - return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN); + return pos.getY() > 5 && world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES); } @Override diff --git a/src/main/java/ru/betterend/world/features/ScatterFeature.java b/src/main/java/ru/betterend/world/features/ScatterFeature.java index 7539ec00..e7c7d095 100644 --- a/src/main/java/ru/betterend/world/features/ScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/ScatterFeature.java @@ -5,7 +5,7 @@ import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -32,7 +32,7 @@ public abstract class ScatterFeature extends DefaultFeature { if (pos.getY() < 5) { return false; } - else if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { + else if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { return false; } return true; diff --git a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java index 6f11fef4..344d9b5d 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFScale3D; @@ -39,8 +39,8 @@ public class BushFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above()) - .is(TagAPI.BLOCK_END_GROUND)) + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES) && !world.getBlockState(pos.above()) + .is(CommonBlockTags.END_STONES)) return false; float radius = MHelper.randRange(1.8F, 3.5F, random); diff --git a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java index b87a4fa1..0708463a 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFScale3D; @@ -43,8 +43,8 @@ public class BushWithOuterFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND) && !world.getBlockState(pos.above()) - .is(TagAPI.BLOCK_END_GROUND)) + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES) && !world.getBlockState(pos.above()) + .is(CommonBlockTags.END_STONES)) return false; float radius = MHelper.randRange(1.8F, 3.5F, random); diff --git a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java index 4752f2a7..f8698751 100644 --- a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.util.BlocksHelper; @@ -23,7 +23,7 @@ public class LargeAmaranitaFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; MutableBlockPos mut = new MutableBlockPos().set(pos); int height = MHelper.randRange(2, 3, random); diff --git a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java index 46f41366..a02a96e7 100644 --- a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java +++ b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -23,7 +23,7 @@ public class Lumecorn extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; int height = MHelper.randRange(4, 7, random); MutableBlockPos mut = new MutableBlockPos().set(pos); diff --git a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java index 9f19222e..e12de794 100644 --- a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.sdf.SDF; @@ -42,7 +42,7 @@ public class TenaneaBushFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) return false; + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) return false; float radius = MHelper.randRange(1.8F, 3.5F, random); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); diff --git a/src/main/java/ru/betterend/world/features/terrain/ArchFeature.java b/src/main/java/ru/betterend/world/features/terrain/ArchFeature.java index ef2fe51c..dc7b15c5 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ArchFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ArchFeature.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFRotation; @@ -41,7 +41,7 @@ public class ArchFeature extends DefaultFeature { world, new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7) ); - if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) { return false; } diff --git a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java index 82faf6d5..bbef945f 100644 --- a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java @@ -6,7 +6,7 @@ import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFRotation; import ru.bclib.sdf.primitive.SDFHexPrism; @@ -40,8 +40,8 @@ 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(TagAPI.BLOCK_GEN_TERRAIN) || bState.getMaterial() - .equals(Material.PLANT) || bState + return bState.getMaterial().isReplaceable() || bState.is(CommonBlockTags.GEN_END_STONES) || bState.getMaterial() + .equals(Material.PLANT) || bState .getMaterial() .equals(Material.LEAVES); }); diff --git a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java index 8774f75c..60fe2d4a 100644 --- a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -119,11 +119,11 @@ public class DesertLakeFeature extends DefaultFeature { r *= r; if (x2 + z2 <= r) { state = world.getBlockState(POS); - if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (state.is(CommonBlockTags.GEN_END_STONES)) { BlocksHelper.setWithoutUpdate(world, POS, AIR); } pos = POS.below(); - if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) { state = EndBiome.findTopMaterial(world, pos); //world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) @@ -178,7 +178,7 @@ public class DesertLakeFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, POS, state); } pos = POS.below(); - if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) { BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); } pos = POS.above(); @@ -191,7 +191,7 @@ public class DesertLakeFeature extends DefaultFeature { // Make border else if (y2 + x2 + z2 <= rb) { state = world.getBlockState(POS); - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && world.isEmptyBlock(POS.above())) { + if (state.is(CommonBlockTags.GEN_END_STONES) && world.isEmptyBlock(POS.above())) { BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.END_MOSS); } else if (y < waterLevel) { @@ -230,7 +230,7 @@ public class DesertLakeFeature extends DefaultFeature { private boolean canReplace(BlockState state) { return state.getMaterial() - .isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() + .isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() .equals( Material.PLANT) || state .getMaterial() diff --git a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java index 7a9b7dba..a5a8c7d5 100644 --- a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -123,11 +123,11 @@ public class EndLakeFeature extends DefaultFeature { r *= r; if (x2 + z2 <= r) { state = world.getBlockState(POS); - if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (state.is(CommonBlockTags.GEN_END_STONES)) { BlocksHelper.setWithoutUpdate(world, POS, AIR); } pos = POS.below(); - if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) { state = EndBiome.findTopMaterial(world, pos); if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) @@ -182,7 +182,7 @@ public class EndLakeFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, POS, state); } pos = POS.below(); - if (world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES)) { BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState()); } pos = POS.above(); @@ -228,7 +228,7 @@ public class EndLakeFeature extends DefaultFeature { private boolean canReplace(BlockState state) { return state.getMaterial() - .isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() + .isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial() .equals( Material.PLANT) || state .getMaterial() diff --git a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java index b5ca611e..73190f08 100644 --- a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFRotation; @@ -31,7 +31,7 @@ public class FallenPillarFeature extends DefaultFeature { world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) ); - if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) { return false; } @@ -57,7 +57,7 @@ public class FallenPillarFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() + return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial() .equals(Material.PLANT); }).fillRecursive(world, pos); diff --git a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java index ca9db523..36bb5819 100644 --- a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java @@ -13,7 +13,7 @@ import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFCoordModify; import ru.bclib.sdf.operator.SDFDisplacement; @@ -61,7 +61,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(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { + while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } @@ -195,7 +195,7 @@ public class GeyserFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); MHelper.shuffle(HORIZONTAL, random); @@ -240,7 +240,7 @@ public class GeyserFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (state.is(CommonBlockTags.GEN_END_STONES)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); @@ -272,11 +272,11 @@ public class GeyserFeature extends DefaultFeature { static { REPLACE1 = (state) -> { - return state.isAir() || (state.is(TagAPI.BLOCK_GEN_TERRAIN)); + return state.isAir() || (state.is(CommonBlockTags.GEN_END_STONES)); }; REPLACE2 = (state) -> { - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) { + if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) { return true; } if (state.getMaterial().equals(Material.PLANT)) { diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java index 736af16c..890385f8 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFScale3D; @@ -29,7 +29,7 @@ public class ObsidianBoulderFeature extends DefaultFeature { world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) ); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { return false; } @@ -46,7 +46,7 @@ public class ObsidianBoulderFeature extends DefaultFeature { } private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) { - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_END_GROUND)) { + if (!world.getBlockState(pos.below()).is(CommonBlockTags.END_STONES)) { return; } @@ -68,7 +68,7 @@ public class ObsidianBoulderFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() + return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial() .equals(Material.PLANT); }).fillRecursive(world, pos); } diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java index 9411bbbf..f56b89c8 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFRotation; @@ -33,7 +33,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) ); - if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) { return false; } @@ -64,7 +64,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.getMaterial() + return state.getMaterial().isReplaceable() || state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial() .equals(Material.PLANT); }).fillRecursive(world, pos); diff --git a/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java b/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java index 416680fe..d98dd712 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.world.features.DefaultFeature; @@ -25,7 +25,7 @@ public class SingleBlockFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES)) { return false; } diff --git a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java index 4ec06f76..a93b1367 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -21,7 +21,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below()).is(CommonBlockTags.GEN_END_STONES)) { return false; } @@ -42,7 +42,7 @@ public class SmaragdantCrystalFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(crystal.getBlock())) { + if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(crystal.getBlock())) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, crystal); mut.setY(mut.getY() + 1); diff --git a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java index 04440416..7ffbc296 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java @@ -11,8 +11,8 @@ import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; import ru.bclib.sdf.operator.SDFSmoothUnion; @@ -41,8 +41,8 @@ public class SpireFeature extends DefaultFeature { final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); pos = getPosOnSurfaceWG(world, pos); if (pos.getY() < 10 || !world.getBlockState(pos.below(3)) - .is(TagAPI.BLOCK_GEN_TERRAIN) || !world.getBlockState(pos.below(6)) - .is(TagAPI.BLOCK_GEN_TERRAIN)) { + .is(CommonBlockTags.GEN_END_STONES) || !world.getBlockState(pos.below(6)) + .is(CommonBlockTags.GEN_END_STONES)) { return false; } @@ -99,7 +99,7 @@ public class SpireFeature extends DefaultFeature { static { REPLACE = (state) -> { - if (state.is(TagAPI.BLOCK_END_GROUND)) { + if (state.is(CommonBlockTags.END_STONES)) { return true; } if (state.getBlock() instanceof LeavesBlock) { diff --git a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java index 3065a834..a4e8a510 100644 --- a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java @@ -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.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.StalactiteBlock; import ru.bclib.util.BlocksHelper; import ru.bclib.world.features.DefaultFeature; @@ -45,7 +45,7 @@ public class StalactiteFeature extends DefaultFeature { mut.setY(pos.getY() + i * dir); BlockState state = world.getBlockState(mut); if (!state.getMaterial().isReplaceable()) { - stalagnate = state.is(TagAPI.BLOCK_GEN_TERRAIN); + stalagnate = state.is(CommonBlockTags.GEN_END_STONES); height = i; break; } diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java index 00398093..93141653 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -44,7 +44,7 @@ public class SulphuricCaveFeature extends DefaultFeature { bpos.setY(top - 1); BlockState state = world.getBlockState(bpos); - while (!state.is(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) { + while (!state.is(CommonBlockTags.GEN_END_STONES) && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } @@ -53,7 +53,7 @@ public class SulphuricCaveFeature extends DefaultFeature { } top = (int) (bpos.getY() - (radius * 1.3F + 5)); - while (state.is(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { + while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } @@ -105,7 +105,7 @@ public class SulphuricCaveFeature extends DefaultFeature { } else if (dist < r2 * r2) { state = world.getBlockState(mut); - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(Blocks.AIR)) { + if (state.is(CommonBlockTags.GEN_END_STONES) || state.is(Blocks.AIR)) { double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval( x * 0.03, y * 0.03, @@ -144,7 +144,7 @@ public class SulphuricCaveFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()) + if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()) .is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); @@ -182,7 +182,7 @@ public class SulphuricCaveFeature extends DefaultFeature { } private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state + return state.is(CommonBlockTags.GEN_END_STONES) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state .is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial() .equals(Material.PLANT) || state .getMaterial() diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java index 0962cc36..8df1be2d 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Fluids; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -61,7 +61,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(POS).is(CommonBlockTags.GEN_END_STONES)) { if (isBorder(world, POS)) { if (random.nextInt(8) > 0) { brimstone.add(POS.immutable()); @@ -97,7 +97,7 @@ public class SulphuricLakeFeature extends DefaultFeature { brimstone.remove(POS); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos offseted = POS.relative(dir); - if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(offseted).is(CommonBlockTags.GEN_END_STONES)) { brimstone.add(offseted); } } @@ -106,7 +106,7 @@ public class SulphuricLakeFeature extends DefaultFeature { brimstone.remove(POS); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos offseted = POS.relative(dir); - if (world.getBlockState(offseted).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(offseted).is(CommonBlockTags.GEN_END_STONES)) { brimstone.add(offseted); } } @@ -123,7 +123,7 @@ public class SulphuricLakeFeature extends DefaultFeature { } else if (dist < r2) { POS.setY(getYOnSurface(world, x, z) - 1); - if (world.getBlockState(POS).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(POS).is(CommonBlockTags.GEN_END_STONES)) { brimstone.add(POS.immutable()); if (random.nextBoolean()) { brimstone.add(POS.below()); diff --git a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java index a7b8133f..1e6dffa4 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java @@ -6,7 +6,7 @@ import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.features.DefaultFeature; @@ -25,7 +25,7 @@ public class SurfaceVentFeature extends DefaultFeature { world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)) ); - if (!world.getBlockState(pos.below(3)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below(3)).is(CommonBlockTags.GEN_END_STONES)) { return false; } @@ -46,7 +46,7 @@ public class SurfaceVentFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(CommonBlockTags.GEN_END_STONES) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); diff --git a/src/main/java/ru/betterend/world/features/terrain/ThinArchFeature.java b/src/main/java/ru/betterend/world/features/terrain/ThinArchFeature.java index 95bb6edb..3b6c6599 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ThinArchFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ThinArchFeature.java @@ -9,7 +9,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFCoordModify; import ru.bclib.sdf.operator.SDFDisplacement; @@ -36,7 +36,7 @@ public class ThinArchFeature extends DefaultFeature { Random random = featurePlaceContext.random(); BlockPos pos = getPosOnSurfaceWG(world, new BlockPos((origin.getX() & 0xFFFFFFF0) | 7, 0, (origin.getZ() & 0xFFFFFFF0) | 7)); - if (!world.getBlockState(pos.below(5)).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) { return false; } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java index e092dec8..8aa761da 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.chunk.ChunkAccess; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.world.features.DefaultFeature; import ru.betterend.util.BlockFixer; @@ -63,13 +63,13 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { mut.setY(y); BlockState top = chunk.getBlockState(mut); BlockState bottom = chunk.getBlockState(mut2); - if (top.isAir() && (bottom.is(TagAPI.BLOCK_GEN_TERRAIN) || bottom.is(Blocks.STONE))) { + if (top.isAir() && (bottom.is(CommonBlockTags.GEN_END_STONES) || bottom.is(Blocks.STONE))) { mut3.set(mut2).move(sx, 0, sz); floorPositions.add(mut3.immutable()); updateMin(mut3, min); updateMax(mut3, max); } - else if (bottom.isAir() && (top.is(TagAPI.BLOCK_GEN_TERRAIN) || top.is(Blocks.STONE))) { + else if (bottom.isAir() && (top.is(CommonBlockTags.GEN_END_STONES) || top.is(Blocks.STONE))) { mut3.set(mut).move(sx, 0, sz); ceilPositions.add(mut3.immutable()); updateMin(mut3, min); diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java index c0f202cf..c6b2cee2 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java @@ -14,8 +14,8 @@ import net.minecraft.world.level.levelgen.Heightmap; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.bclib.world.biomes.BCLBiome; @@ -66,11 +66,11 @@ public abstract class EndCaveFeature extends DefaultFeature { caveBlocks.parallelStream().forEach((bpos) -> { if (world.getBlockState(bpos).getMaterial().isReplaceable()) { BlockPos side = bpos.below(); - if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(side).is(CommonBlockTags.GEN_END_STONES)) { floorPositions.add(side); } side = bpos.above(); - if (world.getBlockState(side).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(side).is(CommonBlockTags.GEN_END_STONES)) { ceilPositions.add(side); } } @@ -128,7 +128,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(CommonBlockTags.GEN_END_STONES)) { 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(TagAPI.BLOCK_GEN_TERRAIN) && bpos.getY() > 5) { + while (!state.is(CommonBlockTags.GEN_END_STONES) && 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(TagAPI.BLOCK_GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { + while (state.is(CommonBlockTags.GEN_END_STONES) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java index 07afd22d..98aea791 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java @@ -6,7 +6,7 @@ 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.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.noise.OpenSimplexNoise; @@ -74,7 +74,7 @@ public class RoundCaveFeature extends EndCaveFeature { } private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.BLOCK_GEN_TERRAIN) || + return state.is(CommonBlockTags.GEN_END_STONES) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.LEAVES); diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java index 7b23abb4..114ede15 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java @@ -15,8 +15,8 @@ import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.world.biomes.BCLBiome; import ru.betterend.noise.OpenSimplexNoise; @@ -82,7 +82,7 @@ public class TunelCaveFeature extends EndCaveFeature { ) * 20) * 0.1F) * 0.9F; float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F; val = (val + vert * vert + dist) + density + gradient; - if (val < 0.15 && world.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && noWaterNear(world, pos)) { + if (val < 0.15 && world.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES) && noWaterNear(world, pos)) { positions.add(pos.immutable()); } } @@ -141,7 +141,7 @@ public class TunelCaveFeature extends EndCaveFeature { } else if (world.getBlockState(mut).getMaterial().isReplaceable()) { mut.setY(bpos.getY() - 1); - if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(mut).is(CommonBlockTags.GEN_END_STONES)) { Set floorPositions = floorSets.get(bio); if (floorPositions == null) { floorPositions = Sets.newHashSet(); @@ -150,7 +150,7 @@ public class TunelCaveFeature extends EndCaveFeature { floorPositions.add(mut.immutable()); } mut.setY(bpos.getY() + 1); - if (world.getBlockState(mut).is(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(mut).is(CommonBlockTags.GEN_END_STONES)) { Set ceilPositions = ceilSets.get(bio); if (ceilPositions == null) { ceilPositions = Sets.newHashSet(); diff --git a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java index 6a46e825..baf18b68 100644 --- a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; @@ -112,7 +112,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.getBark().defaultBlockState(), pos, REPLACE); } } @@ -196,7 +196,7 @@ public class DragonTreeFeature extends DefaultFeature { static { REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (state.getBlock() == EndBlocks.DRAGON_TREE_LEAVES) { diff --git a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java index 040c678b..71a31ca2 100644 --- a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java @@ -361,7 +361,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { static { REPLACE = (state) -> { - if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT)) { + if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) { return true; } return state.getMaterial().isReplaceable(); diff --git a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java index 696bfeda..e8efe5d0 100644 --- a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFFlatWave; import ru.bclib.sdf.operator.SDFScale3D; @@ -90,7 +90,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { SplineHelper.fillSpline(branch, world, wood, pos, REPLACE); } } @@ -123,7 +123,7 @@ public class JellyshroomFeature extends DefaultFeature { SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); REPLACE = (state) -> { - if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT)) { + if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT)) { return true; } return state.getMaterial().isReplaceable(); diff --git a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java index 50d72630..5703ab84 100644 --- a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java @@ -11,7 +11,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.PosInfo; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFDisplacement; @@ -83,7 +83,7 @@ public class LacugroveFeature extends DefaultFeature { boolean generate = false; for (int y = minY; y < maxY; y++) { mut.setY(y); - if (world.getBlockState(mut).is(TagAPI.BLOCK_END_GROUND)) { + if (world.getBlockState(mut).is(CommonBlockTags.END_STONES)) { generate = true; break; } @@ -94,7 +94,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(TagAPI.BLOCK_END_GROUND)) { + .equals(Material.PLANT) || state.is(CommonBlockTags.END_STONES)) { BlocksHelper.setWithoutUpdate( world, mut, @@ -189,7 +189,7 @@ public class LacugroveFeature extends DefaultFeature { static { REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (EndBlocks.LACUGROVE.isTreeLog(state)) { diff --git a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java index f1145e30..373f6bb0 100644 --- a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties.TripleShape; import ru.bclib.sdf.SDF; @@ -187,7 +187,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { SplineHelper.fillSplineForce(branch, world, EndBlocks.LUCERNIA.getBark().defaultBlockState(), pos, REPLACE); } } @@ -195,7 +195,7 @@ public class LucerniaFeature extends DefaultFeature { static { REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (state.getBlock() == EndBlocks.LUCERNIA_LEAVES) { diff --git a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java index cdbc29c3..99b65c3a 100644 --- a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java @@ -171,7 +171,7 @@ public class MossyGlowshroomFeature extends DefaultFeature { .setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (state.getMaterial().equals(Material.PLANT)) { diff --git a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java index 087a1903..17aaac08 100644 --- a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java @@ -187,7 +187,7 @@ public class PythadendronTreeFeature extends DefaultFeature { static { REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) { diff --git a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java index 01aa5d65..e8c4492e 100644 --- a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java @@ -175,7 +175,7 @@ public class TenaneaFeature extends DefaultFeature { static { REPLACE = (state) -> { - /*if (state.is(TagAPI.BLOCK_END_GROUND)) { + /*if (state.is(CommonBlockTags.END_STONES)) { return true; }*/ if (state.getBlock() == EndBlocks.TENANEA_LEAVES) { diff --git a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java index e37207cd..af0ef623 100644 --- a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java @@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.material.Material; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.sdf.SDF; import ru.bclib.sdf.operator.SDFFlatWave; import ru.bclib.sdf.operator.SDFScale; @@ -159,7 +159,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(TagAPI.BLOCK_GEN_TERRAIN)) { + if (world.getBlockState(pos.offset(last.x(), last.y(), last.z())).is(CommonBlockTags.GEN_END_STONES)) { SplineHelper.fillSplineForce(branch, world, wood, pos, REPLACE); } } @@ -218,7 +218,7 @@ public class UmbrellaTreeFeature extends DefaultFeature { SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); REPLACE = (state) -> { - if (/*state.is(TagAPI.BLOCK_END_GROUND) || */state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { + if (/*state.is(CommonBlockTags.END_STONES) || */state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { return true; } return state.getMaterial().isReplaceable(); diff --git a/src/main/java/ru/betterend/world/structures/piece/CavePiece.java b/src/main/java/ru/betterend/world/structures/piece/CavePiece.java index bd9ecbbf..08ddaf45 100644 --- a/src/main/java/ru/betterend/world/structures/piece/CavePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/CavePiece.java @@ -11,7 +11,7 @@ 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.pieces.StructurePieceSerializationContext; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.noise.OpenSimplexNoise; @@ -67,7 +67,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(TagAPI.BLOCK_END_GROUND)) { + if (world.getBlockState(pos).is(CommonBlockTags.END_STONES)) { BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR); } } diff --git a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java index 60acae3b..10027b39 100644 --- a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java @@ -16,7 +16,8 @@ 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.pieces.StructurePieceSerializationContext; -import ru.bclib.api.TagAPI; +import ru.bclib.api.tag.CommonBlockTags; +import ru.bclib.api.tag.TagAPI; import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.util.MHelper; import ru.betterend.registry.EndBlocks; @@ -69,7 +70,7 @@ public class CrystalMountainPiece extends MountainPiece { continue; } pos.setY(minY); - while (!chunk.getBlockState(pos).is(TagAPI.BLOCK_GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState( + while (!chunk.getBlockState(pos).is(CommonBlockTags.GEN_END_STONES) && pos.getY() > 56 && !chunk.getBlockState( pos.below()).is(Blocks.CAVE_AIR)) { pos.setY(pos.getY() - 1); } diff --git a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java index 4a582e27..cb8a1b8c 100644 --- a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java @@ -21,8 +21,8 @@ import net.minecraft.world.level.levelgen.Heightmap.Types; import net.minecraft.world.level.levelgen.structure.BoundingBox; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext; import net.minecraft.world.level.material.FluidState; -import ru.bclib.api.TagAPI; import ru.bclib.api.biomes.BiomeAPI; +import ru.bclib.api.tag.CommonBlockTags; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.noise.OpenSimplexNoise; @@ -118,7 +118,7 @@ public class LakePiece extends BasePiece { double dist = x3 + y2 + z3; if (dist < r2) { BlockState state = chunk.getBlockState(mut); - if (state.is(TagAPI.BLOCK_GEN_TERRAIN) || state.isAir()) { + if (state.is(CommonBlockTags.GEN_END_STONES) || state.isAir()) { state = mut.getY() < center.getY() ? WATER : CAVE_AIR; chunk.setBlockState(mut, state, false); }