Skip to content

Commit

Permalink
Fix ClassCastException crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DrexHD committed Nov 3, 2024
1 parent a940e5d commit a129f63
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.block.LilyPadBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.vehicle.BoatEntity;
import net.minecraft.entity.vehicle.AbstractBoatEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -18,7 +18,7 @@
public abstract class LilyPadBlockMixin {
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;)Z"))
private void ledgerLogLilyPadBreak(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) {
BoatEntity boat = (BoatEntity) entity;
AbstractBoatEntity boat = (AbstractBoatEntity) entity;
if (boat.getFirstPassenger() instanceof PlayerEntity player) {
BlockBreakCallback.EVENT.invoker().breakBlock(world, new BlockPos(pos), state, null, Sources.VEHICLE, player);
} else {
Expand Down

0 comments on commit a129f63

Please sign in to comment.