Skip to content

Commit

Permalink
Add requireOpForTPSCommand in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Yann151924 authored and LunNova committed Jun 6, 2017
1 parent 8e2d95d commit b0be0ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ build.number
# Forge+MCP downloads #
##################
download
/.nb-gradle/
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class TickProfiler {
public static long tickCount = 0;
public boolean requireOpForProfileCommand = true;
public boolean requireOpForDumpCommand = true;
public boolean requireOpForTPSCommand = false;
private int profilingInterval = 0;
private String profilingFileName = "world/computer/<computer id>/profile.txt";
private boolean profilingJson = false;
Expand Down Expand Up @@ -66,6 +67,7 @@ public void preInit(FMLPreInitializationEvent event) {
DumpCommand.name = config.get(GENERAL, "dumpCommandName", DumpCommand.name, "Name of the command to be used for dumping block data.").getString();
TPSCommand.name = config.get(GENERAL, "tpsCommandName", TPSCommand.name, "Name of the command to be used for TPS reports.").getString();
requireOpForProfileCommand = config.get(GENERAL, "requireOpForProfileCommand", requireOpForProfileCommand, "If a player must be opped to use /profile").getBoolean(requireOpForProfileCommand);
requireOpForTPSCommand = config.get(GENERAL, "requireOpForTPSCommand", requireOpForTPSCommand, "If a player must be opped to use /tps").getBoolean(requireOpForTPSCommand);
requireOpForDumpCommand = config.get(GENERAL, "requireOpForProfileCommand", requireOpForDumpCommand, "If a player must be opped to use /dump").getBoolean(requireOpForDumpCommand);
profilingInterval = config.get(GENERAL, "profilingInterval", profilingInterval, "Interval, in minutes, to record profiling information to disk. 0 = never. Recommended >= 2.").getInt();
profilingFileName = config.get(GENERAL, "profilingFileName", profilingFileName, "Location to store profiling information to, relative to the server folder. For example, why not store it in a computercraft computer's folder?").getString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public String getCommandName() {
return name;
}

@Override
public boolean requireOp() {
return TickProfiler.instance.requireOpForTPSCommand;
}

@Override
public String getCommandUsage(ICommandSender commandSender) {
return "Usage: /tps";
Expand Down

0 comments on commit b0be0ec

Please sign in to comment.