-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Удален патч setBlock(повышения производительности)
- Добавлена команда tps - Добавлены новые изменения в Nukkit-Mot
- Loading branch information
Showing
11 changed files
with
61 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.reider745.commands; | ||
|
||
import cn.nukkit.command.Command; | ||
import cn.nukkit.command.CommandSender; | ||
|
||
public class TpsCommand extends Command { | ||
public static long[] innerCoreTimes = new long[20]; | ||
public static long[] nukkitTimes = new long[20]; | ||
public TpsCommand() { | ||
super("tps"); | ||
} | ||
|
||
@Override | ||
public boolean execute(CommandSender commandSender, String s, String[] strings) { | ||
if(!commandSender.isOp()) | ||
return false; | ||
|
||
long innerCoreSum = 0; | ||
for(long time : innerCoreTimes) | ||
innerCoreSum += Math.min(20, 1000 / time); | ||
|
||
long nukkitSum = 0; | ||
for(long time : nukkitTimes) | ||
nukkitSum += Math.min(20, 1000 / time); | ||
|
||
commandSender.sendMessage("Inner core tps: "+(innerCoreSum/20.0f)); | ||
commandSender.sendMessage("Nukkit tps: "+(nukkitSum/20.0f)); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters