From f6a99e57d8f7a6545265242b47d1f8e2ae3a87f4 Mon Sep 17 00:00:00 2001 From: Mike van der Velde Date: Sun, 5 Jan 2020 18:33:40 +0100 Subject: [PATCH] Renamed method getTranslationComponent to createTranslationTextComponent --- .../foundation/command/KillTPSCommand.java | 20 +++++++++---------- .../create/foundation/utility/Lang.java | 6 +++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/command/KillTPSCommand.java b/src/main/java/com/simibubi/create/foundation/command/KillTPSCommand.java index a2321e166..6cf33ded2 100644 --- a/src/main/java/com/simibubi/create/foundation/command/KillTPSCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/KillTPSCommand.java @@ -6,8 +6,6 @@ import com.simibubi.create.Create; import com.simibubi.create.foundation.utility.Lang; import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; -import net.minecraft.util.text.StringTextComponent; -import net.minecraft.util.text.TranslationTextComponent; public class KillTPSCommand { @@ -19,11 +17,11 @@ public class KillTPSCommand { .requires(cs -> cs.hasPermissionLevel(2)) .executes(ctx -> { //killtps no arguments - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.slowed_by.0", Create.lagger.isLagging() ? Create.lagger.getTickTime() : 0), true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.slowed_by.0", Create.lagger.isLagging() ? Create.lagger.getTickTime() : 0), true); if (Create.lagger.isLagging()) - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.usage.0"), true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.usage.0"), true); else - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.usage.1"),true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.usage.1"),true); return 1; }) @@ -33,10 +31,10 @@ public class KillTPSCommand { int tickTime = Create.lagger.getTickTime(); if (tickTime > 0){ Create.lagger.setLagging(true); - ctx.getSource().sendFeedback((Lang.getTranslationComponent("command.killTPSCommand.status.slowed_by.1", tickTime)),true); - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.usage.0"),true); + ctx.getSource().sendFeedback((Lang.createTranslationTextComponent("command.killTPSCommand.status.slowed_by.1", tickTime)),true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.usage.0"),true); } else { - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.usage.1"),true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.usage.1"),true); } return 1; @@ -47,8 +45,8 @@ public class KillTPSCommand { int tickTime = IntegerArgumentType.getInteger(ctx, Lang.translate("command.killTPSCommand.argument.tickTime")); Create.lagger.setTickTime(tickTime); Create.lagger.setLagging(true); - ctx.getSource().sendFeedback((Lang.getTranslationComponent("command.killTPSCommand.status.slowed_by.1", tickTime)),true); - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.usage.0"),true); + ctx.getSource().sendFeedback((Lang.createTranslationTextComponent("command.killTPSCommand.status.slowed_by.1", tickTime)),true); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.usage.0"),true); return 1; }) @@ -58,7 +56,7 @@ public class KillTPSCommand { .executes(ctx -> { //killtps stop Create.lagger.setLagging(false); - ctx.getSource().sendFeedback(Lang.getTranslationComponent("command.killTPSCommand.status.slowed_by.2"), false); + ctx.getSource().sendFeedback(Lang.createTranslationTextComponent("command.killTPSCommand.status.slowed_by.2"), false); return 1; }) diff --git a/src/main/java/com/simibubi/create/foundation/utility/Lang.java b/src/main/java/com/simibubi/create/foundation/utility/Lang.java index f19f774ba..479ae60e0 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/Lang.java +++ b/src/main/java/com/simibubi/create/foundation/utility/Lang.java @@ -12,15 +12,15 @@ import net.minecraft.util.text.TranslationTextComponent; public class Lang { public static String translate(String key, Object... args) { - return getTranslationComponent(key, args).getFormattedText(); + return createTranslationTextComponent(key, args).getFormattedText(); } - public static TranslationTextComponent getTranslationComponent(String key, Object... args) { + public static TranslationTextComponent createTranslationTextComponent(String key, Object... args) { return new TranslationTextComponent(Create.ID + "." + key, args); } public static void sendStatus(PlayerEntity player, String key, Object... args) { - player.sendStatusMessage(getTranslationComponent(key, args), true); + player.sendStatusMessage(createTranslationTextComponent(key, args), true); } public static List translatedOptions(String prefix, String... keys) {