From 229afb81a8899d9df9ae32ea263d411ef789fa81 Mon Sep 17 00:00:00 2001 From: sylv256 Date: Mon, 11 Nov 2024 18:15:52 -0500 Subject: [PATCH] fix: clients who disable omniscience after becoming evanesced stay aware of their own player --- gradle.properties | 2 +- .../gay/sylv/legacy_landscape/effect/EvanescenceEffect.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 3326257..39021d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ mod_name=Legacy Landscape # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=EUPL-1.2 # The mod version. See https://semver.org/ -mod_version=0.6.0+1.21.1 +mod_version=0.6.1+1.21.1 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/gay/sylv/legacy_landscape/effect/EvanescenceEffect.java b/src/main/java/gay/sylv/legacy_landscape/effect/EvanescenceEffect.java index a5372cc..642d500 100644 --- a/src/main/java/gay/sylv/legacy_landscape/effect/EvanescenceEffect.java +++ b/src/main/java/gay/sylv/legacy_landscape/effect/EvanescenceEffect.java @@ -77,6 +77,7 @@ public static void onOmniscient(ServerLevel level, ServerPlayer player) { player.getChunkTrackingView().forEach( chunkPos -> level.getEntities() .get(Maths.chunkToBox(chunkPos, level), entity -> { + if (entity.equals(player)) return; if (entity instanceof LivingEntity livingEntity && livingEntity.hasEffect(LegacyEffects.EVANESCENCE)) { showForPlayer(livingEntity, player); } @@ -88,6 +89,7 @@ public static void onRemoveOmniscience(ServerLevel level, ServerPlayer player) { player.getChunkTrackingView().forEach( chunkPos -> level.getEntities() .get(Maths.chunkToBox(chunkPos, level), entity -> { + if (entity.equals(player)) return; if (entity instanceof LivingEntity livingEntity && livingEntity.hasEffect(LegacyEffects.EVANESCENCE)) { removeForPlayer(livingEntity, player); }