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 c23d6f0..7a6061b 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,7 @@ processResources { 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..582fde0 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 (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 diff --git a/gradle.properties b/gradle.properties index 3f5306a..523a055 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,12 +5,15 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop min_minecraft_version=1.20.6 +max_minecraft_version=1.20.6 +minecraft_versions=1.20.6 + minecraft_version=1.20.6 yarn_mappings=1.20.6+build.3 -loader_version=0.15.11 +loader_version=0.16.13 # Mod Properties -mod_version=1.2.3+1.20.6 +mod_version=1.2.3.2+1.20.6 maven_group=one.oth3r file_name=sit! diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 2708393..874dc38 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -155,7 +155,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); } diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index e15b210..b4730b3 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -207,7 +207,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 @@ -226,9 +226,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); @@ -368,7 +368,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/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": {