fixed server only issues, properly separated client / server logic in common class.
This commit is contained in:
1 parent
c6f52b3293
commit
b744956777
12 files changed
+59
-66
No files matched your search
@@ -8,6 +8,8 @@ import net.minecraft.commands.Commands;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -33,6 +35,13 @@ public class ServerTickRateManager extends TickRateManager
|
||||
return tickWarpStartTime != 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldEntityTick(Entity e)
|
||||
{
|
||||
return (runsNormally() || (e instanceof Player));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the game is deeply frozen.
|
||||
* This can be used for things that you may not normally want
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package carpet.helpers;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
public class TickRateManager
|
||||
{
|
||||
public static final int PLAYER_GRACE = 2;
|
||||
@@ -93,4 +96,10 @@ public class TickRateManager
|
||||
runGameElements = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean shouldEntityTick(Entity e)
|
||||
{
|
||||
// client
|
||||
return (runsNormally() || (e instanceof Player) || isSuperHot() && e.getControllingPassenger() instanceof Player);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user