mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 13:42:59 +00:00 
			
		
		
		
	Fixed turtle ability to feed/breed passive mobs.
This commit is contained in:
		 David Queneau
					David Queneau
				
			
				
					committed by
					
						 David Queneau
						David Queneau
					
				
			
			
				
	
			
			
			 David Queneau
						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) { |  | ||||||
|                     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); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user