Fixed build issues with Chairs

This commit is contained in:
Frank 2023-12-18 13:27:35 +01:00
parent 331a7ea800
commit 7e06e9ce3f
2 changed files with 9 additions and 10 deletions

View file

@ -112,11 +112,11 @@ public abstract class BaseChair extends AbstractChair {
} }
@Override @Override
public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) { public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
if (player.isCreative() && state.getValue(TOP) && world.getBlockState(pos.below()).getBlock() == this) { if (player.isCreative() && state.getValue(TOP) && world.getBlockState(pos.below()).getBlock() == this) {
world.setBlockAndUpdate(pos.below(), Blocks.AIR.defaultBlockState()); world.setBlockAndUpdate(pos.below(), Blocks.AIR.defaultBlockState());
} }
super.playerWillDestroy(world, pos, state, player); return super.playerWillDestroy(world, pos, state, player);
} }
public static class Wood extends BaseChair implements BehaviourWood { public static class Wood extends BaseChair implements BehaviourWood {

View file

@ -9,15 +9,14 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.protocol.game.ClientboundAddEntityPacket; import net.minecraft.network.protocol.game.ClientboundAddEntityPacket;
import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult; import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.*;
import net.minecraft.world.entity.EntitySelector;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import net.minecraft.world.entity.animal.WaterAnimal; import net.minecraft.world.entity.animal.WaterAnimal;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import org.joml.Vector3f;
import java.util.List; import java.util.List;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -115,13 +114,13 @@ public class EntityChair extends Entity {
} }
@Override @Override
public double getPassengersRidingOffset() { protected Vector3f getPassengerAttachmentPoint(Entity entity, EntityDimensions entityDimensions, float f) {
return 0.0; return new Vector3f(0.0f, 0.0f, 0.0f);
} }
@Override @Override
public double getMyRidingOffset() { protected float ridingOffset(Entity entity) {
return 0.0; return 0.0f;
} }
@Override @Override