Fix cart contraption pickup

This commit is contained in:
simibubi 2021-06-26 12:28:03 +02:00
parent 737b7ad255
commit 6feacd3fc2

View file

@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.mo
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -42,7 +41,6 @@ import net.minecraft.util.Direction;
import net.minecraft.util.NonNullList; import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
@ -209,6 +207,8 @@ public class MinecartContraptionItem extends Item {
entity = entity.getRidingEntity(); entity = entity.getRidingEntity();
if (!(entity instanceof AbstractMinecartEntity)) if (!(entity instanceof AbstractMinecartEntity))
return; return;
if (!entity.isAlive())
return;
AbstractMinecartEntity cart = (AbstractMinecartEntity) entity; AbstractMinecartEntity cart = (AbstractMinecartEntity) entity;
Type type = cart.getMinecartType(); Type type = cart.getMinecartType();
if (type != Type.RIDEABLE && type != Type.FURNACE && type != Type.CHEST) if (type != Type.RIDEABLE && type != Type.FURNACE && type != Type.CHEST)