9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2026-01-06 15:41:49 +00:00

Reimplement vanilla and eigencraft redstone cache

This commit is contained in:
Samsuik
2025-02-16 23:29:18 +00:00
parent 047821fb7d
commit 4fa7c85bce
22 changed files with 608 additions and 25 deletions

View File

@@ -14,7 +14,6 @@ import me.samsuik.sakura.physics.PhysicsVersion;
import net.minecraft.Util;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.item.FallingBlockEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;

View File

@@ -165,7 +165,7 @@ public final class LocalConfigManager implements LocalStorageHandler {
public synchronized LocalValueConfig config(BlockPos position) {
long gameTime = this.level.getGameTime();
long ticks = this.expirationTick - gameTime;
long ticks = gameTime - this.expirationTick;
if (ticks >= CONFIG_CACHE_EXPIRATION / 3) {
this.chunkConfigCache.values().removeIf(pair -> pair.value().isExpired(gameTime));
this.expirationTick = gameTime;