From ead62854d6f3aed849910e8fecb29f6eefefcbda Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Sun, 19 Jun 2022 02:11:56 +0800 Subject: [PATCH] better layer range check hint for `tweakmSchematicBlockPlacementRestriction` in_margin -> outside_the_layer --- .../PlacementRestrictor.java | 20 +++++++++---------- .../assets/tweakermore/lang/en_us.json | 2 +- .../assets/tweakermore/lang/zh_cn.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/fallenbreath/tweakermore/impl/features/tweakmSchematicProPlace/PlacementRestrictor.java b/src/main/java/me/fallenbreath/tweakermore/impl/features/tweakmSchematicProPlace/PlacementRestrictor.java index 64af50f4..321834a3 100644 --- a/src/main/java/me/fallenbreath/tweakermore/impl/features/tweakmSchematicProPlace/PlacementRestrictor.java +++ b/src/main/java/me/fallenbreath/tweakermore/impl/features/tweakmSchematicProPlace/PlacementRestrictor.java @@ -49,16 +49,6 @@ public static boolean canDoBlockPlacement(MinecraftClient mc, ItemPlacementConte return true; } - // If the target pos is outside the layer range (within margin range), cancel - if (!layerRange.isPositionWithinRange(pos)) - { - if (hintType.showNotPossible) - { - info("in_margin"); - } - return false; - } - World schematicWorld = SchematicWorldHandler.getSchematicWorld(); World clientWorld = mc.world; @@ -90,6 +80,16 @@ public static boolean canDoBlockPlacement(MinecraftClient mc, ItemPlacementConte return false; } + // If the target pos is outside the layer range, cancel + if (!layerRange.isPositionWithinRange(pos)) + { + if (hintType.showNotPossible) + { + info("outside_the_layer"); + } + return false; + } + // check if the player is using the right item stack for block placement if (EntityUtils.getUsedHandForItem(mc.player, schematicStack) == null) { diff --git a/src/main/resources/assets/tweakermore/lang/en_us.json b/src/main/resources/assets/tweakermore/lang/en_us.json index bc98f3f8..c8714565 100644 --- a/src/main/resources/assets/tweakermore/lang/en_us.json +++ b/src/main/resources/assets/tweakermore/lang/en_us.json @@ -61,7 +61,7 @@ "tweakermore.config.tweakmSchematicBlockPlacementRestriction": "tweakmSchematicBlockPlacementRestriction", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.comment": "Similar to litematica's placementRestriction option, it cancels block placement when the placement doesn't match current schematic\nUnlike litematica's implementation, it uses a simple and accurate constraint strategy,\nit works nicely with tweakeroo's placement tweaks\nDoes not work with litematica's or easy place mode", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.pretty_name": "Schematic Block Placement Restriction", - "tweakermore.config.tweakmSchematicBlockPlacementRestriction.in_margin": "Block placement not allowed (in margin)", + "tweakermore.config.tweakmSchematicBlockPlacementRestriction.outside_the_layer": "Block placement not allowed (outside the layer)", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.is_air": "Block placement not allowed (is air)", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.no_block": "No item for %1$s", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.wrong_item": "Require %1$s", diff --git a/src/main/resources/assets/tweakermore/lang/zh_cn.json b/src/main/resources/assets/tweakermore/lang/zh_cn.json index e7ca3589..444ce0db 100644 --- a/src/main/resources/assets/tweakermore/lang/zh_cn.json +++ b/src/main/resources/assets/tweakermore/lang/zh_cn.json @@ -61,7 +61,7 @@ "tweakermore.config.tweakmSchematicBlockPlacementRestriction": "原理图方块放置限制", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.comment": "与litematica的放置限制(placementRestriction)选项类似,它将取消与原理图不匹配的方块的放置\n但与litematica的实现不同的是,它使用了一个简单又准确的约束策略,\n可以完美地与tweakeroo的方块放置功能兼容\n在litematica的放置限制或轻松放置开启时无效", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.pretty_name": "原理图方块放置限制", - "tweakermore.config.tweakmSchematicBlockPlacementRestriction.in_margin": "此处不允许方块放置 (边缘保护)", + "tweakermore.config.tweakmSchematicBlockPlacementRestriction.outside_the_layer": "此处不允许方块放置 (位于渲染层外)", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.is_air": "此处不允许方块放置 (不存在方块)", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.no_block": "%1$s不存在对应的物品", "tweakermore.config.tweakmSchematicBlockPlacementRestriction.wrong_item": "需要%1$s",