@@ -125,13 +125,13 @@ private void render(BlockEntity blockEntity, float partialTicks, PoseStack poseS
125125
126126 // PMWeatherAPI: Change ids to be integers instead of strings (also removes the String.format nightmare that was causing lag)
127127 int id = ((short ) x + resolution ) << 8 | ((short ) z + resolution );
128- String stringID = String . valueOf ( id ) ;
128+ long longID = ( long )( x + resolution + 1 ) + ( long )( z + resolution + 1 ) * (( long ) resolution * 2L + 1L ); ;
129129
130- float dbz = radarBlockEntity .reflectivityMap .getOrDefault (stringID , 0.0F );
131- float temp = radarBlockEntity .temperatureMap .getOrDefault (stringID , 15.0F );
132- float vel = radarBlockEntity .velocityMap .getOrDefault (stringID , 0.0F );
130+ float dbz = radarBlockEntity .reflectivityMap .getOrDefault (longID , 0.0F );
131+ float temp = radarBlockEntity .temperatureMap .getOrDefault (longID , 15.0F );
132+ float vel = radarBlockEntity .velocityMap .getOrDefault (longID , 0.0F );
133133 Color color = PMWClientStorages .RADAR_MODE_COLORS .computeIfAbsent (radarMode , rm -> new HashMap <>()).getOrDefault (id , new Color (1.0F , 0 , 1.0F ));
134- Color dbg = radarBlockEntity .debugMap .getOrDefault (stringID , new Color (0 , 0 , 0 ));
134+ Color dbg = radarBlockEntity .debugMap .getOrDefault (longID , new Color (0 , 0 , 0 ));
135135
136136 Vector3f pixelPos = (new Vector3f ((float )x , 0.0F , (float )z )).mul (1.0F / (float )resolution ).mul (sizeRenderDiameter / 2.0F );
137137 Vec3 worldPos = (new Vec3 (x , 0.0F , z )).multiply (1.0F / (float )resolution , 0.0F , (1.0F / (float )resolution )).multiply (simSize , 0.0F , simSize ).add (pos .getCenter ());
@@ -323,9 +323,9 @@ private void render(BlockEntity blockEntity, float partialTicks, PoseStack poseS
323323 temp = ThermodynamicEngine .samplePoint (GameBusClientEvents .weatherHandler , worldPos , blockEntity .getLevel (), radarBlockEntity , 0 ).temperature ();
324324 }
325325
326- radarBlockEntity .reflectivityMap .put (stringID , dbz );
327- radarBlockEntity .temperatureMap .put (stringID , temp );
328- radarBlockEntity .velocityMap .put (stringID , vel );
326+ radarBlockEntity .reflectivityMap .put (longID , dbz );
327+ radarBlockEntity .temperatureMap .put (longID , temp );
328+ radarBlockEntity .velocityMap .put (longID , vel );
329329
330330 // PMWeatherAPI: Support custom radar modes
331331 PixelRenderData pixelRenderData = new PixelRenderData (canRender , dbz * 60.0F , vel , temp , x , z , resolution , renderData );
@@ -404,7 +404,7 @@ private void render(BlockEntity blockEntity, float partialTicks, PoseStack poseS
404404 }
405405 }
406406
407- radarBlockEntity .debugMap .put (stringID , dbg );
407+ radarBlockEntity .debugMap .put (longID , dbg );
408408 }
409409 if (ClientConfig .radarDebugging ) {
410410 color = dbg ;
0 commit comments