From 531f4b4a4586fcb2fe6a045ebd1417728e7528e0 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Tue, 3 Dec 2024 11:10:12 -0600 Subject: [PATCH 01/15] v1.2.1+1.21.4 --- gradle.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index e960c2d..d5e525c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,16 +4,16 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -min_minecraft_version=1.21.3 -minecraft_version=1.21.3 -yarn_mappings=1.21.3+build.2 -loader_version=0.16.7 +min_minecraft_version=1.21.4 +minecraft_version=1.21.4 +yarn_mappings=1.21.4+build.1 +loader_version=0.16.9 # Mod Properties -mod_version=1.2.1+1.21.3 +mod_version=1.2.1+1.21.4 maven_group=one.oth3r file_name=sit! # Dependencies -fabric_version=0.107.0+1.21.3 +fabric_version=0.110.5+1.21.4 modmenu_version=12.0.0-beta.1 From 15fa69baa401df212a2ad429ae5e3cacf25025bb Mon Sep 17 00:00:00 2001 From: Oth3r Date: Sun, 15 Dec 2024 12:09:01 -0600 Subject: [PATCH 02/15] add command blocks --- src/main/java/one/oth3r/sit/file/FileData.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/FileData.java b/src/main/java/one/oth3r/sit/file/FileData.java index 1e7de3d..4e95a66 100644 --- a/src/main/java/one/oth3r/sit/file/FileData.java +++ b/src/main/java/one/oth3r/sit/file/FileData.java @@ -89,9 +89,12 @@ public class FileData { )); public static final ArrayList INTERACTION_BLOCKS = new ArrayList<>(Arrays.asList( - new CustomBlock(new ArrayList<>(Arrays.asList("minecraft:crafter")),new ArrayList<>(Arrays.asList( + new CustomBlock(new ArrayList<>(Arrays.asList( + "minecraft:crafter","minecraft:repeating_command_block","minecraft:chain_command_block","minecraft:command_block")), + new ArrayList<>(Arrays.asList( "#minecraft:shulker_boxes","#c:player_workstations/furnaces","#c:player_workstations/crafting_tables", - "#c:villager_job_sites","#minecraft:trapdoors","#c:chests")),new ArrayList<>()) + "#c:villager_job_sites","#minecraft:trapdoors","#c:chests")), + new ArrayList<>()) )); public static final HandSetting MAIN_HAND = new HandSetting(HandSetting.SittingRequirement.EMPTY, new HandSetting.Filter( From abecde44c8b20ded84da63a1fc99942b0723c869 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Sun, 22 Dec 2024 18:12:15 -0600 Subject: [PATCH 03/15] fix entity y adjustment system --- src/main/java/one/oth3r/sit/utl/Utl.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/one/oth3r/sit/utl/Utl.java b/src/main/java/one/oth3r/sit/utl/Utl.java index 25e82de..4fd84bd 100644 --- a/src/main/java/one/oth3r/sit/utl/Utl.java +++ b/src/main/java/one/oth3r/sit/utl/Utl.java @@ -205,6 +205,10 @@ public class Utl { } public static class 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; /** * checks if the entity's block is still there, & is valid @@ -221,8 +225,12 @@ public class Utl { * gets the bound block pos of the sit entity */ 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.getY() + (Y_ADJUSTMENT*-1); + // get the block pos - BlockPos pos = new BlockPos(entity.getBlockX(),entity.getBlockY(),entity.getBlockZ()); + BlockPos pos = new BlockPos(entity.getBlockX(),(int)entityY,entity.getBlockZ()); // if above the block, subtract 1 if (isAboveBlockHeight(entity)) { pos = pos.add(0,-1,0); @@ -254,20 +262,20 @@ public class Utl { entity.setInvulnerable(true); entity.setInvisible(true); - /// make a double for adjusting the entity height if some versions change the player sit height on entities again - double adjustmentY = 0; - // get the entities y level double entityY = blockPos.getY(); - entityY += sitHeight + adjustmentY; + entityY += sitHeight; // set the entities position - entity.updatePositionAndAngles(blockPos.getX()+.5, entityY, blockPos.getZ()+.5, 0, 0); + entity.updatePosition(blockPos.getX()+.5, entityY, blockPos.getZ()+.5); // change pitch based on if player is sitting below block height or not (full block height only) if (entity.getY() == blockPos.getY() + 1) entity.setPitch(90); // below else entity.setPitch(-90); // above + // adjusting the entity height after doing the main calculations, for correct player visuals + entity.updatePosition(entity.getX(),entityY+Y_ADJUSTMENT,entity.getZ()); + return entity; } From b46e10e835fe32e8375a4ac47fd1bd03e6d0f732 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Tue, 11 Feb 2025 14:51:06 -0600 Subject: [PATCH 04/15] copy constructors --- src/main/java/one/oth3r/sit/file/CustomBlock.java | 6 ++++++ src/main/java/one/oth3r/sit/file/ServerConfig.java | 10 +--------- src/main/java/one/oth3r/sit/file/SittingBlock.java | 5 +++++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/CustomBlock.java b/src/main/java/one/oth3r/sit/file/CustomBlock.java index 6f8f0f7..e9b8769 100644 --- a/src/main/java/one/oth3r/sit/file/CustomBlock.java +++ b/src/main/java/one/oth3r/sit/file/CustomBlock.java @@ -28,6 +28,12 @@ public class CustomBlock { this.blockStates = blockStates; } + public CustomBlock(CustomBlock customBlock) { + this.blockIds = new ArrayList<>(customBlock.blockIds); + this.blockTags = new ArrayList<>(customBlock.blockTags); + this.blockStates = new ArrayList<>(customBlock.blockStates); + } + public ArrayList getBlockIds() { return blockIds; } diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index 05c604e..ed84611 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -43,15 +43,7 @@ public class ServerConfig implements CustomFile { public ServerConfig() {} public ServerConfig(ServerConfig serverConfig) { - this.version = serverConfig.version; - this.lang = serverConfig.lang; - this.keepActive = serverConfig.keepActive; - this.sitWhileSeated = serverConfig.sitWhileSeated; - this.presetBlocks = serverConfig.presetBlocks; - this.customEnabled = serverConfig.customEnabled; - this.sittingBlocks = serverConfig.sittingBlocks; - this.blacklistedBlocks = serverConfig.blacklistedBlocks; - this.interactionBlocks = serverConfig.interactionBlocks; + loadFileData(serverConfig); } public ServerConfig(Double version, String lang, boolean keepActive, boolean sitWhileSeated, diff --git a/src/main/java/one/oth3r/sit/file/SittingBlock.java b/src/main/java/one/oth3r/sit/file/SittingBlock.java index 1f2cf36..149cfc0 100644 --- a/src/main/java/one/oth3r/sit/file/SittingBlock.java +++ b/src/main/java/one/oth3r/sit/file/SittingBlock.java @@ -22,4 +22,9 @@ public class SittingBlock extends CustomBlock { super(blockIds, blockTags, blockStates); this.sittingHeight = sittingHeight; } + + public SittingBlock(SittingBlock sittingBlock) { + super(sittingBlock); + this.sittingHeight = sittingBlock.sittingHeight; + } } From 04d246a5bff03db7b9660cf8f5a0828c141ea5ac Mon Sep 17 00:00:00 2001 From: Oth3r Date: Tue, 11 Feb 2025 14:51:32 -0600 Subject: [PATCH 05/15] new y sitting limiter - #16 --- .../java/one/oth3r/sit/file/ServerConfig.java | 73 +++++++++++++++++-- src/main/java/one/oth3r/sit/utl/Logic.java | 23 ++++++ 2 files changed, 90 insertions(+), 6 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index ed84611..dad103f 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -16,25 +16,33 @@ import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.Properties; +import java.util.stream.Collectors; public class ServerConfig implements CustomFile { @SerializedName("version") - private Double version = 2.1; + private Double version = 2.2; + @SerializedName("lang") private String lang = "en_us"; @SerializedName("lang-options") private final String langOptions = "en_us, it_it, pt_br, tr_tr, zh_tw"; + @SerializedName("keep-active") private Boolean keepActive = true; @SerializedName("sit-while-seated") private Boolean sitWhileSeated = false; @SerializedName("preset-blocks") private PresetBlocks presetBlocks = new PresetBlocks(); + + @SerializedName("sitting-eye-y-bounds") + private YBounds yBounds = new YBounds(); + @SerializedName("custom-enabled") private Boolean customEnabled = false; @SerializedName("custom-blocks") private ArrayList sittingBlocks = FileData.Defaults.SITTING_BLOCKS; + @SerializedName("blacklisted-blocks") private ArrayList blacklistedBlocks = FileData.Defaults.BLACKLISTED_BLOCKS; @SerializedName("interaction-blocks") @@ -81,6 +89,10 @@ public class ServerConfig implements CustomFile { return presetBlocks; } + public YBounds getYBounds() { + return yBounds; + } + public Boolean isCustomEnabled() { return customEnabled; } @@ -117,6 +129,13 @@ public class ServerConfig implements CustomFile { this.fullBlocks = fullBlocks; } + public PresetBlocks(PresetBlocks presetBlocks) { + this.stairs = presetBlocks.stairs; + this.slabs = presetBlocks.slabs; + this.carpets = presetBlocks.carpets; + this.fullBlocks = presetBlocks.fullBlocks; + } + public boolean isStairs() { return stairs; } @@ -134,6 +153,42 @@ public class ServerConfig implements CustomFile { } } + public static class YBounds { + @SerializedName("above") + private Double above = 0.1; + @SerializedName("below") + private Double below = 3.0; + + public YBounds() { + } + + public YBounds(Double above, Double below) { + this.above = above; + this.below = below; + } + + public YBounds(YBounds yBounds) { + this.above = yBounds.above; + this.below = yBounds.below; + } + + public Double getAbove() { + return above; + } + + public void setAbove(Double above) { + this.above = above; + } + + public Double getBelow() { + return below; + } + + public void setBelow(Double below) { + this.below = below; + } + } + @Override public void reset() { loadFileData(new ServerConfig()); @@ -150,17 +205,23 @@ public class ServerConfig implements CustomFile { this.lang = newFile.lang; this.keepActive = newFile.keepActive; this.sitWhileSeated = newFile.sitWhileSeated; - this.presetBlocks = newFile.presetBlocks; + + this.presetBlocks = new PresetBlocks(newFile.presetBlocks); + + this.yBounds = new YBounds(newFile.yBounds); + this.customEnabled = newFile.customEnabled; - this.sittingBlocks = newFile.sittingBlocks; - this.blacklistedBlocks = newFile.blacklistedBlocks; + this.sittingBlocks = newFile.sittingBlocks.stream().map(SittingBlock::new).collect(Collectors.toCollection(ArrayList::new)); + this.blacklistedBlocks = newFile.blacklistedBlocks.stream().map(CustomBlock::new).collect(Collectors.toCollection(ArrayList::new)); + this.interactionBlocks = newFile.interactionBlocks.stream().map(CustomBlock::new).collect(Collectors.toCollection(ArrayList::new)); } @Override public void update() { /// update to 2.1, just a new list, nothing to change - if (version == 2.0) { - version = 2.1; + /// update to 2.2, new settings, no changes + if (version >= 2.0 && version <= 2.1) { + version = 2.2; } } diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 62556b4..a7d792e 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -10,6 +10,7 @@ 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 org.jetbrains.annotations.Nullable; @@ -27,6 +28,9 @@ public class Logic { if (!checkHands(player)) return false; } + // check if the block is in the right y level limits from the config + if (!checkYLimits(player, blockPos)) return false; + ServerWorld serverWorld = player.getServerWorld(); BlockState blockState = serverWorld.getBlockState(blockPos); @@ -74,6 +78,25 @@ public class Logic { return canSit; } + /** + * check if the Y-level of the block is within the limits of the player, bounds are set in the {@link ServerConfig} + */ + public static boolean checkYLimits(ServerPlayerEntity player, BlockPos blockPos) { + double playerEyeY = player.getEyeY(); + double blockY = blockPos.getY(); + // if the block is above the eye height + boolean isAbove = playerEyeY < blockY; + // get the height difference (positive) + double heightDifference = Math.abs(playerEyeY - blockY); + // get the config limits + ServerConfig.YBounds yBounds = FileData.getServerConfig().getYBounds(); + + // debug + Data.LOGGER.info("{} {} can sit? {}", heightDifference, isAbove ? "Above" : "Below", (isAbove? yBounds.getAbove(): yBounds.getBelow()) >= heightDifference); + + return (isAbove? yBounds.getAbove(): yBounds.getBelow()) >= heightDifference; + } + /** * removes the entity bound to the player from the game, using the player */ From e8ac5722ea710ef22420cb6d0d1c8f014a964322 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Thu, 13 Feb 2025 09:50:23 -0600 Subject: [PATCH 06/15] sitting-eye-y-bounds -> height-difference-limit --- .../java/one/oth3r/sit/file/ServerConfig.java | 22 +++++++++---------- src/main/java/one/oth3r/sit/utl/Logic.java | 6 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index dad103f..0698e67 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -35,8 +35,8 @@ public class ServerConfig implements CustomFile { @SerializedName("preset-blocks") private PresetBlocks presetBlocks = new PresetBlocks(); - @SerializedName("sitting-eye-y-bounds") - private YBounds yBounds = new YBounds(); + @SerializedName("height-difference-limit") + private YDifferenceLimit yDifferenceLimit = new YDifferenceLimit(); @SerializedName("custom-enabled") private Boolean customEnabled = false; @@ -89,8 +89,8 @@ public class ServerConfig implements CustomFile { return presetBlocks; } - public YBounds getYBounds() { - return yBounds; + public YDifferenceLimit getYDifferenceLimit() { + return yDifferenceLimit; } public Boolean isCustomEnabled() { @@ -153,23 +153,23 @@ public class ServerConfig implements CustomFile { } } - public static class YBounds { + public static class YDifferenceLimit { @SerializedName("above") private Double above = 0.1; @SerializedName("below") private Double below = 3.0; - public YBounds() { + public YDifferenceLimit() { } - public YBounds(Double above, Double below) { + public YDifferenceLimit(Double above, Double below) { this.above = above; this.below = below; } - public YBounds(YBounds yBounds) { - this.above = yBounds.above; - this.below = yBounds.below; + public YDifferenceLimit(YDifferenceLimit yDifferenceLimit) { + this.above = yDifferenceLimit.above; + this.below = yDifferenceLimit.below; } public Double getAbove() { @@ -208,7 +208,7 @@ public class ServerConfig implements CustomFile { this.presetBlocks = new PresetBlocks(newFile.presetBlocks); - this.yBounds = new YBounds(newFile.yBounds); + this.yDifferenceLimit = new YDifferenceLimit(newFile.yDifferenceLimit); this.customEnabled = newFile.customEnabled; this.sittingBlocks = newFile.sittingBlocks.stream().map(SittingBlock::new).collect(Collectors.toCollection(ArrayList::new)); diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index a7d792e..e2d04bf 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -89,12 +89,12 @@ public class Logic { // get the height difference (positive) double heightDifference = Math.abs(playerEyeY - blockY); // get the config limits - ServerConfig.YBounds yBounds = FileData.getServerConfig().getYBounds(); + ServerConfig.YDifferenceLimit yDifferenceLimit = FileData.getServerConfig().getYDifferenceLimit(); // debug - Data.LOGGER.info("{} {} can sit? {}", heightDifference, isAbove ? "Above" : "Below", (isAbove? yBounds.getAbove(): yBounds.getBelow()) >= heightDifference); + Data.LOGGER.info("{} {} can sit? {}", heightDifference, isAbove ? "Above" : "Below", (isAbove? yDifferenceLimit.getAbove(): yDifferenceLimit.getBelow()) >= heightDifference); - return (isAbove? yBounds.getAbove(): yBounds.getBelow()) >= heightDifference; + return (isAbove? yDifferenceLimit.getAbove(): yDifferenceLimit.getBelow()) >= heightDifference; } /** From e76629af32b6db93ee5988ea23e4af98c6c0ccf8 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Thu, 13 Feb 2025 15:59:46 -0600 Subject: [PATCH 07/15] use player y instead of player eye y --- .../java/one/oth3r/sit/file/ServerConfig.java | 4 ++-- src/main/java/one/oth3r/sit/utl/Logic.java | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index 0698e67..b140bf5 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -155,9 +155,9 @@ public class ServerConfig implements CustomFile { public static class YDifferenceLimit { @SerializedName("above") - private Double above = 0.1; + private Double above = 1.0; @SerializedName("below") - private Double below = 3.0; + private Double below = 1.0; public YDifferenceLimit() { } diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index e2d04bf..2fbc0b2 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -82,19 +82,20 @@ public class Logic { * check if the Y-level of the block is within the limits of the player, bounds are set in the {@link ServerConfig} */ public static boolean checkYLimits(ServerPlayerEntity player, BlockPos blockPos) { - double playerEyeY = player.getEyeY(); + double playerY = player.getBlockY(); double blockY = blockPos.getY(); // if the block is above the eye height - boolean isAbove = playerEyeY < blockY; + boolean isAbove = playerY < blockY; + + // return true if equal + if (playerY == blockY) return true; + // get the height difference (positive) - double heightDifference = Math.abs(playerEyeY - blockY); + double heightDifference = Math.abs(playerY - blockY); // get the config limits ServerConfig.YDifferenceLimit yDifferenceLimit = FileData.getServerConfig().getYDifferenceLimit(); - // debug - Data.LOGGER.info("{} {} can sit? {}", heightDifference, isAbove ? "Above" : "Below", (isAbove? yDifferenceLimit.getAbove(): yDifferenceLimit.getBelow()) >= heightDifference); - - return (isAbove? yDifferenceLimit.getAbove(): yDifferenceLimit.getBelow()) >= heightDifference; + return (isAbove? yDifferenceLimit.getAbove() : yDifferenceLimit.getBelow()) >= heightDifference; } /** From dbee32a5e9ac977efe15746fd7f81040e914feb3 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Fri, 14 Feb 2025 11:39:28 -0600 Subject: [PATCH 08/15] update localization --- .../java/one/oth3r/sit/file/ServerConfig.java | 2 +- .../assets/sit-oth3r/lang/de_de.json | 83 +++++++++++++++++++ .../assets/sit-oth3r/lang/zh_cn.json | 83 +++++++++++++++++++ src/main/resources/assets/sit/lang/zh_tw.json | 51 ------------ 4 files changed, 167 insertions(+), 52 deletions(-) create mode 100644 src/main/resources/assets/sit-oth3r/lang/de_de.json create mode 100644 src/main/resources/assets/sit-oth3r/lang/zh_cn.json delete mode 100644 src/main/resources/assets/sit/lang/zh_tw.json diff --git a/src/main/java/one/oth3r/sit/file/ServerConfig.java b/src/main/java/one/oth3r/sit/file/ServerConfig.java index b140bf5..dd183c5 100644 --- a/src/main/java/one/oth3r/sit/file/ServerConfig.java +++ b/src/main/java/one/oth3r/sit/file/ServerConfig.java @@ -26,7 +26,7 @@ public class ServerConfig implements CustomFile { @SerializedName("lang") private String lang = "en_us"; @SerializedName("lang-options") - private final String langOptions = "en_us, it_it, pt_br, tr_tr, zh_tw"; + 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/resources/assets/sit-oth3r/lang/de_de.json b/src/main/resources/assets/sit-oth3r/lang/de_de.json new file mode 100644 index 0000000..409e00a --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/de_de.json @@ -0,0 +1,83 @@ +{ + "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", + "config.server.description": "Konfiguriert die Einstellung des Servers.", + "config.server.lang": "Sprache", + "config.server.lang.description": "Die Sprache, die für die Sit! Mod benutzt wird.", + "config.server.keep-active": "Aktiv lassen", + "config.server.keep-active.description": "Stellt ein ob die Sit! Entität bleiben soll, selbst wenn der Spieler/Server offline ist.\nWenn nein, wird der Spieler nicht mehr sitzen, wenn er sich wieder einloggt.", + "config.server.sit-while-seated": "Setzten während reiten", + "config.server.sit-while-seated.description": "Stellt die Fähigkeit ein auf einem anderem Sit! Block zu sitzen, wenn man bereits auf einem sitzt.", + "config.server.preset-blocks": "Vorhandene Blöcke", + "config.server.preset-blocks.description": "Stellt die Standard Sit! Blöcke ein.", + "config.server.preset-blocks.stairs": "Treppen", + "config.server.preset-blocks.slabs": "Stufen", + "config.server.preset-blocks.carpets": "Teppiche", + "config.server.preset-blocks.full-blocks": "Volle Blöcke", + "config.server.custom-enabled": "Benutzerdefiniert", + "config.server.custom-enabled.description": "Stellt das Benutzen von Benutzerdefinierten Blöcken zum Sitzen ein.", + "config.server.custom-blocks": "Benutzerdefinierte Blöcke", + "config.server.custom-blocks.description": "Die Liste Benutzerdefinierter Sitz-Blöcke", + "config.server.custom-block.block-ids": "Block IDs", + "config.server.custom-block.block-ids.description": "Die Block-ID(s) für Benutzerdefinierte Sitzt-Blöcke.", + "config.server.custom-block.block-tags": "Block Tags", + "config.server.custom-block.block-tags.description": "Die Block-Tag(s) für Benutzerdefinierte Sitzt-Blöcke.", + "config.server.custom-block.blockstates": "Blockstates", + "config.server.custom-block.blockstates.description": "Die Blockstates, die ein Block haben muss, um ein eigener Sitz-Block zu sein.", + "config.server.custom-block.sitting-height": "Sitzt Höhe", + "config.server.custom-block.sitting-height.description": "Die Spieler Sitzhöhe von den eigenen Blöcken.", + "config.server.blacklisted-blocks": "Gesperrte Blöcke", + "config.server.blacklisted-blocks.description": "Die Liste der Blöcke auf denen man nicht sitzen kann.", + "config.sitting": "Sitzt Konfiguration", + "config.sitting.description": "Konfiguriert die Sitzfähigkeit. Auf dem Server kann jeder Spieler seine eigene Sitzkonfiguration haben, wenn er den Mod benutzt.", + "config.sitting.enabled": "Aktiviert", + "config.sitting.enabled.description": "Stellt die Fähigkeit zum Sitzen ein.", + "config.sitting.hand-sitting": "Hand Sitzen", + "config.sitting.hand-sitting.description": "Stellt die Fähigkeit ein, mit der Hilfe von Hand-Interaktionen zu sitzen.", + "config.sitting.hand.main": "Haupthand", + "config.sitting.hand.main.description": "Haupthand", + "config.sitting.hand.off": "Zweithand", + "config.sitting.hand.off.description": "Zweithand", + "config.sitting.hand.description": "Konfiguriert die %s sitzt Einstellungen.", + "config.sitting.hand.requirement": "Sitzungsanforderung", + "config.sitting.hand.requirement.description": "Die Handanforderung zum Sitten. Z.B. wenn EMPTY, muss die Hand leer sein", + "config.sitting.hand.requirement.description.none": "Keine Anforderung zum Sitzen.", + "config.sitting.hand.requirement.description.empty": "Die Hand muss leer sein, um zu sitzen.", + "config.sitting.hand.requirement.description.filter": "Man kann nur sitzen, wenn der Gegenstand in der Hand einem der Filter entspricht.", + "config.sitting.hand.filter": "Filter", + "config.sitting.hand.filter.description": "Die Liste der Gegenstände für die Filter-Handvoraussetzung.", + "config.sitting.hand.filter.block": "Blöcke", + "config.sitting.hand.filter.block.description": "Der Block-Standard-Filter.", + "config.sitting.hand.filter.food": "Essen", + "config.sitting.hand.filter.food.description": "Der Essen-Standard-Filter.", + "config.sitting.hand.filter.usable": "Benutzbare Gegenstände", + "config.sitting.hand.filter.usable.description": "Die benutzbaren Gegenstände Standardfilter. (Dreizacken, Schilde, Bogen)", + "config.sitting.hand.filter.custom-items": "Benutzerdefinierte Items", + "config.sitting.hand.filter.custom-items.description": "Eine Liste von Benutzerdefinierten Elementen, die dem Filter hinzugefügt werden sollen.", + "config.sitting.hand.filter.custom-tags": "Benutzerdefinierte Tags", + "config.sitting.hand.filter.custom-tags.description": "Eine Liste von Benutzerdefinierte Item-Tags für den Filter.", + "sit!.chat.toggle_sit": "%s sitzt!", + "sit!.chat.toggle_sit.on": "Aktiviert", + "sit!.chat.toggle_sit.off": "Deaktiviert", + "sit!.chat.unsupported": "Sit! Ist auf dem Server nicht verfügbar.", + "sit!.chat.reloaded": "Konfiguration wurde neu geladen!", + "sit!.chat.purged": "Alle geladenen Sit! Entitäten gelöscht! %s", + "sit!.chat.purged.total": "(%s entfernt)", + "key.sit!.toggle": "Sitzen umschalten", + "key.sit!.sit": "Sitzen", + "key.sit!.config": "Konfiguration öffnen", + "sit!.screen.config": "Sit! Konfiguration", + "sit!.gui.button.file": "Datei öffnen", + "sit!.gui.button.folder": "Ordner öffnen", + "sit!.gui.button.reset": "Zurücksetzen", + "sit!.gui.button.issues": "Probleme", + "sit!.gui.button.donate": "Spenden", + "sit!.gui.button.revert": "Änderungen rückgängig machen", + "sit!.gui.button.save": "Speichern und schließen", + "sit!.gui.button.website": "Website", + "sit!.console.connected": "Verbunden mit Sit! Server: %s", + "sit!.console.player_settings": "Benutzerdefinierte Sitzungseinstellungen von %s erhalten!", + "modmenu.descriptionTranslation.sit-oth3r": "Fügt die Möglichkeit hinzu, in Minecraft zu sitzen! Endlose Anpassungsmöglichkeiten für Handbeschränkungen und sitzbare Blöcke.\nSpieler können ihre eigenen Sitzeinstellungen verwenden, wenn sie den Sit!-Client auf dem Server nutzen!" +} \ 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 new file mode 100644 index 0000000..d75c032 --- /dev/null +++ b/src/main/resources/assets/sit-oth3r/lang/zh_cn.json @@ -0,0 +1,83 @@ +{ + "category.sit!": "Sit!", + "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! 模组以后,玩家加入装有 Sit! 的服务器可以拥有自己的坐下配置。" +} \ No newline at end of file diff --git a/src/main/resources/assets/sit/lang/zh_tw.json b/src/main/resources/assets/sit/lang/zh_tw.json deleted file mode 100644 index 391b9cf..0000000 --- a/src/main/resources/assets/sit/lang/zh_tw.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "config.sit.empty": "空", - "config.sit.restrictive": "限制", - "config.sit.none": "無", - "config.sit.category.general": "一般", - "config.sit.category.general.tooltip": "一般設定", - "config.sit.category.main_hand": "慣用手", - "config.sit.category.main_hand.tooltip": "慣用手設定", - "config.sit.category.off_hand": "非慣用手", - "config.sit.category.off_hand.tooltip": "非慣用手設定", - "config.sit.general.keep_active": "保持活躍", - "config.sit.general.keep_active.description": "即使在登出/關閉時,也保持實體處於活躍狀態", - "config.sit.general.sittable": "可坐的方塊", - "config.sit.general.sittable.description": "切換坐在不同方塊類型上的能力。", - "config.sit.general.sit_while_seated": "坐下時坐下", - "config.sit.general.sit_while_seated.description": "切換已經坐在一個方塊上時,坐在其他方塊上的能力。", - "config.sit.general.sittable.stairs": "階梯", - "config.sit.general.sittable.slabs": "半磚", - "config.sit.general.sittable.carpets": "地毯", - "config.sit.general.sittable.full_blocks": "完整方塊", - "config.sit.general.sittable.custom": "自訂", - "config.sit.general.sittable.custom.description": "啟用新增自訂方塊以供坐下。", - "config.sit.general.sittable_blocks": "自訂可坐方塊", - "config.sit.general.sittable_blocks.description": "新增自訂可坐方塊!", - "config.sit.general.sittable_blocks.description_2": "範例:%s", - "config.sit.general.sittable_blocks.description_4": "第一個條目:自訂方塊", - "config.sit.general.sittable_blocks.description_5": "第二個條目:坐姿高度(0-1 之間的數字,例如 0.52)", - "config.sit.general.sittable_blocks.description_6": "第三個條目:碰撞箱大小(玩家下馬時在實體上方生成的位置)", - "config.sit.general.sittable_blocks.description_7": "第四個條目(可選):坐下的必要方塊狀態(輸入「!」排除方塊狀態)", - "config.sit.general.sittable_blocks.description_8": "使用「|」分隔不同的條目!", - "config.sit.hand": "手部設定", - "config.sit.hand.requirements": "需求", - "config.sit.hand.requirements.description": "坐下的手部需求。", - "config.sit.hand.requirements.description_2": "空 = 手必須是空的", - "config.sit.hand.requirements.description_3": "限制 = 為手部狀態設定限制", - "config.sit.hand.requirements.description_4": "無 = 隨時可以坐下", - "config.sit.hand.restrictions": "限制", - "config.sit.hand.restrictions.description": "切換預設的手部限制以供坐下。", - "config.sit.hand.restrictions.blocks": "方塊", - "config.sit.hand.restrictions.food": "食物", - "config.sit.hand.restrictions.usable": "可使用的", - "config.sit.hand.restrictions.usable.description": "例如:弓、三叉戟、盾牌", - "config.sit.hand.whitelist": "白名單", - "config.sit.hand.whitelist.description": "為玩家可以用來坐下的物品建立自訂白名單。", - "config.sit.hand.blacklist": "黑名單", - "config.sit.hand.blacklist.description": "為玩家無法用來坐下的物品建立自訂黑名單。", - "config.sit.hand.list.description": "範例:", - "config.sit.hand.list.description_2": "「minecraft:torch」", - "key.sit.command.reloaded": "已重新載入設定!", - "key.sit.command.purged": "已清除所有活躍的椅子實體!" -} From b1702c9bebab19864580c01fb7d393d493f19d70 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Fri, 14 Feb 2025 11:41:31 -0600 Subject: [PATCH 09/15] fix sit toggle messages not showing correctly --- src/main/java/one/oth3r/sit/utl/Logic.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/one/oth3r/sit/utl/Logic.java b/src/main/java/one/oth3r/sit/utl/Logic.java index 2fbc0b2..2708393 100644 --- a/src/main/java/one/oth3r/sit/utl/Logic.java +++ b/src/main/java/one/oth3r/sit/utl/Logic.java @@ -194,11 +194,11 @@ public class Logic { // get the message settings - String messageKey = "sit!.chat.sit_toggle."+(config.getEnabled()?"on":"off"); + String messageKey = "sit!.chat.toggle_sit."+(config.getEnabled()?"on":"off"); Formatting messageColor = config.getEnabled()?Formatting.GREEN:Formatting.RED; // send the player the actionbar message - return Utl.lang("sit!.chat.sit_toggle", + return Utl.lang("sit!.chat.toggle_sit", Utl.lang(messageKey).formatted(messageColor)); } else { // unsupported server message if not in a Sit! server From 6fd3a8bd29e84849422554c397b4610708874d0c Mon Sep 17 00:00:00 2001 From: Oth3r Date: Fri, 14 Feb 2025 11:45:38 -0600 Subject: [PATCH 10/15] update dependencies --- gradle.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index d5e525c..24455bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,8 +6,8 @@ org.gradle.parallel=true # check these on https://fabricmc.net/develop min_minecraft_version=1.21.4 minecraft_version=1.21.4 -yarn_mappings=1.21.4+build.1 -loader_version=0.16.9 +yarn_mappings=1.21.4+build.8 +loader_version=0.16.10 # Mod Properties mod_version=1.2.1+1.21.4 @@ -15,5 +15,5 @@ maven_group=one.oth3r file_name=sit! # Dependencies -fabric_version=0.110.5+1.21.4 -modmenu_version=12.0.0-beta.1 +fabric_version=0.116.1+1.21.4 +modmenu_version=13.0.0-beta.1 From f983763a708683b5351e2ea6ed0f09c53e1d85a0 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Fri, 14 Feb 2025 11:48:53 -0600 Subject: [PATCH 11/15] v1.2.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 24455bd..9047fb5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.21.4+build.8 loader_version=0.16.10 # Mod Properties -mod_version=1.2.1+1.21.4 +mod_version=1.2.2+1.21.4 maven_group=one.oth3r file_name=sit! From 39fc860ccea271c44d2e3d51b02cdc1d804cbed4 Mon Sep 17 00:00:00 2001 From: Oth3r Date: Fri, 14 Feb 2025 11:59:13 -0600 Subject: [PATCH 12/15] changelog --- changelog.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/changelog.md b/changelog.md index aef44e2..08b94ce 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,15 @@ -# v1.2.1 -Quick bugfix update. :) -### block interaction checker -now it actually works (based on config sadly) -* added `interaction-blocks` to the server config, any block added to this list will block sitting with the hand -### other changes -* added refreshes to the config files on startup and reload to write missing parts to disk -* bumped the `server-config.json` version -* fixed `usable` hand filter not working \ No newline at end of file +# v1.2.2 +more configuration! +### height-difference-limit +new server config for y difference limit for sitting + +limit how far above or below a block can compared to a player be to sit! + +**default**: 1 block above and below the player's y + +### fixes / changelog: +* fixed interaction-blocks not getting copied correctly when updating the file +* fixed actionbar text for toggling sitting ablity not displaying correctly +* added `height-difference-limit` `server-config` option +* added German localization (de_de) +* added Simplified Chinese localization (zh_ch) \ No newline at end of file From 08788456b2034c6bc00560e23a53c6b0251c04bb Mon Sep 17 00:00:00 2001 From: Oth3r Date: Mon, 17 Feb 2025 16:05:18 -0600 Subject: [PATCH 13/15] 1.21.3 --- gradle.properties | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9047fb5..08df4aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ 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.3 +minecraft_version=1.21.3 +yarn_mappings=1.21.3+build.2 loader_version=0.16.10 # Mod Properties @@ -15,5 +15,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.114.0+1.21.3 +modmenu_version=12.0.0-beta.1 From a9399fcbf9117733795da47e1bc8686ebd5fbd0e Mon Sep 17 00:00:00 2001 From: Oth3r Date: Tue, 18 Feb 2025 12:07:14 -0600 Subject: [PATCH 14/15] 1.21.3 number fix --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 08df4aa..67f1082 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.21.3+build.2 loader_version=0.16.10 # Mod Properties -mod_version=1.2.2+1.21.4 +mod_version=1.2.2+1.21.3 maven_group=one.oth3r file_name=sit! From b5eaf3df7ad1ced18691b34b1865c6463be0b02a Mon Sep 17 00:00:00 2001 From: Oth3r Date: Sun, 23 Feb 2025 15:06:21 -0600 Subject: [PATCH 15/15] 1.21-1.21.1 version fix --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5934e3a..fbe92d7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.21.1+build.3 loader_version=0.16.9 # Mod Properties -mod_version=1.2.1+1.21-1.21.1 +mod_version=1.2.2+1.21-1.21.1 maven_group=one.oth3r file_name=sit!