Skip to content

Commit

Permalink
Change alias to main command
Browse files Browse the repository at this point in the history
  • Loading branch information
Terminator committed Sep 8, 2019
1 parent 4f32351 commit fba71f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ String buildType = (isFat ? "FAT" : "THIN")
String spongeForgeVersion = '1.12.2-2838-7.1.7-RC3886'
String forgeVersion = '1.12.2-14.23.5.2838'

version = "1.12.2-GAMMA-1.7.1"
version = "1.12.2-GAMMA-1.7.2"
group = "com.github.terminatornl"
archivesBaseName = "Tiquality-"+ (isObfuscated ? "" : "DEOBF-") + buildType
println("Compiling: " + archivesBaseName + "-" + version)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public class TiqualityConfig {
@Config.RangeDouble(min = 0, max = 1)
public static double OFFLINE_PLAYER_TICK_TIME_MULTIPLIER = 0.5;

@Config.Comment({
"The alias for the /tiquality command.",
"Bear in mind that when this alias is already in use by another mod, we skip command registration entirely. (Even /tiquality)"
})
public static String TIQUALITY_COMMAND_ALIAS = "tq";

@Config.Comment({
"A block will tick if at least one of the following statements is true:",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.github.terminatornl.tiquality.command;

import com.github.terminatornl.tiquality.TiqualityConfig;
import net.minecraft.command.CommandHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.server.permission.DefaultPermissionLevel;
Expand All @@ -8,7 +9,7 @@
public class CommandHub {

public static final CommandHub INSTANCE = new CommandHub();
public static final String[] ALIASES = {"tiquality", "tq"};
public static final String[] ALIASES = {"tiquality", TiqualityConfig.TIQUALITY_COMMAND_ALIAS};
public static final String DESCRIPTION_USE = "Allows use of Tiquality commands.";
public static final String DESCRIPTION_CLAIM = "Allows claiming areas using commands.";
public static final String DESCRIPTION_ADMIN = "Allows use of Tiquality admin commands.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ public void notifyFallingBehind(double ratio) {
Entity e = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityFromUuid(getOwner().getId());
if (e instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e;
player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "Warning: " + TextFormatting.GRAY + "Your blocks tick at " + (Math.round(ratio * 10000D) / 100D) + "% speed." + TextFormatting.DARK_GRAY + " (/tq notify)"), true);
player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "Warning: " + TextFormatting.GRAY + "Your blocks tick at " + (Math.round(ratio * 10000D) / 100D) + "% speed." + TextFormatting.DARK_GRAY + " (/tiquality notify)"), true);
double serverTPS_raw = Tiquality.TPS_MONITOR.getAverageTPS();

String serverTPS = TWO_DECIMAL_FORMATTER.format(Math.round(serverTPS_raw * 100D) / 100D);
String playerTPS = TWO_DECIMAL_FORMATTER.format(Math.round(serverTPS_raw * ratio * 100D) / 100D);


player.sendMessage(new TextComponentString(PREFIX + "Your TPS: " + TextFormatting.WHITE + playerTPS + TextFormatting.GRAY + " (" + TextFormatting.WHITE + Math.round(ratio * 100D) + "%" + TextFormatting.GRAY + ")" + TextFormatting.DARK_GRAY + " (/tq notify)"));
player.sendMessage(new TextComponentString(PREFIX + "Your TPS: " + TextFormatting.WHITE + playerTPS + TextFormatting.GRAY + " (" + TextFormatting.WHITE + Math.round(ratio * 100D) + "%" + TextFormatting.GRAY + ")" + TextFormatting.DARK_GRAY + " (/tiquality notify)"));
}
}
}
Expand Down

0 comments on commit fba71f1

Please sign in to comment.