[Change] Adopted changes in Bonemeal API

This commit is contained in:
Frank 2023-12-05 17:31:39 +01:00
parent bec94d96e6
commit 66b1aa50d5
41 changed files with 78 additions and 66 deletions

View file

@ -20,8 +20,7 @@ public interface BonemealNyliumLike extends BonemealableBlock {
default boolean isValidBonemealTarget( default boolean isValidBonemealTarget(
LevelReader blockGetter, LevelReader blockGetter,
BlockPos blockPos, BlockPos blockPos,
BlockState blockState, BlockState blockState
boolean bl
) { ) {
return blockGetter.getBlockState(blockPos.above()).isAir(); return blockGetter.getBlockState(blockPos.above()).isAir();
} }

View file

@ -21,11 +21,10 @@ public class FeatureSpreader implements BonemealNyliumLike {
public boolean isValidBonemealTarget( public boolean isValidBonemealTarget(
LevelReader blockGetter, LevelReader blockGetter,
BlockPos blockPos, BlockPos blockPos,
BlockState blockState, BlockState blockState
boolean bl
) { ) {
return spreadableFeature != null return spreadableFeature != null
&& BonemealNyliumLike.super.isValidBonemealTarget(blockGetter, blockPos, blockState, bl); && BonemealNyliumLike.super.isValidBonemealTarget(blockGetter, blockPos, blockState);
} }
@Override @Override

View file

@ -49,7 +49,7 @@ public abstract class BaseAnvilBlock extends AnvilBlock implements AddMineablePi
public IntegerProperty durability; public IntegerProperty durability;
public BaseAnvilBlock(MapColor color) { public BaseAnvilBlock(MapColor color) {
this(Properties.copy(Blocks.ANVIL).mapColor(color)); this(Properties.ofFullCopy(Blocks.ANVIL).mapColor(color));
} }
public BaseAnvilBlock(BlockBehaviour.Properties properties) { public BaseAnvilBlock(BlockBehaviour.Properties properties) {

View file

@ -48,7 +48,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseBarrelBlock extends BarrelBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseBarrelBlock> { public abstract class BaseBarrelBlock extends BarrelBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseBarrelBlock> {
BaseBarrelBlock(Block source) { BaseBarrelBlock(Block source) {
this(Properties.copy(source).noOcclusion()); this(Properties.ofFullCopy(source).noOcclusion());
} }
BaseBarrelBlock(BlockBehaviour.Properties properties) { BaseBarrelBlock(BlockBehaviour.Properties properties) {

View file

@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseBarsBlock extends IronBarsBlock implements BlockModelProvider, RenderLayerProvider, BehaviourMetal { public abstract class BaseBarsBlock extends IronBarsBlock implements BlockModelProvider, RenderLayerProvider, BehaviourMetal {
public BaseBarsBlock(Block source) { public BaseBarsBlock(Block source) {
this(Properties.copy(source).strength(5.0F, 6.0F).noOcclusion()); this(Properties.ofFullCopy(source).strength(5.0F, 6.0F).noOcclusion());
} }
public BaseBarsBlock(BlockBehaviour.Properties properties) { public BaseBarsBlock(BlockBehaviour.Properties properties) {

View file

@ -2,9 +2,11 @@ package org.betterx.bclib.blocks;
import org.betterx.bclib.behaviours.interfaces.BehaviourStone; import org.betterx.bclib.behaviours.interfaces.BehaviourStone;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.BaseEntityBlock; import net.minecraft.world.level.block.BaseEntityBlock;
import net.minecraft.world.level.block.PiglinWallSkullBlock;
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.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.LootParams;
@ -13,6 +15,7 @@ import java.util.Collections;
import java.util.List; import java.util.List;
public abstract class BaseBlockWithEntity extends BaseEntityBlock { public abstract class BaseBlockWithEntity extends BaseEntityBlock {
protected BaseBlockWithEntity(Properties settings) { protected BaseBlockWithEntity(Properties settings) {
super(settings); super(settings);
} }
@ -29,8 +32,14 @@ public abstract class BaseBlockWithEntity extends BaseEntityBlock {
} }
public static class Stone extends BaseBlockWithEntity implements BehaviourStone { public static class Stone extends BaseBlockWithEntity implements BehaviourStone {
public static final MapCodec<Stone> CODEC = simpleCodec(Stone::new);
public Stone(Properties settings) { public Stone(Properties settings) {
super(settings); super(settings);
} }
@Override
protected MapCodec<? extends BaseEntityBlock> codec() {
return Stone.CODEC;
}
} }
} }

View file

@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseBookshelfBlock extends BaseBlock implements TagProvider { public abstract class BaseBookshelfBlock extends BaseBlock implements TagProvider {
protected BaseBookshelfBlock(Block source) { protected BaseBookshelfBlock(Block source) {
this(Properties.copy(source)); this(Properties.ofFullCopy(source));
} }
protected BaseBookshelfBlock(BlockBehaviour.Properties properties) { protected BaseBookshelfBlock(BlockBehaviour.Properties properties) {

View file

@ -37,19 +37,18 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseButtonBlock> { public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseButtonBlock> {
private final Block parent; private final Block parent;
protected BaseButtonBlock(Block parent, Properties properties, boolean sensitive, BlockSetType type) { protected BaseButtonBlock(Block parent, Properties properties, BlockSetType type) {
this(parent, properties, 30, sensitive, type); this(parent, properties, 30, type);
} }
protected BaseButtonBlock( protected BaseButtonBlock(
Block parent, Block parent,
Properties properties, Properties properties,
int ticksToStayPressed, int ticksToStayPressed,
boolean sensitive,
BlockSetType type BlockSetType type
) { ) {
super( super(
properties.noCollission(), type, ticksToStayPressed, sensitive type, ticksToStayPressed, properties.noCollission()
); );
this.parent = parent; this.parent = parent;
} }
@ -130,13 +129,13 @@ public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelP
public static class Metal extends BaseButtonBlock implements BehaviourMetal { public static class Metal extends BaseButtonBlock implements BehaviourMetal {
public Metal(Block source, BlockSetType type) { public Metal(Block source, BlockSetType type) {
super(source, Properties.copy(source).noOcclusion(), false, type); super(source, Properties.ofFullCopy(source).noOcclusion(), type);
} }
} }
public static class Stone extends BaseButtonBlock implements BehaviourStone { public static class Stone extends BaseButtonBlock implements BehaviourStone {
public Stone(Block source, BlockSetType type) { public Stone(Block source, BlockSetType type) {
super(source, Properties.copy(source).noOcclusion(), false, type); super(source, Properties.ofFullCopy(source).noOcclusion(), type);
} }
@ -150,7 +149,7 @@ public abstract class BaseButtonBlock extends ButtonBlock implements BlockModelP
public static class Wood extends BaseButtonBlock implements BehaviourWood { public static class Wood extends BaseButtonBlock implements BehaviourWood {
public Wood(Block source, BlockSetType type) { public Wood(Block source, BlockSetType type) {
super(source, Properties.copy(source).strength(0.5F, 0.5F).noOcclusion(), true, type); super(source, Properties.ofFullCopy(source).strength(0.5F, 0.5F).noOcclusion(), type);
} }
@Override @Override

View file

@ -28,7 +28,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseChainBlock extends ChainBlock implements BlockModelProvider, RenderLayerProvider, DropSelfLootProvider<BaseChainBlock> { public abstract class BaseChainBlock extends ChainBlock implements BlockModelProvider, RenderLayerProvider, DropSelfLootProvider<BaseChainBlock> {
public BaseChainBlock(MapColor color) { public BaseChainBlock(MapColor color) {
this(Properties.copy(Blocks.CHAIN).mapColor(color)); this(Properties.ofFullCopy(Blocks.CHAIN).mapColor(color));
} }
public BaseChainBlock(BlockBehaviour.Properties properties) { public BaseChainBlock(BlockBehaviour.Properties properties) {

View file

@ -33,7 +33,7 @@ public abstract class BaseChestBlock extends ChestBlock implements BlockModelPro
private final Block parent; private final Block parent;
protected BaseChestBlock(Block source) { protected BaseChestBlock(Block source) {
super(Properties.copy(source).noOcclusion(), () -> BaseBlockEntities.CHEST); super(Properties.ofFullCopy(source).noOcclusion(), () -> BaseBlockEntities.CHEST);
this.parent = source; this.parent = source;
} }

View file

@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseComposterBlock extends ComposterBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseComposterBlock> { public abstract class BaseComposterBlock extends ComposterBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseComposterBlock> {
protected BaseComposterBlock(Block source) { protected BaseComposterBlock(Block source) {
super(Properties.copy(source)); super(Properties.ofFullCopy(source));
} }

View file

@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseCraftingTableBlock> { public abstract class BaseCraftingTableBlock extends CraftingTableBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BaseCraftingTableBlock> {
protected BaseCraftingTableBlock(Block source) { protected BaseCraftingTableBlock(Block source) {
this(Properties.copy(source)); this(Properties.ofFullCopy(source));
} }
protected BaseCraftingTableBlock(BlockBehaviour.Properties properties) { protected BaseCraftingTableBlock(BlockBehaviour.Properties properties) {

View file

@ -88,7 +88,7 @@ public class BaseCropBlock extends BasePlantBlock implements SurvivesOnBlocks {
} }
@Override @Override
public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) { public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state) {
return state.getValue(AGE) < 3; return state.getValue(AGE) < 3;
} }

View file

@ -43,11 +43,11 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseDoorBlock extends DoorBlock implements RenderLayerProvider, BlockModelProvider, TagProvider { public abstract class BaseDoorBlock extends DoorBlock implements RenderLayerProvider, BlockModelProvider, TagProvider {
protected BaseDoorBlock(Block source, BlockSetType type) { protected BaseDoorBlock(Block source, BlockSetType type) {
this(Properties.copy(source).strength(3F, 3F).noOcclusion(), type); this(Properties.ofFullCopy(source).strength(3F, 3F).noOcclusion(), type);
} }
protected BaseDoorBlock(BlockBehaviour.Properties properties, BlockSetType type) { protected BaseDoorBlock(BlockBehaviour.Properties properties, BlockSetType type) {
super(properties, type); super(type, properties);
} }
@Override @Override

View file

@ -130,13 +130,9 @@ public abstract class BaseDoublePlantBlock extends BaseBlockNotFull implements R
return BCLRenderLayer.CUTOUT; return BCLRenderLayer.CUTOUT;
} }
@Override @Override
public boolean isValidBonemealTarget( public boolean isValidBonemealTarget(LevelReader levelReader, BlockPos blockPos, BlockState blockState) {
LevelReader levelReader,
BlockPos blockPos,
BlockState blockState,
boolean isClient
) {
return true; return true;
} }

View file

@ -34,7 +34,7 @@ public abstract class BaseFenceBlock extends FenceBlock implements BlockModelPro
private final Block parent; private final Block parent;
protected BaseFenceBlock(Block source) { protected BaseFenceBlock(Block source) {
super(Properties.copy(source).noOcclusion()); super(Properties.ofFullCopy(source).noOcclusion());
this.parent = source; this.parent = source;
} }

View file

@ -43,7 +43,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseFurnaceBlock extends FurnaceBlock implements BlockModelProvider, RenderLayerProvider { public abstract class BaseFurnaceBlock extends FurnaceBlock implements BlockModelProvider, RenderLayerProvider {
public BaseFurnaceBlock(Block source) { public BaseFurnaceBlock(Block source) {
this(Properties.copy(source).lightLevel(state -> state.getValue(LIT) ? 13 : 0)); this(Properties.ofFullCopy(source).lightLevel(state -> state.getValue(LIT) ? 13 : 0));
} }
public BaseFurnaceBlock(BlockBehaviour.Properties properties) { public BaseFurnaceBlock(BlockBehaviour.Properties properties) {

View file

@ -32,7 +32,7 @@ public abstract class BaseGateBlock extends FenceGateBlock implements BlockModel
private final Block parent; private final Block parent;
protected BaseGateBlock(Block source, WoodType type) { protected BaseGateBlock(Block source, WoodType type) {
super(Properties.copy(source).noOcclusion(), type); super(type, Properties.ofFullCopy(source).noOcclusion());
this.parent = source; this.parent = source;
} }

View file

@ -27,7 +27,7 @@ public class BaseGlassBlock extends BaseBlockNotFull implements AddMineablePicka
} }
public BaseGlassBlock(Block block, float resistance) { public BaseGlassBlock(Block block, float resistance) {
super(Properties.copy(block) super(Properties.ofFullCopy(block)
.explosionResistance(resistance) .explosionResistance(resistance)
.noOcclusion() .noOcclusion()
.isSuffocating((arg1, arg2, arg3) -> false) .isSuffocating((arg1, arg2, arg3) -> false)

View file

@ -29,7 +29,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseLadderBlock extends LadderBlock implements RenderLayerProvider, BlockModelProvider, BehaviourClimable, DropSelfLootProvider<BaseLadderBlock> { public abstract class BaseLadderBlock extends LadderBlock implements RenderLayerProvider, BlockModelProvider, BehaviourClimable, DropSelfLootProvider<BaseLadderBlock> {
protected BaseLadderBlock(Block block) { protected BaseLadderBlock(Block block) {
this(Properties.copy(block).noOcclusion()); this(Properties.ofFullCopy(block).noOcclusion());
} }
public BaseLadderBlock(BlockBehaviour.Properties properties) { public BaseLadderBlock(BlockBehaviour.Properties properties) {

View file

@ -67,7 +67,7 @@ public class BaseOreBlock extends DropExperienceBlock implements BlockModelProvi
int experience, int experience,
int miningLevel int miningLevel
) { ) {
super(properties, UniformInt.of(experience > 0 ? 1 : 0, experience)); super(UniformInt.of(experience > 0 ? 1 : 0, experience), properties);
this.dropItem = drop; this.dropItem = drop;
this.minCount = minCount; this.minCount = minCount;
this.maxCount = maxCount; this.maxCount = maxCount;

View file

@ -39,7 +39,7 @@ public abstract class BasePathBlock extends BaseBlockNotFull {
private Block baseBlock; private Block baseBlock;
public BasePathBlock(Block source) { public BasePathBlock(Block source) {
super(Properties.copy(source).isValidSpawn((state, world, pos, type) -> false)); super(Properties.ofFullCopy(source).isValidSpawn((state, world, pos, type) -> false));
this.baseBlock = Blocks.DIRT; this.baseBlock = Blocks.DIRT;
if (source instanceof BaseTerrainBlock) { if (source instanceof BaseTerrainBlock) {
BaseTerrainBlock terrain = (BaseTerrainBlock) source; BaseTerrainBlock terrain = (BaseTerrainBlock) source;

View file

@ -99,7 +99,7 @@ public abstract class BasePlantBlock extends BaseBlockNotFull implements RenderL
} }
@Override @Override
public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) { public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state) {
return true; return true;
} }

View file

@ -35,10 +35,9 @@ import org.jetbrains.annotations.Nullable;
public abstract class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BasePressurePlateBlock> { public abstract class BasePressurePlateBlock extends PressurePlateBlock implements BlockModelProvider, TagProvider, DropSelfLootProvider<BasePressurePlateBlock> {
private final Block parent; private final Block parent;
protected BasePressurePlateBlock(Sensitivity rule, Block source, BlockSetType type) { protected BasePressurePlateBlock(Block source, BlockSetType type) {
super( super(
rule, Properties.copy(source).noCollission().noOcclusion().strength(0.5F), type, Properties.ofFullCopy(source).noCollission().noOcclusion().strength(0.5F)
type
); );
this.parent = source; this.parent = source;
} }
@ -83,7 +82,7 @@ public abstract class BasePressurePlateBlock extends PressurePlateBlock implemen
public static class Wood extends BasePressurePlateBlock implements BehaviourWood { public static class Wood extends BasePressurePlateBlock implements BehaviourWood {
public Wood(Block source, BlockSetType type) { public Wood(Block source, BlockSetType type) {
super(Sensitivity.EVERYTHING, source, type); super(/*Sensitivity.EVERYTHING,*/ source, type);
} }
@Override @Override
@ -96,13 +95,13 @@ public abstract class BasePressurePlateBlock extends PressurePlateBlock implemen
public static class Stone extends BasePressurePlateBlock implements BehaviourStone { public static class Stone extends BasePressurePlateBlock implements BehaviourStone {
public Stone(Block source, BlockSetType type) { public Stone(Block source, BlockSetType type) {
super(Sensitivity.MOBS, source, type); super(/*Sensitivity.MOBS,*/ source, type);
} }
} }
public static class Metal extends BasePressurePlateBlock implements BehaviourMetal { public static class Metal extends BasePressurePlateBlock implements BehaviourMetal {
public Metal(Block source, BlockSetType type) { public Metal(Block source, BlockSetType type) {
super(Sensitivity.MOBS, source, type); super(/*Sensitivity.MOBS,*/ source, type);
} }
} }

View file

@ -29,7 +29,7 @@ public abstract class BaseRotatedPillarBlock extends RotatedPillarBlock implemen
} }
protected BaseRotatedPillarBlock(Block block) { protected BaseRotatedPillarBlock(Block block) {
this(Properties.copy(block)); this(Properties.ofFullCopy(block));
} }
@ -71,7 +71,7 @@ public abstract class BaseRotatedPillarBlock extends RotatedPillarBlock implemen
} }
public Wood(Block block, boolean flammable) { public Wood(Block block, boolean flammable) {
this(Properties.copy(block), flammable); this(Properties.ofFullCopy(block), flammable);
} }
} }

View file

@ -41,7 +41,7 @@ public abstract class BaseSlabBlock extends SlabBlock implements BlockModelProvi
public final boolean fireproof; public final boolean fireproof;
protected BaseSlabBlock(Block source, boolean fireproof) { protected BaseSlabBlock(Block source, boolean fireproof) {
super(Properties.copy(source)); super(Properties.ofFullCopy(source));
this.parent = source; this.parent = source;
this.fireproof = fireproof; this.fireproof = fireproof;
} }

View file

@ -44,7 +44,7 @@ public abstract class BaseStairsBlock extends StairBlock implements BlockModelPr
public final boolean fireproof; public final boolean fireproof;
protected BaseStairsBlock(Block source, boolean fireproof) { protected BaseStairsBlock(Block source, boolean fireproof) {
super(source.defaultBlockState(), Properties.copy(source)); super(source.defaultBlockState(), Properties.ofFullCopy(source));
this.parent = source; this.parent = source;
this.fireproof = fireproof; this.fireproof = fireproof;
} }

View file

@ -69,8 +69,8 @@ public abstract class BaseStripableBarkBlock extends BaseBarkBlock {
super( super(
stripedBlock, stripedBlock,
(flammable (flammable
? Properties.copy(stripedBlock).ignitedByLava() ? Properties.ofFullCopy(stripedBlock).ignitedByLava()
: Properties.copy(stripedBlock)).mapColor(color) : Properties.ofFullCopy(stripedBlock)).mapColor(color)
); );
this.flammable = flammable; this.flammable = flammable;
} }

View file

@ -68,7 +68,7 @@ public abstract class BaseStripableLogBlock extends BaseRotatedPillarBlock {
public Wood(MapColor color, Block striped, boolean flammable) { public Wood(MapColor color, Block striped, boolean flammable) {
super( super(
striped, striped,
(flammable ? Properties.copy(striped).ignitedByLava() : Properties.copy(striped)).mapColor(color) (flammable ? Properties.ofFullCopy(striped).ignitedByLava() : Properties.ofFullCopy(striped)).mapColor(color)
); );
this.flammable = flammable; this.flammable = flammable;
} }

View file

@ -54,7 +54,7 @@ public class BaseTerrainBlock extends BaseBlock {
public BaseTerrainBlock(Block baseBlock, MapColor color) { public BaseTerrainBlock(Block baseBlock, MapColor color) {
super(Properties super(Properties
.copy(baseBlock) .ofFullCopy(baseBlock)
.mapColor(color) .mapColor(color)
.sound(BlockSounds.TERRAIN_SOUND) .sound(BlockSounds.TERRAIN_SOUND)
.randomTicks() .randomTicks()

View file

@ -41,7 +41,7 @@ import org.jetbrains.annotations.Nullable;
public abstract class BaseTrapdoorBlock extends TrapDoorBlock implements RenderLayerProvider, BlockModelProvider, TagProvider, DropSelfLootProvider<BaseTrapdoorBlock> { public abstract class BaseTrapdoorBlock extends TrapDoorBlock implements RenderLayerProvider, BlockModelProvider, TagProvider, DropSelfLootProvider<BaseTrapdoorBlock> {
protected BaseTrapdoorBlock(BlockBehaviour.Properties properties, BlockSetType type) { protected BaseTrapdoorBlock(BlockBehaviour.Properties properties, BlockSetType type) {
super(properties, type); super(type, properties);
} }

View file

@ -3,6 +3,7 @@ package org.betterx.bclib.blocks;
import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlant; import org.betterx.bclib.behaviours.interfaces.BehaviourWaterPlant;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.LevelReader;
@ -18,7 +19,7 @@ public abstract class BaseUnderwaterWallPlantBlock extends BaseWallPlantBlock im
} }
@Override @Override
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { public boolean canPlaceLiquid(Player p, BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
return false; return false;
} }

View file

@ -137,7 +137,7 @@ public class BaseVineBlock extends BaseBlockNotFull implements RenderLayerProvid
} }
@Override @Override
public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) { public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state) {
while (world.getBlockState(pos).getBlock() == this) { while (world.getBlockState(pos).getBlock() == this) {
pos = pos.below(); pos = pos.below();
} }

View file

@ -34,7 +34,7 @@ public abstract class BaseWallBlock extends WallBlock implements BlockModelProvi
private final Block parent; private final Block parent;
protected BaseWallBlock(Block source) { protected BaseWallBlock(Block source) {
super(Properties.copy(source).noOcclusion()); super(Properties.ofFullCopy(source).noOcclusion());
this.parent = source; this.parent = source;
} }

View file

@ -28,12 +28,12 @@ public class BaseWeightedPlateBlock extends WeightedPressurePlateBlock implement
public BaseWeightedPlateBlock(Block source, BlockSetType type) { public BaseWeightedPlateBlock(Block source, BlockSetType type) {
super( super(
15, 15,
Properties.copy(source) type,
Properties.ofFullCopy(source)
.noCollission() .noCollission()
.noOcclusion() .noOcclusion()
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()
.strength(0.5F), .strength(0.5F)
type
); );
this.parent = source; this.parent = source;
} }

View file

@ -16,6 +16,7 @@ import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.BlockGetter;
@ -53,7 +54,7 @@ public abstract class StalactiteBlock extends BaseBlockNotFull implements Simple
private static final VoxelShape[] SHAPES; private static final VoxelShape[] SHAPES;
public StalactiteBlock(Block source) { public StalactiteBlock(Block source) {
this(Properties.copy(source).noOcclusion()); this(Properties.ofFullCopy(source).noOcclusion());
} }
public StalactiteBlock(BlockBehaviour.Properties properties) { public StalactiteBlock(BlockBehaviour.Properties properties) {
@ -239,7 +240,7 @@ public abstract class StalactiteBlock extends BaseBlockNotFull implements Simple
} }
@Override @Override
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { public boolean canPlaceLiquid(Player player, BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) {
return false; return false;
} }

View file

@ -9,6 +9,7 @@ import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.item.enchantment.Enchantments;
@ -32,6 +33,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
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;
public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements RenderLayerProvider, BonemealableBlock, LiquidBlockContainer { public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements RenderLayerProvider, BonemealableBlock, LiquidBlockContainer {
private static final VoxelShape SHAPE = box(4, 0, 4, 12, 14, 12); private static final VoxelShape SHAPE = box(4, 0, 4, 12, 14, 12);
@ -94,7 +96,7 @@ public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements R
} }
@Override @Override
public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, boolean isClient) { public boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state) {
return true; return true;
} }
@ -115,8 +117,15 @@ public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements R
level.addFreshEntity(item); level.addFreshEntity(item);
} }
@Override @Override
public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { public boolean canPlaceLiquid(
@Nullable Player player,
BlockGetter world,
BlockPos pos,
BlockState state,
Fluid fluid
) {
return false; return false;
} }

View file

@ -38,7 +38,7 @@ public abstract class BaseHangingSignBlock extends CeilingHangingSignBlock imple
} }
protected BaseHangingSignBlock(WoodType type, MapColor color, boolean flammable, WallSignProvider provider) { protected BaseHangingSignBlock(WoodType type, MapColor color, boolean flammable, WallSignProvider provider) {
super(BehaviourBuilders.createSign(color, flammable), type); super(type, BehaviourBuilders.createSign(color, flammable));
this.wallSign = () -> provider.create(BehaviourBuilders.createWallSign(color, this, flammable), type); this.wallSign = () -> provider.create(BehaviourBuilders.createWallSign(color, this, flammable), type);
} }

View file

@ -39,7 +39,7 @@ public abstract class BaseSignBlock extends StandingSignBlock implements BlockMo
} }
protected BaseSignBlock(WoodType type, MapColor color, boolean flammable, WallSignProvider provider) { protected BaseSignBlock(WoodType type, MapColor color, boolean flammable, WallSignProvider provider) {
super(BehaviourBuilders.createSign(color, flammable), type); super(type, BehaviourBuilders.createSign(color, flammable));
this.wallSign = () -> provider.create(BehaviourBuilders.createWallSign(color, this, flammable), type); this.wallSign = () -> provider.create(BehaviourBuilders.createWallSign(color, this, flammable), type);
} }

View file

@ -19,7 +19,7 @@ public abstract class BaseWallHangingSignBlock extends WallHangingSignBlock impl
Properties properties, Properties properties,
WoodType woodType WoodType woodType
) { ) {
super(properties, woodType); super(woodType, properties);
} }
@Override @Override

View file

@ -14,7 +14,7 @@ import java.util.List;
public abstract class BaseWallSignBlock extends WallSignBlock implements TagProvider { public abstract class BaseWallSignBlock extends WallSignBlock implements TagProvider {
protected BaseWallSignBlock(Properties properties, WoodType woodType) { protected BaseWallSignBlock(Properties properties, WoodType woodType) {
super(properties, woodType); super(woodType, properties);
} }
@Override @Override