Skip to content

Commit 9dc7279

Browse files
authored
Only mark non-signs as stale (#14)
Fixes issue where signs in unloaded chunks were incorrectly marked as stale and deleted.
1 parent 464939d commit 9dc7279

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

realty-paper-api/src/main/java/io/github/md5sha256/realty/api/SignTextApplicator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public void loadAndApplyChunkSigns(@NotNull World world,
187187
for (SignWithRegion swr : resolved) {
188188
if (applySignTextIfLoaded(world, swr.signEntity().blockX(),
189189
swr.signEntity().blockY(), swr.signEntity().blockZ(),
190-
swr.regionId(), swr.state(), swr.placeholders()) == ApplyResult.BLOCK_NOT_LOADED) {
190+
swr.regionId(), swr.state(), swr.placeholders()) == ApplyResult.FAILED) {
191191
stale.add(swr.signEntity());
192192
}
193193
}
@@ -208,6 +208,8 @@ public void cleanupStaleSigns(@NotNull List<RealtySignEntity> stale) {
208208
session.realtySignMapper().deleteByPosition(
209209
signEntity.worldId(), signEntity.blockX(),
210210
signEntity.blockY(), signEntity.blockZ());
211+
signCache.remove(signEntity.worldId(), signEntity.blockX(),
212+
signEntity.blockY(), signEntity.blockZ());
211213
}
212214
}
213215
logger.info("Cleaned up " + stale.size() + " stale sign(s)");

0 commit comments

Comments
 (0)