mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-15 09:33:40 +01:00
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.CapabilityMinecartController;
|
||||||
import com.simibubi.create.content.contraptions.components.structureMovement.train.capability.MinecartController;
|
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.Entity;
|
||||||
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -78,6 +80,11 @@ public class MinecartCouplingItem extends Item {
|
||||||
if (event.getWorld().isRemote)
|
if (event.getWorld().isRemote)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
for (boolean forward : Iterate.trueAndFalse) {
|
||||||
|
if (controller.hasContraptionCoupling(forward))
|
||||||
|
couplings--;
|
||||||
|
}
|
||||||
|
|
||||||
CouplingHandler.status(player, "removed");
|
CouplingHandler.status(player, "removed");
|
||||||
controller.decouple();
|
controller.decouple();
|
||||||
if (!player.isCreative())
|
if (!player.isCreative())
|
||||||
|
|
Loading…
Reference in a new issue