carpet client synchronizations and protocols
This commit is contained in:
1 parent
2522884da3
commit
e540f9e238
19 files changed
+406
-173
No files matched your search
@@ -5,6 +5,7 @@ import java.util.Map;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import carpet.CarpetServer;
|
||||
import carpet.network.ServerNetworkHandler;
|
||||
import carpet.utils.Messenger;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -177,7 +178,7 @@ public class TickSpeed
|
||||
}
|
||||
}
|
||||
|
||||
public static void tickrate(float rate)
|
||||
public static void tickrate(float rate, boolean update)
|
||||
{
|
||||
tickrate = rate;
|
||||
long mspt = (long)(1000.0 / tickrate);
|
||||
@@ -189,7 +190,7 @@ public class TickSpeed
|
||||
|
||||
TickSpeed.mspt = (float)mspt;
|
||||
|
||||
notifyTickrateListeners("carpet");
|
||||
if (update) notifyTickrateListeners("carpet");
|
||||
}
|
||||
|
||||
private static void tickrateChanged(String modId, float rate)
|
||||
@@ -221,7 +222,7 @@ public class TickSpeed
|
||||
}
|
||||
}
|
||||
}
|
||||
ServerNetworkHandler.sendTickRateToPlayers(tickrate);
|
||||
ServerNetworkHandler.updateTickSpeedToConnectedPlayers();
|
||||
}
|
||||
|
||||
public static BiConsumer<String, Float> addTickrateListener(String modId, BiConsumer<String, Float> tickrateListener)
|
||||
|
||||
Reference in new issue
Block a user