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 f008b81e1..b7897e76a 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 @@ -7,50 +7,43 @@ import net.momirealms.craftengine.core.block.BlockBehavior; import net.momirealms.craftengine.core.block.CustomBlock; import net.momirealms.craftengine.core.block.behavior.BlockBehaviorFactory; import net.momirealms.craftengine.core.sound.SoundData; +import net.momirealms.craftengine.core.util.Pair; import net.momirealms.craftengine.core.util.RandomUtils; import net.momirealms.craftengine.core.util.ResourceConfigUtils; +import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.Callable; public class ChimeBlockBehavior extends BukkitBlockBehavior { public static final Factory FACTORY = new Factory(); - private final SoundData hitSound; - private final boolean randomPitch; - private final float randomMultiplier; + private final List> hitSounds; - public ChimeBlockBehavior(CustomBlock customBlock, SoundData hitSound, boolean randomPitch, float randomMultiplier) { + public ChimeBlockBehavior(CustomBlock customBlock, List> hitSounds) { super(customBlock); - this.hitSound = hitSound; - this.randomPitch = randomPitch; - this.randomMultiplier = randomMultiplier; + this.hitSounds = hitSounds; } @Override public void onProjectileHit(Object thisBlock, Object[] args, Callable superMethod) { + Pair hitSound = hitSounds.get(RandomUtils.generateRandomInt(0, hitSounds.size())); Object blockPos = FastNMS.INSTANCE.field$BlockHitResult$blockPos(args[2]); - Object sound = FastNMS.INSTANCE.constructor$SoundEvent(KeyUtils.toResourceLocation(hitSound.id()), Optional.empty()); - float pitch = hitSound.pitch().get(); - if (randomPitch) { - pitch = pitch + RandomUtils.generateRandomInt(0, 1) * this.randomMultiplier; - } - FastNMS.INSTANCE.method$LevelAccessor$playSound(args[0], null, blockPos, sound, CoreReflections.instance$SoundSource$BLOCKS, hitSound.volume().get(), pitch); + Object sound = FastNMS.INSTANCE.constructor$SoundEvent(KeyUtils.toResourceLocation(hitSound.left().id()), Optional.empty()); + float pitch = hitSound.left().pitch().get() + RandomUtils.generateRandomInt(0, 1) * hitSound.right(); + FastNMS.INSTANCE.method$LevelAccessor$playSound(args[0], null, blockPos, sound, CoreReflections.instance$SoundSource$BLOCKS, hitSound.left().volume().get(), pitch); } public static class Factory implements BlockBehaviorFactory { @Override public BlockBehavior create(CustomBlock block, Map arguments) { - SoundData hitSound = SoundData.create(ResourceConfigUtils.requireNonNullOrThrow(arguments.get("hit-sound"), "warning.config.block.behavior.chime.missing_hit_sound"), SoundData.SoundValue.FIXED_1, SoundData.SoundValue.ranged(0.9f, 1f)); - Map randomPitch = ResourceConfigUtils.getAsMapOrNull(arguments.get("random-pitch"), "random-pitch"); - boolean enableRandomPitch = false; - float randomMultiplier = 1f; - if (randomPitch != null) { - enableRandomPitch = true; - randomMultiplier = ResourceConfigUtils.getAsFloat(arguments.getOrDefault("multiplier", 1f), "multiplier"); - } - return new ChimeBlockBehavior(block, hitSound, enableRandomPitch, randomMultiplier); + List> hitSounds = ResourceConfigUtils.parseConfigAsList(arguments.get("hit-sounds"), map -> { + SoundData hitSound = SoundData.create(ResourceConfigUtils.requireNonNullOrThrow(arguments.get("sound"), "warning.config.block.behavior.chime.missing_hit_sound"), SoundData.SoundValue.FIXED_1, SoundData.SoundValue.ranged(0.9f, 1f)); + float randomMultiplier = ResourceConfigUtils.getAsFloat(arguments.get("random-pitch-multiplier"), "random-pitch-multiplier"); + return Pair.of(hitSound, randomMultiplier); + }); + return new ChimeBlockBehavior(block, hitSounds); } } } diff --git a/common-files/src/main/resources/resources/default/configuration/blocks/palm_tree.yml b/common-files/src/main/resources/resources/default/configuration/blocks/palm_tree.yml index 789f9768a..7abfca063 100644 --- a/common-files/src/main/resources/resources/default/configuration/blocks/palm_tree.yml +++ b/common-files/src/main/resources/resources/default/configuration/blocks/palm_tree.yml @@ -17,7 +17,30 @@ items: parent: minecraft:block/custom/palm_log behavior: type: block_item - block: default:palm_log + block: + behavior: + type: strippable_block + stripped: default:stripped_palm_log + loot: + template: default:loot_table/self + settings: + template: default:settings/wood + states: + template: default:block_state/pillar + arguments: + base_block: note_block + texture_top_path: minecraft:block/custom/palm_log_top + texture_side_path: minecraft:block/custom/palm_log + model_vertical_path: minecraft:block/custom/palm_log + model_horizontal_path: minecraft:block/custom/palm_log_horizontal + vanilla_id: + type: self_increase_int + from: 0 + to: 2 + internal_id: + type: self_increase_int + from: 0 + to: 2 default:stripped_palm_log: material: nether_brick custom-model-data: 1001 @@ -36,7 +59,27 @@ items: parent: minecraft:block/custom/stripped_palm_log behavior: type: block_item - block: default:stripped_palm_log + block: + loot: + template: default:loot_table/self + settings: + template: default:settings/wood + states: + template: default:block_state/pillar + arguments: + base_block: note_block + texture_top_path: minecraft:block/custom/stripped_palm_log_top + texture_side_path: minecraft:block/custom/stripped_palm_log + model_vertical_path: minecraft:block/custom/stripped_palm_log + model_horizontal_path: minecraft:block/custom/stripped_palm_log_horizontal + vanilla_id: + type: self_increase_int + from: 3 + to: 5 + internal_id: + type: self_increase_int + from: 3 + to: 5 default:palm_wood: material: nether_brick custom-model-data: 1002 @@ -55,7 +98,30 @@ items: parent: minecraft:block/custom/palm_wood behavior: type: block_item - block: default:palm_wood + block: + behavior: + type: strippable_block + stripped: default:stripped_palm_wood + loot: + template: default:loot_table/self + settings: + template: default:settings/wood + states: + template: default:block_state/pillar + arguments: + base_block: note_block + texture_top_path: minecraft:block/custom/palm_log + texture_side_path: minecraft:block/custom/palm_log + model_vertical_path: minecraft:block/custom/palm_wood + model_horizontal_path: minecraft:block/custom/palm_wood_horizontal + vanilla_id: + type: self_increase_int + from: 6 + to: 8 + internal_id: + type: self_increase_int + from: 6 + to: 8 default:stripped_palm_wood: material: nether_brick custom-model-data: 1003 @@ -74,7 +140,27 @@ items: parent: minecraft:block/custom/stripped_palm_wood behavior: type: block_item - block: default:stripped_palm_wood + block: + loot: + template: default:loot_table/self + settings: + template: default:settings/wood + states: + template: default:block_state/pillar + arguments: + base_block: note_block + texture_top_path: minecraft:block/custom/stripped_palm_log + texture_side_path: minecraft:block/custom/stripped_palm_log + model_vertical_path: minecraft:block/custom/stripped_palm_wood + model_horizontal_path: minecraft:block/custom/stripped_palm_wood_horizontal + vanilla_id: + type: self_increase_int + from: 9 + to: 11 + internal_id: + type: self_increase_int + from: 9 + to: 11 default:palm_planks: material: nether_brick custom-model-data: 1004 @@ -92,7 +178,18 @@ items: parent: minecraft:block/custom/palm_planks behavior: type: block_item - block: default:palm_planks + block: + settings: + template: default:settings/planks + loot: + template: default:loot_table/self + state: + model: + template: default:model/simplified_cube_all + arguments: + path: minecraft:block/custom/palm_planks + id: 12 + state: note_block:12 default:palm_sapling: material: nether_brick custom-model-data: 1005 @@ -107,7 +204,42 @@ items: texture: minecraft:block/custom/palm_sapling behavior: type: block_item - block: default:palm_sapling + block: + settings: + template: default:settings/sapling + behaviors: + - type: bush_block + bottom-block-tags: + - minecraft:dirt + - minecraft:farmland + - minecraft:sand + - type: sapling_block + feature: minecraft:fancy_oak + bone-meal-success-chance: 0.45 + loot: + template: default:loot_table/self + states: + properties: + stage: + type: int + default-value: 0 + range: 0~1 + appearances: + default: + state: oak_sapling:0 + model: + path: minecraft:block/custom/palm_sapling + generation: + parent: minecraft:block/cross + textures: + cross: minecraft:block/custom/palm_sapling + variants: + stage=0: + appearance: default + id: 0 + stage=1: + appearance: default + id: 1 default:palm_leaves: material: oak_leaves custom-model-data: 1000 @@ -115,9 +247,9 @@ items: item-name: components: minecraft:block_state: - distance: "1" - persistent: "false" - waterlogged: "false" + distance: '1' + persistent: 'false' + waterlogged: 'false' model: type: minecraft:model path: minecraft:item/custom/palm_leaves @@ -128,7 +260,27 @@ items: value: -12012264 behavior: type: block_item - block: default:palm_leaves + block: + behavior: + type: leaves_block + loot: + template: default:loot_table/leaves + arguments: + leaves: default:palm_leaves + sapling: default:palm_sapling + settings: + template: default:settings/leaves + states: + template: default:block_state/leaves + arguments: + default_state: oak_leaves[distance=1,persistent=false,waterlogged=false] + waterlogged_state: oak_leaves[distance=1,persistent=false,waterlogged=true] + model_path: minecraft:block/custom/palm_leaves + texture_path: minecraft:block/custom/palm_leaves + internal_id: + type: self_increase_int + from: 0 + to: 27 default:palm_trapdoor: material: nether_brick custom-model-data: 1006 @@ -143,7 +295,47 @@ items: parent: minecraft:block/custom/palm_trapdoor_bottom behavior: type: block_item - block: default:palm_trapdoor + block: + behavior: + type: trapdoor_block + can-open-with-hand: true + can-open-by-wind-charge: true + sounds: + open: minecraft:block.wooden_trapdoor.open + close: minecraft:block.wooden_trapdoor.close + loot: + template: default:loot_table/self + settings: + template: + - default:sound/wood + overrides: + map-color: 2 + instrument: bass + hardness: 3.0 + resistance: 3.0 + burnable: true + tags: + - minecraft:mineable/axe + - minecraft:trapdoors + states: + template: default:block_state/trapdoor + arguments: + base_block: acacia_trapdoor + model_bottom_path: minecraft:block/custom/palm_trapdoor_bottom + model_bottom_generation: + parent: minecraft:block/template_orientable_trapdoor_bottom + textures: + texture: minecraft:block/custom/palm_trapdoor + model_open_path: minecraft:block/custom/palm_trapdoor_open + model_open_generation: + parent: minecraft:block/template_orientable_trapdoor_open + textures: + texture: minecraft:block/custom/palm_trapdoor + model_top_path: minecraft:block/custom/palm_trapdoor_top + model_top_generation: + parent: minecraft:block/template_orientable_trapdoor_top + textures: + texture: minecraft:block/custom/palm_trapdoor default:palm_door: material: nether_brick custom-model-data: 1007 @@ -157,7 +349,68 @@ items: path: minecraft:item/custom/palm_door behavior: type: double_high_block_item - block: default:palm_door + block: + behavior: + type: door_block + can-open-with-hand: true + can-open-by-wind-charge: true + sounds: + open: minecraft:block.wooden_door.open + close: minecraft:block.wooden_door.close + loot: + template: default:loot_table/door + settings: + template: + - default:sound/wood + overrides: + push-reaction: destroy + map-color: 2 + instrument: bass + hardness: 3.0 + resistance: 3.0 + burnable: true + tags: + - minecraft:wooden_doors + - minecraft:doors + - minecraft:mineable/axe + states: + template: default:block_state/door + arguments: + base_block: oak_door + model_top_left_path: minecraft:block/custom/palm_door_top_left + model_top_left_generation: + parent: minecraft:block/door_top_left + textures: &textures + bottom: minecraft:block/custom/palm_door_bottom + top: minecraft:block/custom/palm_door_top + model_top_right_path: minecraft:block/custom/palm_door_top_right + model_top_right_generation: + parent: minecraft:block/door_top_right + textures: *textures + model_top_left_open_path: minecraft:block/custom/palm_door_top_left_open + model_top_left_open_generation: + parent: minecraft:block/door_top_left_open + textures: *textures + model_top_right_open_path: minecraft:block/custom/palm_door_top_right_open + model_top_right_open_generation: + parent: minecraft:block/door_top_right_open + textures: *textures + model_bottom_left_path: minecraft:block/custom/palm_door_bottom_left + model_bottom_left_generation: + parent: minecraft:block/door_bottom_left + textures: *textures + model_bottom_right_path: minecraft:block/custom/palm_door_bottom_right + model_bottom_right_generation: + parent: minecraft:block/door_bottom_right + textures: *textures + model_bottom_left_open_path: minecraft:block/custom/palm_door_bottom_left_open + model_bottom_left_open_generation: + parent: minecraft:block/door_bottom_left_open + textures: *textures + model_bottom_right_open_path: minecraft:block/custom/palm_door_bottom_right_open + model_bottom_right_open_generation: + parent: minecraft:block/door_bottom_right_open + textures: *textures default:palm_fence_gate: material: nether_brick custom-model-data: 1008 @@ -172,7 +425,49 @@ items: parent: minecraft:block/custom/palm_fence_gate behavior: type: block_item - block: default:palm_fence_gate + block: + behaviors: + type: fence_gate_block + can-open-with-hand: true + can-open-by-wind-charge: true + sounds: + open: minecraft:block.fence_gate.open + close: minecraft:block.fence_gate.close + loot: + template: default:loot_table/self + settings: + template: + - default:sound/wood + - default:hardness/planks + overrides: + map-color: 2 + instrument: bass + burnable: true + tags: + - minecraft:fence_gates + - minecraft:mineable/axe + - minecraft:unstable_bottom_center + states: + template: default:block_state/fence_gate + arguments: + base_block: oak_fence_gate + model_fence_gate_path: minecraft:block/custom/palm_fence_gate + model_fence_gate_generation: + parent: minecraft:block/template_fence_gate + textures: &textures + texture: minecraft:block/custom/palm_planks + model_fence_gate_open_path: minecraft:block/custom/palm_fence_gate_open + model_fence_gate_open_generation: + parent: minecraft:block/template_fence_gate_open + textures: *textures + model_fence_gate_wall_path: minecraft:block/custom/palm_fence_gate_wall + model_fence_gate_wall_generation: + parent: minecraft:block/template_fence_gate_wall + textures: *textures + model_fence_gate_wall_open_path: minecraft:block/custom/palm_fence_gate_wall_open + model_fence_gate_wall_open_generation: + parent: minecraft:block/template_fence_gate_wall_open + textures: *textures default:palm_slab: material: nether_brick custom-model-data: 1009 @@ -187,7 +482,39 @@ items: parent: minecraft:block/custom/palm_slab behavior: type: block_item - block: default:palm_slab + block: + behaviors: + type: slab_block + loot: + template: default:loot_table/slab + settings: + template: + - default:sound/wood + - default:burn_data/planks + - default:hardness/planks + overrides: + map-color: 2 + instrument: bass + tags: + - minecraft:wooden_slabs + - minecraft:slabs + - minecraft:mineable/axe + states: + template: default:block_state/slab + arguments: + base_block: petrified_oak_slab + model_bottom_path: minecraft:block/custom/palm_slab + model_bottom_generation: + parent: minecraft:block/slab + textures: &textures + bottom: minecraft:block/custom/palm_planks + side: minecraft:block/custom/palm_planks + top: minecraft:block/custom/palm_planks + model_top_path: minecraft:block/custom/palm_slab_top + model_top_generation: + parent: minecraft:block/slab_top + textures: *textures + model_double_path: minecraft:block/custom/palm_planks default:palm_stairs: material: nether_brick custom-model-data: 1013 @@ -202,7 +529,42 @@ items: fuel-time: 300 behavior: type: block_item - block: default:palm_stairs + block: + loot: + template: default:loot_table/self + settings: + template: + - default:sound/wood + - default:hardness/planks + - default:burn_data/planks + overrides: + map-color: 2 + instrument: bass + tags: + - minecraft:mineable/axe + - minecraft:stairs + - minecraft:wooden_stairs + behavior: + type: stairs_block + states: + template: default:block_state/stairs + arguments: + base_block: cut_copper_stairs + model_stairs_inner_path: minecraft:block/custom/palm_stairs_inner + model_stairs_inner_generation: + parent: minecraft:block/inner_stairs + textures: &textures + bottom: &block_texture minecraft:block/custom/palm_planks + side: *block_texture + top: *block_texture + model_stairs_outer_path: minecraft:block/custom/palm_stairs_outer + model_stairs_outer_generation: + parent: minecraft:block/outer_stairs + textures: *textures + model_stairs_path: minecraft:block/custom/palm_stairs + model_stairs_generation: + parent: minecraft:block/stairs + textures: *textures default:palm_pressure_plate: material: nether_brick custom-model-data: 1014 @@ -217,44 +579,49 @@ items: fuel-time: 300 behavior: type: block_item - block: default:palm_pressure_plate - default:palm_button: - material: nether_brick - custom-model-data: 1015 - model: - type: minecraft:model - path: minecraft:item/custom/palm_button - generation: - parent: minecraft:block/button_inventory - textures: - texture: minecraft:block/custom/palm_planks - data: - item-name: - settings: - fuel-time: 100 - behavior: - type: block_item - block: default:palm_button - default:palm_button_pressed: - material: nether_brick - custom-model-data: 1016 - model: - type: minecraft:model - path: minecraft:block/custom/palm_button_pressed - generation: - parent: minecraft:block/button_pressed - textures: - texture: minecraft:block/custom/palm_planks - default:palm_button_not_pressed: - material: nether_brick - custom-model-data: 1017 - model: - type: minecraft:model - path: minecraft:block/custom/palm_button_not_pressed - generation: - parent: minecraft:block/button - textures: - texture: minecraft:block/custom/palm_planks + block: + loot: + template: default:loot_table/self + settings: + template: + - default:sound/wood + - default:hardness/planks + overrides: + burnable: true + push-reaction: destroy + map-color: 2 + instrument: bass + tags: + - minecraft:mineable/axe + - minecraft:wall_post_override + - minecraft:wooden_pressure_plates + - minecraft:pressure_plates + behaviors: + type: pressure_plate_block + sensitivity: all + pressed-time: 20 + sounds: + on: minecraft:block.wooden_pressure_plate.click_on + off: minecraft:block.wooden_pressure_plate.click_off + states: + template: default:block_state/pressure_plate + arguments: + normal_state: light_weighted_pressure_plate:0 + powered_state: light_weighted_pressure_plate:1 + normal_id: 0 + powered_id: 1 + model_normal_path: minecraft:block/custom/palm_pressure_plate + model_normal_generation: + parent: minecraft:block/pressure_plate_up + textures: + texture: minecraft:block/custom/palm_planks + model_powered_path: minecraft:block/custom/palm_pressure_plate_down + model_powered_generation: + parent: minecraft:block/pressure_plate_down + textures: + texture: minecraft:block/custom/palm_planks + +items#palm_fence: default:palm_fence: material: nether_brick custom-model-data: 1018 @@ -291,468 +658,7 @@ items: textures: texture: minecraft:block/custom/palm_planks -blocks: - default:palm_log: - behavior: - type: strippable_block - stripped: default:stripped_palm_log - loot: - template: default:loot_table/self - settings: - template: default:settings/wood - overrides: - map-color: 2 - states: - template: default:block_state/pillar - arguments: - base_block: note_block - texture_top_path: minecraft:block/custom/palm_log_top - texture_side_path: minecraft:block/custom/palm_log - model_vertical_path: minecraft:block/custom/palm_log - model_horizontal_path: minecraft:block/custom/palm_log_horizontal - vanilla_id: - type: self_increase_int - from: 0 - to: 2 - internal_id: - type: self_increase_int - from: 0 - to: 2 - default:stripped_palm_log: - loot: - template: default:loot_table/self - settings: - template: default:settings/wood - overrides: - map-color: 2 - states: - template: default:block_state/pillar - arguments: - base_block: note_block - texture_top_path: minecraft:block/custom/stripped_palm_log_top - texture_side_path: minecraft:block/custom/stripped_palm_log - model_vertical_path: minecraft:block/custom/stripped_palm_log - model_horizontal_path: minecraft:block/custom/stripped_palm_log_horizontal - vanilla_id: - type: self_increase_int - from: 3 - to: 5 - internal_id: - type: self_increase_int - from: 3 - to: 5 - default:palm_wood: - behavior: - type: strippable_block - stripped: default:stripped_palm_wood - loot: - template: default:loot_table/self - settings: - template: default:settings/wood - overrides: - map-color: 2 - states: - template: default:block_state/pillar - arguments: - base_block: note_block - texture_top_path: minecraft:block/custom/palm_log - texture_side_path: minecraft:block/custom/palm_log - model_vertical_path: minecraft:block/custom/palm_wood - model_horizontal_path: minecraft:block/custom/palm_wood_horizontal - vanilla_id: - type: self_increase_int - from: 6 - to: 8 - internal_id: - type: self_increase_int - from: 6 - to: 8 - default:stripped_palm_wood: - loot: - template: default:loot_table/self - settings: - template: default:settings/wood - overrides: - map-color: 2 - states: - template: default:block_state/pillar - arguments: - base_block: note_block - texture_top_path: minecraft:block/custom/stripped_palm_log - texture_side_path: minecraft:block/custom/stripped_palm_log - model_vertical_path: minecraft:block/custom/stripped_palm_wood - model_horizontal_path: minecraft:block/custom/stripped_palm_wood_horizontal - vanilla_id: - type: self_increase_int - from: 9 - to: 11 - internal_id: - type: self_increase_int - from: 9 - to: 11 - default:palm_planks: - settings: - template: default:settings/planks - overrides: - map-color: 2 - loot: - template: default:loot_table/self - state: - model: - template: default:model/simplified_cube_all - arguments: - path: minecraft:block/custom/palm_planks - id: 12 - state: note_block:12 - default:palm_sapling: - settings: - template: default:settings/sapling - behaviors: - - type: bush_block - bottom-block-tags: - - minecraft:dirt - - minecraft:farmland - - minecraft:sand - - type: sapling_block - feature: minecraft:fancy_oak - bone-meal-success-chance: 0.45 - loot: - template: default:loot_table/self - states: - properties: - stage: - type: int - default-value: 0 - range: 0~1 - appearances: - default: - state: oak_sapling:0 - model: - path: minecraft:block/custom/palm_sapling - generation: - parent: minecraft:block/cross - textures: - cross: minecraft:block/custom/palm_sapling - variants: - stage=0: - appearance: default - id: 0 - stage=1: - appearance: default - id: 1 - default:palm_leaves: - behavior: - type: leaves_block - loot: - template: default:loot_table/leaves - arguments: - leaves: default:palm_leaves - sapling: default:palm_sapling - settings: - template: default:settings/leaves - overrides: - map-color: 19 - states: - template: default:block_state/leaves - arguments: - default_state: oak_leaves[distance=1,persistent=false,waterlogged=false] - waterlogged_state: oak_leaves[distance=1,persistent=false,waterlogged=true] - model_path: minecraft:block/custom/palm_leaves - texture_path: minecraft:block/custom/palm_leaves - internal_id: - type: self_increase_int - from: 0 - to: 27 - default:palm_trapdoor: - behavior: - type: trapdoor_block - can-open-with-hand: true - can-open-by-wind-charge: true - sounds: - open: minecraft:block.wooden_trapdoor.open - close: minecraft:block.wooden_trapdoor.close - loot: - template: default:loot_table/self - settings: - template: - - default:sound/wood - overrides: - map-color: 2 - instrument: bass - hardness: 3.0 - resistance: 3.0 - burnable: true - tags: - - minecraft:mineable/axe - - minecraft:trapdoors - states: - template: default:block_state/trapdoor - arguments: - base_block: acacia_trapdoor - model_bottom_path: minecraft:block/custom/palm_trapdoor_bottom - model_bottom_generation: - parent: minecraft:block/template_orientable_trapdoor_bottom - textures: - texture: minecraft:block/custom/palm_trapdoor - model_open_path: minecraft:block/custom/palm_trapdoor_open - model_open_generation: - parent: minecraft:block/template_orientable_trapdoor_open - textures: - texture: minecraft:block/custom/palm_trapdoor - model_top_path: minecraft:block/custom/palm_trapdoor_top - model_top_generation: - parent: minecraft:block/template_orientable_trapdoor_top - textures: - texture: minecraft:block/custom/palm_trapdoor - default:palm_door: - behavior: - type: door_block - can-open-with-hand: true - can-open-by-wind-charge: true - sounds: - open: minecraft:block.wooden_door.open - close: minecraft:block.wooden_door.close - loot: - template: default:loot_table/door - settings: - template: - - default:sound/wood - overrides: - push-reaction: destroy - map-color: 2 - instrument: bass - hardness: 3.0 - resistance: 3.0 - burnable: true - tags: - - minecraft:wooden_doors - - minecraft:doors - - minecraft:mineable/axe - states: - template: default:block_state/door - arguments: - base_block: oak_door - model_top_left_path: minecraft:block/custom/palm_door_top_left - model_top_left_generation: - parent: minecraft:block/door_top_left - textures: &textures - bottom: minecraft:block/custom/palm_door_bottom - top: minecraft:block/custom/palm_door_top - model_top_right_path: minecraft:block/custom/palm_door_top_right - model_top_right_generation: - parent: minecraft:block/door_top_right - textures: *textures - model_top_left_open_path: minecraft:block/custom/palm_door_top_left_open - model_top_left_open_generation: - parent: minecraft:block/door_top_left_open - textures: *textures - model_top_right_open_path: minecraft:block/custom/palm_door_top_right_open - model_top_right_open_generation: - parent: minecraft:block/door_top_right_open - textures: *textures - model_bottom_left_path: minecraft:block/custom/palm_door_bottom_left - model_bottom_left_generation: - parent: minecraft:block/door_bottom_left - textures: *textures - model_bottom_right_path: minecraft:block/custom/palm_door_bottom_right - model_bottom_right_generation: - parent: minecraft:block/door_bottom_right - textures: *textures - model_bottom_left_open_path: minecraft:block/custom/palm_door_bottom_left_open - model_bottom_left_open_generation: - parent: minecraft:block/door_bottom_left_open - textures: *textures - model_bottom_right_open_path: minecraft:block/custom/palm_door_bottom_right_open - model_bottom_right_open_generation: - parent: minecraft:block/door_bottom_right_open - textures: *textures - default:palm_fence_gate: - behaviors: - type: fence_gate_block - can-open-with-hand: true - can-open-by-wind-charge: true - sounds: - open: minecraft:block.fence_gate.open - close: minecraft:block.fence_gate.close - loot: - template: default:loot_table/self - settings: - template: - - default:sound/wood - - default:hardness/planks - overrides: - map-color: 2 - instrument: bass - burnable: true - tags: - - minecraft:fence_gates - - minecraft:mineable/axe - - minecraft:unstable_bottom_center - states: - template: default:block_state/fence_gate - arguments: - base_block: oak_fence_gate - model_fence_gate_path: minecraft:block/custom/palm_fence_gate - model_fence_gate_generation: - parent: minecraft:block/template_fence_gate - textures: &textures - texture: minecraft:block/custom/palm_planks - model_fence_gate_open_path: minecraft:block/custom/palm_fence_gate_open - model_fence_gate_open_generation: - parent: minecraft:block/template_fence_gate_open - textures: *textures - model_fence_gate_wall_path: minecraft:block/custom/palm_fence_gate_wall - model_fence_gate_wall_generation: - parent: minecraft:block/template_fence_gate_wall - textures: *textures - model_fence_gate_wall_open_path: minecraft:block/custom/palm_fence_gate_wall_open - model_fence_gate_wall_open_generation: - parent: minecraft:block/template_fence_gate_wall_open - textures: *textures - default:palm_slab: - behaviors: - type: slab_block - loot: - template: default:loot_table/slab - settings: - template: - - default:sound/wood - - default:burn_data/planks - - default:hardness/planks - overrides: - map-color: 2 - instrument: bass - tags: - - minecraft:wooden_slabs - - minecraft:slabs - - minecraft:mineable/axe - states: - template: default:block_state/slab - arguments: - base_block: petrified_oak_slab - model_bottom_path: minecraft:block/custom/palm_slab - model_bottom_generation: - parent: minecraft:block/slab - textures: &textures - bottom: minecraft:block/custom/palm_planks - side: minecraft:block/custom/palm_planks - top: minecraft:block/custom/palm_planks - model_top_path: minecraft:block/custom/palm_slab_top - model_top_generation: - parent: minecraft:block/slab_top - textures: *textures - model_double_path: minecraft:block/custom/palm_planks - default:palm_stairs: - loot: - template: default:loot_table/self - settings: - template: - - default:sound/wood - - default:hardness/planks - - default:burn_data/planks - overrides: - map-color: 2 - instrument: bass - tags: - - minecraft:mineable/axe - - minecraft:stairs - - minecraft:wooden_stairs - behavior: - type: stairs_block - states: - template: default:block_state/stairs - arguments: - base_block: cut_copper_stairs - model_stairs_inner_path: minecraft:block/custom/palm_stairs_inner - model_stairs_inner_generation: - parent: minecraft:block/inner_stairs - textures: &textures - bottom: &block_texture minecraft:block/custom/palm_planks - side: *block_texture - top: *block_texture - model_stairs_outer_path: minecraft:block/custom/palm_stairs_outer - model_stairs_outer_generation: - parent: minecraft:block/outer_stairs - textures: *textures - model_stairs_path: minecraft:block/custom/palm_stairs - model_stairs_generation: - parent: minecraft:block/stairs - textures: *textures - default:palm_pressure_plate: - loot: - template: default:loot_table/self - settings: - template: - - default:sound/wood - - default:hardness/planks - overrides: - burnable: true - push-reaction: destroy - map-color: 2 - instrument: bass - tags: - - minecraft:mineable/axe - - minecraft:wall_post_override - - minecraft:wooden_pressure_plates - - minecraft:pressure_plates - behaviors: - type: pressure_plate_block - sensitivity: all - pressed-time: 20 - sounds: - on: minecraft:block.wooden_pressure_plate.click_on - off: minecraft:block.wooden_pressure_plate.click_off - states: - template: default:block_state/pressure_plate - arguments: - normal_state: light_weighted_pressure_plate:0 - powered_state: light_weighted_pressure_plate:1 - normal_id: 0 - powered_id: 1 - model_normal_path: minecraft:block/custom/palm_pressure_plate - model_normal_generation: - parent: minecraft:block/pressure_plate_up - textures: - texture: minecraft:block/custom/palm_planks - model_powered_path: minecraft:block/custom/palm_pressure_plate_down - model_powered_generation: - parent: minecraft:block/pressure_plate_down - textures: - texture: minecraft:block/custom/palm_planks - default:palm_button: - loot: - template: default:loot_table/self - settings: - template: - - default:sound/wood - - default:hardness/button - overrides: - burnable: true - push-reaction: destroy - map-color: 2 - instrument: harp - tags: - - minecraft:buttons - - minecraft:mineable/axe - - minecraft:wooden_buttons - behaviors: - - type: face_attached_horizontal_directional_block - - type: button_block - ticks-to-stay-pressed: 30 - can-button-be-activated-by-arrows: true - sounds: - on: minecraft:block.wooden_button.click_on - off: minecraft:block.wooden_button.click_off - states: - template: default:block_state/button - arguments: - base_block: birch_button - pressed_item: default:palm_button_pressed - not_pressed_item: default:palm_button_not_pressed - internal_id: - type: self_increase_int - from: 0 - to: 23 +blocks#palm_fence: default:palm_fence: loot: template: default:loot_table/self 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 b8ad2e75d..71d6e9e30 100644 --- a/common-files/src/main/resources/resources/default/configuration/i18n.yml +++ b/common-files/src/main/resources/resources/default/configuration/i18n.yml @@ -54,10 +54,6 @@ i18n: item.hami_melon_seeds: Hami Melon Seeds item.palm_button: Palm Button item.palm_fence: Palm Fence - item.infected_palm_log: Infected Palm Log - item.small_mushroom: Small Mushroom - item.medium_mushroom: Medium Mushroom - item.large_mushroom: Large Mushroom category.default.name: Default Assets category.default.lore: Contains the default configuration of CraftEngine category.palm_tree: Palm Tree @@ -121,10 +117,6 @@ i18n: item.hami_melon_seeds: 哈密瓜种子 item.palm_button: 棕榈木按钮 item.palm_fence: 棕榈木栅栏 - item.infected_palm_log: 菌蚀棕榈原木 - item.small_mushroom: 小型蘑菇 - item.medium_mushroom: 中型蘑菇 - item.large_mushroom: 大型蘑菇 category.default.name: 默认资产 category.default.lore: 包含了CraftEngine的默认配置 category.palm_tree: 棕榈树 @@ -172,10 +164,6 @@ lang: block_name:default:default:attached_hami_melon_stem: Hami Melon Stem block_name:default:palm_button: Palm Button block_name:default:palm_fence: Palm Fence - block_name:default:infected_palm_log: Infected Palm Log - block_name:default:small_mushroom: Small Mushroom - block_name:default:medium_mushroom: Medium Mushroom - block_name:default:large_mushroom: Large Mushroom zh_cn: block_name:default:chinese_lantern: 灯笼 block_name:default:netherite_anvil: 下界合金砧 @@ -211,7 +199,3 @@ lang: block_name:default:default:attached_hami_melon_stem: 哈密瓜茎 block_name:default:palm_button: 棕榈木按钮 block_name:default:palm_fence: 棕榈木栅栏 - block_name:default:infected_palm_log: 菌蚀棕榈原木 - block_name:default:small_mushroom: 小型蘑菇 - block_name:default:medium_mushroom: 中型蘑菇 - block_name:default:large_mushroom: 大型蘑菇 diff --git a/core/src/main/java/net/momirealms/craftengine/core/block/properties/Property.java b/core/src/main/java/net/momirealms/craftengine/core/block/properties/Property.java index 8ff91b9a8..233ad526b 100644 --- a/core/src/main/java/net/momirealms/craftengine/core/block/properties/Property.java +++ b/core/src/main/java/net/momirealms/craftengine/core/block/properties/Property.java @@ -171,6 +171,6 @@ public abstract class Property> { @Override public String toString() { - return MoreObjects.toStringHelper(this).add("name", this.name).add("clazz", this.clazz).add("values", this.possibleValues()).toString(); + return this.getClass().getSimpleName() + "{clazz=" + this.clazz + ", name='" + this.name + "', values=" + this.possibleValues() + '}'; } }