Finish migrating messages
This commit is contained in:
parent
cae9cb1e26
commit
4f41e24da5
5 changed files with 28 additions and 24 deletions
|
@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
|
|
||||||
|
|
||||||
my_version=1.0.0.0302231751
|
my_version=1.0.0.0303231214
|
||||||
my_modgroup=dev.zontreck.essentials
|
my_modgroup=dev.zontreck.essentials
|
||||||
my_modid=ariasessentials
|
my_modid=ariasessentials
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,18 @@ public class Messages {
|
||||||
public static final String NO_MORE_THAN_ONE_TPA;
|
public static final String NO_MORE_THAN_ONE_TPA;
|
||||||
public static final String TPA;
|
public static final String TPA;
|
||||||
|
|
||||||
|
public static final String HOME_FORMAT;
|
||||||
|
public static final String HOME_HOVER_TEXT;
|
||||||
|
public static final String HOME_COUNT;
|
||||||
|
|
||||||
public static final String TELEPORT_REQUEST_ACCEPTED;
|
public static final String TELEPORT_REQUEST_ACCEPTED;
|
||||||
|
|
||||||
|
public static final String TELEPORTING_HOME;
|
||||||
|
public static final String TELEPORT_HOME_FAIL;
|
||||||
|
|
||||||
|
public static final String HOME_DELETE_SUCCESS;
|
||||||
|
public static final String HOME_DELETE_FAIL;
|
||||||
|
|
||||||
static{
|
static{
|
||||||
ESSENTIALS_PREFIX = "!Gray![!Dark_Green!AE!Gray!] ";
|
ESSENTIALS_PREFIX = "!Gray![!Dark_Green!AE!Gray!] ";
|
||||||
|
|
||||||
|
@ -101,5 +111,15 @@ public class Messages {
|
||||||
NO_MORE_THAN_ONE_TPA = ESSENTIALS_PREFIX + "!Dark_Red!You already have a TPA Request active, wait for it to expire, or use the cancel button/command";
|
NO_MORE_THAN_ONE_TPA = ESSENTIALS_PREFIX + "!Dark_Red!You already have a TPA Request active, wait for it to expire, or use the cancel button/command";
|
||||||
|
|
||||||
TPA = "[0] !Bold!!Dark_Purple! is requesting to teleport to you!\n\n";
|
TPA = "[0] !Bold!!Dark_Purple! is requesting to teleport to you!\n\n";
|
||||||
|
|
||||||
|
HOME_FORMAT = "!Dark_Gray![!Gold!Home!Dark_Gray!]!Bold!!Dark_Purple![0]";
|
||||||
|
HOME_HOVER_TEXT = "!Bold!!Dark_Green!Click here to go to this home";
|
||||||
|
HOME_COUNT = ESSENTIALS_PREFIX + "!Bold!!Dark_Purple!You have [0] total homes.";
|
||||||
|
|
||||||
|
TELEPORTING_HOME = ESSENTIALS_PREFIX + "!Dark_Green!Teleporting home now!";
|
||||||
|
TELEPORT_HOME_FAIL = ESSENTIALS_PREFIX + "!Dark_Red!Home not found";
|
||||||
|
|
||||||
|
HOME_DELETE_FAIL = ESSENTIALS_PREFIX + "!Dark_Red!Home could not be deleted due to an unknown error";
|
||||||
|
HOME_DELETE_SUCCESS = ESSENTIALS_PREFIX + "!Dark_Green!Home was successfully deleted";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,10 @@ import com.mojang.brigadier.arguments.StringArgumentType;
|
||||||
|
|
||||||
import dev.zontreck.essentials.AriasEssentials;
|
import dev.zontreck.essentials.AriasEssentials;
|
||||||
import dev.zontreck.essentials.Messages;
|
import dev.zontreck.essentials.Messages;
|
||||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
|
||||||
import dev.zontreck.libzontreck.profiles.Profile;
|
|
||||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
|
||||||
|
|
||||||
public class DelHomeCommand {
|
public class DelHomeCommand {
|
||||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||||
|
@ -37,12 +34,12 @@ public class DelHomeCommand {
|
||||||
AriasEssentials.player_homes.get(p.getUUID()).delete(homeName);
|
AriasEssentials.player_homes.get(p.getUUID()).delete(homeName);
|
||||||
|
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(p, new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.doColors("!dark_green!Home was deleted successfully")), ctx.getServer());
|
ChatHelpers.broadcastTo(p, ChatHelpers.macro(Messages.HOME_DELETE_SUCCESS), ctx.getServer());
|
||||||
}catch(Exception e)
|
}catch(Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(ctx.getEntity().getUUID(), new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.doColors("!dark_red!Home could not be deleted due to an unknown error")), ctx.getServer());
|
ChatHelpers.broadcastTo(ctx.getEntity().getUUID(), ChatHelpers.macro(Messages.HOME_DELETE_FAIL), ctx.getServer());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,10 @@ import dev.zontreck.essentials.commands.teleport.TeleportContainer;
|
||||||
import dev.zontreck.essentials.commands.teleport.TeleportDestination;
|
import dev.zontreck.essentials.commands.teleport.TeleportDestination;
|
||||||
import dev.zontreck.essentials.homes.Home;
|
import dev.zontreck.essentials.homes.Home;
|
||||||
import dev.zontreck.essentials.homes.NoSuchHomeException;
|
import dev.zontreck.essentials.homes.NoSuchHomeException;
|
||||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
|
||||||
import dev.zontreck.libzontreck.profiles.UserProfileNotYetExistsException;
|
|
||||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
|
||||||
|
|
||||||
public class HomeCommand {
|
public class HomeCommand {
|
||||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||||
|
@ -46,7 +43,7 @@ public class HomeCommand {
|
||||||
TeleportContainer cont = new TeleportContainer(p, dest.Position.asMinecraftVector(), dest.Rotation.asMinecraftVector(), dest.getActualDimension());
|
TeleportContainer cont = new TeleportContainer(p, dest.Position.asMinecraftVector(), dest.Rotation.asMinecraftVector(), dest.getActualDimension());
|
||||||
TeleportActioner.PerformTeleport(cont);
|
TeleportActioner.PerformTeleport(cont);
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(p.getUUID(), new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.doColors("!dark_green!Home found! Wormhole opening now...")), ctx.getServer());
|
ChatHelpers.broadcastTo(p.getUUID(), ChatHelpers.macro(Messages.TELEPORTING_HOME), ctx.getServer());
|
||||||
}catch(CommandSyntaxException e)
|
}catch(CommandSyntaxException e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -54,7 +51,7 @@ public class HomeCommand {
|
||||||
}catch(NoSuchHomeException e)
|
}catch(NoSuchHomeException e)
|
||||||
{
|
{
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(ctx.getEntity().getUUID(), new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.doColors(" !dark_red!Home not found. Maybe it does not exist?")), ctx.getServer());
|
ChatHelpers.broadcastTo(ctx.getEntity().getUUID(), ChatHelpers.macro(Messages.TELEPORT_HOME_FAIL), ctx.getServer());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
package dev.zontreck.essentials.commands.homes;
|
package dev.zontreck.essentials.commands.homes;
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.sql.Statement;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
import com.mojang.brigadier.context.CommandContext;
|
import com.mojang.brigadier.context.CommandContext;
|
||||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||||
|
@ -15,16 +8,13 @@ import dev.zontreck.essentials.AriasEssentials;
|
||||||
import dev.zontreck.essentials.Messages;
|
import dev.zontreck.essentials.Messages;
|
||||||
import dev.zontreck.essentials.homes.Home;
|
import dev.zontreck.essentials.homes.Home;
|
||||||
import dev.zontreck.essentials.homes.Homes;
|
import dev.zontreck.essentials.homes.Homes;
|
||||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
|
||||||
import dev.zontreck.libzontreck.chat.Clickable;
|
import dev.zontreck.libzontreck.chat.Clickable;
|
||||||
import dev.zontreck.libzontreck.chat.HoverTip;
|
import dev.zontreck.libzontreck.chat.HoverTip;
|
||||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
import net.minecraft.commands.Commands;
|
import net.minecraft.commands.Commands;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.entity.player.Player;
|
|
||||||
import net.minecraft.network.chat.Style;
|
import net.minecraft.network.chat.Style;
|
||||||
import net.minecraft.network.chat.TextComponent;
|
|
||||||
|
|
||||||
public class HomesCommand {
|
public class HomesCommand {
|
||||||
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
public static void register(CommandDispatcher<CommandSourceStack> dispatcher)
|
||||||
|
@ -40,13 +30,13 @@ public class HomesCommand {
|
||||||
|
|
||||||
Homes homes = AriasEssentials.player_homes.get(player.getUUID());
|
Homes homes = AriasEssentials.player_homes.get(player.getUUID());
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(player.getUUID(), new TextComponent(Messages.ESSENTIALS_PREFIX + ChatColor.doColors(" !Dark_Purple!There are !gold!"+String.valueOf(homes.count())+" !dark_purple!total homes.")), player.server);
|
ChatHelpers.broadcastTo(player.getUUID(), ChatHelpers.macro(Messages.HOME_COUNT, String.valueOf(homes.count())), player.server);
|
||||||
|
|
||||||
|
|
||||||
for (Home string : homes.getList()) {
|
for (Home string : homes.getList()) {
|
||||||
Style st = Style.EMPTY.withFont(Style.DEFAULT_FONT).withHoverEvent(HoverTip.get(ChatColor.BOLD+ChatColor.DARK_GREEN+"Click here to go to this home")).withClickEvent(Clickable.command("/home "+string.homeName));
|
Style st = Style.EMPTY.withFont(Style.DEFAULT_FONT).withHoverEvent(HoverTip.get(ChatHelpers.macroize(Messages.HOME_HOVER_TEXT))).withClickEvent(Clickable.command("/home "+string.homeName));
|
||||||
|
|
||||||
ChatHelpers.broadcastTo(player.getUUID(), new TextComponent(ChatColor.BOLD + ChatColor.MINECOIN_GOLD+"["+ChatColor.resetChat()+ChatColor.UNDERLINE+ChatColor.BOLD+ChatColor.DARK_GREEN+"HOME"+ChatColor.resetChat()+ChatColor.BOLD+ChatColor.MINECOIN_GOLD+"] "+ChatColor.resetChat()+ChatColor.YELLOW+string.homeName).setStyle(st), ctx.getSource().getServer());
|
ChatHelpers.broadcastTo(player.getUUID(), ChatHelpers.macro(Messages.HOME_FORMAT, string.homeName).setStyle(st), ctx.getSource().getServer());
|
||||||
|
|
||||||
}
|
}
|
||||||
}catch(CommandSyntaxException ex)
|
}catch(CommandSyntaxException ex)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue