1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-10 22:35:59 +00:00

Fix the use of the item on the entity

This commit is contained in:
svitoos
2019-09-14 02:29:43 +03:00
committed by parly
parent 799bb77847
commit f997b02b8f

View File

@@ -227,25 +227,12 @@ public class TurtlePlaceCommand implements ITurtleCommand
// Place on the entity // Place on the entity
boolean placed = false; boolean placed = false;
ActionResult cancelResult = null; // ForgeHooks.onInteractEntityAt( turtlePlayer, hitEntity, 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 == ActionResult.SUCCESS ) if( cancelResult == ActionResult.SUCCESS )
{ {
placed = true; placed = true;
} }
else else
{
// See PlayerEntity.interactOn
// cancelResult = ForgeHooks.onInteractEntity( turtlePlayer, hitEntity, Hand.MAIN_HAND);
if( cancelResult == ActionResult.SUCCESS )
{
placed = true;
}
else if( cancelResult == null )
{ {
if( hitEntity.interact( turtlePlayer, Hand.MAIN_HAND ) ) if( hitEntity.interact( turtlePlayer, Hand.MAIN_HAND ) )
{ {
@@ -257,7 +244,6 @@ public class TurtlePlaceCommand implements ITurtleCommand
if( placed ) turtlePlayer.loadInventory( stackCopy ); if( placed ) turtlePlayer.loadInventory( stackCopy );
} }
} }
}
// Stop claiming drops // Stop claiming drops
List<ItemStack> remainingDrops = DropConsumer.clear(); List<ItemStack> remainingDrops = DropConsumer.clear();