5959import net .wurstclient .settings .SettingGroup ;
6060import net .wurstclient .settings .SliderSetting ;
6161import net .wurstclient .settings .SliderSetting .ValueDisplay ;
62+ import net .wurstclient .nicewurst .NiceWurstModule ;
6263
6364@ SearchTags ({"map" , "minimap" , "world map" , "mapa" })
6465public final class MapaHack extends Hack
@@ -79,7 +80,7 @@ public final class MapaHack extends Hack
7980 private final CheckboxSetting noMap = new CheckboxSetting ("No map" ,
8081 "Disables terrain rendering and cache writes while keeping ESP icons positioned inside the map box." ,
8182 false );
82- private final SettingGroup espGroup = new SettingGroup ("ESP icons" ,
83+ private final SettingGroup mapEspGroup = new SettingGroup ("ESP icons" ,
8384 net .wurstclient .util .text .WText .literal (
8485 "Controls which enabled ESP hacks are mirrored onto the map." ),
8586 false , true );
@@ -177,9 +178,17 @@ public MapaHack()
177178 setCategory (Category .RENDER );
178179 addSetting (openWorldMapButton );
179180 addSetting (noMap );
180- espGroup .addChildren (chestEspOnMap , workstationEspOnMap , signEspOnMap ,
181- portalEspOnMap , playerEspOnMap , logoutSpotsOnMap , bedEspOnMap );
182- addSetting (espGroup );
181+ if (NiceWurstModule .isActive ())
182+ {
183+ mapEspGroup .addChildren (portalEspOnMap , playerEspOnMap ,
184+ logoutSpotsOnMap );
185+ }else
186+ {
187+ mapEspGroup .addChildren (chestEspOnMap , workstationEspOnMap ,
188+ signEspOnMap , portalEspOnMap , playerEspOnMap , logoutSpotsOnMap ,
189+ bedEspOnMap );
190+ }
191+ addSetting (mapEspGroup );
183192 addSetting (minimapIconSize );
184193 addSetting (worldMapIconSize );
185194 addSetting (iconOutline );
@@ -248,7 +257,16 @@ public void onRenderGUI(GuiGraphicsExtractor context, float partialTicks)
248257 if (MC .player == null || MC .level == null )
249258 return ;
250259
251- renderMapEsp (context , partialTicks , cfg );
260+ context .enableScissor (cfg .minimapPosX , cfg .minimapPosY ,
261+ cfg .minimapPosX + cfg .minimapSize ,
262+ cfg .minimapPosY + cfg .minimapSize );
263+ try
264+ {
265+ renderMapEsp (context , partialTicks , cfg );
266+ }finally
267+ {
268+ context .disableScissor ();
269+ }
252270 renderMinimapOverlay (context , cfg );
253271
254272 if (!isEditorScreen (MC .screen ))
@@ -850,6 +868,7 @@ public XMapConfig createConfig()
850868 private void updateMapSettingVisibility ()
851869 {
852870 boolean mapVisible = !noMap .isChecked ();
871+ boolean niceWurst = NiceWurstModule .isActive ();
853872 minimapSamples .setVisibleInGui (mapVisible );
854873 rotateWithPlayer .setVisibleInGui (mapVisible );
855874 undergroundMode .setVisibleInGui (mapVisible );
@@ -878,6 +897,13 @@ private void updateMapSettingVisibility()
878897 waterDetail .setVisibleInGui (mapVisible );
879898 waterOpacity .setVisibleInGui (mapVisible );
880899 chunkRefreshAggression .setVisibleInGui (mapVisible );
900+ chestEspOnMap .setVisibleInGui (mapVisible && !niceWurst );
901+ workstationEspOnMap .setVisibleInGui (mapVisible && !niceWurst );
902+ signEspOnMap .setVisibleInGui (mapVisible && !niceWurst );
903+ portalEspOnMap .setVisibleInGui (mapVisible );
904+ playerEspOnMap .setVisibleInGui (mapVisible );
905+ logoutSpotsOnMap .setVisibleInGui (mapVisible );
906+ bedEspOnMap .setVisibleInGui (mapVisible && !niceWurst );
881907 }
882908
883909 private static boolean isEditorScreen (Screen screen )
@@ -912,46 +938,55 @@ public void renderFullscreenMapEsp(GuiGraphicsExtractor context, int mapX,
912938 if (MC .player == null || MC .level == null )
913939 return ;
914940
915- if (chestEspOnMap .isChecked () && WURST .getHax ().chestEspHack .isEnabled ())
916- renderFullscreenChestMarkers (context , mapX , mapY , drawWidth ,
917- drawHeight , centerX , centerZ , blocksPerPixel );
918- if (workstationEspOnMap .isChecked ()
919- && WURST .getHax ().workstationEspHack .isEnabled ())
920- renderFullscreenBlockGroups (context , mapX , mapY , drawWidth ,
921- drawHeight , centerX , centerZ , blocksPerPixel ,
922- WURST .getHax ().workstationEspHack .getMapaGroups ());
923- if (signEspOnMap .isChecked () && WURST .getHax ().signEspHack .isEnabled ())
941+ context .enableScissor (mapX , mapY , mapX + drawWidth , mapY + drawHeight );
942+ try
924943 {
925- renderFullscreenAabbs (context , mapX , mapY , drawWidth , drawHeight ,
926- centerX , centerZ , blocksPerPixel ,
927- WURST .getHax ().signEspHack .getMapaSignBoxes (),
928- iconForItem (Items .OAK_SIGN ),
929- WURST .getHax ().signEspHack .getMapaSignColor ());
930- renderFullscreenAabbs (context , mapX , mapY , drawWidth , drawHeight ,
931- centerX , centerZ , blocksPerPixel ,
932- WURST .getHax ().signEspHack .getMapaFrameBoxes (1.0f ),
933- iconForItem (Items .ITEM_FRAME ),
934- WURST .getHax ().signEspHack .getMapaFrameColor ());
944+ if (chestEspOnMap .isChecked ()
945+ && WURST .getHax ().chestEspHack .isEnabled ())
946+ renderFullscreenChestMarkers (context , mapX , mapY , drawWidth ,
947+ drawHeight , centerX , centerZ , blocksPerPixel );
948+ if (workstationEspOnMap .isChecked ()
949+ && WURST .getHax ().workstationEspHack .isEnabled ())
950+ renderFullscreenBlockGroups (context , mapX , mapY , drawWidth ,
951+ drawHeight , centerX , centerZ , blocksPerPixel ,
952+ WURST .getHax ().workstationEspHack .getMapaGroups ());
953+ if (signEspOnMap .isChecked ()
954+ && WURST .getHax ().signEspHack .isEnabled ())
955+ {
956+ renderFullscreenAabbs (context , mapX , mapY , drawWidth ,
957+ drawHeight , centerX , centerZ , blocksPerPixel ,
958+ WURST .getHax ().signEspHack .getMapaSignBoxes (),
959+ iconForItem (Items .OAK_SIGN ),
960+ WURST .getHax ().signEspHack .getMapaSignColor ());
961+ renderFullscreenAabbs (context , mapX , mapY , drawWidth ,
962+ drawHeight , centerX , centerZ , blocksPerPixel ,
963+ WURST .getHax ().signEspHack .getMapaFrameBoxes (1.0f ),
964+ iconForItem (Items .ITEM_FRAME ),
965+ WURST .getHax ().signEspHack .getMapaFrameColor ());
966+ }
967+ if (portalEspOnMap .isChecked ()
968+ && WURST .getHax ().portalEspHack .isEnabled ())
969+ renderFullscreenBlockGroups (context , mapX , mapY , drawWidth ,
970+ drawHeight , centerX , centerZ , blocksPerPixel ,
971+ WURST .getHax ().portalEspHack .getMapaGroups ());
972+ if (playerEspOnMap .isChecked ()
973+ && WURST .getHax ().playerEspHack .isEnabled ())
974+ renderFullscreenPlayers (context , mapX , mapY , drawWidth ,
975+ drawHeight , centerX , centerZ , blocksPerPixel );
976+ if (logoutSpotsOnMap .isChecked ()
977+ && WURST .getHax ().logoutSpotsHack .isEnabled ())
978+ renderFullscreenLogoutSpots (context , mapX , mapY , drawWidth ,
979+ drawHeight , centerX , centerZ , blocksPerPixel );
980+ if (bedEspOnMap .isChecked () && WURST .getHax ().bedEspHack .isEnabled ())
981+ renderFullscreenAabbs (context , mapX , mapY , drawWidth ,
982+ drawHeight , centerX , centerZ , blocksPerPixel ,
983+ WURST .getHax ().bedEspHack .getMapaBoxes (),
984+ iconForItem (Items .RED_BED ),
985+ WURST .getHax ().bedEspHack .getMapaColor ());
986+ }finally
987+ {
988+ context .disableScissor ();
935989 }
936- if (portalEspOnMap .isChecked ()
937- && WURST .getHax ().portalEspHack .isEnabled ())
938- renderFullscreenBlockGroups (context , mapX , mapY , drawWidth ,
939- drawHeight , centerX , centerZ , blocksPerPixel ,
940- WURST .getHax ().portalEspHack .getMapaGroups ());
941- if (playerEspOnMap .isChecked ()
942- && WURST .getHax ().playerEspHack .isEnabled ())
943- renderFullscreenPlayers (context , mapX , mapY , drawWidth , drawHeight ,
944- centerX , centerZ , blocksPerPixel );
945- if (logoutSpotsOnMap .isChecked ()
946- && WURST .getHax ().logoutSpotsHack .isEnabled ())
947- renderFullscreenLogoutSpots (context , mapX , mapY , drawWidth ,
948- drawHeight , centerX , centerZ , blocksPerPixel );
949- if (bedEspOnMap .isChecked () && WURST .getHax ().bedEspHack .isEnabled ())
950- renderFullscreenAabbs (context , mapX , mapY , drawWidth , drawHeight ,
951- centerX , centerZ , blocksPerPixel ,
952- WURST .getHax ().bedEspHack .getMapaBoxes (),
953- iconForItem (Items .RED_BED ),
954- WURST .getHax ().bedEspHack .getMapaColor ());
955990 }
956991
957992 private void renderFullscreenChestMarkers (GuiGraphicsExtractor context ,
0 commit comments