Skip to content

Commit 245042f

Browse files
committed
Placeholder logic/configs for MapLoaderBot
1 parent 13083d7 commit 245042f

5 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/main/java/net/evmodder/evmod/Configs.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public static final class Generic{
8282
public static final ConfigInteger MAPART_AUTOREMOVE_AFTER = new ConfigInteger("mapArtAutoRemoveThreshold", 2, 1, 20, /*useSlider=*/true).apply(GENERIC_KEY);
8383
public static final ConfigDouble MAPART_AUTOREMOVE_REACH = new ConfigDouble("mapArtAutoRemoveReach", 3.9d).apply(GENERIC_KEY);
8484

85+
public static final ConfigBooleanHotkeyed MAPART_SUPPRESS_BOT = new ConfigBooleanHotkeyed("mapArtSuppressBot", false, "").apply(GENERIC_KEY);
86+
8587
public static final ConfigString WHISPER_PLAY_SOUND = new ConfigString("whisperPlaySound",
8688
Main.mapArtFeaturesOnly ? "" : "{sound:block.note_block.bass, category:PLAYERS, volume:.7, pitch:2}").apply(GENERIC_KEY);
8789
public static final ConfigString WHISPER_PLAY_SOUND_UNFOCUSED = new ConfigString("whisperPlaySoundUnfocused",
@@ -160,6 +162,7 @@ private static final List<IConfigBase> getConfigs(Settings settings){
160162
MAPART_AUTOPLACE.setBooleanValue(false);
161163
MAPART_AUTOREMOVE.setBooleanValue(false);
162164
}
165+
if(settings.mapLoaderBot) configs.add(MAPART_SUPPRESS_BOT);
163166
// if(settings.keybindMapArtMove || settings.keybindMapArtMoveBundle)
164167
configs.addAll(List.of(SKIP_NULL_MAPS, SKIP_VOID_MAPS));
165168
if(settings.mapHighlights) configs.add(SKIP_MONO_COLOR_MAPS);

src/main/java/net/evmodder/evmod/Main.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import net.evmodder.evmod.keybinds.KeybindInventoryRestock;
3232
import net.evmodder.evmod.listeners.*;
3333
import net.evmodder.evmod.onTick.AutoPlaceItemFrames;
34+
import net.evmodder.evmod.onTick.MapLoaderBot;
3435
import net.evmodder.evmod.onTick.TooltipMapLoreMetadata;
3536
import net.evmodder.evmod.onTick.TooltipMapNameColor;
3637
import net.evmodder.evmod.onTick.TooltipRepairCost;
@@ -117,7 +118,9 @@ public class Main{
117118
final WhisperPlaySound whisperPlaySound = mapArtFeaturesOnly ? null : new WhisperPlaySound();
118119
if(settings.gameMessageListener) new GameMessageListener(remoteSender, epearlLookup, whisperPlaySound);
119120
final GameMessageFilter gameMessageFilter = settings.gameMessageFilter ? new GameMessageFilter(remoteSender) : null;
120-
121+
if(settings.mapLoaderBot) TickListener.register(new TickListener(){
122+
@Override public void onTickStart(MinecraftClient client){MapLoaderBot.onTickStart(client);}
123+
});
121124
final KeybindInventoryOrganize[] kbInvOrgs = mapArtFeaturesOnly ? null : new KeybindInventoryOrganize[]{
122125
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_1.getStrings()),
123126
new KeybindInventoryOrganize(Configs.Hotkeys.INV_ORGANIZE_2.getStrings()),

src/main/java/net/evmodder/evmod/Settings.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ final class Settings{
1616
final boolean showNicheConfigs;
1717
final boolean storeDataInInstanceFolder;
1818
final boolean database, epearlOwners;
19-
final boolean inventoryRestockAuto, placementHelperIframeAutoPlace, placementHelperMapArt, placementHelperMapArtAutoPlace, placementHelperMapArtAutoRemove, broadcaster;
19+
final boolean placementHelperIframeAutoPlace, placementHelperMapArt, placementHelperMapArtAutoPlace, placementHelperMapArtAutoRemove;
20+
final boolean mapLoaderBot, inventoryRestockAuto, broadcaster;
2021
final boolean serverJoinListener, serverQuitListener, gameMessageListener, gameMessageFilter, containerOpenCloseListener;
2122
final boolean cmdAssignPearl, cmdDeletedMapsNearby, cmdExportMapImg, cmdMapArtGroup, cmdMapHashCode, cmdSeen, cmdSendAs, cmdTimeOnline;
2223
final boolean mapHighlights, mapHighlightsInGUIs, tooltipMapHighlights, tooltipMapMetadata, tooltipRepairCost;
@@ -65,6 +66,7 @@ private final boolean extractConfigValue(HashMap<String, Boolean> config, String
6566
placementHelperMapArt = extractConfigValue(settings, "placement_helper.mapart");
6667
placementHelperMapArtAutoPlace = placementHelperMapArt && extractConfigValue(settings, "placement_helper.mapart.autoplace");
6768
placementHelperMapArtAutoRemove = placementHelperMapArt && extractConfigValue(settings, "placement_helper.mapart.autoremove");
69+
mapLoaderBot = extractConfigValue(settings, "map_bot.loader");
6870
serverJoinListener = extractConfigValue(settings, "listener.server_join");
6971
serverQuitListener = extractConfigValue(settings, "listener.server_quit");
7072
gameMessageListener = extractConfigValue(settings, "listener.game_message.read");
@@ -96,9 +98,10 @@ private final boolean extractConfigValue(HashMap<String, Boolean> config, String
9698
List<Path> paths = Files.walk(Paths.get(mapGroupDir))
9799
.filter(Files::isRegularFile)
98100
.filter(p ->
99-
(p.getFileName().toString().indexOf('.') == -1 ||
100-
(p.getNameCount() > 1 && p.getName(p.getNameCount()-2).toString().equals("seen"))
101-
) && !p.getFileName().toString().endsWith(".group"))
101+
(p.getFileName().toString().indexOf('.') == -1 || (
102+
p.getNameCount() > 1 && p.getName(p.getNameCount()-2).toString().equals("seen")
103+
&& !p.getFileName().toString().startsWith(".")
104+
)) && !p.getFileName().toString().endsWith(".group"))
102105
.toList();
103106
if(!paths.isEmpty()){
104107
paths.stream().forEach(p -> p.toFile().renameTo(p.resolveSibling(p.getFileName().toString()+".group").toFile()));

src/main/resources/assets/evmod/settings.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ map_highlights.in_gui: true
1919
tooltip.map_highlights: true
2020
tooltip.map_metadata: true
2121
tooltip.repair_cost: true
22+
map_bot.loader: true
2223

24+
#
2325
listener.server_join: true # depends: mapstate_cache.inv, send_on_srvr_join
2426
listener.server_quit: true # depends: mapstate_cache.inv, log_logout_coords
2527
listener.container_open: true # depends: inventory_restock.auto, mapstate_cache.echest
2628

29+
#
2730
database: true
2831

32+
#
2933
listener.game_message.read: true # depends: share_ignores, whisper_sound, whisper_pearl_pull
3034
listener.game_message.filter: true # depends: borrow_ignores
3135
inventory_restock.auto: false

src/main/resources/assets/evmod/settings_for_mapart_ver.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ map_highlights.in_gui: true
1919
tooltip.map_highlights: true
2020
tooltip.map_metadata: true
2121
tooltip.repair_cost: true
22+
map_bot.loader: false
2223

2324
# Used by map state cacher (if you don't use that, I recommend setting them to false)
2425
listener.server_join: true

0 commit comments

Comments
 (0)