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

@ -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