mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-08-27 07:52:18 +00:00
Fixed turtle ability to feed/breed passive mobs.
This commit is contained in:
parent
1b31972092
commit
e4ad8bc117
@ -215,27 +215,18 @@ public class TurtlePlaceCommand implements ITurtleCommand {
|
||||
// Place on the entity
|
||||
boolean placed = false;
|
||||
ActionResult cancelResult = hitEntity.interactAt(turtlePlayer, hitPos, Hand.MAIN_HAND);
|
||||
if (cancelResult == null) {
|
||||
cancelResult = hitEntity.interactAt(turtlePlayer, hitPos, Hand.MAIN_HAND);
|
||||
}
|
||||
|
||||
if (cancelResult != null && cancelResult.isAccepted()) {
|
||||
placed = true;
|
||||
} else if (hitEntity instanceof LivingEntity) {
|
||||
// See EntityPlayer.interactOn
|
||||
cancelResult = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND);
|
||||
}
|
||||
else {
|
||||
cancelResult = hitEntity.interact(turtlePlayer, Hand.MAIN_HAND);
|
||||
if (cancelResult != null && cancelResult.isAccepted()) {
|
||||
placed = true;
|
||||
} else if (cancelResult == null) {
|
||||
if (hitEntity.interact(turtlePlayer, Hand.MAIN_HAND) == ActionResult.CONSUME) {
|
||||
placed = true;
|
||||
} else {
|
||||
placed = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND)
|
||||
.isAccepted();
|
||||
if (placed) {
|
||||
turtlePlayer.loadInventory(stackCopy);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (hitEntity instanceof LivingEntity) {
|
||||
placed = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND).isAccepted();
|
||||
if (placed) turtlePlayer.loadInventory(stackCopy);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user