From 0aaa09260b76c69da252ca96295b2c29534cdda3 Mon Sep 17 00:00:00 2001 From: reidbhuntley Date: Fri, 28 May 2021 14:42:47 -0400 Subject: [PATCH] Fix minecart coupling item dupe --- .../structureMovement/train/MinecartCouplingItem.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/MinecartCouplingItem.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/MinecartCouplingItem.java index d421c8fb1..66986c18d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/MinecartCouplingItem.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/train/MinecartCouplingItem.java @@ -4,6 +4,8 @@ import com.simibubi.create.AllItems; import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.CapabilityMinecartController; import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController; +import com.simibubi.create.foundation.utility.Iterate; + import net.minecraft.entity.Entity; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; import net.minecraft.entity.player.PlayerEntity; @@ -78,6 +80,11 @@ public class MinecartCouplingItem extends Item { if (event.getWorld().isRemote) return true; + for (boolean forward : Iterate.trueAndFalse) { + if (controller.hasContraptionCoupling(forward)) + couplings--; + } + CouplingHandler.status(player, "removed"); controller.decouple(); if (!player.isCreative())