From 6feacd3fc22ce3639689dbf448944b2cf9c30e08 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Sat, 26 Jun 2021 12:28:03 +0200 Subject: [PATCH] Fix cart contraption pickup --- .../structureMovement/mounted/MinecartContraptionItem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java index 4430d1fab..3bd9f4fe4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MinecartContraptionItem.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.mo import java.io.IOException; import java.util.List; -import java.util.Optional; import javax.annotation.Nullable; @@ -42,7 +41,6 @@ import net.minecraft.util.Direction; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.TextFormatting; -import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; @@ -209,6 +207,8 @@ public class MinecartContraptionItem extends Item { entity = entity.getRidingEntity(); if (!(entity instanceof AbstractMinecartEntity)) return; + if (!entity.isAlive()) + return; AbstractMinecartEntity cart = (AbstractMinecartEntity) entity; Type type = cart.getMinecartType(); if (type != Type.RIDEABLE && type != Type.FURNACE && type != Type.CHEST)