mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-09-06 12:27:56 +00:00
Fixed turtle ability to feed/breed passive mobs.
This commit is contained in:

committed by
David Queneau

parent
1b31972092
commit
e4ad8bc117
@@ -215,27 +215,18 @@ public class TurtlePlaceCommand implements ITurtleCommand {
|
|||||||
// Place on the entity
|
// Place on the entity
|
||||||
boolean placed = false;
|
boolean placed = false;
|
||||||
ActionResult cancelResult = hitEntity.interactAt(turtlePlayer, hitPos, Hand.MAIN_HAND);
|
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()) {
|
if (cancelResult != null && cancelResult.isAccepted()) {
|
||||||
placed = true;
|
placed = true;
|
||||||
} else if (hitEntity instanceof LivingEntity) {
|
}
|
||||||
// See EntityPlayer.interactOn
|
else {
|
||||||
cancelResult = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND);
|
cancelResult = hitEntity.interact(turtlePlayer, Hand.MAIN_HAND);
|
||||||
if (cancelResult != null && cancelResult.isAccepted()) {
|
if (cancelResult != null && cancelResult.isAccepted()) {
|
||||||
placed = true;
|
placed = true;
|
||||||
} else if (cancelResult == null) {
|
}
|
||||||
if (hitEntity.interact(turtlePlayer, Hand.MAIN_HAND) == ActionResult.CONSUME) {
|
else if (hitEntity instanceof LivingEntity) {
|
||||||
placed = true;
|
placed = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND).isAccepted();
|
||||||
} else {
|
if (placed) turtlePlayer.loadInventory(stackCopy);
|
||||||
placed = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND)
|
|
||||||
.isAccepted();
|
|
||||||
if (placed) {
|
|
||||||
turtlePlayer.loadInventory(stackCopy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user