Skip to content

Commit 54480fa

Browse files
committed
1.1.2, closes #18, closes #15
1 parent 767739f commit 54480fa

5 files changed

Lines changed: 40 additions & 7 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ body:
4242
label: Mod Version
4343
description: The version of the mod you were using
4444
options:
45+
- "1.1.2"
4546
- "1.1.1"
4647
- "1.1.0"
4748
- "1.0.3"

CHANGELOG-LATEST.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
### Fixed
22

3-
- Fixed bosses tag not populating properly.
4-
- Fixed possible networking-related NPE.
3+
- Improve networking performance for 1.21.1.
4+
- Fixed crashes with scanning multipart entities.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.2] - 2026-03-01
9+
10+
### Fixed
11+
12+
- Improve networking performance for 1.21.1.
13+
- Fixed crashes with scanning multipart entities.
14+
815
## [1.1.1] - 2026-03-01
916

1017
### Fixed

common/src/main/java/com/evandev/fieldguide/client/render/ScanOverlayRenderer.java

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ public static void render(PoseStack poseStack, float partialTick, Camera camera,
4545
FieldGuideScanner scanner = FieldGuideScanner.getInstance();
4646
Minecraft mc = Minecraft.getInstance();
4747

48-
Entity outOfRangeEntity = scanner.getOutOfRangeEntity();
49-
Entity targetEntity = scanner.getScanningEntity() != null ? scanner.getScanningEntity() : (scanner.getFadingEntity() != null ? scanner.getFadingEntity() : outOfRangeEntity);
48+
Entity outOfRangeEntity = resolveEntity(scanner.getOutOfRangeEntity());
49+
Entity scanningRaw = scanner.getScanningEntity() != null ? scanner.getScanningEntity() : (scanner.getFadingEntity() != null ? scanner.getFadingEntity() : scanner.getOutOfRangeEntity());
50+
Entity targetEntity = resolveEntity(scanningRaw);
51+
5052
BlockPos outOfRangePos = scanner.getOutOfRangePos();
5153
BlockPos targetBlock = (scanner.getScanningTarget() instanceof Block && scanner.getScanningPos() != null) ? scanner.getScanningPos() : (scanner.getFadingPos() != null ? scanner.getFadingPos() : outOfRangePos);
5254

@@ -82,6 +84,22 @@ public static void render(PoseStack poseStack, float partialTick, Camera camera,
8284
}
8385
}
8486

87+
private static Entity resolveEntity(Entity entity) {
88+
if (entity == null) return null;
89+
if (entity instanceof net.minecraft.world.entity.boss.EnderDragonPart dragonPart) {
90+
return dragonPart.parentMob;
91+
}
92+
try {
93+
java.lang.reflect.Method getParent = entity.getClass().getMethod("getParent");
94+
Object parent = getParent.invoke(entity);
95+
if (parent instanceof Entity parentEntity) {
96+
return parentEntity;
97+
}
98+
} catch (Exception ignored) {
99+
}
100+
return entity;
101+
}
102+
85103
private static VertexConsumer createTintedConsumer(VertexConsumer delegate, MultiBufferSource provider, float r, float g, float b, float a) {
86104
if (Services.PLATFORM.isModLoaded("entity_texture_features")) {
87105
return EtfCompat.createTintedConsumer(delegate, provider, r, g, b, a);
@@ -404,15 +422,22 @@ private static void renderEntityOverlay(PoseStack poseStack, float partialTick,
404422
}
405423

406424
MultiBufferSource depthSource = new ScanBufferSourceWrapper(bufferSource, 1, 1, 1, 1, true);
407-
mc.getEntityRenderDispatcher().render(targetEntity, 0.0D, 0.0D, 0.0D, yaw, partialTick, poseStack, depthSource, 15728880);
425+
try {
426+
mc.getEntityRenderDispatcher().render(targetEntity, 0.0D, 0.0D, 0.0D, yaw, partialTick, poseStack, depthSource, 15728880);
427+
} catch (Exception ignored) {
428+
// Failsafe catch for entity parts trying to utilize incorrect render layers
429+
}
408430
bufferSource.endBatch();
409431

410432
if (ModRenderTypes.SCAN_ENTITY_SHADER != null && ModRenderTypes.SCAN_ENTITY_SHADER.getUniform("ColorModulator") != null) {
411433
ModRenderTypes.SCAN_ENTITY_SHADER.getUniform("ColorModulator").set(red, green, blue, alpha);
412434
}
413435

414436
MultiBufferSource forcedSource = new ScanBufferSourceWrapper(bufferSource, red, green, blue, alpha, false);
415-
mc.getEntityRenderDispatcher().render(targetEntity, 0.0D, 0.0D, 0.0D, yaw, partialTick, poseStack, forcedSource, 15728880);
437+
try {
438+
mc.getEntityRenderDispatcher().render(targetEntity, 0.0D, 0.0D, 0.0D, yaw, partialTick, poseStack, forcedSource, 15728880);
439+
} catch (Exception ignored) {
440+
}
416441
bufferSource.endBatch();
417442

418443
if (isEtfLoaded) {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project
2-
version=1.1.1
2+
version=1.1.2
33
group=com.evandev.fieldguide
44
java_version=17
55

0 commit comments

Comments
 (0)