@@ -202,43 +202,43 @@ private void tickFootprints(MoverType type, Vec3 motion, CallbackInfo ci) {
202
202
if ((Object ) this instanceof Player player )
203
203
isFlying = player .getAbilities ().flying ;
204
204
if (motionSqrd > 0.001 && this .level .dimensionTypeRegistration ().is (GCTags .FOOTPRINTS_DIMENSIONS ) && getVehicle () == null && !isFlying ) {
205
- int iPosX = Mth .floor (getX ());
206
- int iPosY = Mth .floor (getY () - 0.05 );
207
- int iPosZ = Mth .floor (getZ ());
208
- BlockPos pos1 = new BlockPos (iPosX , iPosY , iPosZ );
209
- BlockState state = this .level .getBlockState (pos1 );
210
-
211
- // If the block below is the moon block
212
- if (state .is (GCTags .FOOTPRINTS )) {
213
- // If it has been long enough since the last step
214
- if (galacticraft$getDistanceSinceLastStep () > 0.35 ) {
215
- Vector3d pos = new Vector3d (getX (), getY (), getZ ());
216
- // Set the footprint position to the block below and add
217
- // random number to stop z-fighting
218
- pos .y = Mth .floor (getY ()) + random .nextFloat () / 100.0F ;
219
-
220
- // Adjust footprint to left or right depending on step
221
- // count
222
- switch (galacticraft$getLastStep ()) {
223
- case 0 :
224
- pos .add (new Vector3d (Math .sin (Math .toRadians (-getYRot () + 90 )) * 0.25 , 0 , Math .cos (Math .toRadians (-getYRot () + 90 )) * 0.25 ));
225
- break ;
226
- case 1 :
227
- pos .add (new Vector3d (Math .sin (Math .toRadians (-getYRot () - 90 )) * 0.25 , 0 , Math .cos (Math .toRadians (-getYRot () - 90 )) * 0.25 ));
228
- break ;
229
- }
230
-
231
- pos = Footprint .getFootprintPosition (level , getYRot () - 180 , pos , position ());
205
+ // If it has been long enough since the last step
206
+ if (galacticraft$getDistanceSinceLastStep () > 0.35 ) {
207
+ Vector3d pos = new Vector3d (getX (), getY (), getZ ());
208
+ // Set the footprint position to the block below and add
209
+ // random number to stop z-fighting
210
+ pos .y = Mth .floor (getY ()) + random .nextFloat () / 100.0F ;
211
+
212
+ // Adjust footprint to left or right depending on step
213
+ // count
214
+ switch (galacticraft$getLastStep ()) {
215
+ case 0 :
216
+ pos .add (new Vector3d (Math .sin (Math .toRadians (-getYRot () + 90 )) * 0.25 , 0 , Math .cos (Math .toRadians (-getYRot () + 90 )) * 0.25 ));
217
+ break ;
218
+ case 1 :
219
+ pos .add (new Vector3d (Math .sin (Math .toRadians (-getYRot () - 90 )) * 0.25 , 0 , Math .cos (Math .toRadians (-getYRot () - 90 )) * 0.25 ));
220
+ break ;
221
+ }
222
+
223
+ pos = Footprint .getFootprintPosition (level , getYRot () - 180 , pos , position ());
224
+
225
+ int iPosX = Mth .floor (pos .x );
226
+ int iPosY = Mth .floor (pos .y - 0.05 );
227
+ int iPosZ = Mth .floor (pos .z );
228
+ BlockPos blockPos = new BlockPos (iPosX , iPosY , iPosZ );
229
+ BlockState state = this .level .getBlockState (blockPos );
232
230
231
+ // If the block below is the moon block
232
+ if (state .is (GCTags .FOOTPRINTS )) {
233
233
long chunkKey = ChunkPos .asLong (SectionPos .blockToSectionCoord (pos .x ), SectionPos .blockToSectionCoord (pos .z ));
234
234
level .galacticraft$getFootprintManager ().addFootprint (chunkKey , new Footprint (level .dimensionTypeRegistration ().unwrapKey ().get ().location (), pos , getYRot (), getUUID ()));
235
-
236
- // Increment and cap step counter at 1
237
- galacticraft$setLastStep ((galacticraft$getLastStep () + 1 ) % 2 );
238
- galacticraft$setDistanceSinceLastStep (0 );
239
- } else {
240
- galacticraft$setDistanceSinceLastStep (galacticraft$getDistanceSinceLastStep () + motionSqrd );
241
235
}
236
+
237
+ // Increment and cap step counter at 1
238
+ galacticraft$setLastStep ((galacticraft$getLastStep () + 1 ) % 2 );
239
+ galacticraft$setDistanceSinceLastStep (0 );
240
+ } else {
241
+ galacticraft$setDistanceSinceLastStep (galacticraft$getDistanceSinceLastStep () + motionSqrd );
242
242
}
243
243
}
244
244
}
0 commit comments