Skip to content

Commit

Permalink
TickCounter should only increment server side!
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 17, 2024
1 parent 18c9e85 commit 3afc30d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ public void saveAdditional(CompoundTag nbt, HolderLookup.Provider provider) {
.ifPresent(tag -> nbt.put(NBT_OWNER_PROFILE, tag));
}
if (!getExtensionData().isEmpty()) nbt.put(NBT_EXTRA, getExtensionData());
// nbt.put(NBT_EXTRA, Util.make(new CompoundTag(), tag -> {
// CompoundTag ext1 = getExtensionData();
// //noinspection ConstantConditions
// ext1.getAllKeys().forEach(key -> tag.put(key, ext1.get(key)));
// }));
}

@Override
Expand Down Expand Up @@ -652,8 +647,7 @@ private int calculateSyncCounter() {
int tuning = tunedSyncValue % tickRate;
int delta = tuning - compileTime;
if (delta <= 0) delta += tickRate;

ModularRouters.LOGGER.info("sync counter for {}: tc={} ct={} tuning={} delta={} counter={}", getBlockPos(), TickEventHandler.TickCounter, compileTime,tuning, delta, tickRate - delta);
// ModularRouters.LOGGER.info("sync counter for {}: tc={} ct={} tuning={} delta={} counter={}", getBlockPos(), TickEventHandler.TickCounter, compileTime,tuning, delta, tickRate - delta);
return tickRate - delta;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TickEventHandler {

@SubscribeEvent
public static void onWorldTick(LevelTickEvent.Post event) {
if (event.getLevel().dimension() == Level.OVERWORLD) {
if (event.getLevel().dimension() == Level.OVERWORLD && !event.getLevel().isClientSide) {
TickCounter++;
}
}
Expand Down

0 comments on commit 3afc30d

Please sign in to comment.