3333import com .google .common .collect .Lists ;
3434import com .mojang .blaze3d .platform .GlStateManager ;
3535import io .github .axolotlclient .AxolotlClientConfig .api .util .Colors ;
36- import io .github .axolotlclient .AxolotlClientConfig .impl .ui .Element ;
3736import io .github .axolotlclient .AxolotlClientConfig .impl .ui .Screen ;
38- import io .github .axolotlclient .AxolotlClientConfig .impl .ui .Selectable ;
3937import io .github .axolotlclient .AxolotlClientConfig .impl .util .DrawUtil ;
4038import io .github .axolotlclient .waypoints .AxolotlClientWaypoints ;
4139import io .github .axolotlclient .waypoints .map .util .LevelChunkStorage ;
@@ -334,17 +332,10 @@ public static void saveLoadedChunkTile(int chunkX, int chunkZ) {
334332 Minecraft minecraft = Minecraft .getInstance ();
335333 var anchorX = chunkX << 4 ;
336334 var anchorZ = chunkZ << 4 ;
337- //anchorZ = anchorZ - anchorZ % TILE_SIZE;
338- //anchorX = anchorX - anchorX % TILE_SIZE;
339335 var level = minecraft .world ;
340336 int tileX = anchorX / TILE_SIZE ;
341337 int tileY = anchorZ / TILE_SIZE ;
342- /*if (anchorX < 0 && anchorX % TILE_SIZE != 0) {
343- tileX -= 1;
344- }
345- if (anchorZ < 0 && anchorZ % TILE_SIZE != 0) {
346- tileY -= 1;
347- }*/
338+
348339 var tileChunk = level .getChunkAt (tileX , tileY );
349340 if (tileChunk != null ) {
350341 var dir = getCurrentLevelMapSaveDir ();
@@ -358,9 +349,6 @@ public static void saveLoadedChunkTile(int chunkX, int chunkZ) {
358349 }
359350 }
360351
361- private double dragMouseX ;
362- private double dragMouseY ;
363-
364352 @ Override
365353 public boolean mouseClicked (double mouseX , double mouseY , int button ) {
366354 if (!super .mouseClicked (mouseX , mouseY , button )) {
@@ -373,9 +361,6 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
373361 minecraft .openScreen (new ContextMenuScreen (this , mouseX , mouseY , new ContextMenuScreen .Type .Map (dimension , worldX , getY (worldX , worldZ ), worldZ )));
374362 }
375363 return true ;
376- } else if (button == 0 ) {
377- dragMouseX = (mouseX - dragOffset .x );
378- dragMouseY = (mouseY - dragOffset .y );
379364 }
380365 return false ;
381366 }
@@ -386,7 +371,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int button) {
386371 public boolean mouseDragged (double mouseX , double mouseY , int button , double dragX , double dragY ) {
387372 if (!super .mouseDragged (mouseX , mouseY , button , dragX , dragY )) {
388373 if (button == 0 ) {
389- dragOffset .set ((float ) ( mouseX - dragMouseX ) , (float ) ( mouseY - dragMouseY ) , 0 );
374+ dragOffset .add ((float ) dragX , (float ) dragY , 0 );
390375 return true ;
391376 }
392377 return false ;
@@ -418,49 +403,6 @@ public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, doubl
418403
419404 @ Override
420405 public void init () {
421- class Overlay implements Element , Selectable {
422-
423- @ Override
424- public boolean isFocused () {
425- return true ;
426- }
427-
428- @ Override
429- public void setFocused (boolean focused ) {
430-
431- }
432-
433- @ Override
434- public SelectionType getType () {
435- return SelectionType .NONE ;
436- }
437-
438- @ Override
439- public boolean isMouseOver (double mouseX , double mouseY ) {
440- return true ;
441- }
442-
443- boolean called = false ;
444-
445- @ Override
446- public boolean mouseScrolled (double mouseX , double mouseY , double amountX , double amountY ) {
447- if (called ) return false ;
448- called = true ;
449- var bl = WorldMapScreen .this .mouseScrolled (mouseX , mouseY , amountX , amountY );
450- called = false ;
451- return bl ;
452- }
453-
454- @ Override
455- public boolean mouseDragged (double mouseX , double mouseY , int button , double deltaX , double deltaY ) {
456- if (called ) return false ;
457- called = true ;
458- var bl = WorldMapScreen .super .mouseDragged (mouseX , mouseY , button , deltaX , deltaY );
459- called = false ;
460- return bl ;
461- }
462- }
463- addSelectableChild (new Overlay ());
464406 addDrawableChild (new ImageButton (4 , height - 20 , 16 , 16 , new ImageButton .WidgetSprites (OPTIONS_SPRITE , OPTIONS_SPRITE , OPTIONS_HOVERED_SPRITE ),
465407 btn -> minecraft .openScreen (AxolotlClientWaypoints .createOptionsScreen (this )), AxolotlClientWaypoints .tr ("options" )));
466408 var slider = addDrawableChild (new AbstractSliderButton (width - 150 , 20 , 150 , 20 , AxolotlClientWaypoints .tr ("player_y" ), 0 ) {
0 commit comments