forked from virt-mirrors/Sit
lang update to not cause issues
This commit is contained in:
parent
c6c9414b0b
commit
d3274d7302
8 changed files with 47 additions and 48 deletions
|
@ -50,7 +50,7 @@ public class SitCommand {
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
if (args[0].equalsIgnoreCase("reload")) {
|
if (args[0].equalsIgnoreCase("reload")) {
|
||||||
Logic.reload();
|
Logic.reload();
|
||||||
Data.LOGGER.info(Utl.lang("msg.reloaded").getString());
|
Data.LOGGER.info(Utl.lang("sit!.chat.reloaded").getString());
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ public class SitCommand {
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("reload")) {
|
if (args[0].equalsIgnoreCase("reload")) {
|
||||||
Logic.reload();
|
Logic.reload();
|
||||||
player.sendMessage(Utl.messageTag().append(Utl.lang("msg.reloaded").formatted(Formatting.GREEN)));
|
player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").formatted(Formatting.GREEN)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0].equalsIgnoreCase("purgeChairEntities")) Utl.Entity.purge(player,true);
|
if (args[0].equalsIgnoreCase("purgeChairEntities")) Utl.Entity.purge(player,true);
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class ReloadCommandMixin {
|
||||||
// send a reloaded message to all players with permissions
|
// send a reloaded message to all players with permissions
|
||||||
for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) {
|
for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) {
|
||||||
if (player.isCreativeLevelTwoOp()) {
|
if (player.isCreativeLevelTwoOp()) {
|
||||||
player.sendMessage(Utl.messageTag().append(Utl.lang("msg.reloaded").formatted(Formatting.GREEN)));
|
player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").formatted(Formatting.GREEN)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class ConfigScreen extends Screen {
|
||||||
protected final Screen parent;
|
protected final Screen parent;
|
||||||
|
|
||||||
public ConfigScreen(Screen parent) {
|
public ConfigScreen(Screen parent) {
|
||||||
super(Text.translatable("screen.config"));
|
super(Text.translatable("sit!.screen.config"));
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ public class ConfigScreen extends Screen {
|
||||||
sittingConfigButton.setPosition(this.width / 2 - (sittingConfigButton.getWidth()/2), startY+36);
|
sittingConfigButton.setPosition(this.width / 2 - (sittingConfigButton.getWidth()/2), startY+36);
|
||||||
|
|
||||||
|
|
||||||
TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("gui.button.issues"),
|
TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.issues"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://github.com/Oth3r/Sit/issues")), true)
|
ConfirmLinkScreen.opening(this, URI.create("https://github.com/Oth3r/Sit/issues")), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build());
|
||||||
issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12);
|
issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12);
|
||||||
|
|
||||||
|
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.button.website"),
|
this.addDrawableChild(ButtonWidget.builder(Text.translatable("sit!.gui.button.website"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://modrinth.com/mod/sit!"))
|
ConfirmLinkScreen.opening(this, URI.create("https://modrinth.com/mod/sit!"))
|
||||||
).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build());
|
).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build());
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class ConfigScreen extends Screen {
|
||||||
close();
|
close();
|
||||||
}).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build());
|
}).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build());
|
||||||
|
|
||||||
TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("gui.button.donate"),
|
TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.donate"),
|
||||||
ConfirmLinkScreen.opening(this, URI.create("https://Ko-fi.com/oth3r")), true)
|
ConfirmLinkScreen.opening(this, URI.create("https://Ko-fi.com/oth3r")), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build());
|
||||||
donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12);
|
donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12);
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class UnderConstructionScreen<T extends CustomFile<T>> extends Screen {
|
||||||
protected T file;
|
protected T file;
|
||||||
|
|
||||||
public UnderConstructionScreen(Screen parent, T file) {
|
public UnderConstructionScreen(Screen parent, T file) {
|
||||||
super(Text.translatable("screen.config"));
|
super(Text.translatable("sit!.screen.config"));
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.file = file;
|
this.file = file;
|
||||||
}
|
}
|
||||||
|
@ -32,17 +32,17 @@ public class UnderConstructionScreen<T extends CustomFile<T>> extends Screen {
|
||||||
Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, URI.create("https://www.instagram.com/bunnestbun/"))));
|
Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, URI.create("https://www.instagram.com/bunnestbun/"))));
|
||||||
foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35);
|
foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35);
|
||||||
|
|
||||||
ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("gui.button.file"),
|
ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.file"),
|
||||||
(button) -> Util.getOperatingSystem().open(this.file.getFile()))
|
(button) -> Util.getOperatingSystem().open(this.file.getFile()))
|
||||||
.dimensions(0, 0, 118 ,20).build());
|
.dimensions(0, 0, 118 ,20).build());
|
||||||
openFileButton.setPosition(this.width / 2 - 70, startY+110);
|
openFileButton.setPosition(this.width / 2 - 70, startY+110);
|
||||||
|
|
||||||
TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("gui.button.folder"),
|
TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.folder"),
|
||||||
(button) -> Util.getOperatingSystem().open(Paths.get(this.file.getFile().getParent())), true)
|
(button) -> Util.getOperatingSystem().open(Paths.get(this.file.getFile().getParent())), true)
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build());
|
||||||
folderButton.setPosition(this.width / 2 + 50, startY + 110);
|
folderButton.setPosition(this.width / 2 + 50, startY + 110);
|
||||||
|
|
||||||
TextureButtonWidget resetButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("gui.button.reset"),
|
TextureButtonWidget resetButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.reset"),
|
||||||
(button) -> {
|
(button) -> {
|
||||||
this.file.reset();
|
this.file.reset();
|
||||||
this.file.save();
|
this.file.save();
|
||||||
|
@ -50,13 +50,13 @@ public class UnderConstructionScreen<T extends CustomFile<T>> extends Screen {
|
||||||
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "reset_file"), 15, 15).build());
|
.dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "reset_file"), 15, 15).build());
|
||||||
resetButton.setPosition(this.width / 2 -70, startY + 135);
|
resetButton.setPosition(this.width / 2 -70, startY + 135);
|
||||||
|
|
||||||
ButtonWidget revertButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("gui.button.revert"),
|
ButtonWidget revertButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.revert"),
|
||||||
(button) -> this.file.save())
|
(button) -> this.file.save())
|
||||||
.dimensions(0, 0, 118,20).build());
|
.dimensions(0, 0, 118,20).build());
|
||||||
revertButton.setPosition(this.width / 2 - 48, startY+135);
|
revertButton.setPosition(this.width / 2 - 48, startY+135);
|
||||||
|
|
||||||
|
|
||||||
ButtonWidget saveExitButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("gui.button.save"),
|
ButtonWidget saveExitButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.save"),
|
||||||
(button) -> {
|
(button) -> {
|
||||||
this.file.load();
|
this.file.load();
|
||||||
this.file.save();
|
this.file.save();
|
||||||
|
|
|
@ -34,19 +34,19 @@ public class Events {
|
||||||
|
|
||||||
private static void register() {
|
private static void register() {
|
||||||
toggle_key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
toggle_key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
"key.toggle",
|
"key.sit!.toggle",
|
||||||
GLFW.GLFW_KEY_UNKNOWN,
|
GLFW.GLFW_KEY_UNKNOWN,
|
||||||
"category.sit"
|
"category.sit!"
|
||||||
));
|
));
|
||||||
sit_key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
sit_key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
"key.sit",
|
"key.sit!.sit",
|
||||||
GLFW.GLFW_KEY_UNKNOWN,
|
GLFW.GLFW_KEY_UNKNOWN,
|
||||||
"category.sit"
|
"category.sit!"
|
||||||
));
|
));
|
||||||
config__key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
config__key = KeyBindingHelper.registerKeyBinding(new KeyBinding(
|
||||||
"key.config",
|
"key.sit!.config",
|
||||||
GLFW.GLFW_KEY_UNKNOWN,
|
GLFW.GLFW_KEY_UNKNOWN,
|
||||||
"category.sit"
|
"category.sit!"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class Events {
|
||||||
player.networkHandler.sendCommand("sit");
|
player.networkHandler.sendCommand("sit");
|
||||||
} else {
|
} else {
|
||||||
// unsupported server message if not in a Sit! server
|
// unsupported server message if not in a Sit! server
|
||||||
player.sendMessage(Utl.lang("msg.unsupported")
|
player.sendMessage(Utl.lang("sit!.chat.unsupported")
|
||||||
.formatted(Formatting.RED), true);
|
.formatted(Formatting.RED), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,15 +164,15 @@ public class Logic {
|
||||||
|
|
||||||
|
|
||||||
// get the message settings
|
// get the message settings
|
||||||
String messageKey = "msg.sit_toggle."+(config.getEnabled()?"on":"off");
|
String messageKey = "sit!.chat.sit_toggle."+(config.getEnabled()?"on":"off");
|
||||||
Formatting messageColor = config.getEnabled()?Formatting.GREEN:Formatting.RED;
|
Formatting messageColor = config.getEnabled()?Formatting.GREEN:Formatting.RED;
|
||||||
|
|
||||||
// send the player the actionbar message
|
// send the player the actionbar message
|
||||||
return Utl.lang("msg.sit_toggle",
|
return Utl.lang("sit!.chat.sit_toggle",
|
||||||
Utl.lang(messageKey).formatted(messageColor));
|
Utl.lang(messageKey).formatted(messageColor));
|
||||||
} else {
|
} else {
|
||||||
// unsupported server message if not in a Sit! server
|
// unsupported server message if not in a Sit! server
|
||||||
return Utl.lang("msg.unsupported")
|
return Utl.lang("sit!.chat.unsupported")
|
||||||
.formatted(Formatting.RED);
|
.formatted(Formatting.RED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,14 +15,12 @@ import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.registry.tag.TagKey;
|
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.text.MutableText;
|
import net.minecraft.text.MutableText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.text.TextColor;
|
||||||
import net.minecraft.util.TypeFilter;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.UseAction;
|
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.hit.HitResult;
|
import net.minecraft.util.hit.HitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -334,7 +332,7 @@ public class Utl {
|
||||||
|
|
||||||
// send a message if needed
|
// send a message if needed
|
||||||
if (message) {
|
if (message) {
|
||||||
player.sendMessage(messageTag().append(Utl.lang("msg.purged",Utl.lang("msg.purged.total",count).styled(
|
player.sendMessage(messageTag().append(Utl.lang("sit!.chat.purged",Utl.lang("sit!.chat.purged.total",count).styled(
|
||||||
style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true)
|
style -> style.withColor(Colors.LIGHT_GRAY).withItalic(true)
|
||||||
)).styled(
|
)).styled(
|
||||||
style -> style.withColor(Colors.GREEN)
|
style -> style.withColor(Colors.GREEN)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"category.sit": "Sit!",
|
"category.sit!": "Sit!",
|
||||||
|
|
||||||
"config.entry.exclusion": "Put a `!` in front of a entry to exclude it!",
|
"config.entry.exclusion": "Put a `!` in front of a entry to exclude it!",
|
||||||
"config.entry.example": "Entry example: %s",
|
"config.entry.example": "Entry example: %s",
|
||||||
|
@ -78,27 +78,28 @@
|
||||||
"config.sitting.hand.filter.custom-tags": "Custom Tags",
|
"config.sitting.hand.filter.custom-tags": "Custom Tags",
|
||||||
"config.sitting.hand.filter.custom-tags.description": "A list of custom item tags to add to the filter.",
|
"config.sitting.hand.filter.custom-tags.description": "A list of custom item tags to add to the filter.",
|
||||||
|
|
||||||
"msg.sit_toggle": "%s Sitting!",
|
"sit!.chat.toggle_sit": "%s Sitting!",
|
||||||
"msg.sit_toggle.on": "Enabled",
|
"sit!.chat.toggle_sit.on": "Enabled",
|
||||||
"msg.sit_toggle.off": "Disabled",
|
"sit!.chat.toggle_sit.off": "Disabled",
|
||||||
"msg.unsupported": "Sit! is not available on this server.",
|
"sit!.chat.unsupported": "Sit! is not available on this server.",
|
||||||
"msg.reloaded": "Reloaded the config!",
|
"sit!.chat.reloaded": "Reloaded the config!",
|
||||||
"msg.purged": "Purged all loaded Sit! entities! %s",
|
"sit!.chat.purged": "Purged all loaded Sit! entities! %s",
|
||||||
"msg.purged.total": "(%s removed)",
|
"sit!.chat.purged.total": "(%s removed)",
|
||||||
|
|
||||||
"key.toggle": "Toggle Sitting",
|
"key.sit!.toggle": "Toggle Sitting",
|
||||||
"key.sit": "Sit",
|
"key.sit!.sit": "Sit",
|
||||||
"key.config": "Open Config",
|
"key.sit!.config": "Open Config",
|
||||||
|
|
||||||
|
"sit!.screen.config": "Sit! Config",
|
||||||
|
"sit!.gui.button.file": "Open File",
|
||||||
|
"sit!.gui.button.folder": "Open Folder",
|
||||||
|
"sit!.gui.button.reset": "Reset",
|
||||||
|
"sit!.gui.button.issues": "Issues",
|
||||||
|
"sit!.gui.button.donate": "Donate",
|
||||||
|
"sit!.gui.button.revert": "Revert Changes",
|
||||||
|
"sit!.gui.button.save": "Save and Close",
|
||||||
|
"sit!.gui.button.website": "Website",
|
||||||
|
|
||||||
"screen.config": "Sit! Config",
|
|
||||||
"gui.button.file": "Open File",
|
|
||||||
"gui.button.folder": "Open Folder",
|
|
||||||
"gui.button.reset": "Reset",
|
|
||||||
"gui.button.issues": "Issues",
|
|
||||||
"gui.button.donate": "Donate",
|
|
||||||
"gui.button.revert": "Revert Changes",
|
|
||||||
"gui.button.save": "Save and Close",
|
|
||||||
"gui.button.website": "Website"
|
|
||||||
"sit!.console.connected": "Connected to Sit! server: %s",
|
"sit!.console.connected": "Connected to Sit! server: %s",
|
||||||
"sit!.console.player_settings": "Received custom sitting settings from %s!",
|
"sit!.console.player_settings": "Received custom sitting settings from %s!",
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue