Skip to content

Commit 0e93ec4

Browse files
committed
Update db link, some translations/comments, and FileIO on 1st launch
1 parent 18ca5eb commit 0e93ec4

5 files changed

Lines changed: 31 additions & 29 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ maven_group=net.evmodder
2727
mod_id=evmod
2828
mod_name=Ev's Mod
2929

30-
#2 = database=TRUE by default, NewMapNotifier, /maphashcode, /mapartgroup seen/2b2t.org, x/SIZE, configs/settings refactor
30+
#2 = database=TRUE by default, NewMapNotifier, /maphashcode, /mapartgroup seen/2b2t.org, x/SIZE, configs/settings refactor, better tooltips
3131
#0 = initial release
3232
mod_version=2.0

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ private static final List<IConfigBase> getConfigs(Settings settings){
165165
if(settings.mapHighlights) configs.add(SKIP_MONO_COLOR_MAPS);
166166

167167
if(settings.gameMessageListener) configs.addAll(List.of(WHISPER_PLAY_SOUND, WHISPER_PLAY_SOUND_UNFOCUSED, WHISPER_PEARL_PULL));
168-
if(!Main.mapArtFeaturesOnly) configs.add(SCROLL_ORDER);
169-
if(settings.serverJoinListener) configs.add(SEND_ON_SERVER_JOIN);
170-
if(settings.serverQuitListener) configs.add(LOG_COORDS_ON_SERVER_QUIT);
168+
if(!Main.mapArtFeaturesOnly){
169+
configs.add(SCROLL_ORDER);
170+
if(settings.serverJoinListener) configs.add(SEND_ON_SERVER_JOIN);
171+
if(settings.serverQuitListener) configs.add(LOG_COORDS_ON_SERVER_QUIT);
172+
}
171173
if(settings.inventoryRestockAuto) configs.addAll(List.of(INV_RESTOCK_AUTO, INV_RESTOCK_AUTO_FOR_INV_ORGS));
172174
if(settings.broadcaster) configs.addAll(List.of(TEMP_BROADCAST_ACCOUNT, TEMP_BROADCAST_TIMESTAMP, TEMP_BROADCAST_MSGS));
173175
if(settings.showNicheConfigs) configs.add(DISABLE_DRAG_CLICK_ON_MAPS_AND_BUNDLES);
@@ -457,7 +459,7 @@ public static class Database{
457459
// public static final ConfigOptionList PLACEMENT_WARN = new ConfigOptionList("placementWarn", MessageOutputType.ACTIONBAR).apply(DATABASE_KEY);
458460
public static final ConfigInteger CLIENT_ID = new ConfigInteger("clientId", InitUtils.DUMMY_CLIENT_ID, 0, 1000000).apply(DATABASE_KEY);
459461
public static final ConfigString CLIENT_KEY = new ConfigString("clientKey", "").apply(DATABASE_KEY);
460-
public static final ConfigString ADDRESS = new ConfigString("address", Main.mapArtFeaturesOnly ? "" : "evmodder.net:14441").apply(DATABASE_KEY);
462+
public static final ConfigString ADDRESS = new ConfigString("address", Main.mapArtFeaturesOnly ? "" : "db.evmodder.net").apply(DATABASE_KEY);
461463
public static final ConfigBoolean SAVE_MAPART = new ConfigBoolean("saveSeenMapArt", !Main.mapArtFeaturesOnly).apply(DATABASE_KEY);
462464
public static final ConfigBoolean SHARE_MAPART = new ConfigBoolean("shareSeenMapArt", !Main.mapArtFeaturesOnly).apply(DATABASE_KEY);
463465
public static final ConfigBoolean EPEARL_OWNERS_BY_UUID = new ConfigBoolean("saveEpearlOwnersByUUID", !Main.mapArtFeaturesOnly).apply(DATABASE_KEY);

src/main/java/net/evmodder/evmod/commands/CommandExportMapImg.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private final int genImgForMapsInInv(final FabricClientCommandSource source, fin
146146
final int w = combine && allMaps.size() > unnestedMaps.size() ? (int)Math.ceil(Math.sqrt(allMaps.size())) : Math.min(width, unnestedMaps.size());
147147
final BufferedImage img = drawImgForMapStates(source, combine ? allMaps : unnestedMaps, w);
148148

149-
if(!new File(FileIO.DIR+MAP_EXPORT_DIR).exists()) new File(FileIO.DIR+MAP_EXPORT_DIR).mkdir();
149+
if(!new File(FileIO.DIR+MAP_EXPORT_DIR).exists()) new File(FileIO.DIR+MAP_EXPORT_DIR).mkdirs();
150150
try{ImageIO.write(img, "png", new File(lastRelPath=(FileIO.DIR+MAP_EXPORT_DIR+name+".png")));}
151151
catch(IOException e){e.printStackTrace();}
152152

@@ -291,7 +291,7 @@ private final void buildMapImgFile(final FabricClientCommandSource source, final
291291
}
292292

293293
//16755200
294-
if(!new File(FileIO.DIR+MAP_EXPORT_DIR).exists()) new File(FileIO.DIR+MAP_EXPORT_DIR).mkdir();
294+
if(!new File(FileIO.DIR+MAP_EXPORT_DIR).exists()) new File(FileIO.DIR+MAP_EXPORT_DIR).mkdirs();
295295
final String relFilePath = FileIO.DIR+MAP_EXPORT_DIR+imgName+".png";
296296
final File imgFile = new File(relFilePath);
297297
if(imgFile.exists()) ++overwritten;

src/main/java/net/evmodder/evmod/commands/CommandMapArtGroup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public final HashSet<UUID> getGroupIdsOrSendError(final TextListener source, fin
6969

7070
final String notFoundGroups = IntStream.range(0, groups.length).filter(i -> data[i] == null).mapToObj(i -> groups[i]).collect(Collectors.joining(","));
7171
if(!notFoundGroups.isEmpty()){
72-
source.sendError(Text.literal("MapArtGroup file(s) not found: "+DIR+notFoundGroups).withColor(ERROR_COLOR));
72+
Main.LOGGER.info("MapArtGroup file(s) not found: "+DIR+notFoundGroups);
7373
String plural = notFoundGroups.indexOf(',') !=- 1 ? "s" : "";
7474
source.sendError(Text.translatable(PREFIX+"notFound", plural, notFoundGroups).withColor(ERROR_COLOR));
7575
// source.sendError(Text.literal("MapArtGroup"+plural+" not found: "+notFoundGroups).withColor(ERROR_COLOR));
@@ -293,7 +293,7 @@ else if(!mapsInGroup.addAll(mapsToAdd)/*mapsInGroup.size() == oldSize*/){
293293
final ByteBuffer bb = ByteBuffer.allocate(mapsInGroup.size()*16);
294294
for(UUID uuid : mapsInGroup) bb.putLong(uuid.getMostSignificantBits()).putLong(uuid.getLeastSignificantBits());
295295
File dir = new File(FileIO.DIR+DIR);
296-
if(!dir.exists()) dir.mkdir();
296+
if(!dir.exists()) dir.mkdirs();
297297
FileIO.saveFileBytes(DIR+groups[0], bb.array());
298298
source.sendFeedback(switch(cmd){
299299
case Command.CREATE -> Text.translatable(

src/main/resources/assets/evmod/lang/en_us.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"evmod.config.generic.comment.bundlesAreReversed": "When pulling items out of a bundle, use reverse index (goofy 2b2t thing, thx Hause)",
101101

102102
"evmod.config.generic.name.mapStateCache": "mapCache",
103-
"evmod.config.generic.comment.mapStateCache": "Preserves cached map previews in player's inventory or echest between sessions (since MapStates get unloaded when you log off 2b2t)",
103+
"evmod.config.generic.comment.mapStateCache": "Preserves cached map previews in player's inventory or echest between sessions\n(since MapStates get unloaded when you log off 2b2t)",
104104
"evmod.config.generic.name.mapStateCacheUnlocked": "mapCacheUnlocked",
105105
"evmod.config.generic.name.mapStateCacheById": "mapCache: by MapId",
106106
"evmod.config.generic.comment.mapStateCacheById": "Does not work on 2b2t!",
@@ -116,15 +116,15 @@
116116
"evmod.config.generic.name.mapArtDefaultGroup": "mapArtDefaultGroup",
117117
"evmod.config.generic.comment.mapArtDefaultGroup": "Default selected group (for highlights). Overridden when using /MapArtGroup",
118118
"evmod.config.generic.name.mapArtGroupUnlockedMapHandling": "mapArtGroupUnlockedMapHandling",
119-
"evmod.config.generic.comment.mapArtGroupUnlockedMapHandling": "Should unlocked maparts be added to MapArtGroups? And if so, should identical-image unlocked and locked mapart be treated as unique (different hashcode)?",
119+
"evmod.config.generic.comment.mapArtGroupUnlockedMapHandling": "Should unlocked maparts be added to MapArtGroups?\nAnd if so, should identical-image unlocked and locked mapart be treated as unique (different hashcode)?",
120120
// unused:
121121
"evmod.config.generic.name.mapArtGroupIncludeUnlocked": "mapArtGroupIncludeUnlocked",
122122
"evmod.config.generic.comment.mapArtGroupIncludeUnlocked": "Include unlocked maps in MapGroups (not recommended)",
123123
"evmod.config.generic.name.mapArtGroupTreatUnlockedAsUnique": "mapArtGroupEnforceLockedMatch",
124124
"evmod.config.generic.comment.mapArtGroupTreatUnlockedAsUnique": "If true, identical-image locked/vs/unlocked maps will be treated as if they are distinct maparts",
125125

126126
"evmod.config.generic.name.iFrameNewMapNotifier": "iFrameNewMapNotifier",
127-
"evmod.config.generic.comment.iFrameNewMapNotifier": "Popup in chat/actionbar when map not in the current group are detected nearby; super useful for maphunting around spawn, but can get very annoying",
127+
"evmod.config.generic.comment.iFrameNewMapNotifier": "Popup in chat/actionbar when map not in the current group are detected nearby;\nsuper useful for map hunting around spawn, but can get annoying",
128128

129129
"evmod.config.generic.name.iFrameTrackingDist": "iFrameTrackingDist",
130130
"evmod.config.generic.comment.iFrameTrackingDist": "Set to 0 to disable recalculating nearby iFrames (slightly better performance)",
@@ -143,7 +143,7 @@
143143
// "evmod.config.generic.comment.iFrameAutoPlacerRotatePlayer": "",
144144

145145
"evmod.config.generic.name.iFrameDisallowOffhand": "iFrameDisallowOffhand",
146-
"evmod.config.generic.comment.iFrameDisallowOffhand": "Disable placing items into iFrames from the offhand (I don't need to display my offhand totem)",
146+
"evmod.config.generic.comment.iFrameDisallowOffhand": "Disable placing items into iFrames from the offhand\n(I don't need to display my offhand totem)",
147147

148148
"evmod.config.generic.name.mapArtPlacer": "mapArtPlacer",
149149
"evmod.config.generic.comment.mapArtPlacer": "MapArt Placement Helper",
@@ -158,7 +158,7 @@
158158
"evmod.config.generic.name.mapArtAutoPlaceInvDelay": "mapArtAutoPlaceInvDelay",
159159
"evmod.config.generic.comment.mapArtAutoPlaceInvDelay": "How many ticks to wait between inventory actions",
160160
"evmod.config.generic.name.mapArtAutoPlaceAntiRotate": "mapArtAutoPlaceAntiRotate",
161-
"evmod.config.generic.comment.mapArtAutoPlaceAntiRotate": "Disable rotating maparts in frames when AutoPlace is active (helps prevent accidental rotating with misclicks)",
161+
"evmod.config.generic.comment.mapArtAutoPlaceAntiRotate": "Disable rotating maparts in frames when AutoPlace is active\n(helps prevent accidental rotating with misclicks)",
162162
"evmod.config.generic.name.mapArtAutoPlaceIFrames": "mapArtAutoPlaceIFrames",
163163
"evmod.config.generic.comment.mapArtAutoPlaceIFrames": "Also place missing iFrames when auto-placing mapart",
164164
"evmod.config.generic.name.mapArtAutoPlaceSendSwingHandPacket": "mapArtAutoPlaceSendSwingHandPacket",
@@ -181,7 +181,7 @@
181181
"evmod.config.generic.comment.whisperPearlPull": "/w msg to trigger a pearl",
182182

183183
"evmod.config.generic.name.ignoreNullMapsInHighlightsAndKeybinds": "ignoreNullMapsInHighlightsAndKeybinds",
184-
"evmod.config.generic.comment.ignoreNullMapsInHighlightsAndKeybinds": "Treat maps with confirmed missing MapState (not just unloaded, but actually deleted (thx Hause)) as filler items.",
184+
"evmod.config.generic.comment.ignoreNullMapsInHighlightsAndKeybinds": "Treat maps with confirmed missing* MapState as filler items.\n(NOT merely unloaded MapState, but actually deleted (thx Hause))",
185185
"evmod.config.generic.name.ignoreTransparentMapsInHighlightsAndKeybinds": "ignoreTransparentMapsInHighlightsAndKeybinds",
186186
"evmod.config.generic.comment.ignoreTransparentMapsInHighlightsAndKeybinds": "Treat fully transparent maps as filler items (this is actually very useful IMO)",
187187
"evmod.config.generic.name.ignoreMonoColorMapsInHightlights": "ignoreMonoColorMapsInHightlights",
@@ -192,7 +192,7 @@
192192
"evmod.config.generic.name.sendChatsOnServerJoin": "sendChatsOnServerJoin*",
193193
"evmod.config.generic.comment.sendChatsOnServerJoin": "Automatically send chats/commands upon joining a server",
194194
"evmod.config.generic.name.logCoordsOnServerQuit": "logCoordsOnServerQuit",
195-
"evmod.config.generic.comment.logCoordsOnServerQuit": "Prints coords to /logs/latest.log when disconnecting; useful sometimes to rescue an account from a sticky situation",
195+
"evmod.config.generic.comment.logCoordsOnServerQuit": "Prints coords to /logs/latest.log when disconnecting;\nuseful sometimes to rescue an account from a sticky situation",
196196
"evmod.config.generic.name.inventoryRestockAuto": "inventoryRestockAuto",
197197
"evmod.config.generic.comment.inventoryRestockAuto": "When opening shulkers/chests, automatically restocks consumables in your inventory",
198198
"evmod.config.generic.name.inventoryRestockAutoForOrganization": "inventoryRestockAutoForOrganization",
@@ -204,7 +204,7 @@
204204
"evmod.config.generic.name.broadcastMsgs": "broadcastMsgs*",
205205
// "evmod.config.generic.comment.broadcastMsgs": "",
206206
"evmod.config.generic.name.fix2b2tGhostItems": "fix2b2tGhostItems*",
207-
"evmod.config.generic.comment.fix2b2tGhostItems": "Disables drag-clicking for certain items (bundles, maps, and banners); credit to EnderKill98 for telling me how to fix this",
207+
"evmod.config.generic.comment.fix2b2tGhostItems": "Disables drag-clicking for certain items (bundles, maps, and banners);\ncredit to EnderKill98 for telling me how to fix this",
208208

209209
// VISUALS:
210210
// "evmod.config.visuals.name.displayTotemCount": "displayTotemCount",
@@ -282,7 +282,7 @@
282282
"evmod.config.visuals.name.exportMapImageBorderColor2": "exportMapImageBorderColor2",
283283
// "evmod.config.visuals.comment.exportMapImageBorderColor2": "",
284284
"evmod.config.visuals.name.exportMapAtomicIdNaming": "exportMapAtomicIdNaming",
285-
"evmod.config.visuals.comment.exportMapAtomicIdNaming": "Use an atomically increasing number rather than use the ingame item name for the generated .png file. Useful for Windows users, where certain characters are prohibitied in filenames",
285+
"evmod.config.visuals.comment.exportMapAtomicIdNaming": "Use an atomically increasing number rather than use the ingame item name for the generated .png file.\nUseful for Windows users, where certain characters are prohibitied in filenames",
286286

287287
// HOTKEYS:
288288
"evmod.config.hotkeys.name.openConfigGui": "openConfigGui",
@@ -300,7 +300,7 @@
300300
"evmod.config.hotkeys.comment.mapMoveIgnoreAirPockets": "Disregard empty space in containers",
301301

302302
"evmod.config.hotkeys.name.mapMoveNeighbors": "mapMoveNeighbors",
303-
"evmod.config.hotkeys.comment.mapMoveNeighbors": "If holding this key while placing a map item into a slot, will try and move adjacent map items if part of the same mapart",
303+
"evmod.config.hotkeys.comment.mapMoveNeighbors": "If holding this key while placing a map item into a slot,\nwill try and move adjacent map items if part of the same mapart",
304304

305305
"evmod.config.hotkeys.name.mapMoveBundle": "mapMoveBundle",
306306
"evmod.config.hotkeys.comment.mapMoveBundle": "Take/Stow maps in bundle",
@@ -311,11 +311,11 @@
311311
"evmod.config.hotkeys.name.mapMoveBundleStowNonSingleMaps": "mapMoveBundleStowNonSingleMaps",
312312
"evmod.config.hotkeys.comment.mapMoveBundleStowNonSingleMaps": "Should the keybind also put maps with item.count > 1 into bundles?",
313313
"evmod.config.hotkeys.name.mapMoveBundleTakeMax": "mapMoveBundleRemoveMax",
314-
"evmod.config.hotkeys.comment.mapMoveBundleTakeMax": "Maximum maps to extract per keybind click. Sometimes nice to limit this to 27 if you are moving maps from bundles -> shulkers",
314+
"evmod.config.hotkeys.comment.mapMoveBundleTakeMax": "Maximum maps to extract per keybind click.\nSometimes nice to limit this to 27 if you are moving maps from bundles -> shulkers",
315315
"evmod.config.hotkeys.name.mapMoveBundleSelectPrioForStow": "mapMoveBundleSelectPrioForStow",
316-
"evmod.config.hotkeys.comment.mapMoveBundleSelectPrioForStow": "When there is no bundle on the cursor, and multiple bundles with empty space in the inventory, what selection strategy do we use for bundle-store?",
316+
"evmod.config.hotkeys.comment.mapMoveBundleSelectPrioForStow": "When there is no bundle on the cursor, and multiple bundles with empty space in the inventory,\nwhat selection strategy do we use for bundle-store?",
317317
"evmod.config.hotkeys.name.mapMoveBundleSelectPrioForTake": "mapMoveBundleSelectPrioForTake",
318-
"evmod.config.hotkeys.comment.mapMoveBundleSelectPrioForTake": "When there is no bundle on the cursor, and multiple bundles with mapart in the inventory, what selection strategy do we use for bundle-extract?",
318+
"evmod.config.hotkeys.comment.mapMoveBundleSelectPrioForTake": "When there is no bundle on the cursor, and multiple bundles with mapart in the inventory,\nwhat selection strategy do we use for bundle-extract?",
319319

320320
"evmod.config.hotkeys.name.toggleCape": "toggleCape",
321321
// "evmod.config.hotkeys.comment.toggleCape": "",
@@ -379,27 +379,27 @@
379379

380380
// DATABASE:
381381
"evmod.config.database.name.clientId": "clientId",
382-
"evmod.config.database.comment.clientId": "Unique user id for database to recognize us by",
382+
"evmod.config.database.comment.clientId": "Unique user id for database to recognize you by",
383383
"evmod.config.database.name.clientKey": "clientKey",
384-
"evmod.config.database.comment.clientKey": "Keep it secret! This key is used to encrypt your database requests; sharing it with other players could let them pretend to be you (when talking to the DB)",
384+
"evmod.config.database.comment.clientKey": "Keep it secret! This key is used to encrypt your database requests;\nsharing it with other players could let them pretend to be you (when talking to the DB)",
385385
"evmod.config.database.name.address": "address",
386-
"evmod.config.database.comment.address": "Default value is a globally-shared DB. Feel free to setup your own DB, or leave blank.",
386+
"evmod.config.database.comment.address": "Feel free to setup your own DB, or set to blank to disable.\nI've got an instance available for public use: db.evmodder.net",
387387
"evmod.config.database.name.saveSeenMapArt": "saveMapArtHashCodes*",
388388
"evmod.config.database.comment.saveSeenMapArt": "Save MapArt HashCodes to a file",
389389
"evmod.config.database.name.shareSeenMapArt": "shareMapArtHashCodes*",
390-
"evmod.config.database.comment.shareSeenMapArt": "Participate in MapArt HashCode database (requires saveMapArtHashCodes=true)",
390+
"evmod.config.database.comment.shareSeenMapArt": "Participate in MapArt HashCode database\n(requires saveMapArtHashCodes=true)",
391391
"evmod.config.database.name.saveEpearlOwnersByUUID": "saveEpearlOwnersByUUID*",
392392
"evmod.config.database.comment.saveEpearlOwnersByUUID": "Save [Epearl.Id->Owner] to a file",
393393
"evmod.config.database.name.saveEpearlOwnersByXZ": "saveEpearlOwnersByXZ*",
394394
"evmod.config.database.comment.saveEpearlOwnersByXZ": "Save [Epearl.X,Z->Owner] to a file",
395395
"evmod.config.database.name.shareEpearlOwners": "shareEpearlOwners*",
396-
"evmod.config.database.comment.shareEpearlOwners": "Participate in EpearlOwner database (requires saveEpearlOwnersByUUID=true)",
396+
"evmod.config.database.comment.shareEpearlOwners": "Participate in EpearlOwner database\n(requires saveEpearlOwnersByUUID=true)",
397397
"evmod.config.database.name.saveIgnoreList": "saveIgnoreList*",
398398
"evmod.config.database.comment.saveIgnoreList": "Save ignorelists to ./configs/evmod/ignores/",
399399
"evmod.config.database.name.shareIgnoreList": "shareIgnoreList*",
400-
"evmod.config.database.comment.shareIgnoreList": "Share your /ignorehard list with the database (requires saveIgnoreList=true)",
400+
"evmod.config.database.comment.shareIgnoreList": "Share your /ignorehard list with the database\n(requires saveIgnoreList=true)",
401401
"evmod.config.database.name.borrowIgnoreLists": "borrowIgnoreLists*",
402-
"evmod.config.database.comment.borrowIgnoreLists": "Apply /ignorehard lists from other accounts (doesn't affect your own list. Requires saveIgnoreList=true. If database is unlinked, will only work for accounts on the same instance, i.e. alts.)",
402+
"evmod.config.database.comment.borrowIgnoreLists": "Apply /ignorehard lists from other accounts.\nDoesn't affect your own list. Requires saveIgnoreList=true.\nIf database is unlinked, will only work for accounts on the same instance, i.e. alts.",
403403
"evmod.config.database.name.shareJoinQuit": "shareJoinQuitMsgs*",
404404
"evmod.config.database.comment.shareJoinQuit": "Used to power /seen, /timeonline, etc."
405405
}

0 commit comments

Comments
 (0)