moar client-server tick speed separation
This commit is contained in:
1 parent
e0a3060339
commit
df786605c2
23 files changed
+166
-148
No files matched your search
@@ -1,6 +1,6 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.fakes.MinecraftServerInterface;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
@@ -159,13 +159,13 @@ public abstract class ServerLevel_tickMixin extends Level
|
||||
))
|
||||
private void tickWorldBorder(WorldBorder worldBorder)
|
||||
{
|
||||
if (TickSpeed.process_entities()) worldBorder.tick();
|
||||
if (((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) worldBorder.tick();
|
||||
}
|
||||
|
||||
@Inject(method = "advanceWeatherCycle", cancellable = true, at = @At("HEAD"))
|
||||
private void tickWeather(CallbackInfo ci)
|
||||
{
|
||||
if (!TickSpeed.process_entities()) ci.cancel();
|
||||
if (!((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) ci.cancel();
|
||||
}
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
@@ -174,7 +174,7 @@ public abstract class ServerLevel_tickMixin extends Level
|
||||
))
|
||||
private void tickTimeConditionally(ServerLevel serverWorld)
|
||||
{
|
||||
if (TickSpeed.process_entities()) tickTime();
|
||||
if (((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) tickTime();
|
||||
}
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
@@ -183,7 +183,7 @@ public abstract class ServerLevel_tickMixin extends Level
|
||||
))
|
||||
private boolean tickPendingBlocks(ServerLevel serverWorld)
|
||||
{
|
||||
if (!TickSpeed.process_entities()) return true;
|
||||
if (!((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) return true;
|
||||
return serverWorld.isDebug(); // isDebug()
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ public abstract class ServerLevel_tickMixin extends Level
|
||||
))
|
||||
private void tickConditionally(Raids raidManager)
|
||||
{
|
||||
if (TickSpeed.process_entities()) raidManager.tick();
|
||||
if (((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) raidManager.tick();
|
||||
}
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
@@ -202,6 +202,6 @@ public abstract class ServerLevel_tickMixin extends Level
|
||||
))
|
||||
private void tickConditionally(ServerLevel serverWorld)
|
||||
{
|
||||
if (TickSpeed.process_entities()) runBlockEvents();
|
||||
if (((MinecraftServerInterface)getServer()).getTickRateManager().process_entities()) runBlockEvents();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user