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..a2bf048 --- /dev/null +++ b/.github/workflows/crowdin-upload-workflow.yml @@ -0,0 +1,24 @@ +name: Crowdin Upload Action + +on: + push: + paths: [ 'common/src/main/resources/assets/directionhud/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/README.md b/README.md index 4f01e02..b851d3a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Sit! -[![github](https://img.shields.io/github/issues/oth3r/Sit?logo=github?label=Issues)](https://github.com/Oth3r/Sit/releases) [![Crowdin](https://badges.crowdin.net/oth3r-sit/localized.svg)](https://crowdin.com/project/oth3r-sit) [![discord](https://dcbadge.vercel.app/api/server/Mec6yNQ9B7?style=flat)](https://discord.gg/Mec6yNQ9B7) +[![github](https://img.shields.io/github/issues/oth3r/Sit?logo=github?label=Issues)](https://github.com/Oth3r/Sit/releases) [![Crowdin](https://badges.crowdin.net/oth3r-sit/localized.svg)](https://crowdin.com/project/oth3r-sit) [![discord](https://dcbadge.vercel.app/api/server/https://discord.gg/AVSTHCAUvn?style=flat)](https://www.oth3r.one/discord) [![modrinth](https://img.shields.io/modrinth/dt/sit!?label=Modrinth&logo=modrinth)](https://modrinth.com/mod/sit!) [![curseforge](https://cf.way2muchnoise.eu/892424.svg)](https://www.curseforge.com/minecraft/mc-mods/Sit1) diff --git a/build.gradle b/build.gradle index 44ebae0..7a6061b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.8-SNAPSHOT' + id 'fabric-loom' version '1.10-SNAPSHOT' id 'maven-publish' id 'com.modrinth.minotaur' version '2.+' id 'net.darkhax.curseforgegradle' version '1.1.+' @@ -14,8 +14,8 @@ base { } repositories { - maven { url "https://maven.terraformersmc.com/releases/" } - maven { url "https://maven.isxander.dev/releases" } + maven { url = "https://maven.terraformersmc.com/releases/" } + maven { url = "https://maven.isxander.dev/releases" } } loom { @@ -33,12 +33,13 @@ dependencies { } processResources { - filteringCharset "UTF-8" + filteringCharset = "UTF-8" var replaceProperties = [ version : project.version, minecraft_version : minecraft_version, min_minecraft_version : min_minecraft_version, + max_minecraft_version : max_minecraft_version, loader_version : loader_version ] @@ -94,7 +95,7 @@ modrinth { versionName = "v${project.mod_version} [Fabric]" versionType = "release" uploadFile = remapJar - gameVersions = [project.minecraft_version] + gameVersions = project.minecraft_versions.split(",").toList() loaders = ['fabric', 'quilt'] dependencies = [ new ModDependency('P7dR8mSH', 'required'), diff --git a/changelog.md b/changelog.md index 05b85df..d33a263 100644 --- a/changelog.md +++ b/changelog.md @@ -1,2 +1,7 @@ +# 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 # v1.2.3 * fixed not being able to sit when the Y level was below 0 \ 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 ccbdc14..516481d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,16 +4,19 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -min_minecraft_version=1.21.4 -minecraft_version=1.21.4 -yarn_mappings=1.21.4+build.8 +min_minecraft_version=1.21.5 +max_minecraft_version=1.21.5 +minecraft_versions=1.21.5 + +minecraft_version=1.21.5 +yarn_mappings=1.21.5+build.1 loader_version=0.16.10 # Mod Properties -mod_version=1.2.3+1.21.4 +mod_version=1.2.3.2+1.21.5 maven_group=one.oth3r file_name=sit! # Dependencies -fabric_version=0.116.1+1.21.4 -modmenu_version=13.0.0-beta.1 +fabric_version=0.119.5+1.21.5 +modmenu_version=14.0.0-rc.2 diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index dd183c5..ed337fc 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -24,9 +24,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; diff --git a/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java b/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java index aefbbe3..bcf1f6f 100644 --- a/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java +++ b/src/main/java/one/oth3r/sit/mixin/ReloadCommandMixin.java @@ -6,8 +6,8 @@ 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; @@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 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(); diff --git a/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java b/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java index fb14e4f..c663036 100644 --- a/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java +++ b/src/main/java/one/oth3r/sit/screen/ClickableImageWidget.java @@ -1,6 +1,5 @@ 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; @@ -21,8 +20,6 @@ public class ClickableImageWidget extends ButtonWidget { @Override protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { - RenderSystem.enableBlend(); - RenderSystem.enableDepthTest(); context.drawTexture(RenderLayer::getGuiTextured, image, this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight()); } diff --git a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java b/src/main/java/one/oth3r/sit/screen/ConfigScreen.java index b64eb60..c95b492 100644 --- a/src/main/java/one/oth3r/sit/screen/ConfigScreen.java +++ b/src/main/java/one/oth3r/sit/screen/ConfigScreen.java @@ -71,11 +71,7 @@ public class ConfigScreen extends Screen { } private void renderBanner(DrawContext context, int x, int y, float alpha) { - RenderSystem.enableBlend(); - context.drawTexture(RenderLayer::getGuiTextured,Identifier.of(Data.MOD_ID, "textures/gui/banner.png"), x, y, 0.0f, 0.0f, 128, 72, 128, 72, ColorHelper.getWhite(alpha)); - - RenderSystem.disableBlend(); } } diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 323cc96..f8626db 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -8,10 +8,7 @@ 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; public class Logic { @@ -184,7 +181,7 @@ public class Logic { // get the poses to check above the block BlockPos pos1 = new BlockPos(pos).add(0,1,0), pos2 = new BlockPos(pos).add(0,2,0), posBelow = new BlockPos(pos); // doesn't check 2 blocks above if not sitting above .80 of the block - if (pos.getY() > entity.getY() - .80) { + if (pos.getY() > (entity.getY()-Utl.Entity.Y_ADJUSTMENT) - .80) { pos2 = pos2.add(0,-1,0); posBelow = posBelow.add(0,-1,0); } @@ -201,6 +198,7 @@ public class Logic { public static void reload() { FileData.loadFiles(); FileData.saveFiles(); + LangReader.loadLanguageFile(); } /** diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index eff47da..92463b0 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -209,7 +209,7 @@ public class Utl { /** * the customizable y height of the entity, as some versions have different sitting heights on the entity */ - private static final double Y_ADJUSTMENT = 0; + public static final double Y_ADJUSTMENT = 0; /** * checks if the entity's block is still there, & is valid @@ -228,9 +228,9 @@ public class Utl { public static BlockPos getBlockPos(DisplayEntity.TextDisplayEntity entity) { // the entity Y level, adjusted // the adjustment - is the opposite of the offset applied in Entity.create() - double entityY = entity.getBlockY() + (Y_ADJUSTMENT*-1); + int entityBlockY = (int) (Math.floor(entity.getY() + (Y_ADJUSTMENT*-1))); // get the block pos - BlockPos pos = new BlockPos(entity.getBlockX(),(int)entityY,entity.getBlockZ()); + BlockPos pos = new BlockPos(entity.getBlockX(),entityBlockY,entity.getBlockZ()); // if above the block, subtract 1 if (isAboveBlockHeight(entity)) { pos = pos.add(0,-1,0); @@ -370,7 +370,8 @@ public class Utl { * sends the settings packets to the server, if client & in game */ public static void sendSettingsPackets() { - if (Data.isClient() && Data.isInGame()) { + if (Data.isClient() && Data.isInGame() && + ClientPlayNetworking.canSend(SitPayloads.SettingsPayload.ID)) { ClientPlayNetworking.send(new SitPayloads.SettingsPayload(Utl.getGson().toJson(FileData.getSittingConfig()))); } } 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 100% rename from src/main/resources/assets/sit-oth3r/lang/de_de.json rename to src/main/resources/assets/sit-oth3r/lang/de_DE.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/en_us.json rename to src/main/resources/assets/sit-oth3r/lang/en_US.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/it_it.json rename to src/main/resources/assets/sit-oth3r/lang/it_IT.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/pt_br.json rename to src/main/resources/assets/sit-oth3r/lang/pt_BR.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/tr_tr.json rename to src/main/resources/assets/sit-oth3r/lang/tr_TR.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/zh_cn.json rename to src/main/resources/assets/sit-oth3r/lang/zh_CN.json 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 100% rename from src/main/resources/assets/sit-oth3r/lang/zh_tw.json rename to src/main/resources/assets/sit-oth3r/lang/zh_TW.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index dd81d2b..46715b8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ }, "depends": { "fabricloader": ">=0.14.21", - "minecraft": ">=${min_minecraft_version} <=${minecraft_version}", + "minecraft": ">=${min_minecraft_version} <=${max_minecraft_version}", "fabric": "*" }, "suggests": {