Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
fix potential bug
Browse files Browse the repository at this point in the history
Signed-off-by: Devan-Kerman <[email protected]>
  • Loading branch information
Devan-Kerman committed Sep 9, 2020
1 parent 0c45112 commit 5184883
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ private static ItemStack deployOnEntity(@Nonnull ItemStack stack, final ITurtleA

if (cancelResult != null && cancelResult.isAccepted()) {
placed = true;
} else {
} else if (hitEntity instanceof LivingEntity) {
// See EntityPlayer.interactOn
cancelResult = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, 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 if (hitEntity instanceof LivingEntity) {
} else {
placed = stackCopy.useOnEntity(turtlePlayer, (LivingEntity) hitEntity, Hand.MAIN_HAND)
.isAccepted();
if (placed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.passive.HorseBaseEntity;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand Down

0 comments on commit 5184883

Please sign in to comment.