Skip to content

Commit

Permalink
fix: 调用原有的 tickBlock 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
JWJUN233233 committed May 27, 2024
1 parent e6f26a5 commit a5222a2
Showing 1 changed file with 2 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.thebusybiscuit.slimefun4.implementation.tasks;

import com.xzavier0722.mc.plugin.slimefun4.storage.controller.SlimefunBlockData;
import com.xzavier0722.mc.plugin.slimefun4.storage.controller.SlimefunUniversalData;
import com.xzavier0722.mc.plugin.slimefun4.storage.util.StorageCacheUtils;
import io.github.bakedlibs.dough.blocks.BlockPosition;
import io.github.bakedlibs.dough.blocks.ChunkPosition;
Expand Down Expand Up @@ -224,13 +223,13 @@ private void tickUniversalBlocks(@Nonnull Set<BlockTicker> tickers, @Nonnull UUI
return;
}
Block b = l.getBlock();
tickUniversalBlock(l, b, item, universalData, System.nanoTime());
tickBlock(l, b, item, null, System.nanoTime());
});
} else {
long timestamp = Slimefun.getProfiler().newEntry();
item.getBlockTicker().update();
Block b = l.getBlock();
tickUniversalBlock(l, b, item, universalData, timestamp);
tickBlock(l, b, item, null, timestamp);
}

tickers.add(item.getBlockTicker());
Expand All @@ -251,18 +250,6 @@ private void tickBlock(Location l, Block b, SlimefunItem item, SlimefunBlockData
}
}

@ParametersAreNonnullByDefault
private void tickUniversalBlock(
Location l, Block b, SlimefunItem item, SlimefunUniversalData data, long timestamp) {
try {
item.getBlockTicker().tick(b, item, (SlimefunBlockData) null);
} catch (Exception | LinkageError x) {
reportErrors(l, item, x);
} finally {
Slimefun.getProfiler().closeEntry(l, item, timestamp);
}
}

@ParametersAreNonnullByDefault
private void reportErrors(Location l, SlimefunItem item, Throwable x) {
BlockPosition position = new BlockPosition(l);
Expand Down

0 comments on commit a5222a2

Please sign in to comment.