Added more Behaviours

This commit is contained in:
Frank 2023-05-24 21:07:51 +02:00
parent e63a3f777f
commit f076a91da1
50 changed files with 236 additions and 287 deletions

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.CustomItemProvider; import org.betterx.bclib.interfaces.CustomItemProvider;
@ -7,17 +8,13 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class AeterniumBlock extends BaseBlock.Metal implements CustomItemProvider {
public class AeterniumBlock extends BaseBlock implements CustomItemProvider {
public AeterniumBlock() { public AeterniumBlock() {
super(FabricBlockSettings super(BehaviourBuilders
.of(Material.METAL, MapColor.COLOR_GRAY) .createMetal(MapColor.COLOR_GRAY)
.hardness(65F) .strength(65F, 1200F)
.resistance(1200F)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.NETHERITE_BLOCK) .sound(SoundType.NETHERITE_BLOCK)
); );

View file

@ -1,15 +1,12 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
public class AmaranitaCapBlock extends BaseBlock.Wood {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class AmaranitaCapBlock extends BaseBlock implements AddMineableAxe {
public AmaranitaCapBlock() { public AmaranitaCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD)); super(BehaviourBuilders.createWood().sound(SoundType.WOOD));
} }
} }

View file

@ -1,18 +1,15 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
public class AmaranitaHymenophoreBlock extends BaseBlock.Wood implements RenderLayerProvider {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider, AddMineableAxe {
public AmaranitaHymenophoreBlock() { public AmaranitaHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD)); super(BehaviourBuilders.createWood().sound(SoundType.WOOD));
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.CustomColorProvider; import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
@ -19,16 +20,12 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.AbstractGlassBlock; import net.minecraft.world.level.block.AbstractGlassBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
@ -39,14 +36,11 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLaye
private static final int MAX_DROP = 4; private static final int MAX_DROP = 4;
public AuroraCrystalBlock() { public AuroraCrystalBlock() {
super(FabricBlockSettings super(BehaviourBuilders
.of(Material.GLASS) .createGlass()
.hardness(1F) .strength(1F)
.resistance(1F) .lightLevel((bs) -> 15)
.luminance(15) );
.noOcclusion()
.isSuffocating((state, world, pos) -> false)
.sound(SoundType.GLASS));
} }
@Override @Override

View file

@ -2,7 +2,6 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -16,16 +15,14 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
public class BlueVineLanternBlock extends BaseBlock.Wood {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
public static final BooleanProperty NATURAL = BlockProperties.NATURAL; public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
public BlueVineLanternBlock() { public BlueVineLanternBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(Properties.of()
.luminance(15) .lightLevel((bs) -> 15)
.sound(SoundType.WART_BLOCK)); .sound(SoundType.WART_BLOCK)
);
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
@ -11,12 +12,11 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public class BlueVineSeedBlock extends EndPlantWithAgeBlock { public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
public BlueVineSeedBlock() { public BlueVineSeedBlock() {
super(basePlantSettings().offsetType(BlockBehaviour.OffsetType.NONE)); super(BehaviourBuilders.createPlant());
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -24,7 +25,7 @@ public class BoluxMushroomBlock extends EndPlantBlock {
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15); private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
public BoluxMushroomBlock() { public BoluxMushroomBlock() {
super(basePlantSettings(10).offsetType(BlockBehaviour.OffsetType.NONE)); super(BehaviourBuilders.createPlant().lightLevel((bs)->10));
} }
@Override @Override

View file

@ -1,6 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe; import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourGlass;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.basis.LitPillarBlock; import org.betterx.betterend.blocks.basis.LitPillarBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -14,21 +15,18 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe { public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements BehaviourGlass {
public BuddingSmaragdantCrystalBlock() { public BuddingSmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS) super(BehaviourBuilders
.luminance(15) .createGlass()
.hardness(1F) .lightLevel((bs) -> 15)
.resistance(1F) .strength(1F)
.noOcclusion() .noOcclusion()
.sound(SoundType.AMETHYST) .sound(SoundType.AMETHYST)
.randomTicks()); .randomTicks());
@ -53,7 +51,11 @@ public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements Add
if (random.nextInt(20) == 0) { if (random.nextInt(20) == 0) {
if (canShardGrowAtState(sideState)) { if (canShardGrowAtState(sideState)) {
BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState() BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState()
.setValue(SmaragdantCrystalShardBlock.WATERLOGGED, sideState.getFluidState().getType() == Fluids.WATER) .setValue(
SmaragdantCrystalShardBlock.WATERLOGGED,
sideState.getFluidState()
.getType() == Fluids.WATER
)
.setValue(SmaragdantCrystalShardBlock.FACING, dir); .setValue(SmaragdantCrystalShardBlock.FACING, dir);
world.setBlockAndUpdate(side, shard); world.setBlockAndUpdate(side, shard);
} }

View file

@ -1,10 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourWood;
import org.betterx.bclib.client.models.ModelsHelper; import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider; import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.EndLanternBlock; import org.betterx.betterend.blocks.basis.EndLanternBlock;
import org.betterx.betterend.client.models.Patterns; import org.betterx.betterend.client.models.Patterns;
@ -15,14 +16,12 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -30,16 +29,14 @@ import java.util.Map;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider, AddMineablePickaxe { public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider, BehaviourWood {
private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12); 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); private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
public BulbVineLanternBlock() { public BulbVineLanternBlock() {
this(FabricBlockSettings.of(Material.METAL) this(BehaviourBuilders.createMetal(MapColor.COLOR_LIGHT_GRAY)
.hardness(1) .strength(1)
.resistance(1) .lightLevel((bs) -> 15)
.mapColor(MapColor.COLOR_LIGHT_GRAY)
.luminance(15)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.LANTERN)); .sound(SoundType.LANTERN));
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock; import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -13,14 +14,13 @@ import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
public CavePumpkinVineBlock() { public CavePumpkinVineBlock() {
super(basePlantSettings().offsetType(BlockBehaviour.OffsetType.NONE)); super(BehaviourBuilders.createPlant());
} }
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12); private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);

View file

@ -31,12 +31,12 @@ import java.util.Map;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class ChandelierBlock extends BaseAttachedBlock implements RenderLayerProvider, BlockModelProvider { public class ChandelierBlock extends BaseAttachedBlock.Metal implements RenderLayerProvider, BlockModelProvider {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public ChandelierBlock(Block source) { public ChandelierBlock(Block source) {
super(FabricBlockSettings.copyOf(source) super(FabricBlockSettings.copyOf(source)
.luminance(15) .lightLevel((bs) -> 15)
.noCollission() .noCollission()
.noOcclusion() .noOcclusion()
.requiresCorrectToolForDrops()); .requiresCorrectToolForDrops());

View file

@ -1,7 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -20,18 +22,14 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class CrystalMossCoverBlock extends MultifaceBlock implements BonemealableBlock, SimpleWaterloggedBlock, RenderLayerProvider, AddMineableShears {
public class CrystalMossCoverBlock extends MultifaceBlock implements BonemealableBlock, SimpleWaterloggedBlock, RenderLayerProvider {
private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
private final MultifaceSpreader spreader = new MultifaceSpreader(this); private final MultifaceSpreader spreader = new MultifaceSpreader(this);
public CrystalMossCoverBlock(MapColor color) { public CrystalMossCoverBlock(MapColor color) {
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT, color) super(BehaviourBuilders.createReplaceablePlant(color)
.noCollission()
.strength(0.2f) .strength(0.2f)
.sound(SoundType.GLOW_LICHEN) .sound(SoundType.GLOW_LICHEN)
.lightLevel(GlowLichenBlock.emission(7))); .lightLevel(GlowLichenBlock.emission(7)));

View file

@ -1,14 +1,11 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourSnow;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.world.level.block.SoundType; public class DenseSnowBlock extends BaseBlock implements BehaviourSnow {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class DenseSnowBlock extends BaseBlock {
public DenseSnowBlock() { public DenseSnowBlock() {
super(FabricBlockSettings.of(Material.SNOW).strength(0.2F).sound(SoundType.SNOW)); super(BehaviourBuilders.createSnow());
} }
} }

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -8,7 +10,6 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
@ -21,12 +22,12 @@ import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
public class EndLotusFlowerBlock extends EndPlantBlock { public class EndLotusFlowerBlock extends EndPlantBlock implements BehaviourPlant {
private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14);
private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16); private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
public EndLotusFlowerBlock() { public EndLotusFlowerBlock() {
super(basePlantSettings(15).offsetType(BlockBehaviour.OffsetType.NONE)); super(BehaviourBuilders.createPlant().lightLevel((bs) -> 15));
} }
@Override @Override

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.blocks.BaseBlockNotFull; import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape; import org.betterx.bclib.blocks.BlockProperties.TripleShape;
@ -21,22 +23,20 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.material.WaterFluid; import net.minecraft.world.level.material.WaterFluid;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class EndLotusLeafBlock extends BaseBlockNotFull implements RenderLayerProvider { public class EndLotusLeafBlock extends BaseBlockNotFull implements RenderLayerProvider, BehaviourPlant {
public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16); private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16);
public EndLotusLeafBlock() { public EndLotusLeafBlock() {
super(FabricBlockSettings.of(Material.PLANT).noOcclusion().sound(SoundType.WET_GRASS)); super(BehaviourBuilders.createPlant().noOcclusion().sound(SoundType.WET_GRASS));
} }
@Override @Override

View file

@ -50,7 +50,7 @@ public class EndPortalBlock extends NetherPortalBlock implements RenderLayerProv
public EndPortalBlock() { public EndPortalBlock() {
super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL) super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL)
.resistance(Blocks.BEDROCK.getExplosionResistance()) .resistance(Blocks.BEDROCK.getExplosionResistance())
.luminance(15)); .lightLevel((bs) -> 15));
} }
@Override @Override

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockWithEntity; import org.betterx.bclib.blocks.BaseBlockWithEntity;
import org.betterx.bclib.interfaces.AlloyingRecipeWorkstation; import org.betterx.bclib.interfaces.AlloyingRecipeWorkstation;
import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity; import org.betterx.betterend.blocks.entities.EndStoneSmelterBlockEntity;
@ -27,7 +28,6 @@ import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
@ -35,25 +35,23 @@ import net.minecraft.world.phys.BlockHitResult;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class EndStoneSmelter extends BaseBlockWithEntity implements AlloyingRecipeWorkstation { public class EndStoneSmelter extends BaseBlockWithEntity.Stone implements AlloyingRecipeWorkstation {
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final BooleanProperty LIT = BlockStateProperties.LIT; public static final BooleanProperty LIT = BlockStateProperties.LIT;
public static final String ID = "end_stone_smelter"; public static final String ID = "end_stone_smelter";
public EndStoneSmelter() { public EndStoneSmelter() {
super(FabricBlockSettings.of(Material.STONE, MapColor.COLOR_GRAY) super(BehaviourBuilders.createStone(MapColor.COLOR_YELLOW)
.luminance(state -> state.getValue(LIT) ? 15 : 0) .lightLevel(state -> state.getValue(LIT) ? 15 : 0)
.hardness(4F) .strength(4F, 100F)
.resistance(100F)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.STONE)); );
registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false)); registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false));
} }

View file

@ -1,26 +1,26 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class EnderBlock extends BaseBlock { public class EnderBlock extends BaseBlock.Stone {
public EnderBlock() { public EnderBlock() {
super(FabricBlockSettings.of(Material.STONE, MapColor.WARPED_WART_BLOCK) super(BehaviourBuilders
.hardness(5F) .createStone(MapColor.WARPED_WART_BLOCK)
.resistance(6F) .strength(5F, 6F)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.sound(SoundType.STONE)); .sound(SoundType.STONE)
);
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)

View file

@ -1,17 +1,13 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
public class FilaluxLanternBlock extends BaseBlock.Wood {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class FilaluxLanternBlock extends BaseBlock implements AddMineableAxe {
public FilaluxLanternBlock() { public FilaluxLanternBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(Properties.of()
.luminance(15) .lightLevel((bs) -> 15)
.sound(SoundType.WOOD)); .sound(SoundType.WOOD));
} }
} }

View file

@ -1,33 +1,32 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.blocks.BaseAttachedBlock; import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import java.util.EnumMap; import java.util.EnumMap;
public class FilaluxWingsBlock extends BaseAttachedBlock implements RenderLayerProvider, AddMineableShears { public class FilaluxWingsBlock extends BaseAttachedBlock implements RenderLayerProvider, BehaviourPlant {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public FilaluxWingsBlock() { public FilaluxWingsBlock() {
super(FabricBlockSettings.of(Material.PLANT) super(BehaviourBuilders
.createPlant()
.sound(SoundType.WET_GRASS) .sound(SoundType.WET_GRASS)
.noCollission()); );
} }
@Override @Override

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.interfaces.CustomItemProvider; import org.betterx.bclib.interfaces.CustomItemProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears; import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
@ -24,11 +26,12 @@ import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, AddMineableShears { public class FlamaeaBlock extends EndPlantBlock implements CustomItemProvider, BehaviourPlant, AddMineableShears {
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16); private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
public FlamaeaBlock() { public FlamaeaBlock() {
super(basePlantSettings() super(BehaviourBuilders
.createPlant()
.sound(SoundType.WET_GRASS) .sound(SoundType.WET_GRASS)
.offsetType(BlockBehaviour.OffsetType.NONE) .offsetType(BlockBehaviour.OffsetType.NONE)
); );

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.client.models.ModelsHelper; import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -10,17 +12,18 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
public class FlammalixBlock extends EndPlantBlock { public class FlammalixBlock extends EndPlantBlock implements BehaviourPlant {
private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14);
public FlammalixBlock() { public FlammalixBlock() {
super(basePlantSettings(12).offsetType(OffsetType.NONE)); super(BehaviourBuilders.createPlant(MapColor.COLOR_ORANGE).lightLevel((bs) -> 12));
} }
@Override @Override

View file

@ -5,13 +5,11 @@ import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
public class GlowingHymenophoreBlock extends BaseBlock.Wood implements AddMineableAxe {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class GlowingHymenophoreBlock extends BaseBlock implements AddMineableAxe {
public GlowingHymenophoreBlock() { public GlowingHymenophoreBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(Properties.of()
.luminance(15) .lightLevel((bs) -> 15)
.sound(SoundType.WART_BLOCK)); .sound(SoundType.WART_BLOCK)
);
} }
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableShears; import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -14,19 +15,16 @@ import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineableShears { public class GlowingPillarLuminophorBlock extends BaseBlock implements AddMineableShears {
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
public GlowingPillarLuminophorBlock() { public GlowingPillarLuminophorBlock() {
super(FabricBlockSettings.of(Material.LEAVES) super(BehaviourBuilders
.mapColor(MapColor.COLOR_ORANGE) .createMetal(MapColor.COLOR_ORANGE)
.strength(0.2F) .strength(0.2F)
.luminance(15) .lightLevel((bs) -> 15)
.sound(SoundType.GRASS)); .sound(SoundType.GRASS));
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape; import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears; import org.betterx.bclib.interfaces.tools.AddMineableShears;
@ -17,18 +18,16 @@ import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddMineableShears { public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock implements AddMineableShears {
public GlowingPillarSeedBlock() { public GlowingPillarSeedBlock() {
super(FabricBlockSettings.of(Material.PLANT) super(BehaviourBuilders
.createPlant()
.sound(SoundType.GRASS) .sound(SoundType.GRASS)
.lightLevel(state -> state.getValue(AGE) * 3 + 3) .lightLevel(state -> state.getValue(AGE) * 3 + 3)
.randomTicks() .randomTicks()
.noCollission() .noCollission()
.offsetType(OffsetType.NONE)); );
} }
@Override @Override

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourLeaves;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.blocks.BaseLeavesBlock; import org.betterx.bclib.blocks.BaseLeavesBlock;
import org.betterx.bclib.interfaces.CustomColorProvider; import org.betterx.bclib.interfaces.CustomColorProvider;
@ -21,25 +23,19 @@ import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.List; import java.util.List;
public class HelixTreeLeavesBlock extends BaseBlock implements CustomColorProvider, AddMineableShears { public class HelixTreeLeavesBlock extends BaseBlock implements BehaviourLeaves, CustomColorProvider, AddMineableShears {
public static final IntegerProperty COLOR = EndBlockProperties.COLOR; public static final IntegerProperty COLOR = EndBlockProperties.COLOR;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
public HelixTreeLeavesBlock() { public HelixTreeLeavesBlock() {
super(FabricBlockSettings super(BehaviourBuilders
.of(Material.LEAVES) .createLeaves(MapColor.COLOR_ORANGE, true)
.mapColor(MapColor.COLOR_ORANGE)
.sound(SoundType.WART_BLOCK) .sound(SoundType.WART_BLOCK)
.sound(SoundType.GRASS)
.strength(0.2F)
); );
TagManager.BLOCKS.add(BlockTags.LEAVES, this); TagManager.BLOCKS.add(BlockTags.LEAVES, this);

View file

@ -1,26 +1,21 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor; import net.minecraft.world.level.material.MapColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class HydraluxPetalBlock extends BaseBlock.Wood {
public class HydraluxPetalBlock extends BaseBlock implements AddMineableAxe {
public HydraluxPetalBlock() { public HydraluxPetalBlock() {
this( this(
FabricBlockSettings BehaviourBuilders
.of(Material.PLANT) .createPlant(MapColor.PODZOL)
.hardness(1) .strength(1)
.resistance(1)
.mapColor(MapColor.PODZOL)
.sound(SoundType.WART_BLOCK) .sound(SoundType.WART_BLOCK)
); );
} }

View file

@ -1,8 +1,8 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockNotFull; import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.entities.BlockEntityHydrothermalVent; import org.betterx.betterend.blocks.entities.BlockEntityHydrothermalVent;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -30,27 +30,27 @@ import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock, AddMineablePickaxe { public class HydrothermalVentBlock extends BaseBlockNotFull.Stone implements EntityBlock, LiquidBlockContainer, SimpleWaterloggedBlock {
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE; public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15); private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
public HydrothermalVentBlock() { public HydrothermalVentBlock() {
super(FabricBlockSettings.of(Material.STONE) super(BehaviourBuilders
.createStone()
.sound(SoundType.STONE) .sound(SoundType.STONE)
.noCollission() .noCollission()
.requiresCorrectToolForDrops()); .requiresCorrectToolForDrops()
);
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false)); this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false));
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.PentaShape; import org.betterx.bclib.blocks.BlockProperties.PentaShape;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
@ -16,7 +17,7 @@ import net.minecraft.world.level.block.state.BlockState;
public class LanceleafSeedBlock extends EndPlantWithAgeBlock { public class LanceleafSeedBlock extends EndPlantWithAgeBlock {
public LanceleafSeedBlock() { public LanceleafSeedBlock() {
super(basePlantSettings().offsetType(OffsetType.NONE)); super(BehaviourBuilders.createPlant().offsetType(OffsetType.NONE));
} }
@Override @Override

View file

@ -1,8 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.blocks.BlockProperties.TripleShape; import org.betterx.bclib.blocks.BlockProperties.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock; import org.betterx.betterend.blocks.basis.EndPlantBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
@ -19,15 +20,15 @@ import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShears { public class LargeAmaranitaBlock extends EndPlantBlock implements BehaviourPlant {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; 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_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); private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM);
public LargeAmaranitaBlock() { public LargeAmaranitaBlock() {
super(basePlantSettings() super(BehaviourBuilders
.createPlant()
.lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0) .lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)
.offsetType(OffsetType.NONE)
); );
} }

View file

@ -1,9 +1,9 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockNotFull; import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -20,20 +20,18 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableAxe { public class LumecornBlock extends BaseBlockNotFull.Wood implements RenderLayerProvider {
public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create( public static final EnumProperty<EndBlockProperties.LumecornShape> SHAPE = EnumProperty.create(
"shape", "shape",
EndBlockProperties.LumecornShape.class EndBlockProperties.LumecornShape.class
@ -42,9 +40,11 @@ public class LumecornBlock extends BaseBlockNotFull implements RenderLayerProvid
private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10); private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10);
public LumecornBlock() { public LumecornBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(BehaviourBuilders
.hardness(0.5F) .createWood()
.luminance(state -> state.getValue(SHAPE).getLight())); .strength(0.5F)
.lightLevel(state -> state.getValue(SHAPE).getLight())
);
} }
@Override @Override

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourSeed;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock; import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndFeatures; import org.betterx.betterend.registry.EndFeatures;
@ -14,10 +16,10 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
import java.util.Optional; import java.util.Optional;
public class LumecornSeedBlock extends EndPlantWithAgeBlock { public class LumecornSeedBlock extends EndPlantWithAgeBlock implements BehaviourSeed {
public LumecornSeedBlock() { public LumecornSeedBlock() {
super(basePlantSettings().offsetType(OffsetType.NONE)); super(BehaviourBuilders.createPlant());
} }
@Override @Override

View file

@ -3,6 +3,7 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlockNotFull; import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableHoe;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
@ -18,7 +19,6 @@ import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -30,7 +30,7 @@ import com.google.common.collect.Lists;
import java.util.Queue; import java.util.Queue;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerProvider { public class MengerSpongeBlock extends BaseBlockNotFull implements RenderLayerProvider, AddMineableHoe {
private static final VoxelShape SHAPE; private static final VoxelShape SHAPE;
public MengerSpongeBlock() { public MengerSpongeBlock() {

View file

@ -1,12 +1,10 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourWood;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.interfaces.TagProvider;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.worlds.together.tag.v3.MineableTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
@ -14,16 +12,11 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
public class MossyGlowshroomCapBlock extends BaseBlock implements BehaviourWood {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.List;
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION; public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION;
public MossyGlowshroomCapBlock() { public MossyGlowshroomCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD)); super(BehaviourBuilders.createWood().sound(SoundType.WOOD));
this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false)); this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false));
} }
@ -39,9 +32,4 @@ public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) { protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(TRANSITION); builder.add(TRANSITION);
} }
@Override
public void addTags(List<TagKey<Block>> blockTags, List<TagKey<Item>> itemTags) {
blockTags.add(MineableTags.AXE);
}
} }

View file

@ -8,6 +8,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class NeonCactusBlock extends LitPillarBlock { public class NeonCactusBlock extends LitPillarBlock {
public NeonCactusBlock() { public NeonCactusBlock() {
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15)); super(FabricBlockSettings.copyOf(Blocks.CACTUS).lightLevel((bs) -> 15));
} }
} }

View file

@ -60,7 +60,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate
private static final int MAX_LENGTH = 12; private static final int MAX_LENGTH = 12;
public NeonCactusPlantBlock() { public NeonCactusPlantBlock() {
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15).randomTicks()); super(FabricBlockSettings.copyOf(Blocks.CACTUS).lightLevel((bs) -> 15).randomTicks());
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false) registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false)
.setValue(FACING, Direction.UP) .setValue(FACING, Direction.UP)
.setValue(SHAPE, TripleShape.TOP)); .setValue(SHAPE, TripleShape.TOP));

View file

@ -48,7 +48,7 @@ import com.google.common.collect.Lists;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class RespawnObeliskBlock extends BaseBlock implements CustomColorProvider, RenderLayerProvider { public class RespawnObeliskBlock extends BaseBlock.Stone implements CustomColorProvider, RenderLayerProvider {
private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15); private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15);
private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14); private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14);

View file

@ -30,21 +30,17 @@ import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; public class SilkMothHiveBlock extends BaseBlock.Wood {
public class SilkMothHiveBlock extends BaseBlock {
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
public SilkMothHiveBlock() { public SilkMothHiveBlock() {
super(FabricBlockSettings.of(Material.WOOD) super(Properties.of().of()
.hardness(0.5F) .strength(0.5F, 0.1f)
.resistance(0.1F)
.sound(SoundType.WOOL) .sound(SoundType.WOOL)
.noOcclusion() .noOcclusion()
.randomTicks()); .randomTicks());

View file

@ -3,6 +3,7 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock; import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.items.tool.BaseShearsItem; import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
@ -33,7 +34,6 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty; import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.BlockHitResult;
@ -46,7 +46,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider { public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider, AddMineableShears {
public static final BooleanProperty ACTIVE = EndBlockProperties.ACTIVE; public static final BooleanProperty ACTIVE = EndBlockProperties.ACTIVE;
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
@ -54,7 +54,7 @@ public class SilkMothNestBlock extends BaseBlock implements RenderLayerProvider
private static final VoxelShape BOTTOM = box(0, 0, 0, 16, 16, 16); private static final VoxelShape BOTTOM = box(0, 0, 0, 16, 16, 16);
public SilkMothNestBlock() { public SilkMothNestBlock() {
super(FabricBlockSettings.of(Material.WOOL) super(FabricBlockSettings.copyOf(Blocks.WHITE_WOOL)
.hardness(0.5F) .hardness(0.5F)
.resistance(0.1F) .resistance(0.1F)
.sound(SoundType.WOOL) .sound(SoundType.WOOL)

View file

@ -1,5 +1,7 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.blocks.BaseAttachedBlock; import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
@ -25,7 +27,6 @@ import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
@ -34,7 +35,6 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -43,11 +43,11 @@ import java.util.EnumMap;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant { public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLayerProvider, BonemealableBlock, PottablePlant, BehaviourPlant {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
public SmallJellyshroomBlock() { public SmallJellyshroomBlock() {
super(FabricBlockSettings.of(Material.PLANT).sound(SoundType.NETHER_WART).noCollission()); super(BehaviourBuilders.createPlant().sound(SoundType.NETHER_WART));
} }
@Override @Override

View file

@ -1,19 +1,17 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe; import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourGlass;
import org.betterx.betterend.blocks.basis.LitPillarBlock; import org.betterx.betterend.blocks.basis.LitPillarBlock;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
public class SmaragdantCrystalBlock extends LitPillarBlock implements BehaviourGlass {
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class SmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
public SmaragdantCrystalBlock() { public SmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS) super(BehaviourBuilders
.luminance(15) .createGlass()
.hardness(1F) .lightLevel((bs) -> 15)
.resistance(1F) .strength(1F)
.noOcclusion() .noOcclusion()
.sound(SoundType.AMETHYST)); .sound(SoundType.AMETHYST));
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks; package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseAttachedBlock; import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
@ -19,13 +20,14 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.*; import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import java.util.EnumMap; import java.util.EnumMap;
@ -36,12 +38,12 @@ public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements Ad
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SmaragdantCrystalShardBlock() { public SmaragdantCrystalShardBlock() {
super(FabricBlockSettings.of(Material.STONE) super(BehaviourBuilders.createStone(MapColor.COLOR_GREEN)
.materialColor(MapColor.COLOR_GREEN) .lightLevel((bs) -> 15)
.luminance(15)
.sound(SoundType.AMETHYST_CLUSTER) .sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.noCollission()); .noCollission()
);
} }
@Override @Override

View file

@ -3,7 +3,6 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock; import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.MHelper; import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks; import org.betterx.betterend.registry.EndBlocks;
import org.betterx.betterend.registry.EndItems; import org.betterx.betterend.registry.EndItems;
@ -24,14 +23,15 @@ import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.*; import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -40,14 +40,14 @@ import java.util.EnumMap;
import java.util.List; import java.util.List;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class SulphurCrystalBlock extends BaseAttachedBlock implements AddMineablePickaxe, RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer { public class SulphurCrystalBlock extends BaseAttachedBlock.Glass implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); 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 IntegerProperty AGE = IntegerProperty.create("age", 0, 2);
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SulphurCrystalBlock() { public SulphurCrystalBlock() {
super(FabricBlockSettings.of(Material.STONE) super(Properties.of()
.materialColor(MapColor.COLOR_YELLOW) .mapColor(MapColor.COLOR_YELLOW)
.sound(SoundType.GLASS) .sound(SoundType.GLASS)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.noCollission()); .noCollission());

View file

@ -25,14 +25,14 @@ import net.minecraft.world.phys.BlockHitResult;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class UmbrellaTreeClusterBlock extends BaseBlock { public class UmbrellaTreeClusterBlock extends BaseBlock.Wood {
public static final BooleanProperty NATURAL = BlockProperties.NATURAL; public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
public UmbrellaTreeClusterBlock() { public UmbrellaTreeClusterBlock() {
super(FabricBlockSettings super(FabricBlockSettings
.copyOf(Blocks.NETHER_WART_BLOCK) .copyOf(Blocks.NETHER_WART_BLOCK)
.mapColor(MapColor.COLOR_PURPLE) .mapColor(MapColor.COLOR_PURPLE)
.luminance(15) .lightLevel((bs) -> 15)
); );
registerDefaultState(stateDefinition.any().setValue(NATURAL, false)); registerDefaultState(stateDefinition.any().setValue(NATURAL, false));
} }

View file

@ -23,7 +23,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
@ -36,7 +35,7 @@ import java.util.Optional;
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer { public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
public VentBubbleColumnBlock() { public VentBubbleColumnBlock() {
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).nonOpaque().noCollision().noLootTable()); super(FabricBlockSettings.copyOf(Blocks.BUBBLE_COLUMN).nonOpaque().noCollision().noLootTable());
} }
@Override @Override

View file

@ -31,12 +31,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Map; import java.util.Map;
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer { public class EndLanternBlock extends BaseBlockNotFull.Wood implements SimpleWaterloggedBlock, LiquidBlockContainer {
public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR; public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR;
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public EndLanternBlock(Block source) { public EndLanternBlock(Block source) {
this(FabricBlockSettings.copyOf(source).luminance(15).noOcclusion()); this(FabricBlockSettings.copyOf(source).lightLevel((bs) -> 15).noOcclusion());
} }
public EndLanternBlock(Properties settings) { public EndLanternBlock(Properties settings) {

View file

@ -1,11 +1,12 @@
package org.betterx.betterend.blocks.basis; package org.betterx.betterend.blocks.basis;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.blocks.BasePlantWithAgeBlock; import org.betterx.bclib.blocks.BasePlantWithAgeBlock;
import org.betterx.worlds.together.tag.v3.CommonBlockTags; import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock { public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock implements BehaviourPlant {
protected EndPlantWithAgeBlock() { protected EndPlantWithAgeBlock() {
super(); super();
} }

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks.basis; package org.betterx.betterend.blocks.basis;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseAttachedBlock; import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer; import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider; import org.betterx.bclib.interfaces.RenderLayerProvider;
@ -18,15 +19,12 @@ import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
@ -39,20 +37,19 @@ public class FurBlock extends BaseAttachedBlock implements RenderLayerProvider,
private final int dropChance; private final int dropChance;
public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) { public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) {
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) super(BehaviourBuilders.createReplaceablePlant()
.luminance(light) .lightLevel(bs -> light)
.sound(wet ? SoundType.WET_GRASS : SoundType.GRASS) .sound(wet ? SoundType.WET_GRASS : SoundType.GRASS)
.noCollission()); );
this.drop = drop; this.drop = drop;
this.dropChance = dropChance; this.dropChance = dropChance;
TagManager.BLOCKS.add(BlockTags.LEAVES, this); TagManager.BLOCKS.add(BlockTags.LEAVES, this);
} }
public FurBlock(ItemLike drop, int dropChance) { public FurBlock(ItemLike drop, int dropChance) {
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) super(BehaviourBuilders.createReplaceablePlant()
.sound(SoundType.GRASS) .sound(SoundType.GRASS)
.noCollission()); );
this.drop = drop; this.drop = drop;
this.dropChance = dropChance; this.dropChance = dropChance;
TagManager.BLOCKS.add(BlockTags.LEAVES, this); TagManager.BLOCKS.add(BlockTags.LEAVES, this);

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks.basis; package org.betterx.betterend.blocks.basis;
import org.betterx.bclib.behaviours.interfaces.BehaviourWood;
import org.betterx.bclib.client.models.ModelsHelper; import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.interfaces.CustomColorProvider; import org.betterx.bclib.interfaces.CustomColorProvider;
import org.betterx.betterend.client.models.Patterns; import org.betterx.betterend.client.models.Patterns;
@ -23,12 +24,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Optional; import java.util.Optional;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
public class StoneLanternBlock extends EndLanternBlock implements CustomColorProvider { public class StoneLanternBlock extends EndLanternBlock implements CustomColorProvider, BehaviourWood {
private static final VoxelShape SHAPE_CEIL = box(3, 1, 3, 13, 16, 13); private static final VoxelShape SHAPE_CEIL = box(3, 1, 3, 13, 16, 13);
private static final VoxelShape SHAPE_FLOOR = box(3, 0, 3, 13, 15, 13); private static final VoxelShape SHAPE_FLOOR = box(3, 0, 3, 13, 15, 13);
public StoneLanternBlock(Block source) { public StoneLanternBlock(Block source) {
super(FabricBlockSettings.copyOf(source).luminance(15)); super(FabricBlockSettings.copyOf(source).lightLevel((bs) -> 15));
} }
@Override @Override

View file

@ -171,7 +171,7 @@ public class MetalMaterial {
BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings) BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings)
.hardness(1) .hardness(1)
.resistance(1) .resistance(1)
.luminance(15) .lightLevel((bs) -> 15)
.sound(SoundType.LANTERN); .sound(SoundType.LANTERN);
final int level = material.getLevel(); final int level = material.getLevel();