mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 05:33:00 +00:00 
			
		
		
		
	code cleanup
This commit is contained in:
		| @@ -58,7 +58,6 @@ public class TurtlePlaceCommand implements ITurtleCommand | ||||
|  | ||||
|         // Remember old block | ||||
|         Direction direction = m_direction.toWorldDir( turtle ); | ||||
|         World world = turtle.getWorld(); | ||||
|         BlockPos coordinates = turtle.getPosition().offset( direction ); | ||||
|  | ||||
|         // Create a fake player, and orient it appropriately | ||||
| @@ -322,20 +321,8 @@ public class TurtlePlaceCommand implements ITurtleCommand | ||||
|         boolean placed = false; | ||||
|         BlockEntity existingTile = turtle.getWorld().getBlockEntity( position ); | ||||
|  | ||||
|         if (placementContext.canPlace()) | ||||
|         // See PlayerInteractionManager.processRightClickBlock | ||||
|         /* | ||||
|         PlayerInteractEvent.RightClickBlock event = ForgeHooks.onRightClickBlock( turtlePlayer, Hand.MAIN, position, side, new Vec3d( hitX, hitY, hitZ ) ); | ||||
|         if( !event.isCanceled() ) */ | ||||
|         { | ||||
|             /* if( item.onItemUseFirst( turtlePlayer, turtle.getWorld(), position, side, hitX, hitY, hitZ, Hand.MAIN_HAND) == ActionResult.SUCCESS ) | ||||
|             { | ||||
|                 placed = true; | ||||
|                 turtlePlayer.loadInventory( stackCopy ); | ||||
|             } | ||||
|             else*/ | ||||
|             if( /* event.getUseItem() != Event.Result.DENY && */ | ||||
|                 stackCopy.useOnBlock( context ) == ActionResult.SUCCESS ) | ||||
|         if( placementContext.canPlace() ) { | ||||
|             if( stackCopy.useOnBlock( context ) == ActionResult.SUCCESS ) | ||||
|             { | ||||
|                 placed = true; | ||||
|                 turtlePlayer.loadInventory( stackCopy ); | ||||
| @@ -343,13 +330,6 @@ public class TurtlePlaceCommand implements ITurtleCommand | ||||
|         } | ||||
|  | ||||
|         if( !placed && (item instanceof BucketItem || item instanceof BoatItem || item instanceof LilyPadItem || item instanceof GlassBottleItem) ) | ||||
|         { | ||||
|             ActionResult actionResult = null; // ForgeHooks.onItemRightClick( turtlePlayer, Hand.MAIN_HAND); | ||||
|             if( actionResult == ActionResult.SUCCESS ) | ||||
|             { | ||||
|                 placed = true; | ||||
|             } | ||||
|             else if( actionResult == null ) | ||||
|         { | ||||
|             TypedActionResult<ItemStack> result = stackCopy.use( turtle.getWorld(), turtlePlayer, Hand.MAIN_HAND ); | ||||
|             if( result.getResult() == ActionResult.SUCCESS && !ItemStack.areEqualIgnoreDamage( stack, result.getValue() ) ) | ||||
| @@ -358,7 +338,6 @@ public class TurtlePlaceCommand implements ITurtleCommand | ||||
|                 turtlePlayer.loadInventory( result.getValue() ); | ||||
|             } | ||||
|         } | ||||
|         } | ||||
|  | ||||
|         // Set text on signs | ||||
|         if( placed && item instanceof SignItem ) | ||||
|   | ||||
| @@ -114,9 +114,9 @@ public final class TurtlePlayer extends FakePlayer | ||||
|  | ||||
|     @Override | ||||
|     public Vec3d getCameraPosVec(float float_1) { | ||||
|         y-=getStandingEyeHeight(); | ||||
|         Vec3d r = super.getCameraPosVec(float_1); | ||||
|         y+=getStandingEyeHeight(); | ||||
|         y-= getStandingEyeHeight(); | ||||
|         Vec3d r = super.getCameraPosVec( float_1 ); | ||||
|         y+= getStandingEyeHeight(); | ||||
|         return r; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 svitoos
					svitoos