diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 08a7feb..920dbe0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,7 +5,7 @@ body: - type: markdown attributes: value: | - Please fill out the sections below to help identify and fix the bug + Please fill out the sections below to help identify and fix the bug. - type: textarea id: description attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request_template.yml b/.github/ISSUE_TEMPLATE/feature_request_template.yml new file mode 100644 index 0000000..c1b507e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request_template.yml @@ -0,0 +1,26 @@ +name: Feature Request +description: Suggest a new feature for Sit! +title: '[Feature Request]: ' +body: + - type: textarea + id: description + attributes: + label: Description + description: A description of the problem or missing capability + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe a solution + description: If you have a solution in mind, please describe it. + - type: textarea + id: alternatives + attributes: + label: Describe alternatives + description: Have you considered any alternative solutions or workarounds? + - type: markdown + attributes: + value: >- + This template was generated with [Issue Forms + Creator](https://issue-forms-creator.netlify.app) \ No newline at end of file diff --git a/.github/workflows/crowdin-download-workflow.yml b/.github/workflows/crowdin-download-workflow.yml new file mode 100644 index 0000000..ddaec73 --- /dev/null +++ b/.github/workflows/crowdin-download-workflow.yml @@ -0,0 +1,33 @@ +name: Crowdin Download Action + +permissions: + contents: write + pull-requests: write + actions: read + +on: + workflow_dispatch: + +jobs: + crowdin: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Synchronize with Crowdin + uses: crowdin/github-action@v2 + with: + upload_sources: false + upload_translations: false + download_translations: true + localization_branch_name: crowdin_translations + + create_pull_request: true + pull_request_title: 'Updated Crowdin translations' + pull_request_body: 'New Crowdin pull request with translations' + pull_request_base_branch_name: 'dev' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/crowdin-upload-workflow.yml b/.github/workflows/crowdin-upload-workflow.yml new file mode 100644 index 0000000..fe9194b --- /dev/null +++ b/.github/workflows/crowdin-upload-workflow.yml @@ -0,0 +1,24 @@ +name: Crowdin Upload Action + +on: + push: + paths: [ "src/main/resources/assets/sit-oth3r/lang/en_US.json"] + branches: [ dev ] + workflow_dispatch: + +jobs: + crowdin-upload: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Crowdin push + uses: crowdin/github-action@v2 + with: + upload_sources: true + upload_translations: false + download_translations: false + env: + CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} + CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7a6061b..23b4044 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,7 @@ plugins { - id 'fabric-loom' version '1.10-SNAPSHOT' + id 'fabric-loom' version "1.10-SNAPSHOT" id 'maven-publish' - id 'com.modrinth.minotaur' version '2.+' - id 'net.darkhax.curseforgegradle' version '1.1.+' + id "me.modmuss50.mod-publish-plugin" version "0.8.4" id 'co.uzzu.dotenv.gradle' version '4.0.0' } @@ -14,6 +13,7 @@ base { } repositories { + mavenLocal() maven { url = "https://maven.terraformersmc.com/releases/" } maven { url = "https://maven.isxander.dev/releases" } } @@ -30,6 +30,8 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" + + modImplementation "one.oth3r:otterlib:${project.otterlib_version}" } processResources { @@ -40,6 +42,7 @@ processResources { minecraft_version : minecraft_version, min_minecraft_version : min_minecraft_version, max_minecraft_version : max_minecraft_version, + otterlib_version : otterlib_version, loader_version : loader_version ] @@ -86,33 +89,35 @@ publishing { } } -import com.modrinth.minotaur.dependencies.ModDependency - -modrinth { - token = env.fetchOrNull('MODRINTH') - projectId = 'EsYqsGV4' - versionNumber = project.mod_version - versionName = "v${project.mod_version} [Fabric]" - versionType = "release" - uploadFile = remapJar - gameVersions = project.minecraft_versions.split(",").toList() - loaders = ['fabric', 'quilt'] - dependencies = [ - new ModDependency('P7dR8mSH', 'required'), - new ModDependency('mOgUt4GM', 'optional') - ] +publishMods { changelog = file('changelog.md').text -} + type = STABLE -import net.darkhax.curseforgegradle.TaskPublishCurseForge + file = remapJar.archiveFile + modLoaders.add("fabric") + modLoaders.add("quilt") -tasks.register('publishCurseForge', TaskPublishCurseForge) { - apiToken = env.fetchOrNull('CURSEFORGE') + version = mod_version + displayName = "v${mod_version} [Fabric]" - def mainFile = upload(892424, remapJar) - mainFile.changelog = file('changelog.md') - mainFile.displayName = "v${project.mod_version} [Fabric]" - mainFile.addModLoader("fabric", 'quilt') - mainFile.releaseType = "release" - mainFile.addEnvironment("client", "server") + curseforge { + accessToken = env.fetchOrNull('CURSEFORGE') + projectId = "892424" + projectSlug = "sit1" + minecraftVersions.addAll(minecraft_versions.split(",").toList()) + + requires("fabric-api", "otterlib") + + announcementTitle = "Download from CurseForge" + } + + modrinth { + accessToken = env.fetchOrNull('MODRINTH') + projectId = "EsYqsGV4" + minecraftVersions.addAll(minecraft_versions.split(",").toList()) + + requires("fabric-api", "otterlib") + + announcementTitle = "Download from Modrinth" + } } \ No newline at end of file diff --git a/changelog.md b/changelog.md index 582fde0..f7e4244 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,10 @@ -# v1.2.3.2 -* added an extra check before sending packets to the server from the client -# v1.2.3.1 -* added a version position for quick patches -* fixed sitting height being off by .2 (1.21.4-5) -# v1.2.3 -* fixed not being able to sit when the Y level was below 0 \ No newline at end of file +# v1.2.4.1 +* removed unused assets +* enabled file logging for easier debugging + +# v1.2.4.0 +Small changelog but big update! +\ +Switching to OtterLib will allow for a simplified main mod and lead to more unified mod development across my projects! Download OtterLib today: [Link](https://modrinth.com/mod/otterlib) +* make sitting via hand execute the `/sit` command, to allow for universal sitting permission control +* switch to using OtterLib for file management, config screen management, and more to come \ No newline at end of file diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 0000000..352acbc --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,12 @@ +"project_id_env": "CROWDIN_PROJECT_ID" +"api_token_env": "CROWDIN_PERSONAL_TOKEN" +"base_path": "." +"base_url": "https://api.crowdin.com" +"preserve_hierarchy": true + +files: [ + { + "source": "src/main/resources/assets/sit-oth3r/lang/en_US.json", + "translation": "src/main/resources/assets/sit-oth3r/lang/%locale_with_underscore%.json", + } +] \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 51ec6af..db69bd9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,10 +13,11 @@ yarn_mappings=1.20.4+build.3 loader_version=0.16.13 # Mod Properties -mod_version=1.2.3.2+1.20.4 +mod_version=1.2.4.1+1.20.4 maven_group=one.oth3r file_name=sit! # Dependencies fabric_version=0.97.1+1.20.4 modmenu_version=9.0.0 +otterlib_version=0.1.2.1+1.20.4-fabric \ No newline at end of file diff --git a/src/main/java/one/oth3r/sit/SitClient.java b/src/main/java/one/oth3r/sit/SitClient.java index 43833dc..7bd19c1 100644 --- a/src/main/java/one/oth3r/sit/SitClient.java +++ b/src/main/java/one/oth3r/sit/SitClient.java @@ -1,8 +1,18 @@ package one.oth3r.sit; import net.fabricmc.api.ClientModInitializer; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.util.Identifier; +import one.oth3r.otterlib.client.screen.ConfigScreen; +import one.oth3r.otterlib.client.screen.utl.CustomImage; +import one.oth3r.otterlib.client.screen.utl.SimpleButton; +import one.oth3r.sit.file.FileData; import one.oth3r.sit.utl.Data; import one.oth3r.sit.utl.Events; +import one.oth3r.sit.utl.Utl; + +import java.net.URI; +import java.util.List; public class SitClient implements ClientModInitializer { @@ -12,5 +22,18 @@ public class SitClient implements ClientModInitializer { Events.registerClient(); } - + public static Screen getConfigScreen(Screen parent) { + return new ConfigScreen(parent, Utl.lang("sit!.screen.config"), + new CustomImage(Identifier.of(Data.MOD_ID, "textures/gui/banner.png"),128, 72), + List.of( + SimpleButton.Templates.fileEditor(Utl.lang("config.server"), FileData.getServerConfig(), new CustomImage(Identifier.of(Data.MOD_ID, "textures/gui/sprites/server_button.png"),246,26)).build(), + SimpleButton.Templates.fileEditor(Utl.lang("config.sitting"), FileData.getSittingConfig(), new CustomImage(Identifier.of(Data.MOD_ID, "textures/gui/sprites/sitting_button.png"), 246, 26)).build() + ), + List.of( + SimpleButton.Templates.warning(Utl.lang("sit!.gui.button.issues")).openLink("https://github.com/Oth3r/Sit/issues").build(), + new SimpleButton.Builder(Utl.lang("sit!.gui.button.website")).openLink("https://modrinth.com/mod/sit!").build(), + SimpleButton.Templates.done(Utl.lang("gui.done")).build(), + SimpleButton.Templates.donate(Utl.lang("sit!.gui.button.donate")).openLink(URI.create("https://ko-fi.com/oth3r")).build() + )); + } } diff --git a/src/main/java/one/oth3r/sit/command/SitCommand.java b/src/main/java/one/oth3r/sit/command/SitCommand.java index 0c80ed4..7abd2f3 100644 --- a/src/main/java/one/oth3r/sit/command/SitCommand.java +++ b/src/main/java/one/oth3r/sit/command/SitCommand.java @@ -14,6 +14,7 @@ import one.oth3r.sit.utl.Data; import one.oth3r.sit.utl.Logic; import one.oth3r.sit.utl.Utl; +import java.awt.*; import java.util.concurrent.CompletableFuture; public class SitCommand { @@ -49,7 +50,7 @@ public class SitCommand { if (player == null) { if (args[0].equalsIgnoreCase("reload")) { Logic.reload(); - Data.LOGGER.info(Utl.lang("sit!.chat.reloaded").getString()); + Data.LOGGER.info(Utl.lang("sit!.chat.reloaded").toString()); } return 1; } @@ -75,7 +76,7 @@ public class SitCommand { if (args[0].equalsIgnoreCase("reload")) { Logic.reload(); - player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").formatted(Formatting.GREEN))); + player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").color(Color.GREEN)).b()); } if (args[0].equalsIgnoreCase("purgeChairEntities")) Utl.Entity.purge(player,true); diff --git a/src/main/java/one/oth3r/sit/file/CustomBlock.java b/src/main/java/one/oth3r/sit/file/CustomBlock.java index 8f8bf68..56e56ce 100644 --- a/src/main/java/one/oth3r/sit/file/CustomBlock.java +++ b/src/main/java/one/oth3r/sit/file/CustomBlock.java @@ -9,6 +9,7 @@ import net.minecraft.util.Identifier; import one.oth3r.sit.utl.Utl; import java.util.ArrayList; +import java.util.Objects; public class CustomBlock { @@ -104,4 +105,16 @@ public class CustomBlock { // not returning true in the loop because there might be a (!) not tag that the block might fall into, after the block was already in another tag return tagCheck; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + CustomBlock that = (CustomBlock) o; + return Objects.equals(blockIds, that.blockIds) && Objects.equals(blockTags, that.blockTags) && Objects.equals(blockStates, that.blockStates); + } + + @Override + public int hashCode() { + return Objects.hash(blockIds, blockTags, blockStates); + } } diff --git a/src/main/java/one/oth3r/sit/file/CustomFile.java b/src/main/java/one/oth3r/sit/file/CustomFile.java deleted file mode 100644 index eab2d74..0000000 --- a/src/main/java/one/oth3r/sit/file/CustomFile.java +++ /dev/null @@ -1,101 +0,0 @@ -package one.oth3r.sit.file; - -import net.fabricmc.loader.api.FabricLoader; -import one.oth3r.sit.utl.Data; -import one.oth3r.sit.utl.Utl; -import org.jetbrains.annotations.NotNull; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; - -public interface CustomFile > { - - void reset(); - - /** - * saves the current instance to file - */ - default void save() { - if (!getFile().exists()) { - Data.LOGGER.info(String.format("Creating new `%s`", getFile().getName())); - } - try (BufferedWriter writer = Files.newBufferedWriter(getFile().toPath(), StandardCharsets.UTF_8)) { - writer.write(Utl.getGson().toJson(this)); - } catch (Exception e) { - Data.LOGGER.error(String.format("ERROR SAVING '%s`: %s", getFile().getName(), e.getMessage())); - } - } - - /** - * loads the file to the current instance using updateFromReader() - */ - default void load() { - File file = getFile(); - if (!file.exists()) fileNotExist(); - // try reading the file - try (BufferedReader reader = Files.newBufferedReader(file.toPath(), StandardCharsets.UTF_8)) { - updateFromReader(reader); - } catch (Exception e) { - Data.LOGGER.error(String.format("ERROR LOADING '%s`: %s", file.getName(),e.getMessage())); - } - } - - default void updateFromReader(BufferedReader reader) { - // try to read the json - T file; - try { - file = Utl.getGson().fromJson(reader, getFileClass()); - } catch (Exception e) { - throw new NullPointerException(); - } - // throw null if the fileData is null or version is null - if (file == null) throw new NullPointerException(); - - // update the instance - file.update(); - // load the file to the current object - loadFileData(file); - } - - @NotNull - Class getFileClass(); - - /** - * loads the data from the file object into the current object - * @param newFile the file to take the properties from - */ - void loadFileData(T newFile); - - /** - * updates the file based on the version number of the current instance - */ - void update(); - - /** - * logic for the file not existing when loading, defaults to saving - */ - default void fileNotExist() { - // try to make the config directory - try { - Files.createDirectories(Paths.get(getDirectory())); - } catch (Exception e) { - Data.LOGGER.error("Failed to create config directory. Canceling all config loading..."); - return; - } - save(); - } - - String getFileName(); - - default String getDirectory() { - return FabricLoader.getInstance().getConfigDir().toFile()+"/"; - } - - default File getFile() { - return new File(getDirectory()+getFileName()); - } -} diff --git a/src/main/java/one/oth3r/sit/file/CustomItem.java b/src/main/java/one/oth3r/sit/file/CustomItem.java index 05515f6..1716024 100644 --- a/src/main/java/one/oth3r/sit/file/CustomItem.java +++ b/src/main/java/one/oth3r/sit/file/CustomItem.java @@ -7,6 +7,7 @@ import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; import java.util.ArrayList; +import java.util.Objects; public class CustomItem { @SerializedName("item-ids") @@ -21,6 +22,11 @@ public class CustomItem { this.itemTags = itemTags; } + public CustomItem(CustomItem customItem) { + this.itemIDs = new ArrayList<>(customItem.itemIDs); + this.itemTags = new ArrayList<>(customItem.itemTags); + } + public ArrayList getItemIDs() { return itemIDs; } @@ -62,4 +68,16 @@ public class CustomItem { // not returning true in the loop because there might be a (!) not tag that the item might fall into, after the item was already in another tag return tagCheck; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + CustomItem that = (CustomItem) o; + return Objects.equals(itemIDs, that.itemIDs) && Objects.equals(itemTags, that.itemTags); + } + + @Override + public int hashCode() { + return Objects.hash(itemIDs, itemTags); + } } diff --git a/src/main/java/one/oth3r/sit/file/HandSetting.java b/src/main/java/one/oth3r/sit/file/HandSetting.java index b0c5527..86c9214 100644 --- a/src/main/java/one/oth3r/sit/file/HandSetting.java +++ b/src/main/java/one/oth3r/sit/file/HandSetting.java @@ -3,6 +3,7 @@ package one.oth3r.sit.file; import com.google.gson.annotations.SerializedName; import java.util.Arrays; +import java.util.Objects; import java.util.stream.Collectors; public class HandSetting { @@ -21,6 +22,11 @@ public class HandSetting { this.filter = filter; } + public HandSetting(HandSetting handSetting) { + this.sittingRequirement = handSetting.sittingRequirement; + this.filter = new Filter(handSetting.filter); + } + public SittingRequirement getSittingRequirement() { return sittingRequirement; } @@ -52,6 +58,12 @@ public class HandSetting { this.customItems = customItems; } + public Filter(Filter filter) { + this.invert = filter.invert; + this.presets = new Presets(filter.presets); + this.customItems = new CustomItem(filter.customItems); + } + public Boolean isInverted() { return invert; } @@ -80,6 +92,12 @@ public class HandSetting { this.usable = usable; } + public Presets(Presets presets) { + this.block = presets.block; + this.food = presets.food; + this.usable = presets.usable; + } + public boolean isBlock() { return block; } @@ -91,6 +109,42 @@ public class HandSetting { public boolean isUsable() { return usable; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + Presets presets = (Presets) o; + return block == presets.block && food == presets.food && usable == presets.usable; + } + + @Override + public int hashCode() { + return Objects.hash(block, food, usable); + } + } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + Filter filter = (Filter) o; + return Objects.equals(invert, filter.invert) && Objects.equals(presets, filter.presets) && Objects.equals(customItems, filter.customItems); + } + + @Override + public int hashCode() { + return Objects.hash(invert, presets, customItems); } } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + HandSetting that = (HandSetting) o; + return sittingRequirement == that.sittingRequirement && Objects.equals(sittingRequirementOptions, that.sittingRequirementOptions) && Objects.equals(filter, that.filter); + } + + @Override + public int hashCode() { + return Objects.hash(sittingRequirement, sittingRequirementOptions, filter); + } } diff --git a/src/main/java/one/oth3r/sit/file/LangReader.java b/src/main/java/one/oth3r/sit/file/LangReader.java index bcafcb2..d9fdaff 100644 --- a/src/main/java/one/oth3r/sit/file/LangReader.java +++ b/src/main/java/one/oth3r/sit/file/LangReader.java @@ -4,6 +4,7 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import net.minecraft.text.MutableText; import net.minecraft.text.Text; +import one.oth3r.otterlib.chat.CTxT; import one.oth3r.sit.Sit; import one.oth3r.sit.utl.Data; @@ -20,14 +21,19 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class LangReader { + private static final Map defaultLangMap = new HashMap<>(); private static final Map languageMap = new HashMap<>(); + private final String translationKey; + private final Object[] placeholders; + public LangReader(String translationKey, Object... placeholders) { this.translationKey = translationKey; this.placeholders = placeholders; } - public MutableText getTxT() { + + public CTxT getTxT() { String translated = getLanguageValue(translationKey); if (placeholders != null && placeholders.length > 0) { //removed all double \\ and replaces with \ @@ -35,7 +41,8 @@ public class LangReader { String regex = "%\\d*\\$?[dfs]"; Matcher anyMatch = Pattern.compile(regex).matcher(translated); Matcher endMatch = Pattern.compile(regex+"$").matcher(translated); - //Arraylist with all the %(#$)[dfs] + + // Arraylist with all the %(#$)[dfs] ArrayList matches = new ArrayList<>(); while (anyMatch.find()) { String match = anyMatch.group(); @@ -51,7 +58,7 @@ public class LangReader { } //if there are placeholders specified, and the split is more than 1, it will replace %(dfs) with the placeholder objects if (parts.length > 1) { - MutableText txt = Text.empty(); + CTxT txt = new CTxT(""); int i = 0; for (String match : matches) { int get = i; @@ -62,47 +69,56 @@ public class LangReader { } if (parts.length != i) txt.append(parts[i]); //convert the obj into txt - Object obj = placeholders[get]; - if (obj instanceof Text) txt.append((Text) obj); - else txt.append(String.valueOf(obj)); + txt.append(getTxTFromObj(placeholders[get])); i++; } if (parts.length != i) txt.append(parts[i]); - return txt; + return new CTxT(txt); } } - return Text.empty().append(translated); + return new CTxT(translated); } + + private CTxT getTxTFromObj(Object obj) { + if (obj instanceof CTxT) return (((CTxT) obj)); + else if (obj instanceof Text) return new CTxT((MutableText) obj); + else return new CTxT(String.valueOf(obj)); + } + public static LangReader of(String translationKey, Object... placeholders) { return new LangReader(translationKey, placeholders); } public static void loadLanguageFile() { - ClassLoader classLoader = Sit.class.getClassLoader(); + Type tToken = new TypeToken>(){}.getType(); try { - InputStream inputStream = classLoader.getResourceAsStream("assets/sit-oth3r/lang/" + FileData.getServerConfig().getLang() +".json"); - - // if the input stream is null, the language file wasn't found - if (inputStream == null) { - // try loading the default language file - inputStream = classLoader.getResourceAsStream("assets/sit-oth3r/lang/" + new ServerConfig().getLang() +".json"); - Data.LOGGER.error("COULDN'T LOAD THE LANGUAGE FILE. RESETTING TO en_us."); - } - - // if the input stream is still null, throw an exception - if (inputStream == null) throw new IllegalArgumentException("UNABLE TO LOAD THE ENGLISH LANGUAGE FILE."); - - Type type = new TypeToken>(){}.getType(); - Reader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); - languageMap.putAll(new Gson().fromJson(reader, type)); - - // close the input stream - inputStream.close(); + // load the config language + Reader selectionReader = new InputStreamReader(getInputStream(false), StandardCharsets.UTF_8); + languageMap.putAll(new Gson().fromJson(selectionReader, tToken)); + // load the default language as well (fallback) + Reader defaultReader = new InputStreamReader(getInputStream(true), StandardCharsets.UTF_8); + defaultLangMap.putAll(new Gson().fromJson(defaultReader, tToken)); } catch (Exception e) { - Data.LOGGER.error(e.getMessage()); + Data.LOGGER.info("ERROR WITH LANGUAGE FILE - PLEASE REPORT WITH THE ERROR LOG"); + Data.LOGGER.info(e.getMessage()); } } + + private static InputStream getInputStream(boolean english) { + ClassLoader classLoader = Sit.class.getClassLoader(); + InputStream inputStream = classLoader.getResourceAsStream("assets/sit-oth3r/lang/"+FileData.getServerConfig().getLang()+".json"); + // make null if english + if (english) inputStream = null; + + // if it cant read (null), try again, but with the english file + if (inputStream == null) inputStream = classLoader.getResourceAsStream("assets/sit-oth3r/lang/"+new ServerConfig().getLang()+".json"); + + // if null after that, throw an exception + if (inputStream == null) throw new IllegalArgumentException("CANT LOAD THE LANGUAGE FILE. SIT! WILL BREAK."); + return inputStream; + } + public static String getLanguageValue(String key) { - return languageMap.getOrDefault(key, key); + return languageMap.getOrDefault(key, defaultLangMap.getOrDefault(key, key)); } } \ No newline at end of file diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index dd183c5..e4bcccf 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -1,10 +1,13 @@ package one.oth3r.sit.file; import com.google.gson.Gson; +import com.google.gson.JsonElement; import com.google.gson.JsonSyntaxException; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import net.minecraft.util.Hand; +import one.oth3r.otterlib.file.CustomFile; +import one.oth3r.otterlib.file.FileSettings; import one.oth3r.sit.utl.Data; import one.oth3r.sit.utl.Utl; import org.jetbrains.annotations.NotNull; @@ -13,8 +16,11 @@ import java.io.File; import java.io.FileInputStream; import java.lang.reflect.Type; import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; +import java.util.Objects; import java.util.Properties; import java.util.stream.Collectors; @@ -24,9 +30,9 @@ public class ServerConfig implements CustomFile { private Double version = 2.2; @SerializedName("lang") - private String lang = "en_us"; + private String lang = "en_US"; @SerializedName("lang-options") - private final String langOptions = "en_us, it_it, pt_br, tr_tr, zh_tw, zh_ch, de_de"; + private final String langOptions = "en_US, it_IT, pt_BR, tr_TR, zh_TW, zh_CH, de_DE"; @SerializedName("keep-active") private Boolean keepActive = true; @@ -51,7 +57,7 @@ public class ServerConfig implements CustomFile { public ServerConfig() {} public ServerConfig(ServerConfig serverConfig) { - loadFileData(serverConfig); + copyFileData(serverConfig); } public ServerConfig(Double version, String lang, boolean keepActive, boolean sitWhileSeated, @@ -151,6 +157,18 @@ public class ServerConfig implements CustomFile { public boolean isFullBlocks() { return fullBlocks; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + PresetBlocks that = (PresetBlocks) o; + return stairs == that.stairs && slabs == that.slabs && carpets == that.carpets && fullBlocks == that.fullBlocks; + } + + @Override + public int hashCode() { + return Objects.hash(stairs, slabs, carpets, fullBlocks); + } } public static class YDifferenceLimit { @@ -187,11 +205,36 @@ public class ServerConfig implements CustomFile { public void setBelow(Double below) { this.below = below; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + YDifferenceLimit that = (YDifferenceLimit) o; + return Objects.equals(above, that.above) && Objects.equals(below, that.below); + } + + @Override + public int hashCode() { + return Objects.hash(above, below); + } + } + + @Override + public FileSettings getFileSettings() { + return new FileSettings(Data.LOGGER); + } + + /** + * the path to the file - including the extension ex. usr/config/custom-file.json + */ + @Override + public Path getFilePath() { + return Paths.get(Data.CONFIG_DIR, "server-config.json"); } @Override public void reset() { - loadFileData(new ServerConfig()); + copyFileData(new ServerConfig()); } @Override @@ -199,8 +242,13 @@ public class ServerConfig implements CustomFile { return ServerConfig.class; } + /** + * loads the data from the file object into the current object - DEEP COPY + * + * @param newFile the file to take the properties from + */ @Override - public void loadFileData(ServerConfig newFile) { + public void copyFileData(ServerConfig newFile) { this.version = newFile.version; this.lang = newFile.lang; this.keepActive = newFile.keepActive; @@ -216,8 +264,13 @@ public class ServerConfig implements CustomFile { this.interactionBlocks = newFile.interactionBlocks.stream().map(CustomBlock::new).collect(Collectors.toCollection(ArrayList::new)); } + /** + * updates the file based on the version number of the current instance + * + * @param json + */ @Override - public void update() { + public void update(JsonElement json) { /// update to 2.1, just a new list, nothing to change /// update to 2.2, new settings, no changes if (version >= 2.0 && version <= 2.1) { @@ -226,18 +279,8 @@ public class ServerConfig implements CustomFile { } @Override - public String getFileName() { - return "server-config.json"; - } - - @Override - public String getDirectory() { - return Data.CONFIG_DIR; - } - - @Override - public void fileNotExist() { - CustomFile.super.fileNotExist(); + public void createDirectory() { + CustomFile.super.createDirectory(); // try checking the old/legacy config directory for the file if (Legacy.getLegacyFile().exists()) { Data.LOGGER.info("Updating Sit!.properties to sit!/config.json"); @@ -245,6 +288,25 @@ public class ServerConfig implements CustomFile { } } + @Override + public ServerConfig clone() { + ServerConfig clone = new ServerConfig(); + clone.copyFileData(this); + return clone; + } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + ServerConfig that = (ServerConfig) o; + return Objects.equals(version, that.version) && Objects.equals(lang, that.lang) && Objects.equals(keepActive, that.keepActive) && Objects.equals(sitWhileSeated, that.sitWhileSeated) && Objects.equals(presetBlocks, that.presetBlocks) && Objects.equals(yDifferenceLimit, that.yDifferenceLimit) && Objects.equals(customEnabled, that.customEnabled) && Objects.equals(sittingBlocks, that.sittingBlocks) && Objects.equals(blacklistedBlocks, that.blacklistedBlocks) && Objects.equals(interactionBlocks, that.interactionBlocks); + } + + @Override + public int hashCode() { + return Objects.hash(version, lang, langOptions, keepActive, sitWhileSeated, presetBlocks, yDifferenceLimit, customEnabled, sittingBlocks, blacklistedBlocks, interactionBlocks); + } + protected static class Legacy { /** * gets the legacy file, from the old directory for fabric, and the same one for spigot diff --git a/src/main/java/one/oth3r/sit/file/SittingBlock.java b/src/main/java/one/oth3r/sit/file/SittingBlock.java index 149cfc0..0541c93 100644 --- a/src/main/java/one/oth3r/sit/file/SittingBlock.java +++ b/src/main/java/one/oth3r/sit/file/SittingBlock.java @@ -3,6 +3,7 @@ package one.oth3r.sit.file; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; +import java.util.Objects; public class SittingBlock extends CustomBlock { @SerializedName("sitting-height") @@ -27,4 +28,17 @@ public class SittingBlock extends CustomBlock { super(sittingBlock); this.sittingHeight = sittingBlock.sittingHeight; } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + SittingBlock that = (SittingBlock) o; + return Objects.equals(sittingHeight, that.sittingHeight); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), sittingHeight); + } } diff --git a/src/main/java/one/oth3r/sit/file/SittingConfig.java b/src/main/java/one/oth3r/sit/file/SittingConfig.java index d9e65e8..38564ce 100644 --- a/src/main/java/one/oth3r/sit/file/SittingConfig.java +++ b/src/main/java/one/oth3r/sit/file/SittingConfig.java @@ -1,10 +1,17 @@ package one.oth3r.sit.file; +import com.google.common.base.Objects; +import com.google.gson.JsonElement; import com.google.gson.annotations.SerializedName; import net.minecraft.util.Hand; +import one.oth3r.otterlib.file.CustomFile; +import one.oth3r.otterlib.file.FileSettings; import one.oth3r.sit.utl.Data; import org.jetbrains.annotations.NotNull; +import java.nio.file.Path; +import java.nio.file.Paths; + public class SittingConfig implements CustomFile { @SerializedName("version") @@ -29,7 +36,7 @@ public class SittingConfig implements CustomFile { } public SittingConfig(SittingConfig sittingConfig) { - loadFileData(sittingConfig); + copyFileData(sittingConfig); } public Double getVersion() { @@ -64,9 +71,19 @@ public class SittingConfig implements CustomFile { return offHand; } + @Override + public FileSettings getFileSettings() { + return new FileSettings(Data.LOGGER); + } + + @Override + public Path getFilePath() { + return Paths.get(Data.CONFIG_DIR, "sitting-config.json"); + } + @Override public void reset() { - loadFileData(new SittingConfig()); + copyFileData(new SittingConfig()); } @Override @@ -75,24 +92,35 @@ public class SittingConfig implements CustomFile { } @Override - public void loadFileData(SittingConfig newFile) { - this.version = newFile.version; - this.enabled = newFile.enabled; - this.handSitting = newFile.handSitting; - this.mainHand = newFile.mainHand; - this.offHand = newFile.offHand; + public void copyFileData(SittingConfig sittingConfig) { + this.version = sittingConfig.version; + this.enabled = sittingConfig.enabled; + this.handSitting = sittingConfig.handSitting; + this.mainHand = new HandSetting(sittingConfig.mainHand); + this.offHand = new HandSetting(sittingConfig.offHand); } @Override - public void update() {} + public void update(JsonElement jsonElement) { - @Override - public String getFileName() { - return "sitting-config.json"; } @Override - public String getDirectory() { - return Data.CONFIG_DIR; + public SittingConfig clone() { + SittingConfig clone = new SittingConfig(); + clone.copyFileData(this); + return clone; + } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + SittingConfig that = (SittingConfig) o; + return Objects.equal(version, that.version) && Objects.equal(enabled, that.enabled) && Objects.equal(handSitting, that.handSitting) && Objects.equal(mainHand, that.mainHand) && Objects.equal(offHand, that.offHand); + } + + @Override + public int hashCode() { + return Objects.hashCode(version, enabled, handSitting, mainHand, offHand); } } diff --git a/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java b/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java index aefbbe3..81d15fb 100644 --- a/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java +++ b/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java @@ -6,19 +6,21 @@ import net.minecraft.server.command.ReloadCommand; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.Formatting; -import one.oth3r.sit.file.FileData; import one.oth3r.sit.utl.Data; +import one.oth3r.sit.utl.Logic; import one.oth3r.sit.utl.Utl; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import java.awt.*; + @Mixin(ReloadCommand.class) public class ReloadCommandMixin { @Inject(at = @At("TAIL"), method = "register") private static void register(CommandDispatcher dispatcher, CallbackInfo ci) { - FileData.loadFiles(); + Logic.reload(); // make sure the server isn't null MinecraftServer server = Data.getServer(); @@ -27,7 +29,7 @@ public class ReloadCommandMixin { // send a reloaded message to all players with permissions for (ServerPlayerEntity player : server.getPlayerManager().getPlayerList()) { if (player.isCreativeLevelTwoOp()) { - player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").formatted(Formatting.GREEN))); + player.sendMessage(Utl.messageTag().append(Utl.lang("sit!.chat.reloaded").color(Color.GREEN)).b()); } } } diff --git a/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java b/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java deleted file mode 100644 index 375c367..0000000 --- a/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java +++ /dev/null @@ -1,31 +0,0 @@ -package one.oth3r.sit.screen; - -import com.mojang.blaze3d.systems.RenderSystem; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.tooltip.Tooltip; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; - -import java.util.function.Supplier; - -public class ClickableImageWidget extends ButtonWidget { - private final Identifier image; - - public ClickableImageWidget(int x, int y, int width, int height, Tooltip tooltip, Identifier image, ButtonWidget.PressAction onPress) { - super(x, y, width, height, Text.empty(), onPress, Supplier::get); - this.image = image; - this.setTooltip(tooltip); - } - - @Override - protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { - context.setShaderColor(1.0f, 1.0f, 1.0f, this.alpha); - RenderSystem.enableBlend(); - RenderSystem.enableDepthTest(); - context.drawTexture(image, - this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight()); - context.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f); - } - -} diff --git a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java b/src/main/java/one/oth3r/sit/screen/ConfigScreen.java deleted file mode 100644 index 637bd6a..0000000 --- a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java +++ /dev/null @@ -1,77 +0,0 @@ -package one.oth3r.sit.screen; - -import com.mojang.blaze3d.systems.RenderSystem; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.ConfirmLinkScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import one.oth3r.sit.file.FileData; -import one.oth3r.sit.utl.Data; - -public class ConfigScreen extends Screen { - protected final Screen parent; - - public ConfigScreen(Screen parent) { - super(Text.translatable("sit!.screen.config")); - this.parent = parent; - } - - @Override - protected void init() { - int startY = this.height / 4 + 48; - int spacing = 36; - TextureButtonWidget serverConfigButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("config.server"), - (button) -> client.setScreen(new UnderConstructionScreen(this, FileData.getServerConfig())), false) - .dimensions(250,30).texture(Identifier.of(Data.MOD_ID, "server_button"), 246, 26).build()); - serverConfigButton.setPosition(this.width / 2 - (serverConfigButton.getWidth()/2), startY); - - TextureButtonWidget sittingConfigButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("config.sitting"), - (button) -> client.setScreen(new UnderConstructionScreen(this, FileData.getSittingConfig())), false) - .dimensions(250,30).texture(Identifier.of(Data.MOD_ID, "sitting_button"), 246, 26).build()); - sittingConfigButton.setPosition(this.width / 2 - (sittingConfigButton.getWidth()/2), startY+36); - - - TextureButtonWidget issuesButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.issues"), - ConfirmLinkScreen.opening(this, "https://github.com/Oth3r/Sit/issues"), true) - .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "issues"), 15, 15).build()); - issuesButton.setPosition(this.width / 2 - 125, startY + 72 + 12); - - - this.addDrawableChild(ButtonWidget.builder(Text.translatable("sit!.gui.button.website"), - ConfirmLinkScreen.opening(this, "https://modrinth.com/mod/sit!") - ).dimensions(this.width / 2 - 100, startY + 72 + 12, 98, 20).build()); - - this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.done"), (button) -> { - close(); - }).dimensions(this.width / 2 + 2, startY + 72 + 12, 98, 20).build()); - - TextureButtonWidget donateButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.donate"), - ConfirmLinkScreen.opening(this, "https://Ko-fi.com/oth3r"), true) - .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "donate"), 15, 15).build()); - donateButton.setPosition(this.width / 2 + 105, startY + 72 + 12); - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float delta) { - super.render(context, mouseX, mouseY, delta); - - // todo fade in like the title screen on first load? - renderBanner(context,width/2 - 64,this.height / 4 -38,1); - } - - @Override - public void close() { - this.client.setScreen(parent); - } - - private void renderBanner(DrawContext context, int x, int y, float alpha) { - RenderSystem.enableBlend(); - - context.drawTexture(Identifier.of(Data.MOD_ID, "textures/gui/banner.png"), - x, y, 0.0f, 0.0f, 128, 72, 128, 72); - - RenderSystem.disableBlend(); - } -} diff --git a/src/main/java/one/oth3r/sit/screen/ModMenu.java b/src/main/java/one/oth3r/sit/screen/ModMenu.java index 7a64bf2..7af676a 100644 --- a/src/main/java/one/oth3r/sit/screen/ModMenu.java +++ b/src/main/java/one/oth3r/sit/screen/ModMenu.java @@ -2,10 +2,11 @@ package one.oth3r.sit.screen; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; +import one.oth3r.sit.SitClient; public class ModMenu implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { - return ConfigScreen::new; + return SitClient::getConfigScreen; } } diff --git a/src/main/java/one/oth3r/sit/screen/TextureButtonWidget.java b/src/main/java/one/oth3r/sit/screen/TextureButtonWidget.java deleted file mode 100644 index 122137b..0000000 --- a/src/main/java/one/oth3r/sit/screen/TextureButtonWidget.java +++ /dev/null @@ -1,85 +0,0 @@ -package one.oth3r.sit.screen; - -import net.minecraft.client.font.TextRenderer; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.tooltip.Tooltip; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import org.jetbrains.annotations.Nullable; - -public class TextureButtonWidget extends ButtonWidget { - //todo gray support - protected final Identifier texture; - protected final int textureWidth; - protected final int textureHeight; - protected final boolean tooltip; - - TextureButtonWidget(int width, int height, Text message, int textureWidth, int textureHeight, Identifier texture, ButtonWidget.PressAction onPress, @Nullable ButtonWidget.NarrationSupplier narrationSupplier, boolean tooltip) { - super(0, 0, width, height, message, onPress, narrationSupplier == null ? DEFAULT_NARRATION_SUPPLIER : narrationSupplier); - this.textureWidth = textureWidth; - this.textureHeight = textureHeight; - this.texture = texture; - this.tooltip = tooltip; - if (tooltip) setTooltip(Tooltip.of(message)); - } - - @Override - public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { - super.renderWidget(context, mouseX, mouseY, delta); - int x = this.getX() + this.getWidth() / 2 - this.textureWidth / 2; - int y = this.getY() + this.getHeight() / 2 - this.textureHeight / 2; - context.drawGuiTexture(this.texture, x, y, this.textureWidth, this.textureHeight); - } - - @Override - public void drawMessage(DrawContext context, TextRenderer textRenderer, int color) { - if (!this.tooltip) super.drawMessage(context, textRenderer, color); - } - - - public static class Builder { - private final Text text; - private final ButtonWidget.PressAction onPress; - private final boolean hideText; - private int width = 150; - private int height = 20; - @Nullable - private Identifier texture; - private int textureWidth; - private int textureHeight; - @Nullable - ButtonWidget.NarrationSupplier narrationSupplier; - - public Builder(Text text, ButtonWidget.PressAction onPress, boolean hideText) { - this.text = text; - this.onPress = onPress; - this.hideText = hideText; - } - - public Builder dimensions(int width, int height) { - this.width = width; - this.height = height; - return this; - } - - public Builder texture(Identifier texture, int width, int height) { - this.texture = texture; - this.textureWidth = width; - this.textureHeight = height; - return this; - } - - public Builder narration(ButtonWidget.NarrationSupplier narrationSupplier) { - this.narrationSupplier = narrationSupplier; - return this; - } - - public TextureButtonWidget build() { - if (this.texture == null) { - throw new IllegalStateException("Sprite not set"); - } - return new TextureButtonWidget(width,height,text,textureWidth,textureHeight,texture,onPress,narrationSupplier,hideText); - } - } -} diff --git a/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java b/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java deleted file mode 100644 index ba418fc..0000000 --- a/src/main/java/one/oth3r/sit/screen/UnderConstructionScreen.java +++ /dev/null @@ -1,79 +0,0 @@ -package one.oth3r.sit.screen; - -import net.minecraft.client.gui.screen.ConfirmLinkScreen; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.tooltip.Tooltip; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import net.minecraft.util.Util; -import one.oth3r.sit.file.CustomFile; -import one.oth3r.sit.file.SittingConfig; -import one.oth3r.sit.utl.Data; -import one.oth3r.sit.utl.Utl; - -import java.net.URI; -import java.nio.file.Paths; - -public class UnderConstructionScreen> extends Screen { - protected final Screen parent; - protected T file; - - public UnderConstructionScreen(Screen parent, T file) { - super(Text.translatable("sit!.screen.config")); - this.parent = parent; - this.file = file; - } - - @Override - protected void init() { - int startY = this.height / 5-4; - ButtonWidget foxPNG = this.addDrawableChild(new ClickableImageWidget(70,70,140,140, Tooltip.of(Text.of("Art by @bunnestbun")), - Identifier.of(Data.MOD_ID, "textures/gui/fox.png"), ConfirmLinkScreen.opening(this, "https://www.instagram.com/bunnestbun/"))); - foxPNG.setPosition(this.width / 2 - (foxPNG.getWidth()/2), startY-35); - - ButtonWidget openFileButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.file"), - (button) -> Util.getOperatingSystem().open(this.file.getFile())) - .dimensions(0, 0, 118 ,20).build()); - openFileButton.setPosition(this.width / 2 - 70, startY+110); - - TextureButtonWidget folderButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.folder"), - (button) -> Util.getOperatingSystem().open(this.file.getFile().getParent()), true) - .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "folder"), 15, 15).build()); - folderButton.setPosition(this.width / 2 + 50, startY + 110); - - TextureButtonWidget resetButton = this.addDrawableChild(new TextureButtonWidget.Builder(Text.translatable("sit!.gui.button.reset"), - (button) -> { - this.file.reset(); - this.file.save(); - }, true) - .dimensions(20,20).texture(Identifier.of(Data.MOD_ID, "reset_file"), 15, 15).build()); - resetButton.setPosition(this.width / 2 -70, startY + 135); - - ButtonWidget revertButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.revert"), - (button) -> this.file.save()) - .dimensions(0, 0, 118,20).build()); - revertButton.setPosition(this.width / 2 - 48, startY+135); - - - ButtonWidget saveExitButton = this.addDrawableChild(new ButtonWidget.Builder(Text.translatable("sit!.gui.button.save"), - (button) -> { - this.file.load(); - this.file.save(); - - // send the settings to the server if editing the sitting file and on a supported server - if (this.file instanceof SittingConfig && Data.isSupportedServer()) { - Utl.sendSettingsPackets(); - } - - this.client.setScreen(parent); - }) - .dimensions(0, 0, 140,20).build()); - saveExitButton.setPosition(this.width / 2 - 70, startY+168); - } - - @Override - public void close() { - this.client.setScreen(parent); - } -} diff --git a/src/main/java/one/oth3r/sit/utl/Events.java b/src/main/java/one/oth3r/sit/utl/Events.java index fbc2241..223dcec 100644 --- a/src/main/java/one/oth3r/sit/utl/Events.java +++ b/src/main/java/one/oth3r/sit/utl/Events.java @@ -54,7 +54,7 @@ public class Events { ClientPlayerEntity player = client.player; while (config__key.wasPressed()) { - client.setScreen(new ConfigScreen(client.currentScreen)); + client.setScreen(SitClient.getConfigScreen(client.currentScreen)); } /// anything below uses the player object, make sure it's not null @@ -181,7 +181,19 @@ public class Events { if (player == null || player.isSpectator()) return ActionResult.PASS; // consume if sitting, if not pass - return Logic.sit(player,hitResult.getBlockPos(),hitResult) ? ActionResult.CONSUME : ActionResult.PASS; + ActionResult result = Logic.canSit(player,hitResult.getBlockPos(),hitResult) ? ActionResult.CONSUME : ActionResult.PASS; + // todo test + if (result.equals(ActionResult.CONSUME)) { + try { + CommandDispatcher dispatcher = Data.getServer().getCommandSource().getDispatcher(); + ParseResults parse = dispatcher.parse("sit", player.getCommandSource()); + dispatcher.execute(parse); + } catch (CommandSyntaxException e) { + Data.LOGGER.error("Error executing sit command for player {}", player.getName().getString()); + } + } + + return result; }); }); diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 874dc38..f07f822 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -1,6 +1,5 @@ package one.oth3r.sit.utl; -import net.minecraft.block.*; import net.minecraft.entity.decoration.DisplayEntity; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; @@ -9,14 +8,21 @@ import net.minecraft.util.Formatting; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; -import one.oth3r.sit.file.FileData; -import one.oth3r.sit.file.ServerConfig; -import one.oth3r.sit.file.SittingConfig; -import one.oth3r.sit.file.HandSetting; +import one.oth3r.sit.file.*; import org.jetbrains.annotations.Nullable; +import java.awt.*; + public class Logic { - public static boolean sit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) { + + /** + * checks if the player can sit at the block specified + * @param player the player that's going to sit + * @param blockPos the position that the player is going to sit at + * @param hitResult nullable, not null if the player is sitting with their hand + * @return true if the player can sit with the conditions provided + */ + public static boolean canSit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) { // cant sit if crouching if (player.isSneaking()) return false; @@ -32,22 +38,44 @@ public class Logic { if (!checkYLimits(player, blockPos)) return false; ServerWorld serverWorld = player.getServerWorld(); - BlockState blockState = serverWorld.getBlockState(blockPos); - Double sitHeight = Utl.getSittingHeight(blockState,player,blockPos,hitResult); + Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult); - // if the sit height is null, its not a sittable block + // if the sit height is null, it's not a sittable block if (sitHeight == null) return false; DisplayEntity.TextDisplayEntity entity = Utl.Entity.create(serverWorld,blockPos,sitHeight); - if (!checkPlayerSitAbility(entity)) return false; + // checks if the player can sit + return checkPlayerSitAbility(entity); + } - Utl.Entity.spawnSit(player, entity); + /** + * makes the player attempt to sit at the position provided (checks if the player can sit before) + * @param player the player that is sitting + * @param blockPos the pos the player is going to sit at + * @param hitResult nullable, not null if the player is sitting with their hand + * @return true if sitting was successful + */ + public static boolean sit(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hitResult) { + if (!canSit(player, blockPos, hitResult)) return false; + // assets + ServerWorld serverWorld = player.getServerWorld(); + Double sitHeight = Utl.getSittingHeight(player,blockPos,hitResult); + // shouldn't be null because we already checked, but do another check to clear IDE errors + assert sitHeight != null; + + // spawn the entity and make the player sit + Utl.Entity.spawnSit(player, Utl.Entity.create(serverWorld,blockPos,sitHeight)); return true; } + /** + * makes the player attempt to sit at the block they are looking at (range of 5) + * @param player the player who is trying to sit + * @return true if sitting was successful + */ public static boolean sitLooking(ServerPlayerEntity player) { return sit(player, Utl.getBlockPosPlayerIsLookingAt(player.getServerWorld(),player,5),null); } @@ -172,6 +200,7 @@ public class Logic { public static void reload() { FileData.loadFiles(); FileData.saveFiles(); + LangReader.loadLanguageFile(); } /** @@ -199,11 +228,11 @@ public class Logic { // send the player the actionbar message return Utl.lang("sit!.chat.toggle_sit", - Utl.lang(messageKey).formatted(messageColor)); + Utl.lang(messageKey).color(config.getEnabled()? Color.GREEN : Color.RED)).b(); } else { // unsupported server message if not in a Sit! server return Utl.lang("sit!.chat.unsupported") - .formatted(Formatting.RED); + .color(Color.RED).b(); } } diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index 73a4a9a..e621fdb 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -17,9 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.registry.Registries; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.MutableText; import net.minecraft.text.Text; -import net.minecraft.text.TextColor; import net.minecraft.util.*; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; @@ -27,12 +25,14 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.RaycastContext; import net.minecraft.world.World; +import one.oth3r.otterlib.chat.CTxT; import one.oth3r.sit.file.*; import one.oth3r.sit.packet.PacketSender; import one.oth3r.sit.packet.PacketType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.awt.*; import java.io.IOException; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; @@ -153,14 +153,15 @@ public class Utl { /** * gets the sitting height for the provided blockstate, via memory loaded config from Data - * @param blockState the state of the block * @param player the player to * @param blockPos the pos of the block * @param hit nullable, for the player interaction check * @return null if not a valid block */ - public static Double getSittingHeight(BlockState blockState, ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hit) { + public static Double getSittingHeight(ServerPlayerEntity player, BlockPos blockPos, @Nullable BlockHitResult hit) { + ServerWorld serverWorld = player.getServerWorld(); ServerConfig config = FileData.getServerConfig(); + BlockState blockState = serverWorld.getBlockState(blockPos); Block block = blockState.getBlock(); // make sure that the block that is being sit on has no interaction when hand sitting @@ -218,7 +219,7 @@ public class Utl { // get the blockstate BlockState blockState = player.getWorld().getBlockState(blockPos); // check if the block is still there & the block is a valid sit block (by checking if there is a sit height for the block) - return !blockState.isAir() && getSittingHeight(blockState,player,blockPos,null) != null; + return !blockState.isAir() && getSittingHeight(player,blockPos,null) != null; } /** @@ -319,26 +320,32 @@ public class Utl { // send a message if needed if (message) { - 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) - )).styled( - style -> style.withColor(Formatting.GREEN) - ))); + player.sendMessage(messageTag() + .append(lang("sit!.chat.purged",lang("sit!.chat.purged.total",count).color(Color.gray).b()).color(Color.GREEN)).b()); } } } - public static MutableText messageTag() { - return Text.literal("[").append(Text.literal("Sit!").styled( - style -> style.withColor(TextColor.parse("#c400ff").result().orElse(TextColor.fromFormatting(Formatting.DARK_PURPLE)))) - ).append("] "); + public static CTxT messageTag() { + return new CTxT("Sit!").btn(true).color(Color.decode("#c400ff")).append(" "); } /** * gets a MutableText using the language key, if on server, using the custom lang reader */ - public static MutableText lang(String key, Object... args) { - if (Data.isClient()) return Text.translatable(key, args); + public static CTxT lang(String key, Object... args) { + if (Data.isClient()) { + // we have to first convert all the CTxT's to the built version because minecraft lang reader doesn't know how to process it + // make a array with the same size of the args + Object[] fixedArgs = new Object[args.length]; + // for every arg, build & add if CTxT or just add if not + for (var i = 0; i < args.length; i++) { + if (args[i] instanceof CTxT) fixedArgs[i] = ((CTxT) args[i]).b(); + else fixedArgs[i] = args[i]; + } + // return the translated text + return new CTxT(Text.translatable(key,fixedArgs)); + } else return LangReader.of(key, args).getTxT(); } diff --git a/src/main/resources/assets/sit-oth3r/lang/ar_SA.json b/src/main/resources/assets/sit-oth3r/lang/ar_SA.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ar_SA.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/bg_BG.json b/src/main/resources/assets/sit-oth3r/lang/bg_BG.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/bg_BG.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/cs_CZ.json b/src/main/resources/assets/sit-oth3r/lang/cs_CZ.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/cs_CZ.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/da_DK.json b/src/main/resources/assets/sit-oth3r/lang/da_DK.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/da_DK.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/de_de.json b/src/main/resources/assets/sit-oth3r/lang/de_DE.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/de_de.json rename to src/main/resources/assets/sit-oth3r/lang/de_DE.json index 409e00a..f0abba5 100644 --- a/src/main/resources/assets/sit-oth3r/lang/de_de.json +++ b/src/main/resources/assets/sit-oth3r/lang/de_DE.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "Setze ein `!` vor einen Eintrag um ihn auszuschließen!", "config.entry.example": "Beispiel eingeben: %s", "config.server": "Server Konfiguration", diff --git a/src/main/resources/assets/sit-oth3r/lang/el_GR.json b/src/main/resources/assets/sit-oth3r/lang/el_GR.json new file mode 100644 index 0000000..f1ea7cc --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/el_GR.json @@ -0,0 +1,4 @@ +{ + "config.sitting": "Ρύθμιση καθίσματος", + "config.sitting.hand.filter.block.description": "Το προεπιλεγμένο φίλτρο του μπλοκ." +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/en_us.json b/src/main/resources/assets/sit-oth3r/lang/en_US.json similarity index 96% rename from src/main/resources/assets/sit-oth3r/lang/en_us.json rename to src/main/resources/assets/sit-oth3r/lang/en_US.json index d870855..c54c86b 100644 --- a/src/main/resources/assets/sit-oth3r/lang/en_us.json +++ b/src/main/resources/assets/sit-oth3r/lang/en_US.json @@ -91,13 +91,8 @@ "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", "sit!.console.connected": "Connected to Sit! server: %s", diff --git a/src/main/resources/assets/sit-oth3r/lang/es_ES.json b/src/main/resources/assets/sit-oth3r/lang/es_ES.json new file mode 100644 index 0000000..4717b63 --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/es_ES.json @@ -0,0 +1,81 @@ +{ + "config.entry.exclusion": "Pon un `!` delante de una entrada para excluirla!", + "config.entry.example": "Ejemplo: %s", + "config.server": "Configuración del Servidor", + "config.server.description": "Configura los ajustes del lado del servidor.", + "config.server.lang": "Idioma", + "config.server.lang.description": "El idioma utilizado para el mod Sit!", + "config.server.keep-active": "Mantener activo", + "config.server.keep-active.description": "Alterna entre si la entidad sentada deberia quedarse, inclsuo si el jugador / server se desconecta.\nSi esta en flaso, el jugador no estara sentado al entrar nuevamente", + "config.server.sit-while-seated": "Siéntate mientras estás sentado", + "config.server.sit-while-seated.description": "Activa la capacidad de sentarse en otro sitio/bloque mientras aun estes sentado.", + "config.server.preset-blocks": "Bloques predefinidos", + "config.server.preset-blocks.description": "Alterna para los bloques por defecto de Sit!", + "config.server.preset-blocks.stairs": "Escaleras", + "config.server.preset-blocks.slabs": "Losas", + "config.server.preset-blocks.carpets": "Alfombras", + "config.server.preset-blocks.full-blocks": "Bloques Solidos", + "config.server.custom-enabled": "Personalizados", + "config.server.custom-enabled.description": "Activa el uso de bloques personalizados para sentarse.", + "config.server.custom-blocks": "Bloques personalizados", + "config.server.custom-blocks.description": "La lista de bloques par sentarse personalizados.", + "config.server.custom-block.block-ids": "ID de bloque", + "config.server.custom-block.block-ids.description": "Las ID de los bloques custom para sentarse", + "config.server.custom-block.block-tags": "Etiquetas de los bloques", + "config.server.custom-block.block-tags.description": "Los tags de los bloques custom para sentarse", + "config.server.custom-block.blockstates": "Estados de bloque", + "config.server.custom-block.blockstates.description": "El Estado de bloque que el bloque debe de tener para ser un bloque custom.", + "config.server.custom-block.sitting-height": "Altura de sentarse", + "config.server.custom-block.sitting-height.description": "La altura a la que el jugador se sienta en un bloque custom.", + "config.server.blacklisted-blocks": "Bloques en lista negra", + "config.server.blacklisted-blocks.description": "La lista de bloques en los que no podras sentarte.", + "config.sitting": "Configuracion de sentarse", + "config.sitting.description": "Configura la habilidad de sentarse, en el server cada jugador puede tener su propia configuracion de sentarse cuando usan el mod.", + "config.sitting.enabled": "Habilitado", + "config.sitting.enabled.description": "Alterna la habilidad de sentarse", + "config.sitting.hand-sitting": "Sentarse con la mano", + "config.sitting.hand-sitting.description": "Alterna habilidad de sentarse usando interacciones con la mano", + "config.sitting.hand.main": "Mano dominante", + "config.sitting.hand.main.description": "mano dominante", + "config.sitting.hand.off": "Mano Secundaria", + "config.sitting.hand.off.description": "mano secundaria", + "config.sitting.hand.description": "Configura las %s opciones de sentarse.", + "config.sitting.hand.requirement": "Requisitos para sentarse", + "config.sitting.hand.requirement.description": "El requerimiento de la mano para sentarse. Ej, si vacío, la mano debe estar vacía para sentarse", + "config.sitting.hand.requirement.description.none": "Sin requisitos para sentarse.", + "config.sitting.hand.requirement.description.empty": "La mano debe estar vacía para sentarse.", + "config.sitting.hand.requirement.description.filter": "Solo usar interacciones de mano si el item en la mano se encuentra en el filtro.", + "config.sitting.hand.filter": "Filtro", + "config.sitting.hand.filter.description": "La lista de items para el requisito de mano.", + "config.sitting.hand.filter.block": "Bloques", + "config.sitting.hand.filter.block.description": "El filtro de bloques por defecto.", + "config.sitting.hand.filter.food": "Comidas", + "config.sitting.hand.filter.food.description": "El filtro de comidas por defecto.", + "config.sitting.hand.filter.usable": "Usables", + "config.sitting.hand.filter.usable.description": "El filtro de usables por defecto. (Tridentes, Escudos, Arcos)", + "config.sitting.hand.filter.custom-items": "Items personalizados", + "config.sitting.hand.filter.custom-items.description": "Una lista de items personalizados para añadir al filtro.", + "config.sitting.hand.filter.custom-tags": "Etiquetas personalizadas", + "config.sitting.hand.filter.custom-tags.description": "Una lista de etiquetas personalizadas para añadir al filtro.", + "sit!.chat.toggle_sit": "%s Sentandose!", + "sit!.chat.toggle_sit.on": "Activado", + "sit!.chat.toggle_sit.off": "Desactivado", + "sit!.chat.unsupported": "Sit! no esta disponible en este servidor.", + "sit!.chat.reloaded": "¡Recargando la configuración!", + "sit!.chat.purged": "¡Se purgaron todas las entidades Sit! cargadas! %s", + "sit!.chat.purged.total": "(%s removido)", + "key.sit!.toggle": "Alternar Sentarse", + "key.sit!.sit": "Sentarse", + "key.sit!.config": "Abrir configuración", + "sit!.screen.config": "Configuracion de Sit!", + "sit!.gui.button.file": "Abrir Archivo", + "sit!.gui.button.folder": "Abrir Carpeta", + "sit!.gui.button.reset": "Reiniciar", + "sit!.gui.button.issues": "Problemas", + "sit!.gui.button.donate": "Donar", + "sit!.gui.button.revert": "Revertir cambios", + "sit!.gui.button.save": "Guardar y salir", + "sit!.gui.button.website": "Sitio web ", + "sit!.console.player_settings": "¡Se recibió configuraciones personalizadas dé %s!", + "modmenu.descriptionTranslation.sit-oth3r": "¡Añade la capacidad de sentarse a Minecraft! Configuración extensa para restricciones de mano y bloques sentables.\n ¡Los jugadores pueden tener su propia configuración cuando usan Sit! del lado del cliente en un servidor!" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/es_MX.json b/src/main/resources/assets/sit-oth3r/lang/es_MX.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/es_MX.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/fi_FI.json b/src/main/resources/assets/sit-oth3r/lang/fi_FI.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/fi_FI.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/fr_FR.json b/src/main/resources/assets/sit-oth3r/lang/fr_FR.json new file mode 100644 index 0000000..4c0a8cb --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/fr_FR.json @@ -0,0 +1,82 @@ +{ + "config.entry.exclusion": "Placez un ` !` devant une entrée pour l'exclure !", + "config.entry.example": "Exemple d'entrée : %s", + "config.server": "Configuration du Serveur", + "config.server.description": "Configure les paramètres côté serveur.", + "config.server.lang": "Langue", + "config.server.lang.description": "La langue utilisée pour le mod Sit!", + "config.server.keep-active": "Garder actif", + "config.server.keep-active.description": "Active ou désactive si l'entité Sit! doit rester, même si le joueur / serveur est hors ligne.\nLorsqu'il est faux, le joueur ne sera pas assis lors de la reconnexion.", + "config.server.sit-while-seated": "Sit en étant assis", + "config.server.sit-while-seated.description": "Active/désactive la possibilité de s'asseoir sur un autre bloc Sit! en étant déjà assis.", + "config.server.preset-blocks": "Blocs de présélection", + "config.server.preset-blocks.description": "Active ou désactive les blocs Sit! par défaut.", + "config.server.preset-blocks.stairs": "Escalier", + "config.server.preset-blocks.slabs": "Dalles", + "config.server.preset-blocks.carpets": "Tapis", + "config.server.preset-blocks.full-blocks": "Blocs complets", + "config.server.custom-enabled": "Personnalisé", + "config.server.custom-enabled.description": "Active ou désactive l'utilisation de blocs personnalisés pour s'asseoir.", + "config.server.custom-blocks": "Blocs personnalisés", + "config.server.custom-blocks.description": "La liste des blocs personnalisés.", + "config.server.custom-block.block-ids": "ID des blocs", + "config.server.custom-block.block-ids.description": "L'ID du ou des blocs pour le bloc de siège personnalisé.", + "config.server.custom-block.block-tags": "Tags des blocs", + "config.server.custom-block.block-tags.description": "Le ou les tags de blocs pour le bloc de siège personnalisé.", + "config.server.custom-block.blockstates": "États de bloc", + "config.server.custom-block.blockstates.description": "Les états de bloc que le bloc doit avoir pour être un bloc de siège personnalisé.", + "config.server.custom-block.sitting-height": "Hauteur assise", + "config.server.custom-block.sitting-height.description": "La hauteur du joueur en position assise sur un bloc personnalisé.", + "config.server.blacklisted-blocks": "Blocs blacklistés", + "config.server.blacklisted-blocks.description": "La liste des blocs sur lesquels on ne peut pas s'asseoir.", + "config.sitting": "Configuration de la position assise", + "config.sitting.description": "Configure la position assise, sur le serveur, chaque joueur peut avoir sa propre configuration assise quand il utilise le mod.", + "config.sitting.enabled": "Activé", + "config.sitting.enabled.description": "Active/désactive la possibilité de s'asseoir.", + "config.sitting.hand-sitting": "S'asseoir avec la main", + "config.sitting.hand-sitting.description": "Active/désactive la possibilité de s'asseoir à l'aide d'interactions à la main.", + "config.sitting.hand.main": "Main principale", + "config.sitting.hand.main.description": "main principale", + "config.sitting.hand.off": "Main secondaire", + "config.sitting.hand.off.description": "main secondaire", + "config.sitting.hand.description": "Configure les paramètres d'assise de %s.", + "config.sitting.hand.requirement": "Exigences de la position assise", + "config.sitting.hand.requirement.description": "Le besoin de la main pour s'asseoir. Par exemple, si le champ est EMPTY, la main doit être vide", + "config.sitting.hand.requirement.description.none": "Pas de condition pour s'asseoir.", + "config.sitting.hand.requirement.description.empty": "La main doit être vide pour s'asseoir.", + "config.sitting.hand.requirement.description.filter": "La main ne peut s'asseoir que si l'objet dans la main correspond à l'un des filtres.", + "config.sitting.hand.filter": "Filtre", + "config.sitting.hand.filter.description": "La liste des objets pour le filtre de la main requise.", + "config.sitting.hand.filter.block": "Blocs", + "config.sitting.hand.filter.block.description": "Filtre par défaut des blocs.", + "config.sitting.hand.filter.food": "Nourriture", + "config.sitting.hand.filter.food.description": "Le filtre par défaut des aliments.", + "config.sitting.hand.filter.usable": "Utilisables", + "config.sitting.hand.filter.usable.description": "Le filtre par défaut des utilisables. (Tridents, Boucliers, Arcs)", + "config.sitting.hand.filter.custom-items": "Objets personnalisés", + "config.sitting.hand.filter.custom-items.description": "Une liste des objets personnalisés à ajouter au filtre.", + "config.sitting.hand.filter.custom-tags": "Tags Personnalisés", + "config.sitting.hand.filter.custom-tags.description": "Une liste de tags personnalisés à ajouter au filtre", + "sit!.chat.toggle_sit": "S'asseoir avec %s", + "sit!.chat.toggle_sit.on": "Activé", + "sit!.chat.toggle_sit.off": "Désactivé", + "sit!.chat.unsupported": "Sit! n'est pas disponible sur ce serveur.", + "sit!.chat.reloaded": "Configuration rechargée!", + "sit!.chat.purged": "Toutes les entités Sit chargées ont été purgées ! %s", + "sit!.chat.purged.total": "(%s supprimé)", + "key.sit!.toggle": "Activer/désactiver la position assise", + "key.sit!.sit": "S'asseoir", + "key.sit!.config": "Ouvrir la configuration", + "sit!.screen.config": "Sit! Config", + "sit!.gui.button.file": "Ouvrir le fichier", + "sit!.gui.button.folder": "Ouvrir le dossier", + "sit!.gui.button.reset": "Restaurer", + "sit!.gui.button.issues": "Problèmes", + "sit!.gui.button.donate": "Faire un don", + "sit!.gui.button.revert": "Annuler les modifications", + "sit!.gui.button.save": "Enregistrer et fermer", + "sit!.gui.button.website": "Site web", + "sit!.console.connected": "Connecté au serveur Sit! : %s", + "sit!.console.player_settings": "Reçu les paramètres de séance personnalisés de %s!", + "modmenu.descriptionTranslation.sit-oth3r": "- Ajoute la possibilité de s'asseoir dans Minecraft! Personnalisation infinie des restrictions de main et des blocs assis. \n- Les joueurs peuvent avoir leurs propres paramètres d'assise en utilisant le client Sit! sur le serveur!" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/ga_IE.json b/src/main/resources/assets/sit-oth3r/lang/ga_IE.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ga_IE.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/he_IL.json b/src/main/resources/assets/sit-oth3r/lang/he_IL.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/he_IL.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/hu_HU.json b/src/main/resources/assets/sit-oth3r/lang/hu_HU.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/hu_HU.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/it_it.json b/src/main/resources/assets/sit-oth3r/lang/it_IT.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/it_it.json rename to src/main/resources/assets/sit-oth3r/lang/it_IT.json index 06837ff..68ef576 100644 --- a/src/main/resources/assets/sit-oth3r/lang/it_it.json +++ b/src/main/resources/assets/sit-oth3r/lang/it_IT.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "Metti un `!` davanti a un campo per escluderlo!", "config.entry.example": "Esempio campo: %s", "config.server": "Configura Server", diff --git a/src/main/resources/assets/sit-oth3r/lang/ja_JP.json b/src/main/resources/assets/sit-oth3r/lang/ja_JP.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ja_JP.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/ko_KR.json b/src/main/resources/assets/sit-oth3r/lang/ko_KR.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ko_KR.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/nl_NL.json b/src/main/resources/assets/sit-oth3r/lang/nl_NL.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/nl_NL.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/pl_PL.json b/src/main/resources/assets/sit-oth3r/lang/pl_PL.json new file mode 100644 index 0000000..4319acb --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/pl_PL.json @@ -0,0 +1,57 @@ +{ + "config.entry.exclusion": "Umieść `!` przed wpisem, aby go wykluczyć!", + "config.entry.example": "%s", + "config.server": "Konfiguracja Serwera", + "config.server.lang": "Język", + "config.server.lang.description": "Język używany w modzie Sit!", + "config.server.preset-blocks.stairs": "Schody", + "config.server.preset-blocks.slabs": "Pół bloki", + "config.server.preset-blocks.carpets": "Dywany", + "config.server.preset-blocks.full-blocks": "Pełne bloki", + "config.server.custom-enabled": "Niestandardowe", + "config.server.custom-enabled.description": "Przełącza użycie niestandardowych bloków do siadania.", + "config.server.custom-blocks": "Niestandardowe Bloki", + "config.server.custom-blocks.description": "Lista niestandardowych bloków, na których można siadać.", + "config.server.custom-block.block-ids": "ID bloków", + "config.server.custom-block.block-ids.description": "ID niestandardowych bloków do siadania.", + "config.server.custom-block.sitting-height": "Wysokość siedzenia", + "config.server.custom-block.sitting-height.description": "Wysokość siedzenia gracza na niestandardowym bloku.", + "config.server.blacklisted-blocks": "Bloki na czarnej liście", + "config.server.blacklisted-blocks.description": "Lista bloków, na których nie można siadać", + "config.sitting.description": "Konfiguruje możliwość siadania. Na serwerze, każdy gracz może używać swoich ustawień moda.", + "config.sitting.enabled": "Włączono", + "config.sitting.enabled.description": "Przełącza możliwość siadania.", + "config.sitting.hand-sitting.description": "Przełącza możliwość siadania, używając ręki.", + "config.sitting.hand.main": "Główna ręka", + "config.sitting.hand.main.description": "główna ręka", + "config.sitting.hand.off": "Pomocnicza ręka", + "config.sitting.hand.off.description": "pomocnicza ręka", + "config.sitting.hand.filter": "Filtr", + "config.sitting.hand.filter.description": "Lista przedmiotów do filtra", + "config.sitting.hand.filter.block": "Bloki", + "config.sitting.hand.filter.block.description": "Domyślny filtr bloków.", + "config.sitting.hand.filter.food": "Jedzenie", + "config.sitting.hand.filter.food.description": "Domyślny filtr żywności.", + "config.sitting.hand.filter.usable": "Narzędzia", + "config.sitting.hand.filter.usable.description": "Domyślny filtr przedmiotów, które mogą być używane. (Trójzęby, Tarcze, Łuki)", + "config.sitting.hand.filter.custom-items": "Niestandardowe przedmioty", + "config.sitting.hand.filter.custom-items.description": "Lista niestandardowych przedmiotów dodanych do filtra.", + "sit!.chat.toggle_sit.on": "Włączone", + "sit!.chat.toggle_sit.off": "Wyłączone", + "sit!.chat.unsupported": "Sit! nie jest zainstalowane na tym serwerze.", + "sit!.chat.reloaded": "Przeładowano ustawienia!", + "sit!.chat.purged.total": "(Usunięto %s)", + "key.sit!.toggle": "Przełącz możliwość siadania", + "key.sit!.config": "Otwórz ustawienia", + "sit!.screen.config": "Konfiguracja Sit!", + "sit!.gui.button.file": "Otwórz plik", + "sit!.gui.button.folder": "Otwórz folder", + "sit!.gui.button.reset": "Reset", + "sit!.gui.button.donate": "Wesprzyj", + "sit!.gui.button.revert": "Cofnij zmiany", + "sit!.gui.button.save": "Zapisz i zamknij", + "sit!.gui.button.website": "Strona", + "sit!.console.connected": "Połączono z serwerem wspierającym Sit!: %s", + "sit!.console.player_settings": "Otrzymano niestandardowe ustawienia z: %s!", + "modmenu.descriptionTranslation.sit-oth3r": "Dodaje siadanie na bloki do Minecraft! Nieskończona możliwość konfiguracji. Gracze sami mogą wybrać swoje preferencje, gdy używają Sit! na swoim kliencie!" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/pt_br.json b/src/main/resources/assets/sit-oth3r/lang/pt_BR.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/pt_br.json rename to src/main/resources/assets/sit-oth3r/lang/pt_BR.json index 6cf4080..986ada9 100644 --- a/src/main/resources/assets/sit-oth3r/lang/pt_br.json +++ b/src/main/resources/assets/sit-oth3r/lang/pt_BR.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "Coloque um `!` antes de uma entrada para excluí-la!", "config.entry.example": "Exemplo de entrada: %s", "config.server": "Configuração do Servidor", diff --git a/src/main/resources/assets/sit-oth3r/lang/pt_PT.json b/src/main/resources/assets/sit-oth3r/lang/pt_PT.json new file mode 100644 index 0000000..2dac62c --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/pt_PT.json @@ -0,0 +1,82 @@ +{ + "config.entry.exclusion": "Pôr um '!' à frente de uma entrada para a excluir!", + "config.entry.example": "Exemplo de uma entrada: %s", + "config.server": "Configuração do Servidor", + "config.server.description": "Configura as definições no lado do servidor.", + "config.server.lang": "Idioma", + "config.server.lang.description": "O idioma utilizado para o mod Sit!.", + "config.server.keep-active": "Manter ativo", + "config.server.keep-active.description": "Alterna se a entidade Sit! deve permanecer, mesmo se o jogador/servidor estiver offline.\nQuando falso, o jogador não estará sentado ao entrar novamente.", + "config.server.sit-while-seated": "Sentar enquanto está sentado", + "config.server.sit-while-seated.description": "Alterna a habilidade de sentar noutro bloco Sit! enquanto está sentado.", + "config.server.preset-blocks": "Blocos predefinidos", + "config.server.preset-blocks.description": "Alterna para os blocos Sit! padrão.", + "config.server.preset-blocks.stairs": "Escadas", + "config.server.preset-blocks.slabs": "Degraus", + "config.server.preset-blocks.carpets": "Tapetes", + "config.server.preset-blocks.full-blocks": "Blocos inteiros", + "config.server.custom-enabled": "Personalizado", + "config.server.custom-enabled.description": "Alterna o uso de blocos personalizados para sentar.", + "config.server.custom-blocks": "Blocos personalizados", + "config.server.custom-blocks.description": "A lista de blocos personalizados para sentar.", + "config.server.custom-block.block-ids": "IDs dos blocos", + "config.server.custom-block.block-ids.description": "Os IDs dos blocos para o bloco personalizado para sentar.", + "config.server.custom-block.block-tags": "Etiquetas de blocos", + "config.server.custom-block.block-tags.description": "A(s) etiqueta(s) de blocos para o bloco personalizado para sentar.", + "config.server.custom-block.blockstates": "Blockstates", + "config.server.custom-block.blockstates.description": "Os blockstates indicam que o bloco deve ser um bloco personalizado para sentar.", + "config.server.custom-block.sitting-height": "Altura para sentar", + "config.server.custom-block.sitting-height.description": "A altura a que o jogador se senta no bloco personalizado.", + "config.server.blacklisted-blocks": "Blocos na lista negra", + "config.server.blacklisted-blocks.description": "A lista de blocos em que não é permitido sentar.", + "config.sitting": "Definições de sentar", + "config.sitting.description": "Define a habilidade de sentar. No servidor, cada jogador pode ter a sua própria configuração de sentar quando usam o mod.", + "config.sitting.enabled": "Ativado", + "config.sitting.enabled.description": "Alterna a habilidade de sentar.", + "config.sitting.hand-sitting": "Sentar com a mão", + "config.sitting.hand-sitting.description": "Alterna a habilidade de sentar ao utilizar interações da mão.", + "config.sitting.hand.main": "Mão principal", + "config.sitting.hand.main.description": "mão principal", + "config.sitting.hand.off": "Outra Mão", + "config.sitting.hand.off.description": "outra mão", + "config.sitting.hand.description": "Configura as definições de sentar %s .", + "config.sitting.hand.requirement": "Requisitos para sentar", + "config.sitting.hand.requirement.description": "O requisito da mão para sentar. Ex.: Se \"EMPTY\", a mão tem de estar vazia", + "config.sitting.hand.requirement.description.none": "Sem requisitos para sentar.", + "config.sitting.hand.requirement.description.empty": "A mão tem de estar vazia para sentar.", + "config.sitting.hand.requirement.description.filter": "A mão pode apenas sentar se o item na mão corresponde a um dos filtros.", + "config.sitting.hand.filter": "Filtro", + "config.sitting.hand.filter.description": "A lista de itens para o filtro de requisitos para a mão.", + "config.sitting.hand.filter.block": "Blocos", + "config.sitting.hand.filter.block.description": "O filtro padrão para blocos.", + "config.sitting.hand.filter.food": "Alimentos", + "config.sitting.hand.filter.food.description": "O filtro padrão para alimentos.", + "config.sitting.hand.filter.usable": "Utilidades", + "config.sitting.hand.filter.usable.description": "O filtro padrão de utilidades. (Tridentes, Escudos, Setas)", + "config.sitting.hand.filter.custom-items": "Itens personalizados", + "config.sitting.hand.filter.custom-items.description": "A lista de itens personalizados a adicionar ao filtro.", + "config.sitting.hand.filter.custom-tags": "Etiquetas personalizadas", + "config.sitting.hand.filter.custom-tags.description": "A lista de etiquetas de itens personalizadas a adicionar ao filtro.", + "sit!.chat.toggle_sit": "%s está sentado!", + "sit!.chat.toggle_sit.on": "Ativado", + "sit!.chat.toggle_sit.off": "Desativado", + "sit!.chat.unsupported": "Sit! não está disponível neste servidor.", + "sit!.chat.reloaded": "Definições recarregadas!", + "sit!.chat.purged": "Foram eliminadas todas as entidades Sit! carregadas! %s", + "sit!.chat.purged.total": "(%s removido)", + "key.sit!.toggle": "Alternar sentar", + "key.sit!.sit": "Sentar", + "key.sit!.config": "Abrir definições", + "sit!.screen.config": "Definições do Sit!", + "sit!.gui.button.file": "Abrir ficheiro", + "sit!.gui.button.folder": "Abrir pasta", + "sit!.gui.button.reset": "Repor", + "sit!.gui.button.issues": "Problemas", + "sit!.gui.button.donate": "Doar", + "sit!.gui.button.revert": "Reverter alterações", + "sit!.gui.button.save": "Guardar e fechar", + "sit!.gui.button.website": "Website", + "sit!.console.connected": "Conectado ao servidor Sit!: %s", + "sit!.console.player_settings": "Recebidas definições de sentar personalizadas de %s!", + "modmenu.descriptionTranslation.sit-oth3r": "Adiciona a função de sentar ao Minecraft! Personalização ilimitada para restrições de mão e blocos possíveis de sentar.\nOs jogadores podem ter as suas próprias definições ao usar o cliente Sit! no servidor!" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/ro_RO.json b/src/main/resources/assets/sit-oth3r/lang/ro_RO.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ro_RO.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/ru_RU.json b/src/main/resources/assets/sit-oth3r/lang/ru_RU.json new file mode 100644 index 0000000..9179bbe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/ru_RU.json @@ -0,0 +1,82 @@ +{ + "config.entry.exclusion": "Поместите `!` перед записью, чтобы исключить её!", + "config.entry.example": "Пример ввода: %s", + "config.server": "Конфигурация сервера", + "config.server.description": "Настраивает параметры сервера.", + "config.server.lang": "Язык", + "config.server.lang.description": "Язык, используемый модом Sit!", + "config.server.keep-active": "Оставить активным", + "config.server.keep-active.description": "Переключает, должна ли сущность Sit! оставаться, даже если игрок / сервер не находится в сети. \nЕсли значение false, игрок не будет сидеть при повторном входе в систему.", + "config.server.sit-while-seated": "Пересаживание на другой блок", + "config.server.sit-while-seated.description": "Переключает возможность сесть на другой блок Sit!, когда вы уже сидите.", + "config.server.preset-blocks": "Предустановленные блоки", + "config.server.preset-blocks.description": "Переключатели для стандартных блоков Sit!", + "config.server.preset-blocks.stairs": "Ступеньки", + "config.server.preset-blocks.slabs": "Полублоки", + "config.server.preset-blocks.carpets": "Ковры", + "config.server.preset-blocks.full-blocks": "Полные блоки", + "config.server.custom-enabled": "Пользовательский", + "config.server.custom-enabled.description": "Переключает использование пользовательских блоков для сидения.", + "config.server.custom-blocks": "Пользовательские блоки", + "config.server.custom-blocks.description": "Список пользовательских блоков для сидения.", + "config.server.custom-block.block-ids": "ID блоков", + "config.server.custom-block.block-ids.description": "ID блоков для пользовательского блока для сидения.", + "config.server.custom-block.block-tags": "Теги блока", + "config.server.custom-block.block-tags.description": "Тег(и) блоков для пользовательского блока для сидения.", + "config.server.custom-block.blockstates": "Блокстатусы", + "config.server.custom-block.blockstates.description": "Блокстатусы которые должны быть у блока, чтобы быть пользовательским блоком для сидения.", + "config.server.custom-block.sitting-height": "Высота сидения", + "config.server.custom-block.sitting-height.description": "Высота сидящего игрока на пользовательском блоке.", + "config.server.blacklisted-blocks": "Черный список блоков", + "config.server.blacklisted-blocks.description": "Список блоков, на которых запрещено сидеть.", + "config.sitting": "Конфигурация сидения", + "config.sitting.description": "Настраивает способность сидеть, на сервере каждый игрок может иметь свою собственную конфигурацию при использовании мода.", + "config.sitting.enabled": "Включено", + "config.sitting.enabled.description": "Переключает возможность сидеть.", + "config.sitting.hand-sitting": "Сидение рукой", + "config.sitting.hand-sitting.description": "Переключает возможность сидеть используя взаимодействия рукой.", + "config.sitting.hand.main": "Главная рука", + "config.sitting.hand.main.description": "главная рука", + "config.sitting.hand.off": "Левая рука", + "config.sitting.hand.off.description": "левая рука", + "config.sitting.hand.description": "Настраивает параметры сидения %s.", + "config.sitting.hand.requirement": "Требование к сидению", + "config.sitting.hand.requirement.description": "Требование к руке для посадки. Те, если EMPTY, рука должна быть пустой", + "config.sitting.hand.requirement.description.none": "Нет требований для сидения.", + "config.sitting.hand.requirement.description.empty": "Чтобы сидеть, рука должна быть пустой.", + "config.sitting.hand.requirement.description.filter": "Чтобы сидеть, предмет в руке должен соответствовать одному из фильтров.", + "config.sitting.hand.filter": "Фильтр", + "config.sitting.hand.filter.description": "Список предметов для фильтра требований руки.", + "config.sitting.hand.filter.block": "Блоки", + "config.sitting.hand.filter.block.description": "Фильтр блоков по умолчанию.", + "config.sitting.hand.filter.food": "Еда", + "config.sitting.hand.filter.food.description": "Фильтр еды по умолчанию.", + "config.sitting.hand.filter.usable": "Используемые", + "config.sitting.hand.filter.usable.description": "Стандартный фильтр используемых. (Трезубцы, Щиты, Луки)", + "config.sitting.hand.filter.custom-items": "Пользовательские предметы", + "config.sitting.hand.filter.custom-items.description": "Список пользовательских предметов для добавления в фильтр.", + "config.sitting.hand.filter.custom-tags": "Пользовательские теги", + "config.sitting.hand.filter.custom-tags.description": "Список пользовательских тегов предметов для добавления в фильтр.", + "sit!.chat.toggle_sit": "%s Сел!", + "sit!.chat.toggle_sit.on": "Включено", + "sit!.chat.toggle_sit.off": "Отключено", + "sit!.chat.unsupported": "Sit! не доступен на этом сервере.", + "sit!.chat.reloaded": "Конфигурация перезагружена!", + "sit!.chat.purged": "Очистил все загруженные сущности Sit! %s", + "sit!.chat.purged.total": "(%s убрано)", + "key.sit!.toggle": "Переключить возможность сидеть", + "key.sit!.sit": "Сесть", + "key.sit!.config": "Открыть Конфигурацию", + "sit!.screen.config": "Конфигурация Sit!", + "sit!.gui.button.file": "Открыть Файл", + "sit!.gui.button.folder": "Открыть Папку", + "sit!.gui.button.reset": "Сбросить", + "sit!.gui.button.issues": "Баг‑трекер", + "sit!.gui.button.donate": "Пожертвовать", + "sit!.gui.button.revert": "Отменить Изменения", + "sit!.gui.button.save": "Сохранить и Закрыть", + "sit!.gui.button.website": "Веб-сайт", + "sit!.console.connected": "Подключено к серверу Sit!: %s", + "sit!.console.player_settings": "Получены пользовательские настройки сидения от %s!", + "modmenu.descriptionTranslation.sit-oth3r": "Добавляет возможность сидеть в Minecraft! Бесконечная кастомизация ограничений для рук и блоков, на которых можно сидеть.\nИгроки могут настраивать свои параметры сидения при использовании клиента Sit! на сервере!" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/sr_SP.json b/src/main/resources/assets/sit-oth3r/lang/sr_SP.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/sr_SP.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/sv_SE.json b/src/main/resources/assets/sit-oth3r/lang/sv_SE.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/sv_SE.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/tr_tr.json b/src/main/resources/assets/sit-oth3r/lang/tr_TR.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/tr_tr.json rename to src/main/resources/assets/sit-oth3r/lang/tr_TR.json index c1d5bd7..cd040d7 100644 --- a/src/main/resources/assets/sit-oth3r/lang/tr_tr.json +++ b/src/main/resources/assets/sit-oth3r/lang/tr_TR.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "Bir girdiyi hariç tutmak için önüne '!' koyun!", "config.entry.example": "Girdi örneği: %s", "config.server": "Sunucu Ayarları", diff --git a/src/main/resources/assets/sit-oth3r/lang/uk_UA.json b/src/main/resources/assets/sit-oth3r/lang/uk_UA.json new file mode 100644 index 0000000..0d2469e --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/uk_UA.json @@ -0,0 +1,24 @@ +{ + "config.server": "Конфігурація сервера", + "config.server.lang": "Мова", + "config.server.lang.description": "Мова, що використовується для моду Sit!.", + "config.server.preset-blocks.stairs": "Сходи", + "config.server.preset-blocks.carpets": "Килими", + "config.server.preset-blocks.full-blocks": "Повні блоки", + "config.server.custom-enabled": "Користувацький", + "config.server.custom-blocks": "Користувацькі блоки", + "config.server.custom-block.block-ids": "ID блоків", + "config.sitting": "Sit! Конфігурація", + "config.sitting.enabled": "Ввімкнено", + "config.sitting.enabled.description": "Вмикає/Вимикає можливість сидіти.", + "config.sitting.hand.main": "Основна рука", + "config.sitting.hand.main.description": "основна рука", + "config.sitting.hand.off": "Ліва Рука", + "config.sitting.hand.off.description": "ліва рука", + "config.sitting.hand.description": "Налаштовує %s налаштування сидіння.", + "config.sitting.hand.filter": "Фільтр", + "config.sitting.hand.filter.block": "Блоки", + "config.sitting.hand.filter.food": "Їжа", + "config.sitting.hand.filter.custom-items": "Користувацькі предмети", + "config.sitting.hand.filter.custom-tags": "Користувацькі теги" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/vi_VN.json b/src/main/resources/assets/sit-oth3r/lang/vi_VN.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/vi_VN.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/src/main/resources/assets/sit-oth3r/lang/zh_cn.json b/src/main/resources/assets/sit-oth3r/lang/zh_CN.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/zh_cn.json rename to src/main/resources/assets/sit-oth3r/lang/zh_CN.json index d75c032..195ed43 100644 --- a/src/main/resources/assets/sit-oth3r/lang/zh_cn.json +++ b/src/main/resources/assets/sit-oth3r/lang/zh_CN.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "在条目前加上“!”以排除。", "config.entry.example": "条目示例:%s", "config.server": "服务端配置", diff --git a/src/main/resources/assets/sit-oth3r/lang/zh_tw.json b/src/main/resources/assets/sit-oth3r/lang/zh_TW.json similarity index 99% rename from src/main/resources/assets/sit-oth3r/lang/zh_tw.json rename to src/main/resources/assets/sit-oth3r/lang/zh_TW.json index 148a76f..d114075 100644 --- a/src/main/resources/assets/sit-oth3r/lang/zh_tw.json +++ b/src/main/resources/assets/sit-oth3r/lang/zh_TW.json @@ -1,5 +1,4 @@ { - "category.sit!": "Sit!", "config.entry.exclusion": "在條目前方加上 `!` 以排除它!", "config.entry.example": "條目範例: %s", "config.server": "伺服器設定", diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/fox.png b/src/main/resources/assets/sit-oth3r/textures/gui/fox.png deleted file mode 100644 index 3d62c80..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/fox.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/donate.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/donate.png deleted file mode 100644 index 4a0892c..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/donate.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/file.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/file.png deleted file mode 100644 index ba61436..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/file.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/folder.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/folder.png deleted file mode 100644 index 98df93f..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/folder.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/issues.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/issues.png deleted file mode 100644 index 59626c2..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/issues.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/reset_file.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/reset_file.png deleted file mode 100644 index 82d9f17..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/reset_file.png and /dev/null differ diff --git a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/server.png b/src/main/resources/assets/sit-oth3r/textures/gui/sprites/server.png deleted file mode 100644 index dc6fb9e..0000000 Binary files a/src/main/resources/assets/sit-oth3r/textures/gui/sprites/server.png and /dev/null differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 46715b8..2359a00 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,7 +28,8 @@ "depends": { "fabricloader": ">=0.14.21", "minecraft": ">=${min_minecraft_version} <=${max_minecraft_version}", - "fabric": "*" + "fabric": "*", + "otterlib": ">=${otterlib_version}" }, "suggests": { "modmenu": "*"