1212import  com .eerussianguy .blazemap .engine .cache .ChunkMDCache ;
1313import  com .eerussianguy .blazemap .engine .client .ClientEngine ;
1414import  com .eerussianguy .blazemap .feature .waypoints .WaypointEditorFragment ;
15+ 
1516import  net .minecraft .core .BlockPos ;
1617import  net .minecraft .core .SectionPos ;
1718import  net .minecraft .world .level .ChunkPos ;
@@ -64,20 +65,20 @@ public static void open() {
6465    }
6566
6667    public  static  void  apply (Consumer <WorldMapGui > function ) {
67-         if   (Minecraft .getInstance ().screen  instanceof  WorldMapGui  gui ) {
68+         if (Minecraft .getInstance ().screen  instanceof  WorldMapGui  gui ) {
6869            function .accept (gui );
6970        }
7071    }
7172
72-     private  static  final  WorldMapHotkey [] HOTKEYS  = new  WorldMapHotkey []{
73-              new  WorldMapHotkey ("LMB" , "Drag to pan the map" ),
74-              new  WorldMapHotkey ("RMB" , "Open context menu" ),
75-              new  WorldMapHotkey ("Scroll" , "Zoom in / out" ),
76-              new  WorldMapHotkey (BlazeMapFeaturesClient .KEY_WAYPOINTS .getKey ().getDisplayName ().getString ().toUpperCase (), "Create waypoint at cursor" ),
77-              new  WorldMapHotkey ("F1" , "Toggle map UI" ),
78-              new  WorldMapHotkey ("F3" , "Toggle debug info" ),
79-              new  WorldMapHotkey ("F12" , "Export atlas" ),
80-              new  WorldMapHotkey ("W A S D" , "Pan the map" )
73+     private  static  final  WorldMapHotkey [] HOTKEYS  = new  WorldMapHotkey []  {
74+         new  WorldMapHotkey ("LMB" , "Drag to pan the map" ),
75+         new  WorldMapHotkey ("RMB" , "Open context menu" ),
76+         new  WorldMapHotkey ("Scroll" , "Zoom in / out" ),
77+         new  WorldMapHotkey (BlazeMapFeaturesClient .KEY_WAYPOINTS .getKey ().getDisplayName ().getString ().toUpperCase (), "Create waypoint at cursor" ),
78+         new  WorldMapHotkey ("F1" , "Toggle map UI" ),
79+         new  WorldMapHotkey ("F3" , "Toggle debug info" ),
80+         new  WorldMapHotkey ("F12" , "Export atlas" ),
81+         new  WorldMapHotkey ("W A S D" , "Pan the map" )
8182    };
8283
8384
@@ -131,14 +132,14 @@ protected void init() {
131132        maps .add (new  Image (HEADER_MAPS , 16 , 16 ).tooltip (new  TextComponent ("Maps" )));
132133        maps .addSpacer ();
133134        List <LineContainer > layerSets  = new  ArrayList <>();
134-         for   (var  mapType  : mapTypes ) {
135+         for (var  mapType  : mapTypes ) {
135136            LineContainer  layerSet  = new  LineContainer (ContainerAxis .VERTICAL , ContainerDirection .NEGATIVE , 2 ).withBackground ();
136137            components .anchor (layerSet , brand_icon , ContainerAxis .VERTICAL , ContainerDirection .POSITIVE );
137138            layerSets .add (layerSet );
138139            maps .add (new  MapTypeButton (mapType .getID (), map , layerSets , layerSet ));
139140
140141            layerSet .setVisible (map .getMapType ().getID ().equals (mapType .getID ()));
141-             for   (var  layer  : mapType .getLayers ()) {
142+             for (var  layer  : mapType .getLayers ()) {
142143                layerSet .add (new  LayerButton (layer , map ));
143144            }
144145            layerSet .addSpacer ().add (new  Image (HEADER_LAYERS , 16 , 16 ).tooltip (new  TextComponent ("Layers" )));
@@ -148,7 +149,7 @@ protected void init() {
148149        LineContainer  overlaySet  = new  LineContainer (ContainerAxis .HORIZONTAL , ContainerDirection .POSITIVE , 2 ).withBackground ();
149150        overlaySet .add (new  Image (HEADER_OVERLAYS , 16 , 16 ).tooltip (new  TextComponent ("Overlays" )));
150151        overlaySet .addSpacer ();
151-         for   (var  overlay  : overlays ) {
152+         for (var  overlay  : overlays ) {
152153            overlaySet .add (new  OverlayButton (overlay .getID (), map ));
153154        }
154155        components .add (overlaySet , ContainerAnchor .BOTTOM_LEFT );
@@ -182,7 +183,7 @@ protected void init() {
182183    private  void  updateLegend () {
183184        var  legend  = WrappedComponent .ofNullable (map .getMapType ().getLayers ().iterator ().next ().value ().getLegendWidget ());
184185
185-         if   (legend  == null ) {
186+         if (legend  == null ) {
186187            this .legend .clear ();
187188        } else  {
188189            this .legend .add (legend );
@@ -203,30 +204,30 @@ public boolean mouseDragged(double p_94699_, double p_94700_, int p_94701_, doub
203204
204205    @ Override 
205206    public  boolean  keyPressed (int  key , int  scancode , int  modifiers ) {
206-         if   (key  == GLFW .GLFW_KEY_F1 ) {
207+         if (key  == GLFW .GLFW_KEY_F1 ) {
207208            visibilityController .toggleVisible ();
208209            return  true ;
209210        }
210211
211-         if   (key  == GLFW .GLFW_KEY_F12 ) {
212+         if (key  == GLFW .GLFW_KEY_F12 ) {
212213            AtlasExporter .exportAsync (new  AtlasTask (this .dimension , map .getMapType ().getID (), map .getRenderer ().getVisibleLayers (), TileResolution .FULL , map .getRenderer ().getCenterRegion ()));
213214            return  true ;
214215        }
215216
216-         if   (key  == GLFW .GLFW_KEY_F3 ) {
217+         if (key  == GLFW .GLFW_KEY_F3 ) {
217218            renderDebug  = !renderDebug ;
218219            return  true ;
219220        }
220221
221-         if   (root .keyPressed (key , scancode , modifiers )) return  true ;
222-         if   (super .keyPressed (key , scancode , modifiers )) return  true ;
222+         if (root .keyPressed (key , scancode , modifiers )) return  true ;
223+         if (super .keyPressed (key , scancode , modifiers )) return  true ;
223224
224-         if   (key  == BlazeMapFeaturesClient .KEY_MAPS .getKey ().getValue ()) {
225+         if (key  == BlazeMapFeaturesClient .KEY_MAPS .getKey ().getValue ()) {
225226            this .onClose ();
226227            return  true ;
227228        }
228229
229-         if   (key  == BlazeMapFeaturesClient .KEY_WAYPOINTS .getKey ().getValue ()) {
230+         if (key  == BlazeMapFeaturesClient .KEY_WAYPOINTS .getKey ().getValue ()) {
230231            Level  level  = Minecraft .getInstance ().level ;
231232            int  posY  = level  == null  ? 60  : level .getSeaLevel ();
232233            Coordination  coordination  = map .getCoordination ();
@@ -235,12 +236,12 @@ public boolean keyPressed(int key, int scancode, int modifiers) {
235236
236237            // Attempt to get y actual level from MDCache 
237238            ChunkMDCache  mdCache  = ClientEngine .getMDCache (chunkPos );
238-             if   (mdCache  != null ) {
239+             if (mdCache  != null ) {
239240                TerrainHeightMD  heightMD  = (TerrainHeightMD ) mdCache .get (
240-                          UnsafeGenerics .stripKey (BlazeMapReferences .MasterData .TERRAIN_HEIGHT )
241+                     UnsafeGenerics .stripKey (BlazeMapReferences .MasterData .TERRAIN_HEIGHT )
241242                );
242243
243-                 if   (heightMD  != null ) {
244+                 if (heightMD  != null ) {
244245                    int  chunkX  = SectionPos .sectionRelative (position .getX ());
245246                    int  chunkZ  = SectionPos .sectionRelative (position .getZ ());
246247                    posY  = heightMD .heightmap [chunkX ][chunkZ ];
0 commit comments