Tool and Tag related Changes

This commit is contained in:
Frank 2022-04-03 22:39:09 +02:00
parent 0c9dcc2e06
commit 5ba0488c9b
37 changed files with 74 additions and 107 deletions

View file

@ -1,13 +1,13 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.tools.AddMineableAxe;
public class AmaranitaCapBlock extends BaseBlock {
public class AmaranitaCapBlock extends BaseBlock implements AddMineableAxe {
public AmaranitaCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD));
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
}
}

View file

@ -1,16 +1,16 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineableAxe;
public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider {
public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider, AddMineableAxe {
public AmaranitaHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD));
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
}
@Override

View file

@ -1,8 +1,7 @@
package ru.betterend.blocks;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos;
@ -24,13 +23,14 @@ import ru.bclib.api.tag.CommonItemTags;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.CustomColorProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import ru.bclib.util.ColorUtil;
import ru.bclib.util.MHelper;
import ru.betterend.registry.EndItems;
import java.util.List;
public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLayerProvider, CustomColorProvider {
public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLayerProvider, CustomColorProvider, AddMineablePickaxe {
public static final Vec3i[] COLORS;
private static final int MIN_DROP = 1;
private static final int MAX_DROP = 4;
@ -38,7 +38,6 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
public AuroraCrystalBlock() {
super(FabricBlockSettings
.of(Material.GLASS)
.breakByTool(FabricToolTags.PICKAXES)
.breakByTool(CommonItemTags.HAMMERS)
.hardness(1F)
.resistance(1F)

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelAccessor;
@ -15,14 +14,14 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BlockProperties;
import ru.bclib.interfaces.tools.AddMineableAxe;
import ru.betterend.registry.EndBlocks;
public class BlueVineLanternBlock extends BaseBlock {
public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
public BlueVineLanternBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.breakByTool(FabricToolTags.AXES)
.luminance(15)
.sound(SoundType.WART_BLOCK));
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.level.BlockGetter;
@ -15,17 +14,17 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
import java.util.Random;
public class BubbleCoralBlock extends EndUnderwaterPlantBlock {
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
public BubbleCoralBlock() {
super(FabricBlockSettings.of(Material.WATER_PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.CORAL_BLOCK)
.noCollission());

View file

@ -4,7 +4,6 @@ import com.google.common.collect.Maps;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
@ -21,13 +20,14 @@ import ru.bclib.client.models.ModelsHelper;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.BlockModelProvider;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import ru.betterend.blocks.basis.EndLanternBlock;
import ru.betterend.client.models.Patterns;
import java.util.Map;
import java.util.Optional;
public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider {
public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider, AddMineablePickaxe {
private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12);
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
@ -35,7 +35,6 @@ public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayer
this(FabricBlockSettings.of(Material.METAL)
.hardness(1)
.resistance(1)
.breakByTool(FabricToolTags.PICKAXES)
.mapColor(MaterialColor.COLOR_LIGHT_GRAY)
.luminance(15)
.requiresCorrectToolForDrops()

View file

@ -4,7 +4,6 @@ import com.google.common.collect.Lists;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
@ -27,6 +26,7 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.util.MHelper;
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
import ru.betterend.registry.EndBlocks;
@ -36,14 +36,13 @@ import java.util.Collections;
import java.util.List;
import java.util.Random;
public class EndLilyBlock extends EndUnderwaterPlantBlock {
public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12);
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
public EndLilyBlock() {
super(FabricBlockSettings.of(Material.WATER_PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.WET_GRASS)
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
@ -16,19 +15,20 @@ import net.minecraft.world.level.storage.loot.LootContext;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.TagAPI.TagLocation;
import ru.bclib.interfaces.TagProvider;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.interfaces.tools.AddMineableShovel;
import ru.bclib.util.ColorUtil;
import java.util.Collections;
import java.util.List;
public class EndstoneDustBlock extends FallingBlock implements TagProvider {
public class EndstoneDustBlock extends FallingBlock implements TagProvider, AddMineableShovel {
@Environment(EnvType.CLIENT)
private static final int COLOR = ColorUtil.color(226, 239, 168);
public EndstoneDustBlock() {
super(FabricBlockSettings
.copyOf(Blocks.SAND)
.breakByTool(FabricToolTags.SHOVELS)
.mapColor(Blocks.END_STONE.defaultMaterialColor())
);
}

View file

@ -1,15 +1,14 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.tools.AddMineableAxe;
public class FilaluxLanternBlock extends BaseBlock {
public class FilaluxLanternBlock extends BaseBlock implements AddMineableAxe {
public FilaluxLanternBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.breakByTool(FabricToolTags.AXES)
.luminance(15)
.sound(SoundType.WOOD));
}

View file

@ -2,7 +2,6 @@ package ru.betterend.blocks;
import com.google.common.collect.Maps;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
@ -15,15 +14,15 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineableShears;
import java.util.EnumMap;
public class FilaluxWingsBlock extends BaseAttachedBlock implements RenderLayerProvider {
public class FilaluxWingsBlock extends BaseAttachedBlock implements RenderLayerProvider, AddMineableShears {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public FilaluxWingsBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.sound(SoundType.WET_GRASS)
.noCollission());
}

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
@ -20,16 +19,16 @@ 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.interfaces.CustomItemProvider;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.betterend.blocks.basis.EndPlantBlock;
import java.util.List;
public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider {
public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, AddMineableShears {
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
public FlamaeaBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.WET_GRASS));
}

View file

@ -1,15 +1,14 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.tools.AddMineableAxe;
public class GlowingHymenophoreBlock extends BaseBlock {
public class GlowingHymenophoreBlock extends BaseBlock implements AddMineableAxe {
public GlowingHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.breakByTool(FabricToolTags.AXES)
.luminance(15)
.sound(SoundType.WART_BLOCK));
}

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.LevelAccessor;
@ -15,15 +14,15 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.betterend.registry.EndBlocks;
public class GlowingPillarLuminophorBlock extends BaseBlock {
public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineableShears {
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
public GlowingPillarLuminophorBlock() {
super(FabricBlockSettings.of(Material.LEAVES)
.mapColor(MaterialColor.COLOR_ORANGE)
.breakByTool(FabricToolTags.SHEARS)
.strength(0.2F)
.luminance(15)
.sound(SoundType.GRASS));

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
@ -13,6 +12,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.material.Material;
import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.util.BlocksHelper;
import ru.bclib.util.MHelper;
import ru.betterend.blocks.basis.EndPlantWithAgeBlock;
@ -20,11 +20,10 @@ import ru.betterend.registry.EndBlocks;
import java.util.Random;
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock {
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddMineableShears {
public GlowingPillarSeedBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.GRASS)
.lightLevel(state -> state.getValue(AGE) * 3 + 3)

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.util.Mth;
@ -20,6 +19,7 @@ import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseLeavesBlock;
import ru.bclib.interfaces.CustomColorProvider;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.util.ColorUtil;
import ru.bclib.util.MHelper;
import ru.betterend.noise.OpenSimplexNoise;
@ -27,7 +27,7 @@ import ru.betterend.registry.EndBlocks;
import java.util.List;
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider {
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider, AddMineableShears {
public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
@ -35,7 +35,6 @@ public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvid
super(FabricBlockSettings
.of(Material.LEAVES)
.mapColor(MaterialColor.COLOR_ORANGE)
.breakByTool(FabricToolTags.SHEARS)
.sound(SoundType.WART_BLOCK)
.sound(SoundType.GRASS)
.strength(0.2F)

View file

@ -4,7 +4,6 @@ import com.google.common.collect.Lists;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
@ -19,6 +18,7 @@ import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.storage.loot.LootContext;
import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.UnderwaterPlantBlock;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.util.MHelper;
import ru.betterend.blocks.EndBlockProperties.HydraluxShape;
import ru.betterend.registry.EndBlocks;
@ -28,13 +28,12 @@ import java.util.Collections;
import java.util.List;
import java.util.Random;
public class HydraluxBlock extends UnderwaterPlantBlock {
public class HydraluxBlock extends UnderwaterPlantBlock implements AddMineableShears {
public static final EnumProperty<HydraluxShape> SHAPE = EndBlockProperties.HYDRALUX_SHAPE;
public HydraluxBlock() {
super(FabricBlockSettings.of(Material.WATER_PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.WET_GRASS)
.lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0)

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
@ -10,13 +9,13 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.interfaces.tools.AddMineableAxe;
public class HydraluxPetalBlock extends BaseBlock {
public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
public HydraluxPetalBlock() {
this(
FabricBlockSettings
.of(Material.PLANT)
.breakByTool(FabricToolTags.AXES)
.breakByHand(true)
.hardness(1)
.resistance(1)

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
@ -37,6 +36,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;
import ru.bclib.blocks.BaseBlockNotFull;
import ru.bclib.blocks.BlockProperties;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import ru.bclib.util.BlocksHelper;
import ru.betterend.blocks.entities.BlockEntityHydrothermalVent;
import ru.betterend.registry.EndBlocks;
@ -44,14 +44,13 @@ import ru.betterend.registry.EndBlocks;
import java.util.Random;
@SuppressWarnings("deprecation")
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock, AddMineablePickaxe {
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
public HydrothermalVentBlock() {
super(FabricBlockSettings.of(Material.STONE)
.breakByTool(FabricToolTags.PICKAXES)
.sound(SoundType.STONE)
.noCollission()
.requiresCorrectToolForDrops());

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
@ -17,19 +16,19 @@ import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BlockProperties;
import ru.bclib.blocks.BlockProperties.TripleShape;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.betterend.blocks.basis.EndPlantBlock;
import ru.betterend.registry.EndBlocks;
import java.util.Random;
public class LargeAmaranitaBlock extends EndPlantBlock {
public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShears {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12);
private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM);
public LargeAmaranitaBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.sound(SoundType.GRASS)
.lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0));

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
@ -23,6 +22,7 @@ import ru.bclib.api.tag.CommonBlockTags;
import ru.bclib.blocks.BaseBlockNotFull;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineableAxe;
import ru.bclib.util.MHelper;
import ru.betterend.blocks.EndBlockProperties.LumecornShape;
import ru.betterend.registry.EndBlocks;
@ -32,14 +32,13 @@ import java.util.Collections;
import java.util.List;
@SuppressWarnings("deprecation")
public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider {
public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableAxe {
public static final EnumProperty<LumecornShape> SHAPE = EnumProperty.create("shape", LumecornShape.class);
private static final VoxelShape SHAPE_BOTTOM = Block.box(6, 0, 6, 10, 16, 10);
private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
public LumecornBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.breakByTool(FabricToolTags.AXES)
.hardness(0.5F)
.luminance(state -> state.getValue(SHAPE).getLight()));
}

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
@ -16,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import ru.bclib.items.tool.BaseShearsItem;
import ru.bclib.util.MHelper;
import ru.betterend.blocks.basis.EndPlantBlock;
import ru.betterend.registry.EndBlocks;
@ -34,7 +34,7 @@ public class NeedlegrassBlock extends EndPlantBlock {
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
if (tool != null && tool.is(FabricToolTags.SHEARS) || EnchantmentHelper.getItemEnchantmentLevel(
if (tool != null && BaseShearsItem.isShear(tool) || EnchantmentHelper.getItemEnchantmentLevel(
Enchantments.SILK_TOUCH,
tool
) > 0) {

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.level.BlockGetter;
@ -15,16 +14,16 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
import java.util.Random;
public class PondAnemoneBlock extends EndUnderwaterPlantBlock {
public class PondAnemoneBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
public PondAnemoneBlock() {
super(FabricBlockSettings.of(Material.WATER_PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.luminance(13)
.sound(SoundType.CORAL_BLOCK)

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
@ -42,7 +41,6 @@ public class SilkMothHiveBlock extends BaseBlock {
public SilkMothHiveBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.breakByHand(true)
.hardness(0.5F)
.resistance(0.1F)
.sound(SoundType.WOOL)

View file

@ -1,7 +1,6 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;

View file

@ -5,7 +5,6 @@ import com.google.common.collect.Maps;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
@ -46,7 +45,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public SmallJellyshroomBlock() {
super(FabricBlockSettings.of(Material.PLANT).breakByHand(true).sound(SoundType.NETHER_WART).noCollission());
super(FabricBlockSettings.of(Material.PLANT).sound(SoundType.NETHER_WART).noCollission());
}
@Override

View file

@ -1,15 +1,14 @@
package ru.betterend.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.Material;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import ru.betterend.blocks.basis.LitPillarBlock;
public class SmaragdantCrystalBlock extends LitPillarBlock {
public class SmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
public SmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS)
.breakByTool(FabricToolTags.PICKAXES)
.luminance(15)
.hardness(1F)
.resistance(1F)

View file

@ -2,7 +2,6 @@ package ru.betterend.blocks;
import com.google.common.collect.Maps;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.context.BlockPlaceContext;
@ -28,18 +27,18 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import java.util.EnumMap;
@SuppressWarnings("deprecation")
public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements AddMineablePickaxe, RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SmaragdantCrystalShardBlock() {
super(FabricBlockSettings.of(Material.STONE)
.materialColor(MaterialColor.COLOR_GREEN)
.breakByTool(FabricToolTags.PICKAXES)
.luminance(15)
.sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops()

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
@ -32,6 +31,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineablePickaxe;
import ru.bclib.util.MHelper;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndItems;
@ -41,7 +41,7 @@ import java.util.EnumMap;
import java.util.List;
@SuppressWarnings("deprecation")
public class SulphurCrystalBlock extends BaseAttachedBlock implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
public class SulphurCrystalBlock extends BaseAttachedBlock implements AddMineablePickaxe, RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public static final IntegerProperty AGE = IntegerProperty.create("age", 0, 2);
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
@ -49,7 +49,6 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements RenderLaye
public SulphurCrystalBlock() {
super(FabricBlockSettings.of(Material.STONE)
.materialColor(MaterialColor.COLOR_YELLOW)
.breakByTool(FabricToolTags.PICKAXES)
.sound(SoundType.GLASS)
.requiresCorrectToolForDrops()
.noCollission());

View file

@ -3,7 +3,6 @@ package ru.betterend.blocks.basis;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
@ -24,20 +23,19 @@ import ru.bclib.api.tag.TagAPI;
import ru.bclib.blocks.BaseAttachedBlock;
import ru.bclib.client.render.BCLRenderLayer;
import ru.bclib.interfaces.RenderLayerProvider;
import ru.bclib.interfaces.tools.AddMineableShears;
import ru.bclib.util.MHelper;
import java.util.EnumMap;
import java.util.List;
public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider {
public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider, AddMineableShears {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
private final ItemLike drop;
private final int dropChance;
public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) {
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT)
.breakByTool(FabricToolTags.SHEARS)
.breakByHand(true)
.luminance(light)
.sound(wet ? SoundType.WET_GRASS : SoundType.GRASS)
.noCollission());

View file

@ -1,6 +1,7 @@
package ru.betterend.complexmaterials;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ArmorMaterial;
import net.minecraft.world.item.Item;
@ -16,7 +17,6 @@ import ru.bclib.api.tag.NamedBlockTags;
import ru.bclib.api.tag.NamedCommonBlockTags;
import ru.bclib.api.tag.NamedItemTags;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.api.tag.TagAPI.TagNamed;
import ru.bclib.blocks.BaseBlock;
import ru.bclib.blocks.BaseChainBlock;
import ru.bclib.blocks.BaseDoorBlock;
@ -90,7 +90,7 @@ public class MetalMaterial {
public final Item leggings;
public final Item boots;
public final TagNamed<Item> alloyingOre;
public final TagKey<Item> alloyingOre;
public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) {
return new MetalMaterial(

View file

@ -6,7 +6,6 @@ import com.google.common.collect.Multimap;
import io.netty.util.internal.ThreadLocalRandom;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
import net.minecraft.client.renderer.block.model.BlockModel;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
@ -38,7 +37,7 @@ import ru.bclib.interfaces.TagProvider;
import java.util.List;
import java.util.UUID;
public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, ItemModelProvider, TagProvider {
public class EndHammerItem extends DiggerItem implements ItemModelProvider, TagProvider {
public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = Mth.createInsecureUUID(ThreadLocalRandom.current());
private final Multimap<Attribute, AttributeModifier> attributeModifiers;

View file

@ -1,10 +1,6 @@
package ru.betterend.mixin.common;
import net.minecraft.world.level.levelgen.Aquifer;
import net.minecraft.world.level.levelgen.NoiseChunk;
import net.minecraft.world.level.levelgen.NoiseChunk.NoiseFiller;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import net.minecraft.world.level.levelgen.NoiseSampler;
import net.minecraft.world.level.levelgen.*;
import net.minecraft.world.level.levelgen.blending.Blender;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@ -17,7 +13,7 @@ public class NoiseChunkMixin implements TargetChecker {
private boolean be_isEndGenerator;
@Inject(method = "<init>*", at = @At("TAIL"))
private void be_onNoiseChunkInit(int i, int j, int k, NoiseSampler noiseSampler, int l, int m, NoiseFiller noiseFiller, NoiseGeneratorSettings noiseGeneratorSettings, Aquifer.FluidPicker fluidPicker, Blender blender, CallbackInfo info) {
private void be_onNoiseChunkInit(int i, int j, int k, NoiseRouter noiseRouter, int l, int m, DensityFunctions.BeardifierOrMarker beardifierOrMarker, NoiseGeneratorSettings noiseGeneratorSettings, Aquifer.FluidPicker fluidPicker, Blender blender, CallbackInfo ci) {
be_isEndGenerator = noiseGeneratorSettings.stable(NoiseGeneratorSettings.END);
}

View file

@ -8,6 +8,7 @@ import net.minecraft.core.NonNullList;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagKey;
import net.minecraft.util.GsonHelper;
import net.minecraft.world.Container;
import net.minecraft.world.item.Item;
@ -173,12 +174,12 @@ public class AlloyingRecipe implements Recipe<Container>, UnknownReceipBookCateg
return this;
}
public Builder setPrimaryInput(Tag<Item> input) {
public Builder setPrimaryInput(TagKey<Item> input) {
this.primaryInput = Ingredient.of(input);
return this;
}
public Builder setSecondaryInput(Tag<Item> input) {
public Builder setSecondaryInput(TagKey<Item> input) {
this.secondaryInput = Ingredient.of(input);
return this;
}
@ -189,7 +190,7 @@ public class AlloyingRecipe implements Recipe<Container>, UnknownReceipBookCateg
return this;
}
public Builder setInput(Tag<Item> primaryInput, Tag<Item> secondaryInput) {
public Builder setInput(TagKey<Item> primaryInput, TagKey<Item> secondaryInput) {
this.setPrimaryInput(primaryInput);
this.setSecondaryInput(secondaryInput);
return this;

View file

@ -4,7 +4,7 @@ import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.world.structures.BCLStructureFeature;
import ru.betterend.BetterEnd;

View file

@ -1,11 +1,10 @@
package ru.betterend.registry;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.impl.tool.attribute.ToolManagerImpl;
import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocksToolHandler;
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.TagKey;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
@ -24,7 +23,6 @@ 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;
@ -40,12 +38,12 @@ public class EndTags {
// https://fabricmc.net/wiki/tutorial:tags
// Block Tags
public static final TagNamed<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal");
public static final TagKey<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal");
// Item Tags
public static final TagNamed<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
public static final TagNamed<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
public static final TagNamed<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
public static final TagKey<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
public static final TagKey<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
public static final TagKey<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
public static void register() {
addEndGround(EndBlocks.THALLASIUM.ore);

View file

@ -1,7 +1,7 @@
package ru.betterend.world.structures.piece;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.StructurePiece;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceSerializationContext;

View file

@ -10,7 +10,7 @@ import net.minecraft.util.Mth;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.MHelper;