This commit is contained in:
grimmauld 2021-06-17 14:01:20 +02:00
parent 785242d5b3
commit 084d240f05

View file

@ -12,6 +12,8 @@ import com.simibubi.create.content.contraptions.components.structureMovement.mou
import net.minecraft.block.DoublePlantBlock; import net.minecraft.block.DoublePlantBlock;
import net.minecraft.entity.merchant.villager.AbstractVillagerEntity;
import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.state.properties.DoubleBlockHalf; import net.minecraft.state.properties.DoubleBlockHalf;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
@ -165,8 +167,14 @@ public class DeployerHandler {
} }
if (cancelResult == null) { if (cancelResult == null) {
if (entity.processInitialInteract(player, hand) if (entity.processInitialInteract(player, hand)
.isAccepted()) .isAccepted()){
if (entity instanceof AbstractVillagerEntity) {
AbstractVillagerEntity villager = ((AbstractVillagerEntity) entity);
if (villager.getCustomer() instanceof DeployerFakePlayer)
villager.setCustomer(null);
}
success = true; success = true;
}
else if (entity instanceof LivingEntity && stack.useOnEntity(player, (LivingEntity) entity, hand) else if (entity instanceof LivingEntity && stack.useOnEntity(player, (LivingEntity) entity, hand)
.isAccepted()) .isAccepted())
success = true; success = true;