Skip to content

Commit

Permalink
✨ wind chime
Browse files Browse the repository at this point in the history
  • Loading branch information
LocusAzzurro committed Apr 13, 2024
1 parent cc0df92 commit cb13911
Show file tree
Hide file tree
Showing 16 changed files with 272 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/generated/resources/.cache/cache
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ bcd76e15f83394c60485fc5da88f93334190030c assets/ultramarine/blockstates/white_an
19883f55d7c1c103e969b07ebe0be13b4f18da56 assets/ultramarine/blockstates/white_marble_railing.json
6bcba48e0f72c2537889daf215fa8218c808b6cd assets/ultramarine/blockstates/white_marble_railing_slant.json
b66c252d8eb3ca732e2547df094d5382b531717a assets/ultramarine/blockstates/white_sky_lantern.json
3823be60cd3050eddd05ad6a0acc8a4174b7ac28 assets/ultramarine/blockstates/wind_chime.json
6f5aad7deb01f9c52147c815a4ed692b201fa2d0 assets/ultramarine/blockstates/wine_pot.json
dedd81b698439455174cf46762a93f554192a135 assets/ultramarine/blockstates/wooden_crate.json
9d5fcc26046ae6dc7ae09740d67df8b16cb33350 assets/ultramarine/blockstates/wooden_gualuo.json
Expand Down Expand Up @@ -2932,6 +2933,7 @@ dd8b93d6962779b8f8696bcbd0ed46b9c42b5be9 assets/ultramarine/models/item/white_an
a28bb0f835383bd8c4f2879799c97ed948e9576a assets/ultramarine/models/item/white_marble_railing.json
b710fe161e0364dddda59d46fc8f32b494e4fda7 assets/ultramarine/models/item/white_marble_railing_slant.json
ba8736149c1499636d5f167a65b662e22f63f1fa assets/ultramarine/models/item/white_sky_lantern.json
12f256e194eb4c7bc09c443449f9de9be9a7ccd8 assets/ultramarine/models/item/wind_chime.json
fc02586cd5f6edee1e1285adf33ffc2b7b9793b3 assets/ultramarine/models/item/wine_pot.json
1237f2932da7cd261f890a84bf48199820cf8ec5 assets/ultramarine/models/item/wooden_crate.json
381b8c6302057a40aec373e7c6e912a09ca6abb3 assets/ultramarine/models/item/wooden_frame.json
Expand Down Expand Up @@ -3360,7 +3362,7 @@ b73cc45e816c59d3eb8735f91a00095e314e7732 assets/ultramarine/textures/block/yello
bb3cff8ef2b03825fc5bbeffb336436d70edcaa4 data/minecraft/tags/blocks/fences.json
6da211c4a0daa09467402493cd75c67675e1f477 data/minecraft/tags/blocks/mineable/axe.json
f322d81978eac3de4a54e222a418652bf27462bb data/minecraft/tags/blocks/mineable/hoe.json
cd50c530ebbcb9aebd0fc973c34da1d0fafd3690 data/minecraft/tags/blocks/mineable/pickaxe.json
faf7fec020bd27f9fb725d4f8ef58d2ba841fd6f data/minecraft/tags/blocks/mineable/pickaxe.json
abbdc8dce331da2dc7cc4c8928d8c981c65f43d5 data/minecraft/tags/blocks/needs_iron_tool.json
491ce75539837239e5aa71710d0bdde0202bd5e8 data/minecraft/tags/blocks/needs_stone_tool.json
3186ba1b362c329daa8cf80a8536319b79fa838a data/minecraft/tags/blocks/planks.json
Expand Down Expand Up @@ -3540,6 +3542,7 @@ c8882bd331893eb80fe19163dfd3c26b71ac6d59 data/ultramarine/advancements/recipes/u
d76b47383cc75685cc530b3ebee93ca45b52ca20 data/ultramarine/advancements/recipes/ultramarine.decorations/straw_hat.json
78190283ae25a91e3e74c7c28db35bf1802ea389 data/ultramarine/advancements/recipes/ultramarine.decorations/teahouse_flag.json
d2775028d559a42916566d62d8eff42b64f8e334 data/ultramarine/advancements/recipes/ultramarine.decorations/terracotta_pot.json
03e3151a45d92c34ff7cb0422f082ef8ae514db9 data/ultramarine/advancements/recipes/ultramarine.decorations/wind_chime.json
4f3e20dff28fcc91edb5acdc8faa09ac31bfe3fb data/ultramarine/advancements/recipes/ultramarine.decorations/wooden_crate.json
f848f1a235cfec29092c3bd2ae318922026741a9 data/ultramarine/advancements/recipes/ultramarine.decorations/wooden_poles.json
b543f3b3df85c194e390e858a3ef318e8b2e3ecc data/ultramarine/advancements/recipes/ultramarine.decorative_blocks/acacia_bracket.json
Expand Down Expand Up @@ -4299,6 +4302,7 @@ f3a4bcf8240c554b43209fffefc87cc6dbce744f data/ultramarine/loot_tables/blocks/whi
0d4f5680ed09decf6bcc5e27c5233dee7aff8ae8 data/ultramarine/loot_tables/blocks/white_marble_railing.json
a316b9524277bdbbc572544584fd1f55ea3eda9c data/ultramarine/loot_tables/blocks/white_marble_railing_slant.json
a6bec953a4b043cadd1b292e2dd5eb17fde8ed65 data/ultramarine/loot_tables/blocks/white_sky_lantern.json
b71c4e94339253b74063dd492f84db94af36ab4e data/ultramarine/loot_tables/blocks/wind_chime.json
4cd659e1c0375848a336ae6879eda315d0f43cc6 data/ultramarine/loot_tables/blocks/wine_pot.json
ebfdc12d19eb9ee8ea6f96ff884c78def322a3dc data/ultramarine/loot_tables/blocks/wooden_crate.json
30ab137acd5d1ea4147a2bdc99ce2d640d7b13fd data/ultramarine/loot_tables/blocks/wooden_gualuo.json
Expand Down Expand Up @@ -4823,6 +4827,7 @@ e697b28e325958cb49ea3d6eb0ffb5b642c64456 data/ultramarine/recipes/white_dye_powd
99bcc5e89baf89e9e1e8f88fc8ebbd177d316801 data/ultramarine/recipes/white_marble_railing.json
b1e388d9eec2759b81416ea1f195df19038fc89a data/ultramarine/recipes/white_marble_railing_slant.json
115997be3b7327eece06d799745c1d98892dd9d6 data/ultramarine/recipes/white_sky_lantern.json
314ae53a7a4dbbac09428aee94b9ab3eae40e97a data/ultramarine/recipes/wind_chime.json
1824b9681a3c5709f349945dc24bcd793200024c data/ultramarine/recipes/wooden_crate.json
f46b6fb0b42727f84443c0b671e13db4b93b4458 data/ultramarine/recipes/wooden_frame.json
75226709b0ed740b8916be6d87e8bd0df1dd0753 data/ultramarine/recipes/wooden_gualuo.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ultramarine:block/wind_chime"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ultramarine:block/wind_chime"
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"ultramarine:porcelain_teapot",
"ultramarine:jade_pendant",
"ultramarine:imperial_jade_seal",
"ultramarine:wind_chime",
"ultramarine:clay_doll_male",
"ultramarine:clay_doll_female",
"ultramarine:blue_and_white_porcelain_flowerpot",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"ultramarine:wind_chime"
]
},
"criteria": {
"has_bronze_ingot": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"ultramarine:bronze_ingot"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "ultramarine:wind_chime"
}
}
},
"requirements": [
[
"has_bronze_ingot",
"has_the_recipe"
]
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:block",
"pools": [
{
"name": "wind_chime",
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "ultramarine:wind_chime"
}
]
}
]
}
22 changes: 22 additions & 0 deletions src/generated/resources/data/ultramarine/recipes/wind_chime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"C",
"B",
"P"
],
"key": {
"C": {
"item": "minecraft:chain"
},
"B": {
"item": "ultramarine:bronze_ingot"
},
"P": {
"item": "ultramarine:bronze_parts"
}
},
"result": {
"item": "ultramarine:wind_chime"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private static void setRenderLayers(FMLClientSetupEvent e) {
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.ROYAL_CENSER.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.JADE_PENDANT.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.IMPERIAL_JADE_SEAL.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.WIND_CHIME.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.TEAHOUSE_FLAG.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.PAPER.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(BlockRegistry.LONG_HANGING_PAINTING.get(), RenderType.cutout());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ public class BlockRegistry {
() -> DecorativeBlock.with(BaseBlockProperty.JADE).shaped(ShapeFunction.cardinalRotations(new RawVoxelShape(5,0,4,10,14,10))).directional().build());
public static final RegistryObject<Block> LONG_PILLOW = BLOCKS.register("long_pillow",
() -> DecorativeBlock.with(BaseBlockProperty.SILK).shaped(ShapeFunction.eightRotations(new RawVoxelShape(-4,0,4,20,8,12))).directional().diagonallyPlaceable().noOcclusion().build());
public static final RegistryObject<Block> WIND_CHIME = BLOCKS.register("wind_chime", WindChime::new);

// MISC OBJECTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ public class ItemRegistry {
public static final RegistryObject<Item> JADE_PENDANT = fromBlock(BlockRegistry.JADE_PENDANT, ModCreativeTab.DECORATIONS);
public static final RegistryObject<Item> IMPERIAL_JADE_SEAL = fromBlock(BlockRegistry.IMPERIAL_JADE_SEAL, ModCreativeTab.DECORATIONS);
public static final RegistryObject<Item> LONG_PILLOW = fromBlock(BlockRegistry.LONG_PILLOW, ModCreativeTab.DECORATIONS);
public static final RegistryObject<Item> WIND_CHIME = fromBlock(BlockRegistry.WIND_CHIME, ModCreativeTab.DECORATIONS);

// MISC OBJECTS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,15 @@ private static void categoryDecorations(@NotNull Consumer<FinishedRecipe> recipe
.pattern("YRY")
.unlockedBy(itemUnlockName(ItemRegistry.SILK.get()), itemCriterion(ItemRegistry.SILK.get()))
.save(recipeConsumer);
ShapedRecipeBuilder.shaped(ItemRegistry.WIND_CHIME.get())
.define('C', Items.CHAIN)
.define('B', ItemRegistry.BRONZE_INGOT.get())
.define('P', ItemRegistry.BRONZE_PARTS.get())
.pattern("C")
.pattern("B")
.pattern("P")
.unlockedBy(itemUnlockName(ItemRegistry.BRONZE_INGOT.get()), itemCriterion(ItemRegistry.BRONZE_INGOT.get()))
.save(recipeConsumer);

// MISC OBJECTS
// Fabric rolls and dolls sold by special trader
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.voxelutopia.ultramarine.world.block;

import com.voxelutopia.ultramarine.Ultramarine;
import com.voxelutopia.ultramarine.data.shape.RawVoxelShape;
import com.voxelutopia.ultramarine.data.shape.ShapeFunction;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.state.BlockState;

import java.util.Random;

public class WindChime extends DecorativeBlock{

public WindChime() {
super(DecorativeBlock.with(BaseBlockProperty.BRONZE).shaped(ShapeFunction.simpleShape(new RawVoxelShape(5,-5,5,11,16,11))).noCollision().noOcclusion());
}

@Override
public boolean isRandomlyTicking(BlockState pState) {
return true;
}

@Override
public void randomTick(BlockState pState, ServerLevel pLevel, BlockPos pPos, Random pRandom) {
float rainLevel = pLevel.getRainLevel(0.1f);
if ((pRandom.nextFloat() * rainLevel) > 0.2f){
playSound(pLevel, pPos, pRandom);
if (pRandom.nextFloat() > 0.5f){
pLevel.scheduleTick(pPos, this, pRandom.nextInt(3));
}
}
}

@Override
public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, Random pRandom) {
playSound(pLevel, pPos, pRandom);
}

private void playSound(ServerLevel pLevel, BlockPos pPos, Random pRandom){
pLevel.playSound(null, pPos, SoundEvents.NOTE_BLOCK_CHIME, SoundSource.BLOCKS, 1.5F, 2.0f - pRandom.nextFloat() * 0.15f);
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/ultramarine/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"block.ultramarine.couplet_top": "Couplet",
"block.ultramarine.couplet": "Couplet Top",
"block.ultramarine.fu_mark": "Fu Mark",
"block.ultramarine.wind_chime": "Wind Chime",

"__comment5__": "Furniture",
"block.ultramarine.oak_cabinet": "Oak Cabinet",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/ultramarine/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"block.ultramarine.couplet_top": "横批",
"block.ultramarine.couplet": "对联",
"block.ultramarine.fu_mark": "福字",
"block.ultramarine.wind_chime": "风铃",

"__comment5__": "Furniture",
"block.ultramarine.oak_cabinet": "橡木橱柜",
Expand Down
124 changes: 124 additions & 0 deletions src/main/resources/assets/ultramarine/models/block/wind_chime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"credit": "Made with Blockbench",
"texture_size": [32, 32],
"render_type": "cutout",
"textures": {
"1": "ultramarine:block/wind_chime",
"particle": "minecraft:block/chain"
},
"elements": [
{
"from": [5, 5, 5],
"to": [11, 6, 11],
"faces": {
"north": {"uv": [8.5, 8, 11.5, 8.5], "texture": "#1"},
"east": {"uv": [2.5, 9, 5.5, 9.5], "texture": "#1"},
"south": {"uv": [6, 9, 9, 9.5], "texture": "#1"},
"west": {"uv": [9.5, 9, 12.5, 9.5], "texture": "#1"},
"up": {"uv": [3, 3, 0, 0], "texture": "#1"},
"down": {"uv": [3, 3.5, 0, 6.5], "texture": "#1"}
}
},
{
"from": [6, 6, 6],
"to": [10, 11, 10],
"faces": {
"north": {"uv": [3.5, 6, 5.5, 8.5], "texture": "#1"},
"east": {"uv": [6, 6, 8, 8.5], "texture": "#1"},
"south": {"uv": [0, 7, 2, 9.5], "texture": "#1"},
"west": {"uv": [7.5, 0, 9.5, 2.5], "texture": "#1"},
"up": {"uv": [9.5, 5, 7.5, 3], "texture": "#1"},
"down": {"uv": [10.5, 5.5, 8.5, 7.5], "texture": "#1"}
}
},
{
"from": [7, 11, 7],
"to": [9, 12, 9],
"faces": {
"north": {"uv": [4.5, 10, 5.5, 10.5], "texture": "#1"},
"east": {"uv": [10, 4.5, 11, 5], "texture": "#1"},
"south": {"uv": [6, 10, 7, 10.5], "texture": "#1"},
"west": {"uv": [7.5, 10, 8.5, 10.5], "texture": "#1"},
"up": {"uv": [4, 11, 3, 10], "texture": "#1"},
"down": {"uv": [11, 3, 10, 4], "texture": "#1"}
}
},
{
"from": [7.5, 11, 7.5],
"to": [8.5, 16, 8.5],
"faces": {
"north": {"uv": [0, 10, 0.5, 12.5], "texture": "#1"},
"east": {"uv": [10, 0, 10.5, 2.5], "texture": "#1"},
"south": {"uv": [1, 10, 1.5, 12.5], "texture": "#1"},
"west": {"uv": [2, 10, 2.5, 12.5], "texture": "#1"},
"up": {"uv": [3, 7.5, 2.5, 7], "texture": "#1"},
"down": {"uv": [3, 8, 2.5, 8.5], "texture": "#1"}
}
},
{
"from": [6.5, -6, 8],
"to": [9.5, 5, 8],
"faces": {
"north": {"uv": [3.5, 0, 5, 5.5], "texture": "#1"},
"east": {"uv": [9, 10, 9, 15.5], "texture": "#1"},
"south": {"uv": [5.5, 0, 7, 5.5], "texture": "#1"},
"west": {"uv": [9.5, 10, 9.5, 15.5], "texture": "#1"},
"up": {"uv": [11.5, 10, 10, 10], "texture": "#1"},
"down": {"uv": [11.5, 10.5, 10, 10.5], "texture": "#1"}
}
},
{
"from": [8, -6, 6.5],
"to": [8, 5, 9.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, -0.5, 8]},
"faces": {
"north": {"uv": [9, 10, 9, 15.5], "texture": "#1"},
"east": {"uv": [5.5, 0, 7, 5.5], "texture": "#1"},
"south": {"uv": [9.5, 10, 9.5, 15.5], "texture": "#1"},
"west": {"uv": [3.5, 0, 5, 5.5], "texture": "#1"},
"up": {"uv": [11.5, 10, 10, 10], "rotation": 270, "texture": "#1"},
"down": {"uv": [11.5, 10.5, 10, 10.5], "rotation": 90, "texture": "#1"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 45, 0],
"scale": [0.375, 0.375, 0.375]
},
"thirdperson_lefthand": {
"rotation": [75, 45, 0],
"scale": [0.375, 0.375, 0.375]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"translation": [2.25, 2.5, 0],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 45, 0],
"translation": [2.25, 2.5, 0],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.25, 0.25, 0.25]
},
"gui": {
"rotation": [30, 45, 0],
"translation": [0, 1.25, 0],
"scale": [0.625, 0.625, 0.625]
},
"head": {
"translation": [0, 0, -7]
}
},
"groups": [
{
"name": "group",
"origin": [0, 0, 0],
"color": 0,
"children": [0, 1, 2, 3, 4, 5]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb13911

Please sign in to comment.