diff --git a/src/main/java/me/jellysquid/mods/lithium/common/world/scheduler/LithiumServerTickScheduler.java b/src/main/java/me/jellysquid/mods/lithium/common/world/scheduler/LithiumServerTickScheduler.java index ebce97b7..e63da410 100644 --- a/src/main/java/me/jellysquid/mods/lithium/common/world/scheduler/LithiumServerTickScheduler.java +++ b/src/main/java/me/jellysquid/mods/lithium/common/world/scheduler/LithiumServerTickScheduler.java @@ -344,17 +344,27 @@ private List> collectTicks(MutableBoundingBox bounds, boole * scheduled ticks which are set to execute at a different time. */ private void addScheduledTick(NextTickListEntry tick) { - TickEntry entry = this.scheduledTicks.computeIfAbsent(tick, this::createTickEntry); + // TISCM fix field value not up-to-date. see git history for yhe original lithium impl + TickEntry oldEntry = this.scheduledTicks.get(tick); + if (oldEntry != null && oldEntry.scheduled) + { + // TISCM Micro Timing logger + this.scheduleSuccess = false; + return; + } // TISCM Micro Timing logger - this.scheduleSuccess = !entry.scheduled; + this.scheduleSuccess = true; - if (!entry.scheduled) { - TickEntryQueue timeIdx = this.scheduledTicksOrdered.computeIfAbsent(getBucketKey(tick.scheduledTime, tick.priority), key -> new TickEntryQueue<>()); - timeIdx.push(entry); + TickEntry entry = this.createTickEntry(tick); + this.scheduledTicks.put(tick, entry); - entry.scheduled = true; - } + // the entry is newly created, so the scheduled flag is always false + + TickEntryQueue timeIdx = this.scheduledTicksOrdered.computeIfAbsent(getBucketKey(tick.scheduledTime, tick.priority), key -> new TickEntryQueue<>()); + timeIdx.push(entry); + + entry.scheduled = true; } private TickEntry createTickEntry(NextTickListEntry tick) {