Fixed canPlaceLiquid signature

This commit is contained in:
Frank 2023-12-19 13:10:14 +01:00
parent d2fe95d6c2
commit 9f9ae18e8c
5 changed files with 44 additions and 5 deletions

View file

@ -13,6 +13,7 @@ import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
@ -65,7 +66,13 @@ public class HydrothermalVentBlock extends BaseBlockNotFull.Stone implements Ent
}
@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;
}

View file

@ -8,6 +8,7 @@ import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
@ -31,6 +32,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import com.google.common.collect.Maps;
import java.util.EnumMap;
import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation")
public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements AddMineablePickaxe, RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer {
@ -58,7 +60,13 @@ public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements Ad
}
@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 !state.getValue(WATERLOGGED);
}

View file

@ -10,6 +10,7 @@ import org.betterx.betterend.registry.EndItems;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
@ -42,6 +43,7 @@ import com.google.common.collect.Maps;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation")
public class SulphurCrystalBlock extends BaseAttachedBlock.Glass implements RenderLayerProvider, SimpleWaterloggedBlock, LiquidBlockContainer, SurvivesOnBrimstone {
@ -103,7 +105,13 @@ public class SulphurCrystalBlock extends BaseAttachedBlock.Glass implements Rend
}
@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 !state.getValue(WATERLOGGED);
}

View file

@ -12,6 +12,7 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.BlockGetter;
@ -32,6 +33,7 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Optional;
import org.jetbrains.annotations.Nullable;
public class VentBubbleColumnBlock extends Block implements BucketPickup, LiquidBlockContainer {
public VentBubbleColumnBlock() {
@ -147,7 +149,13 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid
}
@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;
}

View file

@ -8,6 +8,7 @@ import net.minecraft.client.resources.model.UnbakedModel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.LevelAccessor;
@ -29,6 +30,7 @@ import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
@SuppressWarnings("deprecation")
public class EndLanternBlock extends BaseBlockNotFull.Wood implements SimpleWaterloggedBlock, LiquidBlockContainer {
@ -111,7 +113,13 @@ public class EndLanternBlock extends BaseBlockNotFull.Wood implements SimpleWate
}
@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;
}