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;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock;
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.Item;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.material.MapColor;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class AeterniumBlock extends BaseBlock implements CustomItemProvider {
public class AeterniumBlock extends BaseBlock.Metal implements CustomItemProvider {
public AeterniumBlock() {
super(FabricBlockSettings
.of(Material.METAL, MapColor.COLOR_GRAY)
.hardness(65F)
.resistance(1200F)
super(BehaviourBuilders
.createMetal(MapColor.COLOR_GRAY)
.strength(65F, 1200F)
.requiresCorrectToolForDrops()
.sound(SoundType.NETHERITE_BLOCK)
);

View file

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

View file

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

View file

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

View file

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

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
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);
public BoluxMushroomBlock() {
super(basePlantSettings(10).offsetType(BlockBehaviour.OffsetType.NONE));
super(BehaviourBuilders.createPlant().lightLevel((bs)->10));
}
@Override

View file

@ -1,6 +1,7 @@
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.betterend.blocks.basis.LitPillarBlock;
import org.betterx.betterend.registry.EndBlocks;
@ -14,24 +15,21 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.PushReaction;
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.List;
public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements BehaviourGlass {
public BuddingSmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS)
.luminance(15)
.hardness(1F)
.resistance(1F)
.noOcclusion()
.sound(SoundType.AMETHYST)
.randomTicks());
super(BehaviourBuilders
.createGlass()
.lightLevel((bs) -> 15)
.strength(1F)
.noOcclusion()
.sound(SoundType.AMETHYST)
.randomTicks());
}
@Override
@ -53,8 +51,12 @@ public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements Add
if (random.nextInt(20) == 0) {
if (canShardGrowAtState(sideState)) {
BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState()
.setValue(SmaragdantCrystalShardBlock.WATERLOGGED, sideState.getFluidState().getType() == Fluids.WATER)
.setValue(SmaragdantCrystalShardBlock.FACING, dir);
.setValue(
SmaragdantCrystalShardBlock.WATERLOGGED,
sideState.getFluidState()
.getType() == Fluids.WATER
)
.setValue(SmaragdantCrystalShardBlock.FACING, dir);
world.setBlockAndUpdate(side, shard);
}
}

View file

@ -1,10 +1,11 @@
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.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.BlockModelProvider;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.betterend.blocks.basis.EndLanternBlock;
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.SoundType;
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.VoxelShape;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps;
@ -30,18 +29,16 @@ import java.util.Map;
import java.util.Optional;
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_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
public BulbVineLanternBlock() {
this(FabricBlockSettings.of(Material.METAL)
.hardness(1)
.resistance(1)
.mapColor(MapColor.COLOR_LIGHT_GRAY)
.luminance(15)
.requiresCorrectToolForDrops()
.sound(SoundType.LANTERN));
this(BehaviourBuilders.createMetal(MapColor.COLOR_LIGHT_GRAY)
.strength(1)
.lightLevel((bs) -> 15)
.requiresCorrectToolForDrops()
.sound(SoundType.LANTERN));
}
public BulbVineLanternBlock(Properties settings) {

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
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.WorldGenLevel;
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.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
public CavePumpkinVineBlock() {
super(basePlantSettings().offsetType(BlockBehaviour.OffsetType.NONE));
super(BehaviourBuilders.createPlant());
}
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 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);
public ChandelierBlock(Block source) {
super(FabricBlockSettings.copyOf(source)
.luminance(15)
.lightLevel((bs) -> 15)
.noCollission()
.noOcclusion()
.requiresCorrectToolForDrops());

View file

@ -1,7 +1,9 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.registry.EndBlocks;
import net.minecraft.core.BlockPos;
@ -20,21 +22,17 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
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 {
public class CrystalMossCoverBlock extends MultifaceBlock implements BonemealableBlock, SimpleWaterloggedBlock, RenderLayerProvider, AddMineableShears {
private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
private final MultifaceSpreader spreader = new MultifaceSpreader(this);
public CrystalMossCoverBlock(MapColor color) {
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT, color)
.noCollission()
.strength(0.2f)
.sound(SoundType.GLOW_LICHEN)
.lightLevel(GlowLichenBlock.emission(7)));
super(BehaviourBuilders.createReplaceablePlant(color)
.strength(0.2f)
.sound(SoundType.GLOW_LICHEN)
.lightLevel(GlowLichenBlock.emission(7)));
this.registerDefaultState(this.defaultBlockState().setValue(WATERLOGGED, false));
}

View file

@ -1,14 +1,11 @@
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 net.minecraft.world.level.block.SoundType;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class DenseSnowBlock extends BaseBlock {
public class DenseSnowBlock extends BaseBlock implements BehaviourSnow {
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;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.behaviours.interfaces.BehaviourPlant;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
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.level.BlockGetter;
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.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext;
@ -21,12 +22,12 @@ import com.google.common.collect.Lists;
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_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
public EndLotusFlowerBlock() {
super(basePlantSettings(15).offsetType(BlockBehaviour.OffsetType.NONE));
super(BehaviourBuilders.createPlant().lightLevel((bs) -> 15));
}
@Override

View file

@ -1,5 +1,7 @@
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.BlockProperties;
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.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.material.WaterFluid;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType;
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<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16);
public EndLotusLeafBlock() {
super(FabricBlockSettings.of(Material.PLANT).noOcclusion().sound(SoundType.WET_GRASS));
super(BehaviourBuilders.createPlant().noOcclusion().sound(SoundType.WET_GRASS));
}
@Override

View file

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

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockWithEntity;
import org.betterx.bclib.interfaces.AlloyingRecipeWorkstation;
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.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.storage.loot.LootParams;
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.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists;
import java.util.List;
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 BooleanProperty LIT = BlockStateProperties.LIT;
public static final String ID = "end_stone_smelter";
public EndStoneSmelter() {
super(FabricBlockSettings.of(Material.STONE, MapColor.COLOR_GRAY)
.luminance(state -> state.getValue(LIT) ? 15 : 0)
.hardness(4F)
.resistance(100F)
.requiresCorrectToolForDrops()
.sound(SoundType.STONE));
super(BehaviourBuilders.createStone(MapColor.COLOR_YELLOW)
.lightLevel(state -> state.getValue(LIT) ? 15 : 0)
.strength(4F, 100F)
.requiresCorrectToolForDrops()
);
registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false));
}

View file

@ -1,26 +1,26 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlock;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor;
import net.fabricmc.api.EnvType;
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() {
super(FabricBlockSettings.of(Material.STONE, MapColor.WARPED_WART_BLOCK)
.hardness(5F)
.resistance(6F)
.requiresCorrectToolForDrops()
.sound(SoundType.STONE));
super(BehaviourBuilders
.createStone(MapColor.WARPED_WART_BLOCK)
.strength(5F, 6F)
.requiresCorrectToolForDrops()
.sound(SoundType.STONE)
);
}
@Environment(EnvType.CLIENT)

View file

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

View file

@ -1,33 +1,32 @@
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.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps;
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);
public FilaluxWingsBlock() {
super(FabricBlockSettings.of(Material.PLANT)
.sound(SoundType.WET_GRASS)
.noCollission());
super(BehaviourBuilders
.createPlant()
.sound(SoundType.WET_GRASS)
);
}
@Override

View file

@ -1,5 +1,7 @@
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.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
@ -24,11 +26,12 @@ import com.google.common.collect.Lists;
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);
public FlamaeaBlock() {
super(basePlantSettings()
super(BehaviourBuilders
.createPlant()
.sound(SoundType.WET_GRASS)
.offsetType(BlockBehaviour.OffsetType.NONE)
);

View file

@ -1,5 +1,7 @@
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.betterend.blocks.basis.EndPlantBlock;
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.block.Block;
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.VoxelShape;
import net.fabricmc.api.EnvType;
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);
public FlammalixBlock() {
super(basePlantSettings(12).offsetType(OffsetType.NONE));
super(BehaviourBuilders.createPlant(MapColor.COLOR_ORANGE).lightLevel((bs) -> 12));
}
@Override

View file

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

View file

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

View file

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

View file

@ -1,5 +1,7 @@
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.BaseLeavesBlock;
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.StateDefinition;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.storage.loot.LootParams;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
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;
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);
public HelixTreeLeavesBlock() {
super(FabricBlockSettings
.of(Material.LEAVES)
.mapColor(MapColor.COLOR_ORANGE)
super(BehaviourBuilders
.createLeaves(MapColor.COLOR_ORANGE, true)
.sound(SoundType.WART_BLOCK)
.sound(SoundType.GRASS)
.strength(0.2F)
);
TagManager.BLOCKS.add(BlockTags.LEAVES, this);

View file

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

View file

@ -1,8 +1,8 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.BlocksHelper;
import org.betterx.betterend.blocks.entities.BlockEntityHydrothermalVent;
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.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.jetbrains.annotations.Nullable;
@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 ACTIVATED = BlockProperties.ACTIVE;
private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15);
public HydrothermalVentBlock() {
super(FabricBlockSettings.of(Material.STONE)
.sound(SoundType.STONE)
.noCollission()
.requiresCorrectToolForDrops());
super(BehaviourBuilders
.createStone()
.sound(SoundType.STONE)
.noCollission()
.requiresCorrectToolForDrops()
);
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false));
}

View file

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

View file

@ -1,8 +1,9 @@
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.TripleShape;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.betterend.blocks.basis.EndPlantBlock;
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.VoxelShape;
public class LargeAmaranitaBlock extends EndPlantBlock implements AddMineableShears {
public class LargeAmaranitaBlock extends EndPlantBlock implements BehaviourPlant {
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(basePlantSettings()
super(BehaviourBuilders
.createPlant()
.lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)
.offsetType(OffsetType.NONE)
);
}

View file

@ -1,9 +1,9 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseBlockNotFull;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
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.StateDefinition;
import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Collections;
import java.util.List;
@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(
"shape",
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);
public LumecornBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.hardness(0.5F)
.luminance(state -> state.getValue(SHAPE).getLight()));
super(BehaviourBuilders
.createWood()
.strength(0.5F)
.lightLevel(state -> state.getValue(SHAPE).getLight())
);
}
@Override

View file

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

View file

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

View file

@ -1,12 +1,10 @@
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.interfaces.TagProvider;
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.level.block.Block;
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.properties.BooleanProperty;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.List;
public class MossyGlowshroomCapBlock extends BaseBlock implements TagProvider {
public class MossyGlowshroomCapBlock extends BaseBlock implements BehaviourWood {
public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION;
public MossyGlowshroomCapBlock() {
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
super(BehaviourBuilders.createWood().sound(SoundType.WOOD));
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) {
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 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;
public NeonCactusPlantBlock() {
super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15).randomTicks());
super(FabricBlockSettings.copyOf(Blocks.CACTUS).lightLevel((bs) -> 15).randomTicks());
registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false)
.setValue(FACING, Direction.UP)
.setValue(SHAPE, TripleShape.TOP));

View file

@ -48,7 +48,7 @@ import com.google.common.collect.Lists;
import java.util.List;
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_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14);

View file

@ -30,24 +30,20 @@ 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.DirectionProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class SilkMothHiveBlock extends BaseBlock {
public class SilkMothHiveBlock extends BaseBlock.Wood {
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS;
public SilkMothHiveBlock() {
super(FabricBlockSettings.of(Material.WOOD)
.hardness(0.5F)
.resistance(0.1F)
.sound(SoundType.WOOL)
.noOcclusion()
.randomTicks());
super(Properties.of().of()
.strength(0.5F, 0.1f)
.sound(SoundType.WOOL)
.noOcclusion()
.randomTicks());
this.registerDefaultState(defaultBlockState().setValue(FULLNESS, 0));
}

View file

@ -3,6 +3,7 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineableShears;
import org.betterx.bclib.items.tool.BaseShearsItem;
import org.betterx.bclib.util.BlocksHelper;
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.DirectionProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.phys.AABB;
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.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 DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
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);
public SilkMothNestBlock() {
super(FabricBlockSettings.of(Material.WOOL)
super(FabricBlockSettings.copyOf(Blocks.WHITE_WOOL)
.hardness(0.5F)
.resistance(0.1F)
.sound(SoundType.WOOL)

View file

@ -1,5 +1,7 @@
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.client.render.BCLRenderLayer;
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.state.BlockState;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.storage.loot.LootParams;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
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.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@ -43,11 +43,11 @@ import java.util.EnumMap;
import java.util.List;
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);
public SmallJellyshroomBlock() {
super(FabricBlockSettings.of(Material.PLANT).sound(SoundType.NETHER_WART).noCollission());
super(BehaviourBuilders.createPlant().sound(SoundType.NETHER_WART));
}
@Override

View file

@ -1,20 +1,18 @@
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 net.minecraft.world.level.block.SoundType;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
public class SmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
public class SmaragdantCrystalBlock extends LitPillarBlock implements BehaviourGlass {
public SmaragdantCrystalBlock() {
super(FabricBlockSettings.of(Material.GLASS)
.luminance(15)
.hardness(1F)
.resistance(1F)
.noOcclusion()
.sound(SoundType.AMETHYST));
super(BehaviourBuilders
.createGlass()
.lightLevel((bs) -> 15)
.strength(1F)
.noOcclusion()
.sound(SoundType.AMETHYST));
}
}

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks;
import org.betterx.bclib.behaviours.BehaviourBuilders;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
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.properties.BlockStateProperties;
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.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import com.google.common.collect.Maps;
import java.util.EnumMap;
@ -36,12 +38,12 @@ public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements Ad
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SmaragdantCrystalShardBlock() {
super(FabricBlockSettings.of(Material.STONE)
.materialColor(MapColor.COLOR_GREEN)
.luminance(15)
.sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops()
.noCollission());
super(BehaviourBuilders.createStone(MapColor.COLOR_GREEN)
.lightLevel((bs) -> 15)
.sound(SoundType.AMETHYST_CLUSTER)
.requiresCorrectToolForDrops()
.noCollission()
);
}
@Override

View file

@ -3,7 +3,6 @@ package org.betterx.betterend.blocks;
import org.betterx.bclib.blocks.BaseAttachedBlock;
import org.betterx.bclib.client.render.BCLRenderLayer;
import org.betterx.bclib.interfaces.RenderLayerProvider;
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.registry.EndBlocks;
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.BooleanProperty;
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.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
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.Maps;
@ -40,17 +40,17 @@ import java.util.EnumMap;
import java.util.List;
@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);
public static final IntegerProperty AGE = IntegerProperty.create("age", 0, 2);
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public SulphurCrystalBlock() {
super(FabricBlockSettings.of(Material.STONE)
.materialColor(MapColor.COLOR_YELLOW)
.sound(SoundType.GLASS)
.requiresCorrectToolForDrops()
.noCollission());
super(Properties.of()
.mapColor(MapColor.COLOR_YELLOW)
.sound(SoundType.GLASS)
.requiresCorrectToolForDrops()
.noCollission());
}
@Override

View file

@ -25,14 +25,14 @@ import net.minecraft.world.phys.BlockHitResult;
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 UmbrellaTreeClusterBlock() {
super(FabricBlockSettings
.copyOf(Blocks.NETHER_WART_BLOCK)
.mapColor(MapColor.COLOR_PURPLE)
.luminance(15)
.lightLevel((bs) -> 15)
);
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.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
@ -36,7 +35,7 @@ import java.util.Optional;
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
public VentBubbleColumnBlock() {
super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).nonOpaque().noCollision().noLootTable());
super(FabricBlockSettings.copyOf(Blocks.BUBBLE_COLUMN).nonOpaque().noCollision().noLootTable());
}
@Override

View file

@ -31,12 +31,12 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Map;
@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 WATERLOGGED = BlockStateProperties.WATERLOGGED;
public EndLanternBlock(Block source) {
this(FabricBlockSettings.copyOf(source).luminance(15).noOcclusion());
this(FabricBlockSettings.copyOf(source).lightLevel((bs) -> 15).noOcclusion());
}
public EndLanternBlock(Properties settings) {

View file

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

View file

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

View file

@ -1,5 +1,6 @@
package org.betterx.betterend.blocks.basis;
import org.betterx.bclib.behaviours.interfaces.BehaviourWood;
import org.betterx.bclib.client.models.ModelsHelper;
import org.betterx.bclib.interfaces.CustomColorProvider;
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 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_FLOOR = box(3, 0, 3, 13, 15, 13);
public StoneLanternBlock(Block source) {
super(FabricBlockSettings.copyOf(source).luminance(15));
super(FabricBlockSettings.copyOf(source).lightLevel((bs) -> 15));
}
@Override

View file

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