Skip to content

Commit

Permalink
fix: clients who disable omniscience after becoming evanesced stay aw…
Browse files Browse the repository at this point in the history
…are of their own player
  • Loading branch information
sylv256 committed Nov 11, 2024
1 parent f8a4a32 commit 229afb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 229afb8

Please sign in to comment.