Fix minecart coupling item dupe
This commit is contained in:
parent
5975a3cbac
commit
0aaa09260b
1 changed files with 7 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue