forked from virt-mirrors/Sit
Merge branch 'master' into dev
This commit is contained in:
commit
07b3077438
23 changed files with 130 additions and 34 deletions
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
@ -5,7 +5,7 @@ body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
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
|
- type: textarea
|
||||||
id: description
|
id: description
|
||||||
attributes:
|
attributes:
|
||||||
|
|
26
.github/ISSUE_TEMPLATE/feature_request_template.yml
vendored
Normal file
26
.github/ISSUE_TEMPLATE/feature_request_template.yml
vendored
Normal file
|
@ -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)
|
33
.github/workflows/crowdin-download-workflow.yml
vendored
Normal file
33
.github/workflows/crowdin-download-workflow.yml
vendored
Normal file
|
@ -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 }}
|
24
.github/workflows/crowdin-upload-workflow.yml
vendored
Normal file
24
.github/workflows/crowdin-upload-workflow.yml
vendored
Normal file
|
@ -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 }}
|
|
@ -1,5 +1,5 @@
|
||||||
# Sit!
|
# Sit!
|
||||||
[](https://github.com/Oth3r/Sit/releases) [](https://crowdin.com/project/oth3r-sit) [](https://discord.gg/Mec6yNQ9B7)
|
[](https://github.com/Oth3r/Sit/releases) [](https://crowdin.com/project/oth3r-sit) [](https://www.oth3r.one/discord)
|
||||||
|
|
||||||
[](https://modrinth.com/mod/sit!) [](https://www.curseforge.com/minecraft/mc-mods/Sit1)
|
[](https://modrinth.com/mod/sit!) [](https://www.curseforge.com/minecraft/mc-mods/Sit1)
|
||||||
|
|
||||||
|
|
11
build.gradle
11
build.gradle
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.8-SNAPSHOT'
|
id 'fabric-loom' version '1.10-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'com.modrinth.minotaur' version '2.+'
|
id 'com.modrinth.minotaur' version '2.+'
|
||||||
id 'net.darkhax.curseforgegradle' version '1.1.+'
|
id 'net.darkhax.curseforgegradle' version '1.1.+'
|
||||||
|
@ -14,8 +14,8 @@ base {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.terraformersmc.com/releases/" }
|
maven { url = "https://maven.terraformersmc.com/releases/" }
|
||||||
maven { url "https://maven.isxander.dev/releases" }
|
maven { url = "https://maven.isxander.dev/releases" }
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
|
@ -33,12 +33,13 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
filteringCharset "UTF-8"
|
filteringCharset = "UTF-8"
|
||||||
|
|
||||||
var replaceProperties = [
|
var replaceProperties = [
|
||||||
version : project.version,
|
version : project.version,
|
||||||
minecraft_version : minecraft_version,
|
minecraft_version : minecraft_version,
|
||||||
min_minecraft_version : min_minecraft_version,
|
min_minecraft_version : min_minecraft_version,
|
||||||
|
max_minecraft_version : max_minecraft_version,
|
||||||
loader_version : loader_version
|
loader_version : loader_version
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ modrinth {
|
||||||
versionName = "v${project.mod_version} [Fabric]"
|
versionName = "v${project.mod_version} [Fabric]"
|
||||||
versionType = "release"
|
versionType = "release"
|
||||||
uploadFile = remapJar
|
uploadFile = remapJar
|
||||||
gameVersions = [project.minecraft_version]
|
gameVersions = project.minecraft_versions.split(",").toList()
|
||||||
loaders = ['fabric', 'quilt']
|
loaders = ['fabric', 'quilt']
|
||||||
dependencies = [
|
dependencies = [
|
||||||
new ModDependency('P7dR8mSH', 'required'),
|
new ModDependency('P7dR8mSH', 'required'),
|
||||||
|
|
|
@ -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
|
# v1.2.3
|
||||||
* fixed not being able to sit when the Y level was below 0
|
* fixed not being able to sit when the Y level was below 0
|
12
crowdin.yml
Normal file
12
crowdin.yml
Normal file
|
@ -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",
|
||||||
|
}
|
||||||
|
]
|
|
@ -4,16 +4,19 @@ org.gradle.parallel=true
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/develop
|
# check these on https://fabricmc.net/develop
|
||||||
min_minecraft_version=1.21.4
|
min_minecraft_version=1.21.5
|
||||||
minecraft_version=1.21.4
|
max_minecraft_version=1.21.5
|
||||||
yarn_mappings=1.21.4+build.8
|
minecraft_versions=1.21.5
|
||||||
|
|
||||||
|
minecraft_version=1.21.5
|
||||||
|
yarn_mappings=1.21.5+build.1
|
||||||
loader_version=0.16.10
|
loader_version=0.16.10
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.2.3+1.21.4
|
mod_version=1.2.3.2+1.21.5
|
||||||
maven_group=one.oth3r
|
maven_group=one.oth3r
|
||||||
file_name=sit!
|
file_name=sit!
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.116.1+1.21.4
|
fabric_version=0.119.5+1.21.5
|
||||||
modmenu_version=13.0.0-beta.1
|
modmenu_version=14.0.0-rc.2
|
||||||
|
|
|
@ -24,9 +24,9 @@ public class ServerConfig implements CustomFile<ServerConfig> {
|
||||||
private Double version = 2.2;
|
private Double version = 2.2;
|
||||||
|
|
||||||
@SerializedName("lang")
|
@SerializedName("lang")
|
||||||
private String lang = "en_us";
|
private String lang = "en_US";
|
||||||
@SerializedName("lang-options")
|
@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")
|
@SerializedName("keep-active")
|
||||||
private Boolean keepActive = true;
|
private Boolean keepActive = true;
|
||||||
|
|
|
@ -6,8 +6,8 @@ import net.minecraft.server.command.ReloadCommand;
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import one.oth3r.sit.file.FileData;
|
|
||||||
import one.oth3r.sit.utl.Data;
|
import one.oth3r.sit.utl.Data;
|
||||||
|
import one.oth3r.sit.utl.Logic;
|
||||||
import one.oth3r.sit.utl.Utl;
|
import one.oth3r.sit.utl.Utl;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
@ -18,7 +18,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
public class ReloadCommandMixin {
|
public class ReloadCommandMixin {
|
||||||
@Inject(at = @At("TAIL"), method = "register")
|
@Inject(at = @At("TAIL"), method = "register")
|
||||||
private static void register(CommandDispatcher<ServerCommandSource> dispatcher, CallbackInfo ci) {
|
private static void register(CommandDispatcher<ServerCommandSource> dispatcher, CallbackInfo ci) {
|
||||||
FileData.loadFiles();
|
Logic.reload();
|
||||||
|
|
||||||
// make sure the server isn't null
|
// make sure the server isn't null
|
||||||
MinecraftServer server = Data.getServer();
|
MinecraftServer server = Data.getServer();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package one.oth3r.sit.screen;
|
package one.oth3r.sit.screen;
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.gui.tooltip.Tooltip;
|
import net.minecraft.client.gui.tooltip.Tooltip;
|
||||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||||
|
@ -21,8 +20,6 @@ public class ClickableImageWidget extends ButtonWidget {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
protected void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||||
RenderSystem.enableBlend();
|
|
||||||
RenderSystem.enableDepthTest();
|
|
||||||
context.drawTexture(RenderLayer::getGuiTextured, image,
|
context.drawTexture(RenderLayer::getGuiTextured, image,
|
||||||
this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight());
|
this.getX(), this.getY(), 0.0f, 0.0f, this.getWidth(), this.getHeight(), this.getWidth(), this.getHeight());
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,11 +71,7 @@ public class ConfigScreen extends Screen {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderBanner(DrawContext context, int x, int y, float alpha) {
|
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"),
|
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));
|
x, y, 0.0f, 0.0f, 128, 72, 128, 72, ColorHelper.getWhite(alpha));
|
||||||
|
|
||||||
RenderSystem.disableBlend();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,7 @@ import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.BlockHitResult;
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import one.oth3r.sit.file.FileData;
|
import one.oth3r.sit.file.*;
|
||||||
import one.oth3r.sit.file.ServerConfig;
|
|
||||||
import one.oth3r.sit.file.SittingConfig;
|
|
||||||
import one.oth3r.sit.file.HandSetting;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
public class Logic {
|
public class Logic {
|
||||||
|
@ -184,7 +181,7 @@ public class Logic {
|
||||||
// get the poses to check above the block
|
// 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);
|
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
|
// 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);
|
pos2 = pos2.add(0,-1,0);
|
||||||
posBelow = posBelow.add(0,-1,0);
|
posBelow = posBelow.add(0,-1,0);
|
||||||
}
|
}
|
||||||
|
@ -201,6 +198,7 @@ public class Logic {
|
||||||
public static void reload() {
|
public static void reload() {
|
||||||
FileData.loadFiles();
|
FileData.loadFiles();
|
||||||
FileData.saveFiles();
|
FileData.saveFiles();
|
||||||
|
LangReader.loadLanguageFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -209,7 +209,7 @@ public class Utl {
|
||||||
/**
|
/**
|
||||||
* the customizable y height of the entity, as some versions have different sitting heights on the entity
|
* 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
|
* 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) {
|
public static BlockPos getBlockPos(DisplayEntity.TextDisplayEntity entity) {
|
||||||
// the entity Y level, adjusted
|
// the entity Y level, adjusted
|
||||||
// the adjustment - is the opposite of the offset applied in Entity.create()
|
// 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
|
// 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 above the block, subtract 1
|
||||||
if (isAboveBlockHeight(entity)) {
|
if (isAboveBlockHeight(entity)) {
|
||||||
pos = pos.add(0,-1,0);
|
pos = pos.add(0,-1,0);
|
||||||
|
@ -370,7 +370,8 @@ public class Utl {
|
||||||
* sends the settings packets to the server, if client & in game
|
* sends the settings packets to the server, if client & in game
|
||||||
*/
|
*/
|
||||||
public static void sendSettingsPackets() {
|
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())));
|
ClientPlayNetworking.send(new SitPayloads.SettingsPayload(Utl.getGson().toJson(FileData.getSittingConfig())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
},
|
},
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14.21",
|
"fabricloader": ">=0.14.21",
|
||||||
"minecraft": ">=${min_minecraft_version} <=${minecraft_version}",
|
"minecraft": ">=${min_minecraft_version} <=${max_minecraft_version}",
|
||||||
"fabric": "*"
|
"fabric": "*"
|
||||||
},
|
},
|
||||||
"suggests": {
|
"suggests": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue