diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/BuddingBlockBehavior.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/BuddingBlockBehavior.java index a42367d2d..0fab2a5ca 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/BuddingBlockBehavior.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/BuddingBlockBehavior.java @@ -20,10 +20,10 @@ import java.util.concurrent.Callable; public class BuddingBlockBehavior extends BukkitBlockBehavior { public static final Factory FACTORY = new Factory(); - private final int growthChance; + private final float growthChance; private final List blocks; - public BuddingBlockBehavior(CustomBlock customBlock, int growthChance, List blocks) { + public BuddingBlockBehavior(CustomBlock customBlock, float growthChance, List blocks) { super(customBlock); this.growthChance = growthChance; this.blocks = blocks; @@ -31,7 +31,7 @@ public class BuddingBlockBehavior extends BukkitBlockBehavior { @Override public void randomTick(Object thisBlock, Object[] args, Callable superMethod) throws Exception { - if (RandomUtils.generateRandomInt(0, this.growthChance) != 0) return; + if (RandomUtils.generateRandomFloat(0, 1) >= growthChance) return; Object nmsDirection = CoreReflections.instance$Direction$values[RandomUtils.generateRandomInt(0, 6)]; Direction direction = DirectionUtils.fromNMSDirection(nmsDirection); Object blockPos = FastNMS.INSTANCE.method$BlockPos$relative(args[2], nmsDirection); @@ -90,7 +90,7 @@ public class BuddingBlockBehavior extends BukkitBlockBehavior { @Override public BlockBehavior create(CustomBlock block, Map arguments) { - int growthChance = ResourceConfigUtils.getAsInt(arguments.getOrDefault("growth-chance", 5), "growth-chance"); + float growthChance = ResourceConfigUtils.getAsFloat(arguments.getOrDefault("growth-chance", 0.2), "growth-chance"); List blocks = new ObjectArrayList<>(); MiscUtils.getAsStringList(arguments.get("blocks")).forEach(s -> blocks.add(Key.of(s))); return new BuddingBlockBehavior(block, growthChance, blocks); diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/ChimeBlockBehavior.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/ChimeBlockBehavior.java index cadbbbcf7..e11eb1d3b 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/ChimeBlockBehavior.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/behavior/ChimeBlockBehavior.java @@ -37,7 +37,7 @@ public class ChimeBlockBehavior extends BukkitBlockBehavior { Optional.ofNullable(arguments.get("sounds")) .map(o -> ResourceConfigUtils.getAsMap(o , "hit").get("hit")) .orElse(null), - "warning.config.block.behavior.chime.missing_hit_sound" + "warning.config.block.behavior.chime.missing_sounds_hit" ), SoundData.SoundValue.FIXED_1, SoundData.SoundValue.ranged(0.9f, 1f)); return new ChimeBlockBehavior(block, hitSound); } diff --git a/common-files/src/main/resources/resources/default/configuration/i18n.yml b/common-files/src/main/resources/resources/default/configuration/i18n.yml index 71d6e9e30..a0c7eea40 100644 --- a/common-files/src/main/resources/resources/default/configuration/i18n.yml +++ b/common-files/src/main/resources/resources/default/configuration/i18n.yml @@ -161,7 +161,7 @@ lang: block_name:default:amethyst_wall_torch: Amethyst Torch block_name:default:hami_melon: Hami Melon block_name:default:hami_melon_stem: Hami Melon Stem - block_name:default:default:attached_hami_melon_stem: Hami Melon Stem + block_name:default:attached_hami_melon_stem: Hami Melon Stem block_name:default:palm_button: Palm Button block_name:default:palm_fence: Palm Fence zh_cn: @@ -196,6 +196,6 @@ lang: block_name:default:amethyst_wall_torch: 紫水晶火把 block_name:default:hami_melon: 哈密瓜 block_name:default:hami_melon_stem: 哈密瓜茎 - block_name:default:default:attached_hami_melon_stem: 哈密瓜茎 + block_name:default:attached_hami_melon_stem: 哈密瓜茎 block_name:default:palm_button: 棕榈木按钮 block_name:default:palm_fence: 棕榈木栅栏 diff --git a/common-files/src/main/resources/resources/default/configuration/templates.yml b/common-files/src/main/resources/resources/default/configuration/templates.yml index 20392707e..fa284b068 100644 --- a/common-files/src/main/resources/resources/default/configuration/templates.yml +++ b/common-files/src/main/resources/resources/default/configuration/templates.yml @@ -3930,43 +3930,6 @@ templates#block_states: resistance: 1200.0 burnable: false fluid-state: water - default:block_state/mushroom: - properties: - facing: - type: horizontal_direction - appearances: - north: - state: ${base_block}[waterlogged=false,facing=north] - model: - path: ${model_path} - east: - state: ${base_block}[waterlogged=false,facing=east] - model: - path: ${model_path} - y: 90 - west: - state: ${base_block}[waterlogged=false,facing=west] - model: - path: ${model_path} - y: 270 - south: - state: ${base_block}[waterlogged=false,facing=south] - model: - path: ${model_path} - y: 180 - variants: - facing=north: - appearance: north - id: 0 - facing=east: - appearance: east - id: 1 - facing=west: - appearance: west - id: 2 - facing=south: - appearance: south - id: 3 # recipes templates#recipes: default:recipe/planks: diff --git a/common-files/src/main/resources/translations/en.yml b/common-files/src/main/resources/translations/en.yml index 6c88ca4a0..33f9fde42 100644 --- a/common-files/src/main/resources/translations/en.yml +++ b/common-files/src/main/resources/translations/en.yml @@ -336,7 +336,7 @@ warning.config.block.behavior.stem.missing_attached_stem: "Issue found i warning.config.block.behavior.attached_stem.missing_facing: "Issue found in file - The block '' is missing the required 'facing' property for 'attached_stem_block' behavior." warning.config.block.behavior.attached_stem.missing_fruit: "Issue found in file - The block '' is missing the required 'fruit' argument for 'attached_stem_block' behavior." warning.config.block.behavior.attached_stem.missing_stem: "Issue found in file - The block '' is missing the required 'stem' argument for 'attached_stem_block' behavior." -warning.config.block.behavior.chime.missing_hit_sound: "Issue found in file - The block '' is missing the required 'hit-sound' argument for 'chime_block' behavior." +warning.config.block.behavior.chime.missing_sounds_hit: "Issue found in file - The block '' is missing the required 'sounds.hit' argument for 'chime_block' behavior." warning.config.model.generation.missing_parent: "Issue found in file - The config '' is missing the required 'parent' argument in 'generation' section." warning.config.model.generation.conflict: "Issue found in file - Failed to generate model for '' as two or more configurations attempt to generate different json models with the same path: ''." warning.config.model.generation.invalid_display_position: "Issue found in file - The config '' is using an invalid display position '' in 'generation.display' section. Allowed display positions: []" diff --git a/common-files/src/main/resources/translations/zh_cn.yml b/common-files/src/main/resources/translations/zh_cn.yml index 4072ac068..0bc2572c9 100644 --- a/common-files/src/main/resources/translations/zh_cn.yml +++ b/common-files/src/main/resources/translations/zh_cn.yml @@ -330,7 +330,7 @@ warning.config.block.behavior.stem.missing_attached_stem: "在文件 在文件 发现问题 - 方块 '' 的 'attached_stem_block' 行为缺少必需的 'facing' 属性" warning.config.block.behavior.attached_stem.missing_fruit: "在文件 发现问题 - 方块 '' 的 'attached_stem_block' 行为缺少必需的 'fruit' 选项" warning.config.block.behavior.attached_stem.missing_stem: "在文件 发现问题 - 方块 '' 的 'attached_stem_block' 行为缺少必需的 'stem' 选项" -warning.config.block.behavior.chime.missing_hit_sound: "在文件 发现问题 - 方块 '' 的 'chime_block' 行为缺少必需的 'hit-sound' 选项" +warning.config.block.behavior.chime.missing_sounds_hit: "在文件 发现问题 - 方块 '' 的 'chime_block' 行为缺少必需的 'sounds.hit' 选项" warning.config.model.generation.missing_parent: "在文件 发现问题 - 配置项 '' 的 'generation' 段落缺少必需的 'parent' 参数" warning.config.model.generation.conflict: "在文件 发现问题 - 无法为 '' 生成模型 存在多个配置尝试使用相同路径 '' 生成不同的 JSON 模型" warning.config.model.generation.invalid_display_position: "在文件 发现问题 - 配置项 '' 在 'generation.display' 区域使用了无效的 display 位置类型 ''. 可用展示类型: []"