Skip to content

Commit 0852c70

Browse files
committed
LootSearch
1 parent 51ff8f2 commit 0852c70

File tree

9 files changed

+694
-118
lines changed

9 files changed

+694
-118
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ I’m pleased to note that many of the features and improvements below are compl
5555
- AntiBlast
5656
- [NiceWurst](https://github.com/cev-api/NiceWurst)
5757
- SeedMapperHelper
58+
- LootSearch
5859
- OfflineSettings
5960
- TargetPlace
6061
- SurfaceXray
@@ -357,6 +358,14 @@ I did not, nor could I copy their code directly as most are Meteor based mods. S
357358

358359
![UI](https://i.imgur.com/4b5IA0u.png)
359360

361+
### LootSearch
362+
- Using [my fork](https://github.com/cev-api/SeedMapper-CevAPI) of [SeedMapper](https://github.com/xpple/SeedMapper/) you can export loot tables for selected/all structures and then parse that information using the same UI as ChestSearch.
363+
- Sorted by closest chest.
364+
- You can search for specific loot and set a waypoint towards it.
365+
- Will not function without a valid SeedMapper loot export JSON for the server you're in.
366+
367+
![Loot](https://i.imgur.com/7pkTPxW.png)
368+
360369
## What’s changed or improved in this fork?
361370

362371
### ItemESP (Expanded)

src/main/java/net/wurstclient/chestsearch/ChestRecorder.java

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public class ChestRecorder
4141
private final Map<Integer, List<ItemStack>> buffers = new HashMap<>();
4242
private final Map<Integer, TimerTask> pendingSnapshots = new HashMap<>();
4343

44+
// (notifications are handled by the UI layer)
45+
4446
public static class Bounds
4547
{
4648
public final int minX, minY, minZ;
@@ -461,45 +463,7 @@ private void recordFromStacksInternal(String serverIp, String dimension,
461463
manager.upsertChest(serverIp, dimension, minX, minY, minZ, items, maxX,
462464
maxY, maxZ, facing, Integer.valueOf(x), Integer.valueOf(y),
463465
Integer.valueOf(z));
464-
465-
// debug removed
466-
467-
// Notify container screen that chest was saved so UI text appears
468-
final int nx = minX, ny = minY, nz = minZ;
469-
try
470-
{
471-
Object screen = net.wurstclient.WurstClient.MC == null ? null
472-
: net.wurstclient.WurstClient.MC.screen;
473-
if(screen != null)
474-
{
475-
try
476-
{
477-
java.lang.reflect.Field fMsg =
478-
screen.getClass().getDeclaredField("lastRecordMessage");
479-
java.lang.reflect.Field fUntil =
480-
screen.getClass().getDeclaredField("lastRecordUntilMs");
481-
fMsg.setAccessible(true);
482-
fUntil.setAccessible(true);
483-
java.time.LocalTime t = java.time.LocalTime.now();
484-
String ts =
485-
t.truncatedTo(java.time.temporal.ChronoUnit.SECONDS)
486-
.toString();
487-
String msg = "Chest recorded, position " + nx + "," + ny
488-
+ "," + nz + " at " + ts;
489-
fMsg.set(screen, msg);
490-
fUntil.setLong(screen, System.currentTimeMillis() + 4000);
491-
}catch(NoSuchFieldException nsf)
492-
{
493-
// not the expected screen type, ignore
494-
}catch(Throwable ignored)
495-
{
496-
// reflection failed, ignore
497-
}
498-
}
499-
}catch(Throwable ignored)
500-
{
501-
ignored.printStackTrace();
502-
}
466+
// Notifications are handled on container close by the UI mixin.
503467
}
504468

505469
private static String sanitizePath(String raw)

0 commit comments

Comments
 (0)