@@ -114,24 +114,27 @@ private void onTick(TickEvent.Pre event) {
114114 place (slot );
115115 hasPlacedWater = false ;
116116
117- } else if (!mc .player .hasStatusEffect (Registries .STATUS_EFFECT .getEntry (FIRE_RESISTANCE )) && mc .player .isOnFire ()) {
118- blockPos = mc .player .getBlockPos ();
119- final int slot = findSlot (Items .WATER_BUCKET );
120- if (mc .world .getBlockState (blockPos ).getBlock () == Blocks .FIRE || mc .world .getBlockState (blockPos ).getBlock () == Blocks .SOUL_FIRE ) {
121- float yaw = mc .gameRenderer .getCamera ().getYaw () % 360 ;
122- float pitch = mc .gameRenderer .getCamera ().getPitch () % 360 ;
123- if (center .get ()) {
124- PlayerUtils .centerPlayer ();
117+ } else {
118+ assert mc .player != null ;
119+ if (!mc .player .hasStatusEffect (Registries .STATUS_EFFECT .getEntry (FIRE_RESISTANCE )) && mc .player .isOnFire ()) {
120+ blockPos = mc .player .getBlockPos ();
121+ final int slot = findSlot (Items .WATER_BUCKET );
122+ if (mc .world .getBlockState (blockPos ).getBlock () == Blocks .FIRE || mc .world .getBlockState (blockPos ).getBlock () == Blocks .SOUL_FIRE ) {
123+ float yaw = mc .gameRenderer .getCamera ().getYaw () % 360 ;
124+ float pitch = mc .gameRenderer .getCamera ().getPitch () % 360 ;
125+ if (center .get ()) {
126+ PlayerUtils .centerPlayer ();
127+ }
128+ Rotations .rotate (yaw , 90 );
129+ mc .getNetworkHandler ().sendPacket (new PlayerActionC2SPacket (PlayerActionC2SPacket .Action .START_DESTROY_BLOCK , blockPos , Direction .UP ));
130+ mc .player .swingHand (Hand .MAIN_HAND );
131+ mc .getNetworkHandler ().sendPacket (new PlayerActionC2SPacket (PlayerActionC2SPacket .Action .STOP_DESTROY_BLOCK , blockPos , Direction .UP ));
132+
133+ Rotations .rotate (yaw , pitch );
125134 }
126- Rotations .rotate (yaw , 90 );
127- mc .getNetworkHandler ().sendPacket (new PlayerActionC2SPacket (PlayerActionC2SPacket .Action .START_DESTROY_BLOCK , blockPos , Direction .UP ));
128- mc .player .swingHand (Hand .MAIN_HAND );
129- mc .getNetworkHandler ().sendPacket (new PlayerActionC2SPacket (PlayerActionC2SPacket .Action .STOP_DESTROY_BLOCK , blockPos , Direction .UP ));
130-
131- Rotations .rotate (yaw , pitch );
135+ place (slot );
136+ hasPlacedWater = true ;
132137 }
133- place (slot );
134- hasPlacedWater = true ;
135138 }
136139 }
137140
0 commit comments