Skip to content

Commit 28f22bb

Browse files
fix: #309 #313
1 parent 9156681 commit 28f22bb

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [21.8.1]
2+
3+
### Fixed
4+
5+
- Small issue with state checking. If a block now changes state in-world, whilst the block is enabled, and it no longer matches, it will be removed from the outline render.
6+
- This is specifically tailored to blocks like `Suspicious Sand` and `Suspicious Gravel` which change state when brushed.
7+
8+
### Changed
9+
10+
- Lowered NeoForge minimum version to `1.21.7` to allow for `1.21.7` & `1.21.8` support
11+
112
## [21.8.0]
213

314
### Changed

common/src/main/java/pro/mikey/xray/core/ScanController.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ public static void onBlockChange(Level level, BlockPos pos, BlockState state) {
200200
return;
201201
}
202202

203-
204203
// We're now air baby!
205204
if (state.isAir()) {
206205
// Remove the block from the render list
@@ -222,6 +221,8 @@ public static void onBlockChange(Level level, BlockPos pos, BlockState state) {
222221
}
223222

224223
// Otherwise, do we have scantarget in the active list of things to find?
224+
var noMatchesFound = true;
225+
225226
Set<ActiveScanTarget> activeScanTargets = ScanController.INSTANCE.scanStore.activeScanTargets();
226227
for (var scanType : activeScanTargets) {
227228
if (scanType.type().matches(level, pos, state, state.getFluidState())) {
@@ -231,9 +232,26 @@ public static void onBlockChange(Level level, BlockPos pos, BlockState state) {
231232

232233
// Tell the VBO to refresh for this chunk
233234
OutlineRender.refreshVBOForChunk(chunkPos);
234-
235+
noMatchesFound = false; // We found a match, so we can stop checking
235236
break; // We found a match, so we can stop checking
236237
}
237238
}
239+
240+
// If no matches are found AND the block pos is currently in the render list, we need to remove it and ask the chunk to refresh
241+
var blockFromRenderList = outlineRenderTargets.stream()
242+
.filter(target -> target.x() == pos.getX() && target.y() == pos.getY() && target.z() == pos.getZ())
243+
.findFirst();
244+
245+
if (blockFromRenderList.isEmpty()) {
246+
return;
247+
}
248+
249+
if (noMatchesFound) {
250+
// We didn't find any matches, so we need to remove the block from the render list
251+
outlineRenderTargets.remove(blockFromRenderList.get());
252+
253+
// Tell the VBO to refresh for this chunk
254+
OutlineRender.refreshVBOForChunk(chunkPos);
255+
}
238256
}
239257
}

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ parchment_minecraft_version=1.21.6
1111
parchment_mappings_version=2025.06.29
1212

1313
mod_id=xray
14-
mod_version=21.8.0
14+
mod_version=21.8.1
1515
minecraft_version=1.21.8
16-
minecraft_version_range=[%base],1.21.9
16+
minecraft_version_range=1.21.7,1.21.9
1717

1818
# Forge
1919
forge_version=21.8.13
20-
forge_version_range=21.8
20+
forge_version_range=21.7.0
2121

2222
# Fabric
2323
loader_version=0.16.14

0 commit comments

Comments
 (0)