Skip to content

Commit f596c06

Browse files
committed
Updated OreAirCheck and Added Highlight Auto Refresh
1 parent de00a67 commit f596c06

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Example: ```/sm:config BlockHighlightESP set outlineColor #ff0000 outlineAlpha 0
108108

109109
![ESP](https://i.imgur.com/LaHAJnI.png)
110110

111+
### Auto Clear Highlights
112+
When an existing ESP highlight is already rendered and the user makes a new highlight run (on a new block/area) the highlights are now automatically cleared/refreshed. This allows air/lava checks to apply on new results.
113+
111114
### Improved Waypoints
112115
Supports [Wurst7-CevAPI](https://github.com/cev-api/Wurst7-CevAPI) waypoints, Xaero Waypoints and its own waypoint system via right click context menu.
113116

@@ -117,7 +120,6 @@ Added the ability to set the waypoint compass overlay to be manually toggled ins
117120

118121
I also added the ability to import waypoints from [Wurst7-CevAPI](https://github.com/cev-api/Wurst7-CevAPI). Will soon be adding Xaero waypoint as well.
119122

120-
121123
![Map](https://i.imgur.com/1qDgQw7.png)
122124

123125
### Highlight Timeout Setting
@@ -134,9 +136,12 @@ If the server you're in already has a seed in the database, or it has just been
134136
You can enable/disable this with ```/sm:config AutoApplySeedCrackerSeed true/false```
135137

136138
### Mark As Complete
137-
Can now right click on structures and mark them as complete/incomplete which adds a green tick over the icon
139+
Can now right click on locations and mark them as complete/incomplete which adds a green tick over the icon.
138140

139141
![Complete Me](https://i.imgur.com/tITHz8W.png)
140142

143+
### OreAirCheck Expanded
144+
Now also skips highlights when an ore position is lava‑filled (same logic as air check).
145+
141146
### Notes
142147
If using the original SeedMapper after using my fork you must erase my ```config.json``` first due to the mismatch of settings.

src/main/java/dev/xpple/seedmapper/command/commands/HighlightCommand.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
import net.minecraft.core.BlockPos;
2727
import net.minecraft.network.chat.Component;
2828
import net.minecraft.world.level.ChunkPos;
29+
import net.minecraft.world.level.block.Blocks;
2930
import net.minecraft.world.level.chunk.LevelChunk;
3031
import net.minecraft.world.level.chunk.LevelChunkSection;
3132
import net.minecraft.world.level.chunk.status.ChunkStatus;
33+
import net.minecraft.world.level.material.Fluids;
3234
import org.jetbrains.annotations.Nullable;
3335

3436
import java.lang.foreign.Arena;
@@ -91,6 +93,7 @@ private static int highlightBlock(CustomClientCommandSource source, Pair<Integer
9193
}
9294

9395
private static int highlightBlock(CustomClientCommandSource source, Pair<Integer, Integer> blockPair, int chunkRange) throws CommandSyntaxException {
96+
RenderManager.clear();
9497
SeedIdentifier seed = source.getSeed().getSecond();
9598
int version = source.getVersion();
9699
int dimension = source.getDimension();
@@ -140,7 +143,7 @@ private static int highlightBlock(CustomClientCommandSource source, Pair<Integer
140143
for (int i = 0; i < size; i++) {
141144
MemorySegment pos3 = Pos3.asSlice(pos3s, i);
142145
BlockPos pos = new BlockPos(Pos3.x(pos3), Pos3.y(pos3), Pos3.z(pos3));
143-
if (doAirCheck && chunk.getBlockState(pos).isAir()) {
146+
if (doAirCheck && isAirOrLava(chunk, pos)) {
144147
continue;
145148
}
146149
Integer previouslyGeneratedOre = generatedOres.get(pos);
@@ -189,6 +192,7 @@ private static int highlightOreVein(CustomClientCommandSource source) throws Com
189192
}
190193

191194
private static int highlightOreVein(CustomClientCommandSource source, int chunkRange) throws CommandSyntaxException {
195+
RenderManager.clear();
192196
int version = source.getVersion();
193197
SeedIdentifier seed = source.getSeed().getSecond();
194198
try (Arena arena = Arena.ofConfined()) {
@@ -213,7 +217,7 @@ private static int highlightOreVein(CustomClientCommandSource source, int chunkR
213217
continue;
214218
}
215219
BlockPos pos = new BlockPos(minX + x, y, minZ + z);
216-
if (doAirCheck && chunk.getBlockState(pos).isAir()) {
220+
if (doAirCheck && isAirOrLava(chunk, pos)) {
217221
continue;
218222
}
219223
blocks.put(pos, block);
@@ -248,6 +252,7 @@ private static int highlightTerrain(CustomClientCommandSource source) throws Com
248252
}
249253

250254
private static int highlightTerrain(CustomClientCommandSource source, int chunkRange) throws CommandSyntaxException {
255+
RenderManager.clear();
251256
SeedIdentifier seed = source.getSeed().getSecond();
252257
int dimension = source.getDimension();
253258
if (dimension != Cubiomes.DIM_OVERWORLD()) {
@@ -304,6 +309,7 @@ private static int highlightCanyon(CustomClientCommandSource source, int canyonC
304309
}
305310

306311
private static int highlightCanyon(CustomClientCommandSource source, int canyonCarver, int chunkRange) throws CommandSyntaxException {
312+
RenderManager.clear();
307313
SeedIdentifier seed = source.getSeed().getSecond();
308314
int dimension = source.getDimension();
309315
int version = source.getVersion();
@@ -332,6 +338,7 @@ private static int highlightCave(CustomClientCommandSource source, int caveCarve
332338
}
333339

334340
private static int highlightCave(CustomClientCommandSource source, int caveCarver, int chunkRange) throws CommandSyntaxException {
341+
RenderManager.clear();
335342
SeedIdentifier seed = source.getSeed().getSecond();
336343
int dimension = source.getDimension();
337344
int version = source.getVersion();
@@ -376,4 +383,9 @@ private static int highlightCarver(CustomClientCommandSource source, int chunkRa
376383
source.getClient().schedule(() -> source.sendFeedback(Component.translatable("command.highlight.carver.success", accent(String.valueOf(blocks.size())))));
377384
return blocks.size();
378385
}
386+
387+
private static boolean isAirOrLava(LevelChunk chunk, BlockPos pos) {
388+
var state = chunk.getBlockState(pos);
389+
return state.isAir() || state.is(Blocks.LAVA) || state.getFluidState().is(Fluids.LAVA);
390+
}
379391
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"command.sample.sampleAll.success": "Sampled %s at %s: %s.",
9696
"command.sample.sampleDensity.success": "Sampled density at %s: %s.",
9797

98-
"config.oreAirCheck.comment": "Whether or not SeedMapper should use in-game air checks to invalidate ore positions.",
98+
"config.oreAirCheck.comment": "Whether or not SeedMapper should use in-game air or lava checks to invalidate ore positions.",
9999
"config.devMode.comment": "Enables certain debug commands.",
100100
"config.manualWaypointCompassOverlay.comment": "Set the waypoint compass overlay to be manually toggled instead of automatic.",
101101
"config.worldBorder.comment": "Limits the seed map to a square world border radius in blocks for all dimensions unless overridden. Use 0 to disable.",

0 commit comments

Comments
 (0)