11package gregtech .common .items .behaviors ;
22
3- import codechicken .lib .raytracer .RayTracer ;
4-
53import gregtech .api .GTValues ;
64import gregtech .api .cover .CoverRayTracer ;
75import gregtech .api .items .metaitem .stats .IItemDurabilityManager ;
3129
3230import appeng .api .util .AEColor ;
3331import appeng .tile .networking .TileCableBus ;
32+ import codechicken .lib .raytracer .RayTracer ;
3433import org .apache .commons .lang3 .tuple .Pair ;
3534import org .jetbrains .annotations .Nullable ;
3635
@@ -57,7 +56,7 @@ public ColorSprayBehaviour(ItemStack empty, int totalUses, int color) {
5756 @ Override
5857 public ActionResult <ItemStack > onItemUse (EntityPlayer player , World world , BlockPos pos , EnumHand hand ,
5958 EnumFacing facing , float hitX , float hitY , float hitZ ) {
60- ItemStack stack = player .getHeldItem (hand );
59+ ItemStack stack = player .getHeldItem (hand );
6160 if (!player .canPlayerEdit (pos , facing , stack )) {
6261 return ActionResult .newResult (EnumActionResult .FAIL , player .getHeldItem (hand ));
6362 }
@@ -76,7 +75,8 @@ private boolean tryPaintBlock(EntityPlayer player, World world, BlockPos pos, En
7675 if (color == null ) {
7776 return tryStripBlockColor (player , world , pos , block , side , hand );
7877 }
79- return tryPaintSpecialBlock (player , world , pos , block , hand ) || block .recolorBlock (world , pos , side , this .color );
78+ return tryPaintSpecialBlock (player , world , pos , block , hand ) ||
79+ block .recolorBlock (world , pos , side , this .color );
8080 }
8181
8282 private boolean tryPaintSpecialBlock (EntityPlayer player , World world , BlockPos pos , Block block , EnumHand hand ) {
@@ -99,7 +99,7 @@ private boolean tryPaintSpecialBlock(EntityPlayer player, World world, BlockPos
9999 return true ;
100100 }
101101 TileEntity te = world .getTileEntity (pos );
102- if (player .isSneaking () && te instanceof IPipeTile <?,?> mainPipe ) {
102+ if (player .isSneaking () && te instanceof IPipeTile <?, ?> mainPipe ) {
103103 RayTraceResult hitResult = RayTracer .retraceBlock (world , player , pos );
104104 if (hitResult != null ) {
105105 EnumFacing facing = CoverRayTracer .determineGridSideHit (hitResult );
@@ -131,12 +131,13 @@ private boolean tryPaintSpecialBlock(EntityPlayer player, World world, BlockPos
131131
132132 // note: automatically uses durability from recolouring pipes, apart from the last use, as this allows for proper
133133 // animation of the item's use
134- private boolean traversePipes (EntityPlayer player , World world , EnumHand hand , BlockPos startPos , EnumFacing facing ) {
134+ private boolean traversePipes (EntityPlayer player , World world , EnumHand hand , BlockPos startPos ,
135+ EnumFacing facing ) {
135136 startPos = startPos .offset (facing );
136137 TileEntity connectedTe = world .getTileEntity (startPos );
137138 int count = 1 ;
138139 boolean painted = false ;
139- while (connectedTe instanceof IPipeTile <?,?> connectedPipe && count < MAX_PIPE_TRAVERSAL_LENGTH ) {
140+ while (connectedTe instanceof IPipeTile <?, ?> connectedPipe && count < MAX_PIPE_TRAVERSAL_LENGTH ) {
140141 if (connectedPipe .getPaintingColor () != (this .color == null ? -1 : this .color .colorValue )) {
141142 connectedPipe .setPaintingColor (this .color == null ? -1 : this .color .colorValue );
142143 connectedPipe .scheduleRenderUpdate ();
@@ -154,7 +155,7 @@ private boolean traversePipes(EntityPlayer player, World world, EnumHand hand, B
154155 if (connectedPipe .getNumConnections () == 2 ) {
155156 int connections = connectedPipe .getConnections ();
156157 connections &= ~(1 << facing .getOpposite ().getIndex ());
157- for (EnumFacing other : EnumFacing .VALUES ) {
158+ for (EnumFacing other : EnumFacing .VALUES ) {
158159 if ((connections & (1 << other .getIndex ())) != 0 ) {
159160 facing = other ;
160161 startPos = startPos .offset (facing );
@@ -172,7 +173,7 @@ private boolean traversePipes(EntityPlayer player, World world, EnumHand hand, B
172173
173174 @ SuppressWarnings ("unchecked, rawtypes" )
174175 private boolean tryStripBlockColor (EntityPlayer player , World world , BlockPos pos , Block block ,
175- EnumFacing side , EnumHand hand ) {
176+ EnumFacing side , EnumHand hand ) {
176177 // MC special cases
177178 if (block == Blocks .STAINED_GLASS ) {
178179 world .setBlockState (pos , Blocks .GLASS .getDefaultState ());
@@ -200,7 +201,7 @@ private boolean tryStripBlockColor(EntityPlayer player, World world, BlockPos po
200201 }
201202
202203 // TileEntityPipeBase special case
203- if (te instanceof IPipeTile <?, ?> pipe ) {
204+ if (te instanceof IPipeTile <?, ?>pipe ) {
204205 if (player .isSneaking ()) {
205206 RayTraceResult hitResult = RayTracer .retraceBlock (world , player , pos );
206207 if (hitResult != null ) {
0 commit comments